Win32 - Fix debug window so it doesn't crash if unminimized with no game loaded.

This commit is contained in:
adelikat 2009-11-17 23:50:03 +00:00
parent 19b5cf13f5
commit c400aaab01
4 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,4 @@
17-nov-2009 - adelikat - Win32 - Fix debug window so it doesn't crash if unminimized with no game loaded.
13-nov-2009 - mart0258 - Win32 - TASEdit - Added interface functionality (save/load, running TASEdit mid-movie, etc.) 13-nov-2009 - mart0258 - Win32 - TASEdit - Added interface functionality (save/load, running TASEdit mid-movie, etc.)
13-nov-2009 - adelikat - made savestate compression togglable 13-nov-2009 - adelikat - made savestate compression togglable
13-nov-2009 - adelikat - made savestate backups togglable 13-nov-2009 - adelikat - made savestate backups togglable

View File

@ -243,7 +243,8 @@ uint8 GetMem(uint16 A) {
} }
} }
else if ((A >= 0x4000) && (A < 0x6000)) return 0xFF; //fix me else if ((A >= 0x4000) && (A < 0x6000)) return 0xFF; //fix me
return ARead[A](A); if (GameInfo) return ARead[A](A); //adelikat: 11/17/09: Prevent crash if this is called with no game loaded.
else return 0;
} }
uint8 GetPPUMem(uint8 A) { uint8 GetPPUMem(uint8 A) {

View File

@ -106,7 +106,7 @@ int getBank(int offs)
//GetNesFileAddress doesn't work well with Unif files //GetNesFileAddress doesn't work well with Unif files
int addr = GetNesFileAddress(offs)-16; int addr = GetNesFileAddress(offs)-16;
if (GameInfo->type==GIT_NSF) { if (GameInfo && GameInfo->type==GIT_NSF) {
return addr != -1 ? addr / 0x1000 : -1; return addr != -1 ? addr / 0x1000 : -1;
} }
return addr != -1 ? addr / 0x4000 : -1; return addr != -1 ? addr / 0x4000 : -1;

Binary file not shown.