GB: Support loading CGB-on-AGB boot ROM
Vicki Pfau vi@endrift.com
Tue, 23 Mar 2021 19:35:39 -0700
2 files changed,
10 insertions(+),
4 deletions(-)
M
CHANGES
→
CHANGES
@@ -125,6 +125,7 @@ - Core: Adding to library is now recursive
- GB: Allow pausing event loop while CPU is blocked - GB: Add support for sleep and shutdown callbacks - GB: Redo double speed emulation (closes mgba.io/i/1515) + - GB: Support loading CGB-on-AGB boot ROM - GB Audio: Add channel 4 batching back (fixes mgba.io/i/1313) - GB Core: Return the current number of banks for ROM/SRAM, not theoretical max - GB I/O: Implement preliminary support for PCM12/PCM34 (closes mgba.io/i/1468)
M
src/gb/gb.c
→
src/gb/gb.c
@@ -26,12 +26,13 @@ const uint32_t GB_COMPONENT_MAGIC = 0x400000;
static const uint8_t _knownHeader[4] = { 0xCE, 0xED, 0x66, 0x66}; -#define DMG_BIOS_CHECKSUM 0xC2F5CC97 -#define DMG_2_BIOS_CHECKSUM 0x59C8598E +#define DMG0_BIOS_CHECKSUM 0xC2F5CC97 +#define DMG_BIOS_CHECKSUM 0x59C8598E #define MGB_BIOS_CHECKSUM 0xE6920754 #define SGB_BIOS_CHECKSUM 0xEC8A83B9 #define SGB2_BIOS_CHECKSUM 0X53D0DD63 #define CGB_BIOS_CHECKSUM 0x41884E46 +#define AGB_BIOS_CHECKSUM 0xFFD6B0F1 mLOG_DEFINE_CATEGORY(GB, "GB", "gb");@@ -414,11 +415,12 @@
bool GBIsBIOS(struct VFile* vf) { switch (_GBBiosCRC32(vf)) { case DMG_BIOS_CHECKSUM: - case DMG_2_BIOS_CHECKSUM: + case DMG0_BIOS_CHECKSUM: case MGB_BIOS_CHECKSUM: case SGB_BIOS_CHECKSUM: case SGB2_BIOS_CHECKSUM: case CGB_BIOS_CHECKSUM: + case AGB_BIOS_CHECKSUM: return true; default: return false;@@ -623,7 +625,7 @@ }
if (gb->biosVf) { switch (_GBBiosCRC32(gb->biosVf)) { case DMG_BIOS_CHECKSUM: - case DMG_2_BIOS_CHECKSUM: + case DMG0_BIOS_CHECKSUM: gb->model = GB_MODEL_DMG; break; case MGB_BIOS_CHECKSUM:@@ -637,6 +639,9 @@ gb->model = GB_MODEL_SGB2;
break; case CGB_BIOS_CHECKSUM: gb->model = GB_MODEL_CGB; + break; + case AGB_BIOS_CHECKSUM: + gb->model = GB_MODEL_AGB; break; default: gb->biosVf->close(gb->biosVf);