Git Product home page Git Product logo

emu8051's People

Contributors

agren avatar andreacorallo avatar c-elegans avatar jarikomppa avatar maximus64 avatar steveschnepp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emu8051's Issues

[Feature Request] Serial Terminal AND/OR LCD

Just by looking at the list of features (forgive me for not yet delving deep into implementation details or the software itself), I think it would be nice if it also supported attaching a serial terminal with an arbitrary serial baud rate (since a lot of external components will use this), and an LCD component would be nice as well.

Backspace doesn't work

I'm having trouble with backspace not working. When in the file loading and breakpoint popups pressing backspace does nothing. Pressing delete works as expected.
I haven't looked into why but getch() returns 263 when i press backspace. Perhaps some locale setting...

Anyways, I made it work by also checking for KEY_BACKSPACE. Will create a pull-request.

State of internal CPU registers should be moved into a struct

I'm using emu8051 as part of another project and I require custom savestates.
However, I can't just save or load the entire struct from file because it contains pointers.

I have additional devices and ROM banks anyway, so I mostly care about the CPU register state.
Therefore these fields should be in a struct, or at least next to each other:

emu8051/emu8051.h

Lines 69 to 70 in b93d1da

int mPC; // Program Counter; outside memory area
int mTickDelay; // How many ticks should we delay before continuing

emu8051/emu8051.h

Lines 79 to 84 in b93d1da

// Internal values for interrupt services etc.
int mInterruptActive;
// Stored register values for interrupts (exception checking)
int int_a[2];
int int_psw[2];
int int_sp[2];

That way, one could easily copy them to a file (for now, I'll individually write each entry to a file - I guess the benefit is that it allows to handle endianess correctly).

Allow using absolute paths in parameters

The parameter parsing code tries to parse "/foo" as an option, instead of as a path.

This appears to be for a seamless appearance in windows environments. Since this isn't documented anywhere (and since I think window's option syntax is stupid), I'd like to remove this.

Timing of multi-cycle instructions

If I understand your code right, there is a bug with the timing of instructions. The functions implementing the opcodes seem to return the number of cycles the instruction takes less one.

nop() (single cycle instruction) returns 0
div_ab() returns (four-cycle instruction) returns 3

The result then goes into the mTickDelay member of the aCPU variable.
When the tick() function is called, it first does the following check:

emu8051/core.c

Lines 453 to 456 in 5dc6812

if (aCPU->mTickDelay)
{
aCPU->mTickDelay--;
}

So if mTickDelay is already 0, it will not be decremented. Farther down, the opcode function is called because mTickDelay is 0.
If mTickDelay is 1 when the function is called, mTickDelay is first decremented, and with it being 0 after decrement, the opcode function is called as well. Therefore it makes no difference, if mTickDelay is 0 or 1 when tick() is called.

Unless I am missing a major point here (apologies if I do, but at the moment, I don't have an environment setup for C program step debugging as I am focusing on other languages, so I am doing this in my head), this basically turns 2-cycle instructions into single cycle instructions and 4-cycle instructions into 3-cycle instructions. Wouldn't the opcode functions have to return the actual number of cycles the instruction takes instead of one less?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.