diff --git a/include/arm11/open_agb_firm.h b/include/arm11/open_agb_firm.h index c0b196c..ab36de4 100644 --- a/include/arm11/open_agb_firm.h +++ b/include/arm11/open_agb_firm.h @@ -45,6 +45,7 @@ struct global_oaf_config // [boost] u8 savePolicy; u8 cheatMode; + u8 haltMode; }; #define SAVE_POLICY_GBADB 0 @@ -53,6 +54,10 @@ struct global_oaf_config #define SAVE_POLICY_POPUP 3 #define SAVE_POLICY_SIZE 4 +#define HALT_MODE_POWEROFF 0 +#define HALT_MODE_REBOOT 1 +#define HALT_MODE_SIZE 2 + Result oafParseConfigEarly(void); u16 oafGetBacklightConfig(void); Result oafInitAndRun(void); diff --git a/source/arm11/open_agb_firm.c b/source/arm11/open_agb_firm.c index 9c21562..2fd928b 100644 --- a/source/arm11/open_agb_firm.c +++ b/source/arm11/open_agb_firm.c @@ -100,6 +100,7 @@ static OafConfig g_oafConfig = // [boost] , SAVE_POLICY_GBADB // savePolicy , CHEAT_MODE_DISABLED// cheatMode + , HALT_MODE_POWEROFF// haltMode }; static KHandle g_frameReadyEvent = 0; static u16 detect_cheatKey = 0; diff --git a/source/arm11/pages.c b/source/arm11/pages.c index a6abfaa..62e02f1 100644 --- a/source/arm11/pages.c +++ b/source/arm11/pages.c @@ -71,7 +71,8 @@ atp_text_t CONFIG_OUTPUT = "[general]\n" \ "saveOverride=false\n" \ "defaultSave=%d\n\n" \ "[boost]\n" \ - "cheatMode=%d\n"; + "cheatMode=%d\n"\ + "haltMode=%d\n"; typedef struct global_oaf_config OafConfig; @@ -87,6 +88,7 @@ static atp_error_t config_item( atp_callerdata_t gblcfg, atp_counter_t index, at const char *scaler_val[] = {"上屏无缩放", "上屏GPU放大", "上屏DMA放大", "下屏无缩放"}; const char *savetype_name[] = {"和卡带序列号一致", "读取ROM的特定标记", "汉化带SRAM补丁", "自行决定"}; const char *cheatmode_name[] = {"关闭金手指", "全程激活", "组合键单次激活", "组合键激活/关闭"}; + const char *haltmode_name[] = {"关闭3DS", "停止游戏"}; cfg->extra_text_color = ATP_COLOR_GREEN; if( index == 0 ) { @@ -116,6 +118,11 @@ static atp_error_t config_item( atp_callerdata_t gblcfg, atp_counter_t index, at cfg->text = "激活金手指"; cfg->extra_text = cheatmode_name[g_oafConfig->cheatMode]; } + else if( index == 5 ) + { + cfg->text = "游戏中按住电源键"; + cfg->extra_text = haltmode_name[g_oafConfig->haltMode]; + } cfg->value = index; return ATP_SUCCESS; } @@ -164,6 +171,7 @@ static atp_pageopt_t config_adjust( atp_callerdata_t gblcfg, atp_counter_t index else if( index == 2 ) g_oafConfig->scaler = ( SCALER_SIZE + ( g_oafConfig->scaler+(l?-1:1) ) ) % SCALER_SIZE; else if( index == 3 ) g_oafConfig->savePolicy = ( SAVE_POLICY_SIZE + ( g_oafConfig->savePolicy+(l?-1:1) ) ) % SAVE_POLICY_SIZE; else if( index == 4 ) g_oafConfig->cheatMode = ( CHEAT_MODE_SIZE + (g_oafConfig->cheatMode+(l?-1:1) ) ) % CHEAT_MODE_SIZE; + else if( index == 5 ) g_oafConfig->haltMode = ( HALT_MODE_SIZE + (g_oafConfig->haltMode+(l?-1:1) ) ) % HALT_MODE_SIZE; } else if( start ) { @@ -191,7 +199,8 @@ static atp_pageopt_t config_adjust( atp_callerdata_t gblcfg, atp_counter_t index float2str(g_oafConfig->contrast, contract), float2str(g_oafConfig->brightness, brightness), g_oafConfig->defaultSave, - g_oafConfig->cheatMode + g_oafConfig->cheatMode, + g_oafConfig->haltMode ); fsQuickWrite("config.ini", data, len); free( data );