mirror of https://github.com/mgba-emu/mgba.git
Init GBA I/O registers
This commit is contained in:
parent
0ba7451e3a
commit
9b1f3c3c73
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
#include "gba-video.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) {
|
void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
|
||||||
switch (address) {
|
switch (address) {
|
||||||
case REG_DISPSTAT:
|
case REG_DISPSTAT:
|
||||||
|
|
|
@ -141,6 +141,7 @@ enum GBAIORegisters {
|
||||||
REG_HALTCNT = 0x301
|
REG_HALTCNT = 0x301
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void GBAIOInit(struct GBA* gba);
|
||||||
void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value);
|
void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value);
|
||||||
void GBAIOWrite32(struct GBA* gba, uint32_t address, uint32_t value);
|
void GBAIOWrite32(struct GBA* gba, uint32_t address, uint32_t value);
|
||||||
uint16_t GBAIORead(struct GBA* gba, uint32_t address);
|
uint16_t GBAIORead(struct GBA* gba, uint32_t address);
|
||||||
|
|
|
@ -37,6 +37,8 @@ void GBAInit(struct GBA* gba) {
|
||||||
gba->video.p = gba;
|
gba->video.p = gba;
|
||||||
GBAVideoInit(&gba->video);
|
GBAVideoInit(&gba->video);
|
||||||
|
|
||||||
|
GBAIOInit(gba);
|
||||||
|
|
||||||
gba->springIRQ = 0;
|
gba->springIRQ = 0;
|
||||||
|
|
||||||
ARMReset(&gba->cpu);
|
ARMReset(&gba->cpu);
|
||||||
|
|
Loading…
Reference in New Issue