Something that I think is worth pointing out here is that even though GBC BIOS is used, it is modified internally in Gambatte like so:
unsigned readBios(const unsigned P) {
if (gbIsCgb_) {
if (agbMode && P >= 0xF3 && P < 0x100) {
return (agbOverride[P - 0xF3] + cgbBios[P]) & 0xFF;
}
return cgbBios[P];
}
return dmgBios[P];
}
This changes the last few segments of BIOS execution from this:
00F2: 18 02 JR 00F6h A:12 B:00 C:00 D:ff E:56 F:c0 H:00 L:0d LY:99 SP:fffe Cy:12985836
00F6: CD D0 05 CALL #05D0h A:12 B:00 C:00 D:ff E:56 F:c0 H:00 L:0d LY:99 SP:fffe Cy:12985848
.
.
.
00F9: AF XOR A A:43 B:14 C:00 D:00 E:08 F:c0 H:00 L:7c LY:93 SP:fffe Cy:13053504
00FA: E0 70 LDH (#FF70h),A A:00 B:14 C:00 D:00 E:08 F:80 H:00 L:7c LY:93 SP:fffe Cy:13053508
00FC: 3E 11 LD A,#11h A:00 B:14 C:00 D:00 E:08 F:80 H:00 L:7c LY:93 SP:fffe Cy:13053520
00FE: E0 50 LDH (#FF50h),A A:11 B:14 C:00 D:00 E:08 F:80 H:00 L:7c LY:93 SP:fffe Cy:13053528
0100: 00 NOP
to this:
00F2: 18 01 JR 00F5h A:12 B:00 C:00 D:ff E:56 F:c0 H:00 L:0d LY:99 SP:fffe Cy:12985836
00F5: CD D0 05 CALL #05D0h A:12 B:00 C:00 D:ff E:56 F:c0 H:00 L:0d LY:99 SP:fffe Cy:12985848
.
.
.
00F8: AF XOR A A:43 B:14 C:00 D:00 E:08 F:c0 H:00 L:7c LY:93 SP:fffe Cy:13053504
00F9: E0 70 LDH (#FF70h),A A:00 B:14 C:00 D:00 E:08 F:80 H:00 L:7c LY:93 SP:fffe Cy:13053508
00FB: 04 INC B A:00 B:14 C:00 D:00 E:08 F:80 H:00 L:7c LY:93 SP:fffe Cy:13053520
00FC: 3E 11 LD A,#11h A:00 B:15 C:00 D:00 E:08 F:00 H:00 L:7c LY:93 SP:fffe Cy:13053524
00FE: E0 50 LDH (#FF50h),A A:11 B:15 C:00 D:00 E:08 F:00 H:00 L:7c LY:93 SP:fffe Cy:13053532
0100: 00 NOP
The GBA identifier being the increment of B to one.
@gifvex: how did this realization come about? I'm not aware of the GBA version of GBC BIOS being dumped. Did this solution just match up to observed behaviour and was simple enough to be correct? (I failed to arrive at this solution when looking over the code myself a couple months back so nice work to whoever came up with that!)