mirror of
https://github.com/libretro/Mesen.git
synced 2024-11-23 09:09:45 +00:00
Fixed mapper 80 SRAM/WRAM recognition
This commit is contained in:
parent
4b63fd9755
commit
e65b9c5d5a
@ -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:
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user