all repos — mgba @ d3a637fbae984ba5f56f87a3821565178ff1dbfb

mGBA Game Boy Advance Emulator

GB: Fix boot registers on Game Boy Color
Jeffrey Pfau jeffrey@endrift.com
Sat, 05 Mar 2016 00:55:59 -0800
commit

d3a637fbae984ba5f56f87a3821565178ff1dbfb

parent

9eeb0512103a7108543587dba369bc88c3b815f4

1 files changed, 10 insertions(+), 6 deletions(-)

jump to
M src/gb/gb.csrc/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;