From 9b1f3c3c732d31bedcaf9fc82d286da857f07511 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Fri, 19 Apr 2013 00:04:50 -0700 Subject: [PATCH] Init GBA I/O registers --- src/gba/gba-io.c | 4 ++++ src/gba/gba-io.h | 1 + src/gba/gba.c | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/gba/gba-io.c b/src/gba/gba-io.c index a0f6f1cce..c205a3b4a 100644 --- a/src/gba/gba-io.c +++ b/src/gba/gba-io.c @@ -2,6 +2,10 @@ #include "gba-video.h" +void GBAIOInit(struct GBA* gba) { + gba->memory.io[REG_KEYINPUT >> 1] = 0x3FF; +} + void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) { switch (address) { case REG_DISPSTAT: diff --git a/src/gba/gba-io.h b/src/gba/gba-io.h index 4712d32f4..d0ff592b9 100644 --- a/src/gba/gba-io.h +++ b/src/gba/gba-io.h @@ -141,6 +141,7 @@ enum GBAIORegisters { REG_HALTCNT = 0x301 }; +void GBAIOInit(struct GBA* gba); void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value); void GBAIOWrite32(struct GBA* gba, uint32_t address, uint32_t value); uint16_t GBAIORead(struct GBA* gba, uint32_t address); diff --git a/src/gba/gba.c b/src/gba/gba.c index 6d305bb9b..ff5ef94b0 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -37,6 +37,8 @@ void GBAInit(struct GBA* gba) { gba->video.p = gba; GBAVideoInit(&gba->video); + GBAIOInit(gba); + gba->springIRQ = 0; ARMReset(&gba->cpu);