实现几种存档策略

This commit is contained in:
anod 2022-10-17 19:24:23 +08:00
parent ab8c6085f0
commit 0eb576cfc5

View File

@ -345,16 +345,16 @@ static u16 detectSaveType(u32 romSize)
{
const u32 *romPtr = (u32*)ROM_LOC;
u16 saveType;
if( g_oafConfig.savePolicy == SAVE_POLICY_SRAM )
{
return SAVE_TYPE_SRAM_256k;
}
if((saveType = checkSaveOverride(romPtr[0xAC / 4])) != 0xFF)
{
debug_printf("Serial in override list.\n"
"saveType: %u\n", saveType);
return saveType;
}
if( g_oafConfig.savePolicy == SAVE_POLICY_SRAM )
{
return SAVE_TYPE_SRAM_256k;
}
// Code based on: https://github.com/Gericom/GBARunner2/blob/master/arm9/source/save/Save.vram.cpp
romPtr += 0xE4 / 4; // Skip headers.
@ -856,6 +856,9 @@ Result oafInitAndRun(void)
// Adjust the path for the save file and get save type.
gameCfg2SavePath(filePath, g_oafConfig.saveSlot);
u16 saveType;
if( g_oafConfig.savePolicy == SAVE_POLICY_POPUP )
g_oafConfig.saveOverride = true;
else g_oafConfig.saveOverride = g_oafConfig.useGbaDb = false;
if(g_oafConfig.useGbaDb || g_oafConfig.saveOverride)
saveType = getSaveType(romSize, filePath);
else