diff --git a/Core/BaseMapper.cpp b/Core/BaseMapper.cpp index 2dae3b13..ec02f428 100644 --- a/Core/BaseMapper.cpp +++ b/Core/BaseMapper.cpp @@ -819,7 +819,7 @@ CartridgeState BaseMapper::GetState() state.PrgPageSize = InternalGetPrgPageSize(); state.ChrPageCount = GetCHRPageCount(); state.ChrPageSize = InternalGetChrPageSize(); - for(int i = 0; i < 4; i++) { + for(int i = 0; i < 64; i++) { if(_prgPageNumbers[i] != 0xEEEEEEEE) { int16_t pageNumber = (int16_t)_prgPageNumbers[i]; state.PrgSelectedPages[i] = pageNumber < 0 ? state.PrgPageCount + pageNumber : pageNumber; @@ -828,7 +828,7 @@ CartridgeState BaseMapper::GetState() } } - for(int i = 0; i < 8; i++) { + for(int i = 0; i < 64; i++) { if(_chrPageNumbers[i] != 0xEEEEEEEE) { int16_t pageNumber = (int16_t)_chrPageNumbers[i]; state.ChrSelectedPages[i] = pageNumber < 0 ? state.ChrPageCount + pageNumber : pageNumber; diff --git a/Core/BaseMapper.h b/Core/BaseMapper.h index 5fa6f07a..eab65744 100644 --- a/Core/BaseMapper.h +++ b/Core/BaseMapper.h @@ -46,10 +46,10 @@ struct CartridgeState uint32_t PrgPageCount; uint32_t PrgPageSize; - uint32_t PrgSelectedPages[4]; + uint32_t PrgSelectedPages[64]; uint32_t ChrPageCount; uint32_t ChrPageSize; - uint32_t ChrSelectedPages[8]; + uint32_t ChrSelectedPages[64]; uint32_t Nametables[8]; }; diff --git a/GUI.NET/InteropEmu.cs b/GUI.NET/InteropEmu.cs index 1659e33c..f03f599b 100644 --- a/GUI.NET/InteropEmu.cs +++ b/GUI.NET/InteropEmu.cs @@ -560,12 +560,12 @@ namespace Mesen.GUI public UInt32 PrgPageCount; public UInt32 PrgPageSize; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public UInt32[] PrgSelectedPages; public UInt32 ChrPageCount; public UInt32 ChrPageSize; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public UInt32[] ChrSelectedPages; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]