添加系统设置页面

This commit is contained in:
anod 2022-10-17 11:25:01 +08:00
parent 04de3d9844
commit 4589e69247
2 changed files with 44 additions and 0 deletions

View File

@ -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;
}

View File

@ -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)
{