-
Notifications
You must be signed in to change notification settings - Fork 32
Part 05 Loading a Cartridge
Go Home
First we must make a Cartridge class. The CPU can own this class and expose a LoadROM method. The ROM should then be loaded completely into a block of memory. Then the MMU needs to be extended with a way to map memory requests to a specific device. This must allow the MMU to know that any requests coming into some address range will just be forwarded on to this new device.
The Cartridge will be responsible for knowing what to do with those read/write requests. In the case of requests that come in from 0x0000 to 0x3FFF, they should literally read directly from the cartridge memory.
For now, we should fail catastrophically if a request is done outside of this range since we haven't implemented bank switching (0x4000 to 0x7FFF). For more on this, review Part 11 - Memory Bank Controllers.
Now we are ready to resume the boot process!