Init GBA I/O registers

This commit is contained in:
Jeffrey Pfau 2013-04-19 00:04:50 -07:00
parent 0ba7451e3a
commit 9b1f3c3c73
3 changed files with 7 additions and 0 deletions

View File

@ -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:

View File

@ -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);

View File

@ -37,6 +37,8 @@ void GBAInit(struct GBA* gba) {
gba->video.p = gba;
GBAVideoInit(&gba->video);
GBAIOInit(gba);
gba->springIRQ = 0;
ARMReset(&gba->cpu);