Skip to content
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

Consider using dispatch tables for memory reading and writing #3

Open
ghost opened this issue Dec 30, 2011 · 6 comments
Open

Consider using dispatch tables for memory reading and writing #3

ghost opened this issue Dec 30, 2011 · 6 comments
Assignees

Comments

@ghost
Copy link

ghost commented Dec 30, 2011

Essentially you can make a table that holds pointers to handling sub-routines for addresses being requested. The GameBoy/GameBoy Color memory map is only 16-bit (albeit with ROM and RAM banking), so it can easily be mapped. This is faster than if/else'ing like a mad-man for address decoding.

@ghost ghost assigned NTmatter Dec 30, 2011
@NTmatter
Copy link
Owner

Looks like a good idea. I'll give it a try further down the line.

@ghost
Copy link
Author

ghost commented Dec 31, 2011

Also the games can execute instructions from the their RAM, and often do for waiting out OAM DMA, so make sure you can successfully cover invalidation of the code cache.

@NTmatter
Copy link
Owner

That's a definite chunk of complexity right there. Odds are that I'll just avoid caching any executable instructions in RAM. The real focus of this project is fiddling around with LLVM to produce a mostly native binary of the ROM. It might be worth using the JIT to handle "live" code, though :)

@ghost
Copy link
Author

ghost commented Dec 31, 2011

Yeah, still might be worth it to JIT the busy-wait loops that are often found in RAM in many games.

@NTmatter
Copy link
Owner

It'll be interesting to do some profiling on the effects of JIT with cache invalidation compared to interpreted execution.

@ghost
Copy link
Author

ghost commented Dec 31, 2011

The cases of busy-wait are busy enough to hard-code optimizations upon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant