Implement MBC1 memory mapper
taylus opened this issue · 1 comments
taylus commented
Start w/ simple ROMs like Tetris that don't use bank switching, but will eventually need to implement the various memory mappers to load additional ROM banks into the address range $4000-$7FFF.
References:
- https://gbdev.gg8.se/wiki/articles/Memory_Bank_Controllers
- http://imrannazar.com/GameBoy-Emulation-in-JavaScript:-Memory-Banking
- https://retrocomputing.stackexchange.com/questions/11732/how-does-the-gameboys-memory-bank-switching-work
How to determine which MBC a ROM uses based on its header:
taylus commented
While working on #16, found suggestions online that MBC1 needs to be implemented for the cpu_instrs.gb
test ROM to pass.
All 11 tests passes as single ROMs, but running the "multi" ROM infinitely loops unless MBC1 is working per: https://www.reddit.com/r/EmuDev/comments/5bkq53/gb_debugging_cpu_instrs/d9p9z47/
FWIW, my emulator had this endless loop problem when my MBC1 emulation was not correct
The combined test uses MBC1 and the rest do not.