Open fengb opened 4 years ago
Coarse memory map (block size = 0x1000):
Start | Name |
---|---|
0x0000 | ROM Bank 0 |
0x1000 | ROM Bank 0 |
0x2000 | ROM Bank 0 |
0x3000 | ROM Bank 0 |
0x4000 | ROM Bank [N] |
0x5000 | ROM Bank [N] |
0x6000 | ROM Bank [N] |
0x7000 | ROM Bank [N] |
0x8000 | VRAM |
0x9000 | VRAM |
0xA000 | External RAM Bank [N] |
0xB000 | External RAM Bank [N] |
0xC000 | Work RAM |
0xD000 | Work RAM (Bank [N] CGB) |
0xE000 | Echo RAM / OAM |
0xF000 | IO |
Disadvantages:
Block size = 256:
+
OAM can be split from Echo+
Bootloader can be separate-
A lot more updates per bank switch (32 - 64 updates)Another consideration — storing block number instead of pointers:
+
smaller memory usage+
easier serialization?
how to differentiate between cart and dynamic:
We are currently representing memory as fully linear, which makes it fast for reading. However, setRom is a non-negligible amount of logic.
What if we had distinct pages of memory instead?
In this scheme, setRom can be a simple pointer swap and we can still get away with fast lookup. The biggest challenge would be exposing this to the memory debugger.