Make ROMStorage dynamic.

This commit is contained in:
BearOso 2023-03-23 17:52:39 -05:00
parent 6b2a8bf2de
commit fdcef11795
2 changed files with 4 additions and 2 deletions

View File

@ -928,10 +928,11 @@ bool8 CMemory::Init (void)
return (FALSE);
}
ROMStorage.resize(MAX_ROM_SIZE + 0x200 + 0x8000);
memset(RAM, 0, sizeof(RAM));
memset(SRAM, 0, sizeof(SRAM));
memset(VRAM, 0, sizeof(VRAM));
memset(ROMStorage, 0, sizeof(ROMStorage));
memset(ROMStorage.data(), 0, ROMStorage.size());
memset(IPPU.TileCache[TILE_2BIT], 0, MAX_2BIT_TILES * 64);
memset(IPPU.TileCache[TILE_4BIT], 0, MAX_4BIT_TILES * 64);

View File

@ -13,6 +13,7 @@
#define MEMMAP_MASK (MEMMAP_BLOCK_SIZE - 1)
#include <string>
#include <vector>
struct CMemory
{
@ -56,7 +57,7 @@ struct CMemory
int32 HeaderCount;
uint8 RAM[0x20000];
uint8 ROMStorage[MAX_ROM_SIZE + 0x200 + 0x8000];
std::vector<uint8_t> ROMStorage;
uint8 *ROM;
uint8 SRAM[0x80000];
uint8 VRAM[0x10000];