all repos — mgba @ f78951b7dd7b8b1681211a178772fb1ecd18f945

mGBA Game Boy Advance Emulator

GB IO: Add some register names
Vicki Pfau vi@endrift.com
Sun, 24 May 2020 13:41:09 -0700
commit

f78951b7dd7b8b1681211a178772fb1ecd18f945

parent

f9a42d87d18ac8869d510b35f5c9477373fca8cc

2 files changed, 8 insertions(+), 6 deletions(-)

jump to
M include/mgba/internal/gb/io.hinclude/mgba/internal/gb/io.h

@@ -84,7 +84,7 @@ REG_WY = 0x4A,

REG_WX = 0x4B, // CGB - REG_UNK4C = 0x4C, + REG_KEY0 = 0x4C, REG_KEY1 = 0x4D, REG_VBK = 0x4F, REG_HDMA1 = 0x51,

@@ -97,7 +97,7 @@ REG_BCPS = 0x68,

REG_BCPD = 0x69, REG_OCPS = 0x6A, REG_OCPD = 0x6B, - REG_UNK6C = 0x6C, + REG_OPRI = 0x6C, REG_SVBK = 0x70, REG_UNK72 = 0x72, REG_UNK73 = 0x73,
M src/gb/io.csrc/gb/io.c

@@ -53,6 +53,7 @@ [REG_OBP0] = "OBP0",

[REG_OBP1] = "OBP1", [REG_WY] = "WY", [REG_WX] = "WX", + [REG_KEY0] = "KEY0", [REG_KEY1] = "KEY1", [REG_VBK] = "VBK", [REG_HDMA1] = "HDMA1",

@@ -65,6 +66,7 @@ [REG_BCPS] = "BCPS",

[REG_BCPD] = "BCPD", [REG_OCPS] = "OCPS", [REG_OCPD] = "OCPD", + [REG_OPRI] = "OPRI", [REG_SVBK] = "SVBK", [REG_IE] = "IE", };

@@ -99,7 +101,7 @@ [REG_KEY1] = 0x7E,

[REG_VBK] = 0xFE, [REG_OCPS] = 0x40, [REG_BCPS] = 0x40, - [REG_UNK6C] = 0xFE, + [REG_OPRI] = 0xFE, [REG_SVBK] = 0xF8, [REG_IE] = 0xE0, };

@@ -200,7 +202,7 @@ }

GBIOWrite(gb, REG_WY, 0x00); GBIOWrite(gb, REG_WX, 0x00); if (gb->model & GB_MODEL_CGB) { - GBIOWrite(gb, REG_UNK4C, 0); + GBIOWrite(gb, REG_KEY0, 0); GBIOWrite(gb, REG_JOYP, 0xFF); GBIOWrite(gb, REG_VBK, 0); GBIOWrite(gb, REG_BCPS, 0x80);

@@ -462,7 +464,7 @@ if (gb->memory.io[0x50] != 0xFF) {

break; } GBUnmapBIOS(gb); - if (gb->model >= GB_MODEL_CGB && gb->memory.io[REG_UNK4C] < 0x80) { + if (gb->model >= GB_MODEL_CGB && gb->memory.io[REG_KEY0] < 0x80) { gb->model = GB_MODEL_DMG; GBVideoDisableCGB(&gb->video); }

@@ -474,7 +476,7 @@ return;

default: if (gb->model >= GB_MODEL_CGB) { switch (address) { - case REG_UNK4C: + case REG_KEY0: break; case REG_KEY1: value &= 0x1;