GB: Fix boot registers on Game Boy Color
Jeffrey Pfau jeffrey@endrift.com
Sat, 05 Mar 2016 00:55:59 -0800
1 files changed,
10 insertions(+),
6 deletions(-)
jump to
M
src/gb/gb.c
→
src/gb/gb.c
@@ -175,20 +175,24 @@ if (cart->cgb & 0x80) {
gb->model = GB_MODEL_CGB; gb->audio.style = GB_AUDIO_CGB; cpu->a = 0x11; + cpu->f.packed = 0x80; + cpu->c = 0; + cpu->e = 0x08; + cpu->h = 0; + cpu->l = 0x7C; } else { // TODO: SGB gb->model = GB_MODEL_DMG; gb->audio.style = GB_AUDIO_DMG; cpu->a = 1; + cpu->f.packed = 0xB0; + cpu->c = 0x13; + cpu->e = 0xD8; + cpu->h = 1; + cpu->l = 0x4D; } - - cpu->f.packed = 0xB0; cpu->b = 0; - cpu->c = 0x13; cpu->d = 0; - cpu->e = 0xD8; - cpu->h = 1; - cpu->l = 0x4D; cpu->sp = 0xFFFE; cpu->pc = 0x100;