继续试验金手指开启

This commit is contained in:
anod 2023-03-07 16:42:00 +08:00
parent 53560f025d
commit 73942c4e78
2 changed files with 5 additions and 2 deletions

View File

@ -18,7 +18,7 @@ typedef int cheat_error_t;
#define CHEAT_MODE_FULLTIME 1 #define CHEAT_MODE_FULLTIME 1
#define CHEAT_MODE_ENABYKEY 2 #define CHEAT_MODE_ENABYKEY 2
#define CHEAT_MODE_KEYONOFF 3 #define CHEAT_MODE_KEYONOFF 3
#define CHEAT_MODE_SIZE 3 #define CHEAT_MODE_SIZE 4
#define MAKE_ENTID(hole, key) (((key)+1)<<16|((hole)+1)) #define MAKE_ENTID(hole, key) (((key)+1)<<16|((hole)+1))
#define ENT_USING(entid) ((entid) > 0xffff) #define ENT_USING(entid) ((entid) > 0xffff)

View File

@ -390,9 +390,12 @@ static Result loadGbaRom(const char *const path, u32 *const romSizeOut)
while((res = fRead(f, ptr, 0x100000u, &read)) == RES_OK && read == 0x100000u) while((res = fRead(f, ptr, 0x100000u, &read)) == RES_OK && read == 0x100000u)
ptr += 0x100000u; ptr += 0x100000u;
// use the gbaatm cheat
if( g_oafConfig.cheatMode != CHEAT_MODE_DISABLED ) if( g_oafConfig.cheatMode != CHEAT_MODE_DISABLED )
{ {
apply_cheat( g_oafConfig.cheatMode, fileSize, g_oafConfig.cheatKeys, CHEAT_INUSE_ADDR, &fileSize ); apply_cheat( g_oafConfig.cheatMode, fileSize, g_oafConfig.cheatKeys, CHEAT_INUSE_ADDR, &fileSize );
fini_current_cheat();
acl_close_lib();
} }
*romSizeOut = fixRomPadding(fileSize); *romSizeOut = fixRomPadding(fileSize);
} }
@ -847,7 +850,7 @@ static int cfgIniCallback(void* user, const char* section, const char* name, con
{ {
if( strcmp(name, "cheatMode") == 0 ) if( strcmp(name, "cheatMode") == 0 )
config->cheatMode = (u8)strtoul(value, NULL, 10); config->cheatMode = (u8)strtoul(value, NULL, 10);
if( config->cheatMode > CHEAT_MODE_SIZE ) config->cheatMode = CHEAT_MODE_DISABLED; if( config->cheatMode >= CHEAT_MODE_SIZE ) config->cheatMode = CHEAT_MODE_DISABLED;
} }
else return 0; // Error. else return 0; // Error.