Fixed mapper 80 SRAM/WRAM recognition

This commit is contained in:
oncemailtime 2024-01-29 12:44:24 -05:00 committed by GitHub
parent 4b63fd9755
commit e65b9c5d5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,6 +24,9 @@ protected:
virtual uint32_t GetSaveRamSize() override { return 0x100; }
virtual uint32_t GetSaveRamPageSize() override { return 0x100; }
bool ForceSaveRamSize() override { return HasBattery(); }
bool ForceWorkRamSize() override { return !HasBattery(); }
void InitMapper() override
{
_ramPermission = 0;
@ -33,6 +36,17 @@ protected:
UpdateRamAccess();
}
void WriteRAM(uint16_t addr, uint8_t value) override
{
if((addr & 0xFF00) == 0x7F00) {
//Mirror writes to the top/bottom - the mapper only has 128 bytes of ram, mirrored once.
//The current BaseMapper code doesn't support mapping blocks smaller than 256 bytes,
//so doing this at least ensures it behaves like a mirrored 128-byte block of ram
BaseMapper::WriteRAM(addr ^ 0x80, value);
}
BaseMapper::WriteRAM(addr, value);
}
void WriteRegister(uint16_t addr, uint8_t value) override
{
switch(addr) {
@ -98,4 +112,4 @@ public:
{
}
};
};