Skip to content

Commit

Permalink
SNES: SPC7110 - Fixed incorrect memory mappings after loading save st…
Browse files Browse the repository at this point in the history
…ates

Also fixes a bug in the decompression init code that could cause the emulator to crash when an invalid decompression mode was read from rom
  • Loading branch information
SourMesen committed Jan 22, 2025
1 parent d3e70be commit f15f90d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Core/SNES/Coprocessors/SPC7110/Spc7110.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ void Spc7110::Serialize(Serializer& s)
if(_rtc) {
SV(_rtc);
}

if(!s.IsSaving()) {
UpdateMappings();
}
}

uint8_t Spc7110::Read(uint32_t addr)
Expand Down Expand Up @@ -362,7 +366,7 @@ void Spc7110::IncrementPosition4810()
void Spc7110::LoadEntryHeader()
{
uint32_t address = _directoryBase + _directoryIndex * 4;
_decompMode = ReadDataRom(address);
_decompMode = ReadDataRom(address) & 0x03;
_srcAddress = (ReadDataRom(address + 1) << 16) | (ReadDataRom(address + 2) << 8) | ReadDataRom(address + 3);
}

Expand Down

0 comments on commit f15f90d

Please sign in to comment.