-
Notifications
You must be signed in to change notification settings - Fork 32
Modularising the emulator #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
algodesigner
wants to merge
22
commits into
jhallen:master
Choose a base branch
from
algodesigner:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have decoupled z80 and added the binding methods for:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These are a few steps towards modularising the emulator and decoupling the key components, namely:
z80
,bdos
,bios
,vm
(virtual machine) and subsequently peripherals, terminal emulators, generalised hooks, etc. I made them backward-compatible.I have encapsulated most of the states into the respective classes.
vm
will be shortly separated from main.c. The naming convention is mostly preserved, the class method prefixes along with constructors and destructors have been added.It is worth spending some time on the initial set of unit tests when the model stabilises.
The CPU fails ZEXALL. There are more compliant implementations out there. It appears to be easier to replace it than incrementally fixing it. I could write a new one, but that might take a little bit longer.
It has the remaining dependencies on vm class:
We can have a single pure virtual class (well, a table of of function pointers for those hooks) or hide them and provide binding methods, e.g.
z80_set_memory_man
,z80_set_io
,z80_set_inst_brk
.Functionally, bdos needs some work and tidying up, but most of the hard work has been done. (The proposed change set contains an intermittent fix of BDOS 33 resulting in an endless loop in
GEN80
with the files sizes == 128 bytes)I fully understand that these changes might come across as too radical and deviate from your vision on how the emulator should evolve, but if you are interested, please let me know.