GB: Fix boot registers on Game Boy Color

This commit is contained in:
Jeffrey Pfau 2016-03-05 00:55:59 -08:00
parent 9eeb051210
commit d3a637fbae
1 changed files with 10 additions and 6 deletions

View File

@ -175,20 +175,24 @@ void GBReset(struct LR35902Core* cpu) {
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;