GB: MBC4 does not exist, but MBC6 does

This commit is contained in:
Jeffrey Pfau 2016-01-30 00:15:05 -08:00
parent 041d1860ab
commit f5923c74a7
2 changed files with 13 additions and 14 deletions

View File

@ -27,8 +27,8 @@ static void _GBMBCNone(struct GBMemory* memory, uint16_t address, uint8_t value)
static void _GBMBC1(struct GBMemory*, uint16_t address, uint8_t value);
static void _GBMBC2(struct GBMemory*, uint16_t address, uint8_t value);
static void _GBMBC3(struct GBMemory*, uint16_t address, uint8_t value);
static void _GBMBC4(struct GBMemory*, uint16_t address, uint8_t value);
static void _GBMBC5(struct GBMemory*, uint16_t address, uint8_t value);
static void _GBMBC6(struct GBMemory*, uint16_t address, uint8_t value);
static void _GBMBC7(struct GBMemory*, uint16_t address, uint8_t value);
static void GBSetActiveRegion(struct LR35902Core* cpu, uint16_t address) {
@ -113,12 +113,6 @@ void GBMemoryReset(struct GB* gb) {
gb->memory.mbc = _GBMBC3;
gb->memory.mbcType = GB_MBC3;
break;
case 0x15:
case 0x16:
case 0x17:
gb->memory.mbc = _GBMBC4;
gb->memory.mbcType = GB_MBC4;
break;
default:
mLOG(GB_MBC, WARN, "Unknown MBC type: %02X", cart->type);
case 0x19:
@ -130,6 +124,10 @@ void GBMemoryReset(struct GB* gb) {
gb->memory.mbc = _GBMBC5;
gb->memory.mbcType = GB_MBC5;
break;
case 0x20:
gb->memory.mbc = _GBMBC6;
gb->memory.mbcType = GB_MBC6;
break;
case 0x22:
gb->memory.mbc = _GBMBC7;
gb->memory.mbcType = GB_MBC7;
@ -427,11 +425,6 @@ void _GBMBC3(struct GBMemory* memory, uint16_t address, uint8_t value) {
}
}
void _GBMBC4(struct GBMemory* memory, uint16_t address, uint8_t value) {
// TODO
mLOG(GB_MBC, STUB, "MBC4 unimplemented");
}
void _GBMBC5(struct GBMemory* memory, uint16_t address, uint8_t value) {
int bank = value & 0x7F;
switch (address >> 13) {
@ -465,6 +458,11 @@ void _GBMBC5(struct GBMemory* memory, uint16_t address, uint8_t value) {
}
}
void _GBMBC6(struct GBMemory* memory, uint16_t address, uint8_t value) {
// TODO
mLOG(GB_MBC, STUB, "MBC6 unimplemented");
}
void _GBMBC7(struct GBMemory* memory, uint16_t address, uint8_t value) {
// TODO
mLOG(GB_MBC, STUB, "MBC7 unimplemented");

View File

@ -58,11 +58,12 @@ enum GBMemoryBankControllerType {
GB_MBC1 = 1,
GB_MBC2 = 2,
GB_MBC3 = 3,
GB_MBC4 = 4,
GB_MBC5 = 5,
GB_MBC6 = 6,
GB_MBC7 = 7,
GB_MMM01 = 0x10,
GB_HuC1 = 0x11
GB_HuC1 = 0x11,
GB_HuC3 = 0x12,
};
struct GBMemory;