jarikomppa / emu8051 Goto Github PK
View Code? Open in Web Editor NEW8051/8052 emulator with curses-based UI
License: MIT License
8051/8052 emulator with curses-based UI
License: MIT License
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.
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.
Ok, I know this one is taking it far,
but would it be a nice idea to have an API that would allow creating custom serial port or I/O port components? In my eyes this would make this software infinitely more extensible and useful than most simulators
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:
Lines 69 to 70 in b93d1da
Lines 79 to 84 in b93d1da
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).
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.
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:
Lines 453 to 456 in 5dc6812
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.