Debugger: Fixed crash when opening debugger for NSF files

This commit is contained in:
Souryo 2016-09-08 18:11:50 -04:00
parent 7c5b6f4437
commit 790810df9b
3 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -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];
};

View File

@ -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)]