Init GBA I/O registers
Jeffrey Pfau jeffrey@endrift.com
Fri, 19 Apr 2013 00:04:50 -0700
3 files changed,
7 insertions(+),
0 deletions(-)
M
src/gba/gba-io.c
→
src/gba/gba-io.c
@@ -2,6 +2,10 @@ #include "gba-io.h"
#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:
M
src/gba/gba-io.h
→
src/gba/gba-io.h
@@ -141,6 +141,7 @@ REG_POSTFLG = 0x300,
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);
M
src/gba/gba.c
→
src/gba/gba.c
@@ -37,6 +37,8 @@
gba->video.p = gba; GBAVideoInit(&gba->video); + GBAIOInit(gba); + gba->springIRQ = 0; ARMReset(&gba->cpu);