Don't create an array of size 0.

This commit is contained in:
Stephen Anthony 2020-05-09 15:13:08 -02:30
parent 2770845f6b
commit 2ae04d7450
1 changed files with 4 additions and 2 deletions

View File

@ -52,6 +52,7 @@ void CartridgeEnhanced::install(System& system)
myCurrentSegOffset = make_unique<uInt32[]>(myBankSegs);
// Allocate array for the RAM area
if(myRamSize > 0)
myRAM = make_unique<uInt8[]>(myRamSize);
mySystem = &system;
@ -101,6 +102,7 @@ void CartridgeEnhanced::install(System& system)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeEnhanced::reset()
{
if(myRamSize > 0)
initializeRAM(myRAM.get(), myRamSize);
initializeStartBank(getStartBank());