Allow passing optional rom filename

This commit is contained in:
OV2 2023-03-28 18:05:37 +02:00
parent af70c62343
commit fb3c00460d
2 changed files with 6 additions and 4 deletions

View File

@ -1299,12 +1299,15 @@ uint32 CMemory::FileLoader (uint8 *buffer, const char *filename, uint32 maxsize)
return ((uint32) totalSize);
}
bool8 CMemory::LoadROMMem (const uint8 *source, uint32 sourceSize)
bool8 CMemory::LoadROMMem (const uint8 *source, uint32 sourceSize, const char* optional_rom_filename /*= NULL*/)
{
if(!source || sourceSize > MAX_ROM_SIZE)
return FALSE;
ROMFilename = "MemoryROM";
if (optional_rom_filename)
ROMFilename = optional_rom_filename;
else
ROMFilename = "MemoryROM";
do
{

View File

@ -108,8 +108,7 @@ struct CMemory
int First512BytesCountZeroes() const;
uint32 HeaderRemove (uint32, uint8 *);
uint32 FileLoader (uint8 *, const char *, uint32);
uint32 MemLoader (uint8 *, const char*, uint32);
bool8 LoadROMMem (const uint8 *, uint32);
bool8 LoadROMMem (const uint8 *, uint32, const char* optional_rom_filename = NULL);
bool8 LoadROM (const char *);
bool8 LoadROMInt (int32);
bool8 LoadMultiCartMem (const uint8 *, uint32, const uint8 *, uint32, const uint8 *, uint32);