mirror of https://github.com/mgba-emu/mgba.git
GBA Memory: Add unlicensed cart write handling stub
This commit is contained in:
parent
91cf829261
commit
dc263295dd
|
@ -60,6 +60,7 @@ void GBAUnlCartReset(struct GBA*);
|
|||
void GBAUnlCartUnload(struct GBA*);
|
||||
void GBAUnlCartDetect(struct GBA*);
|
||||
void GBAUnlCartWriteSRAM(struct GBA*, uint32_t address, uint8_t value);
|
||||
void GBAUnlCartWriteROM(struct GBA*, uint32_t address, uint16_t value);
|
||||
|
||||
struct GBASerializedState;
|
||||
void GBAUnlCartSerialize(const struct GBA* gba, struct GBASerializedState* state);
|
||||
|
|
|
@ -126,6 +126,19 @@ void GBAUnlCartWriteSRAM(struct GBA* gba, uint32_t address, uint8_t value) {
|
|||
gba->memory.savedata.data[address & (GBA_SIZE_SRAM - 1)] = value;
|
||||
}
|
||||
|
||||
void GBAUnlCartWriteROM(struct GBA* gba, uint32_t address, uint16_t value) {
|
||||
struct GBAUnlCart* unl = &gba->memory.unl;
|
||||
|
||||
switch (unl->type) {
|
||||
case GBA_UNL_CART_VFAME:
|
||||
case GBA_UNL_CART_NONE:
|
||||
break;
|
||||
case GBA_UNL_CART_MULTICART:
|
||||
mLOG(GBA_MEM, STUB, "Unimplemented writing to ROM %07X:%04X", address, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void _multicartSettle(struct mTiming* timing, void* context, uint32_t cyclesLate) {
|
||||
UNUSED(timing);
|
||||
UNUSED(cyclesLate);
|
||||
|
|
|
@ -963,6 +963,10 @@ void GBAStore16(struct ARMCore* cpu, uint32_t address, int16_t value, int* cycle
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (memory->unl.type) {
|
||||
GBAUnlCartWriteROM(gba, address & (GBA_SIZE_ROM0 - 1), value);
|
||||
break;
|
||||
}
|
||||
mLOG(GBA_MEM, GAME_ERROR, "Bad cartridge Store16: 0x%08X", address);
|
||||
break;
|
||||
case GBA_REGION_ROM2_EX:
|
||||
|
|
Loading…
Reference in New Issue