all repos — mgba @ 9b1f3c3c732d31bedcaf9fc82d286da857f07511

mGBA Game Boy Advance Emulator

Init GBA I/O registers
Jeffrey Pfau jeffrey@endrift.com
Fri, 19 Apr 2013 00:04:50 -0700
commit

9b1f3c3c732d31bedcaf9fc82d286da857f07511

parent

0ba7451e3a0a5b6a1d88a39c79bd13f462ee1a4b

3 files changed, 7 insertions(+), 0 deletions(-)

jump to
M src/gba/gba-io.csrc/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.hsrc/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.csrc/gba/gba.c

@@ -37,6 +37,8 @@

gba->video.p = gba; GBAVideoInit(&gba->video); + GBAIOInit(gba); + gba->springIRQ = 0; ARMReset(&gba->cpu);