From a4f3c99faff648b0a27dc35b907e1024343c5cc6 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 20 Feb 2017 16:23:49 -0800 Subject: [PATCH] DS I/O: Initialize POSTFLG since we replace the boot process --- include/mgba/internal/ds/io.h | 4 ++-- src/ds/io.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/mgba/internal/ds/io.h b/include/mgba/internal/ds/io.h index 3bba5792a..e1ca2bc4a 100644 --- a/include/mgba/internal/ds/io.h +++ b/include/mgba/internal/ds/io.h @@ -97,6 +97,8 @@ enum DSIORegisters { DS_REG_IE_HI = 0x212, DS_REG_IF_LO = 0x214, DS_REG_IF_HI = 0x216, + + DS_REG_POSTFLG = 0x300, }; enum DS7IORegisters { @@ -114,7 +116,6 @@ enum DS7IORegisters { // Memory control DS7_REG_VRAMSTAT = 0x240, DS7_REG_WRAMSTAT = 0x241, - DS7_REG_POSTFLG = 0x300, DS7_REG_HALTCNT = 0x301, DS7_REG_POWCNT2 = 0x304, DS7_REG_BIOSPROT_LO = 0x308, @@ -257,7 +258,6 @@ enum DS9IORegisters { DS9_REG_MAX = 0x106E, - DS9_REG_POSTFLG = 0x300, DS9_REG_POWCNT1 = 0x304, }; diff --git a/src/ds/io.c b/src/ds/io.c index 0f79eb6f9..6ccd0ea97 100644 --- a/src/ds/io.c +++ b/src/ds/io.c @@ -166,6 +166,7 @@ static void DSIOUpdateTimer(struct DSCommon* dscore, uint32_t address) { void DS7IOInit(struct DS* ds) { memset(ds->memory.io7, 0, sizeof(ds->memory.io7)); ds->memory.io7[DS_REG_IPCFIFOCNT >> 1] = 0x0101; + ds->memory.io7[DS_REG_POSTFLG >> 1] = 0x0001; } void DS7IOWrite(struct DS* ds, uint32_t address, uint16_t value) { @@ -322,6 +323,7 @@ uint32_t DS7IORead32(struct DS* ds, uint32_t address) { void DS9IOInit(struct DS* ds) { memset(ds->memory.io9, 0, sizeof(ds->memory.io9)); ds->memory.io9[DS_REG_IPCFIFOCNT >> 1] = 0x0101; + ds->memory.io9[DS_REG_POSTFLG >> 1] = 0x0001; } void DS9IOWrite(struct DS* ds, uint32_t address, uint16_t value) {