Skip to content
This repository has been archived by the owner on Apr 25, 2021. It is now read-only.

Rewrites, cleanups, and other cool stories #4

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

RainbowCookie32
Copy link
Owner

Individual commits may not work on their own.

I need to run some tests on this
-Get rid of the caches, draw directly from memory. Sprites are currently missing.
-Removes the CPU syncronization with cycles.
-Rewrote input handling (seems to behave a bit better?).
-Fixed VBlank LCD Status interrupt.
-Simplified GPU mode setting.
-Misc cleanups
General:
-Removed leftover code from old input code.
-Removed leftover code from cycles sharing between CPU and GPU.
-Wait for GPU thread to return to exit emulation, since it breaks on an SDL close event.

CPU:
-Limit the amount of instructions per frame. Acts as a sort of speed limit so the GPU doesn't fall behind as much.
-Moved the timer logic to the CPU file.
-Rewrote interrupt handling logic (again).
-Initial emulation of the halt bug.
-Wait for one instruction before enabling interrupts with EI. Docs point that it doesn't inmediately enable them.
Tests will now be stored on their own repository.
-Current rendering approach uses a tile cache which is invalidated based on a hash after a write is made to character RAM.

-Split the CPU and Video read/write functions. The video chip can only interact with some areas in memory, going through all the if/else statements as the CPU is wasteful.
Gets rid of emulator.rs, moves its logic to main.rs.
This also adds the possibility of specifying a custom bootrom file, hash verification of it, and uses Option<> to determine whether to use it or not.
-Fix flags for 0xF8 and 0xE8.
-Mask out unused bits when executing POP AF.
-Run DMA transfers a bit each on each CPU loop instead of blocking until it finishes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant