From ed0aa3aea99161cca02ae63defa5347f4404e36b Mon Sep 17 00:00:00 2001 From: anod <182859762@qq.com> Date: Tue, 7 Mar 2023 19:04:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/arm11/open_agb_firm.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/source/arm11/open_agb_firm.c b/source/arm11/open_agb_firm.c index 9220620..3333d21 100644 --- a/source/arm11/open_agb_firm.c +++ b/source/arm11/open_agb_firm.c @@ -392,15 +392,17 @@ static Result loadGbaRom(const char *const path, u32 *const romSizeOut) fClose(f); // use the gbaatm cheat - char gamecode[5]; - memcpy( gamecode, ROM_LOC+0xac, 4 ); - gamecode[4] = '\0'; - debug_printf( "open res:%d\n", acl_open_lib( "gba.acl" )); - debug_printf(" select res:%d\n", acl_select_game( gamecode, 0, NULL )); - int err = apply_cheat( g_oafConfig.cheatMode, fileSize, g_oafConfig.cheatKeys, CHEAT_INUSE_ADDR, &fileSize ); - debug_printf("cheat res: %s => %d\n", gamecode, err); - acl_close_lib(); - fini_current_cheat(); + if( g_oafConfig.cheatMode != CHEAT_MODE_DISABLED ) + { + char gamecode[5]; + memcpy( gamecode, ROM_LOC+0xac, 4 ); + gamecode[4] = '\0'; + acl_open_lib( "gba.acl" ); + acl_select_game( gamecode, 0, NULL ); + apply_cheat( g_oafConfig.cheatMode, fileSize, g_oafConfig.cheatKeys, CHEAT_INUSE_ADDR, &fileSize ); + acl_close_lib(); + fini_current_cheat(); + } *romSizeOut = fixRomPadding(fileSize); }