mirror of https://github.com/mgba-emu/mgba.git
GB: Fix GBC game registers after skipping BIOS
This commit is contained in:
parent
f0997c6214
commit
b716ba2117
2
CHANGES
2
CHANGES
|
@ -1,5 +1,5 @@
|
||||||
0.8.2: (Future)
|
0.8.2: (Future)
|
||||||
Emulation fixes:
|
- GB: Fix GBC game registers after skipping BIOS
|
||||||
- GBA: Add missing RTC overrides for Legendz games
|
- GBA: Add missing RTC overrides for Legendz games
|
||||||
- GBA SIO: Fix Multiplayer busy bit
|
- GBA SIO: Fix Multiplayer busy bit
|
||||||
- GBA SIO: Fix double-unloading active driver
|
- GBA SIO: Fix double-unloading active driver
|
||||||
|
|
11
src/gb/gb.c
11
src/gb/gb.c
|
@ -478,6 +478,7 @@ void GBReset(struct SM83Core* cpu) {
|
||||||
|
|
||||||
void GBSkipBIOS(struct GB* gb) {
|
void GBSkipBIOS(struct GB* gb) {
|
||||||
struct SM83Core* cpu = gb->cpu;
|
struct SM83Core* cpu = gb->cpu;
|
||||||
|
const struct GBCartridge* cart = (const struct GBCartridge*) &gb->memory.rom[0x100];
|
||||||
int nextDiv = 0;
|
int nextDiv = 0;
|
||||||
|
|
||||||
switch (gb->model) {
|
switch (gb->model) {
|
||||||
|
@ -539,9 +540,15 @@ void GBSkipBIOS(struct GB* gb) {
|
||||||
cpu->a = 0x11;
|
cpu->a = 0x11;
|
||||||
cpu->f.packed = 0x80;
|
cpu->f.packed = 0x80;
|
||||||
cpu->c = 0;
|
cpu->c = 0;
|
||||||
cpu->e = 0x08;
|
|
||||||
cpu->h = 0;
|
cpu->h = 0;
|
||||||
cpu->l = 0x7C;
|
if (cart->cgb & 0x80) {
|
||||||
|
cpu->d = 0xFF;
|
||||||
|
cpu->e = 0x56;
|
||||||
|
cpu->l = 0x0D;
|
||||||
|
} else {
|
||||||
|
cpu->e = 0x08;
|
||||||
|
cpu->l = 0x7C;
|
||||||
|
}
|
||||||
gb->timer.internalDiv = 0x1EA;
|
gb->timer.internalDiv = 0x1EA;
|
||||||
nextDiv = 0xC;
|
nextDiv = 0xC;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue