Commit e0c56aa7 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Revert "Add TODO/FIXME and cleanup handleInputFile"

This reverts commit c16abcfb.
parent c16abcfb
Pipeline #53764 passed with stages
in 8 minutes and 49 seconds
......@@ -224,8 +224,6 @@ void setupNGFfilename(void)
}
/* write all the dirty blocks out to a file */
/* TODO/FIXME - shouldn't this just go through libretro's get_memory_data
* interface instead? */
void writeSaveGameFile(void)
{
/* find the dirty blocks and write them to the .NGF file */
......
......@@ -213,48 +213,37 @@ static int strrchr2(const char *src, int c)
return 0;
}
#ifdef LOW_MEMORY
int handleInputFile(const char *romName,
const unsigned char *romData, int romSize)
{
FILE *romFile = NULL;
initSysInfo(); //initialize it all
//get ROM from binary ROM file
romFile = fopen(romName, "rb");
if(!romFile)
if (romData)
{
log_cb(RETRO_LOG_ERROR, "Couldn't open %s file\n", romName);
return 0;
}
m_emuInfo.romSize = fread(mainrom, 1, MAINROM_SIZE_MAX, romFile);
strcpy(m_emuInfo.RomFileName, romName);
int size = romSize > MAINROM_SIZE_MAX ?
MAINROM_SIZE_MAX : romSize;
fclose(romFile);
if (!initRom())
{
log_cb(RETRO_LOG_ERROR, "initRom couldn't handle %s file\n", romName);
return 0;
m_emuInfo.romSize = size;
memcpy(mainrom, romData, size);
strcpy(m_emuInfo.RomFileName, romName);
}
else
{
FILE *romFile = NULL;
setFlashSize(m_emuInfo.romSize);
return 1;
}
#else
int handleInputFile(const char *romName,
const unsigned char *romData, int romSize)
{
int size;
initSysInfo(); //initialize it all
//get ROM from binary ROM file
romFile = fopen(romName, "rb");
if(!romFile)
{
log_cb(RETRO_LOG_ERROR, "Couldn't open %s file\n", romName);
return 0;
}
size = romSize > MAINROM_SIZE_MAX ?
MAINROM_SIZE_MAX : romSize;
m_emuInfo.romSize = fread(mainrom, 1, MAINROM_SIZE_MAX, romFile);
strcpy(m_emuInfo.RomFileName, romName);
m_emuInfo.romSize = size;
memcpy(mainrom, romData, size);
strcpy(m_emuInfo.RomFileName, romName);
fclose(romFile);
}
if (!initRom())
{
......@@ -265,4 +254,3 @@ int handleInputFile(const char *romName,
setFlashSize(m_emuInfo.romSize);
return 1;
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment