Compare commits

...
2 Commits
Author SHA1 Message Date
Riyyi 379ff3babf Doc: Add bootrom section to readme 2022-08-20 12:27:43 +02:00
Riyyi cee8ffabb3 Emulator: Make memory spaces more accurate 2022-08-20 12:27:05 +02:00
2 changed files with 13 additions and 6 deletions
+6 -2
View File
@@ -56,7 +56,11 @@ $ ./vendor/ruc/script/pre-commit.sh install
*** Opcodes *** Opcodes
- https://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html - https://gbdev.io/gb-opcodes/optables/
- https://github.com/lmmendes/game-boy-opcodes - https://gb.insertcoin.dev/
- https://rgbds.gbdev.io/docs/v0.5.2/gbz80.7/ - https://rgbds.gbdev.io/docs/v0.5.2/gbz80.7/
- https://gbdev.io/pandocs/CPU_Instruction_Set.html - https://gbdev.io/pandocs/CPU_Instruction_Set.html
*** Bootroms
https://github.com/ISSOtm/gb-bootroms
+7 -4
View File
@@ -28,10 +28,13 @@ int main(int argc, char* argv[])
Emu::the().addProcessingUnit("cpu", &cpu); Emu::the().addProcessingUnit("cpu", &cpu);
Emu::the().addProcessingUnit("ppu", &ppu); Emu::the().addProcessingUnit("ppu", &ppu);
Emu::the().addMemorySpace("RAM", 1024); // https://gbdev.io/pandocs/Memory_Map.html
Emu::the().addMemorySpace("VRAM", 1024); Emu::the().addMemorySpace("CARDROM", (1 + 0x3fff - 0x0000)); // 16KiB
Emu::the().addMemorySpace("ROM", 1024); Emu::the().addMemorySpace("VRAM", (1 + 0x9fff - 0x8000) * 2); // 8KiB * 2 banks
Emu::the().addMemorySpace("CARDROM", 1024); Emu::the().addMemorySpace("CARDRAM", (1 + 0xbfff - 0xa000)); // 8KiB
Emu::the().addMemorySpace("WRAM", (1 + 0xcfff - 0xc000) + (1 + 0xdfff - 0xd000) * 7); // 4 KiB + 4 KiB * 7 banks, Work RAM
Emu::the().addMemorySpace("ECHORAM", (1 + 0xfdff - 0xe000)); // 7679B, Mirror of 0xc000~0xddff
Emu::the().addMemorySpace("HRAM", (1 + 0xfffe - 0xff80)); // 126B, High RAM (CPU cache)
// Get shared register // Get shared register
print("{}\n", *Emu::the().processingUnit("cpu")->sharedRegister("a")); print("{}\n", *Emu::the().processingUnit("cpu")->sharedRegister("a"));