From 4589e692474a9054abfae12c2ad96205e085670d Mon Sep 17 00:00:00 2001 From: anod <182859762@qq.com> Date: Mon, 17 Oct 2022 11:25:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=B3=BB=E7=BB=9F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/arm11/filebrowser.c | 8 ++++++++ source/arm11/open_agb_firm.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/source/arm11/filebrowser.c b/source/arm11/filebrowser.c index 21ff66f..876d775 100644 --- a/source/arm11/filebrowser.c +++ b/source/arm11/filebrowser.c @@ -193,13 +193,21 @@ static void help_page( atp_text_t *wording, atp_counter_t length ) atp_show( length, display_help, (atp_callerdata_t)wording ); } +extern void oaf_config_page(); + static atp_pageopt_t serve_on_key( atp_callerdata_t data, atp_boolean_t x, atp_boolean_t y, atp_boolean_t l, atp_boolean_t r, atp_boolean_t start, atp_boolean_t select ) { if( start ) { + atp_tips( "", NULL ); help_page( folder_help, sizeof(folder_help)/sizeof(atp_text_t) ); return ATP_PAGE_REFRESH; } + else if( select ) + { + oaf_config_page(); + return ATP_PAGE_REFRESH; + } return ATP_PAGE_NOOPTION; } diff --git a/source/arm11/open_agb_firm.c b/source/arm11/open_agb_firm.c index df8c3e7..9535e8e 100644 --- a/source/arm11/open_agb_firm.c +++ b/source/arm11/open_agb_firm.c @@ -37,6 +37,7 @@ #include "arm11/gpu_cmd_lists.h" #include "arm11/drivers/mcu.h" #include "arm11/acf.h" +#include "arm11/atp.h" #include "kernel.h" #include "kevent.h" @@ -115,7 +116,42 @@ static OafConfig g_oafConfig = }; static KHandle g_frameReadyEvent = 0; +// -------------------------- +// code for oaf config page +// -------------------------- +static atp_error_t config_item( atp_callerdata_t data, atp_counter_t index, atp_itemcfg_t *cfg ) +{ + const char *scaler_val[] = {"上屏无缩放", "上屏GPU放大", "上屏DMA放大", "下屏无缩放"}; + char buf[32]; + if( index == 0 ) + { + cfg->text = "屏幕亮度"; + cfg->extra_text = ee_snprintf(buf, sizeof(buf)-1, "%d", g_oafConfig.brightness); + } + else if( index == 1 ) + { + cfg->text = "GAME BOY画面"; + cfg->extra_text = g_oafConfig.directBoot ? "跳过" : "显示"; + } + else if( index == 2 ) + { + cfg->text = "画面输出"; + cfg->extra_text = scaler_val[g_oafConfig.scaler]; + } + else if( index == 3 ) + { + cfg->text = "推测存档类型"; + cfg->extra_text = g_oafConfig.saveOverride ? "禁用" : "启用"; + } + cfg->value = index; + cfg->extra_text_color = ATP_COLOR_GREEN; + return ATP_SUCCESS; +} +void oaf_config_page() +{ + atp_select( "参数配置", 1, config_item, NULL, NULL, 0, 0, NULL ); +} static u32 fixRomPadding(u32 romFileSize) {