src/gba/gba-io.c (view raw)
1#include "gba-io.h"
2
3void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
4 switch (address) {
5 case REG_WAITCNT:
6 GBAAdjustWaitstates(&gba->memory, value);
7 break;
8 default:
9 GBALog(GBA_LOG_STUB, "Stub I/O register write: %03x", address);
10 break;
11 }
12 gba->memory.io[address >> 1] = value;
13}
14
15uint16_t GBAIORead(struct GBA* gba, uint32_t address) {
16 switch (address) {
17 case REG_WAITCNT:
18 // Handled transparently by registers
19 break;
20 default:
21 GBALog(GBA_LOG_STUB, "Stub I/O register read: %03x", address);
22 break;
23 }
24 return gba->memory.io[address >> 1];
25}