libsnes: Cache region from core once at start
The region value in the comm struct is set once and then gets wiped out later. I don't know what wipes it, but so many things have their hands on that, it's not surprising. Someone knew about this and handled _mapper appropriately, but not _region. Fixes #2503
This commit is contained in:
parent
a8e2a420f0
commit
eeca40e072
|
@ -11,6 +11,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
private readonly List<MemoryDomain> _memoryDomainList = new List<MemoryDomain>();
|
||||
private IMemoryDomains _memoryDomains;
|
||||
private LibsnesApi.SNES_MAPPER? _mapper;
|
||||
private LibsnesApi.SNES_REGION? _region;
|
||||
|
||||
// works for WRAM, garbage for anything else
|
||||
private static int? FakeBusMap(int addr)
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
{
|
||||
public partial class LibsnesCore : IRegionable
|
||||
{
|
||||
public DisplayType Region => Api.Region == LibsnesApi.SNES_REGION.NTSC
|
||||
public DisplayType Region => _region == LibsnesApi.SNES_REGION.NTSC
|
||||
? DisplayType.NTSC
|
||||
: DisplayType.PAL;
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
}
|
||||
}
|
||||
|
||||
if (Api.Region == LibsnesApi.SNES_REGION.NTSC)
|
||||
if (_region == LibsnesApi.SNES_REGION.NTSC)
|
||||
{
|
||||
// similar to what aviout reports from snes9x and seems logical from bsnes first principles. bsnes uses that numerator (ntsc master clockrate) for sure.
|
||||
VsyncNumerator = 21477272;
|
||||
|
@ -484,6 +484,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
: Api.CMD_load_cartridge_super_game_boy(_currLoadParams.rom_xml, _currLoadParams.rom_data, _currLoadParams.rom_size, _currLoadParams.dmg_data);
|
||||
|
||||
_mapper = Api.Mapper;
|
||||
_region = Api.Region;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue