mirror of
https://gitee.com/anod/open_agb_firm.git
synced 2025-05-12 11:46:56 +08:00
增加显示电量的内容
This commit is contained in:
parent
c02aef0cb1
commit
c7f0f4f342
@ -51,7 +51,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
Result res = fMount(FS_DRIVE_SDMC);
|
Result res = fMount(FS_DRIVE_SDMC);
|
||||||
if(res == RES_OK) res = oafParseConfigEarly();
|
if(res == RES_OK) res = oafParseConfigEarly();
|
||||||
GFX_init(GFX_RGB565, GFX_RGB565);
|
GFX_init(GFX_BGR8, GFX_RGB565);
|
||||||
setBacklight();
|
setBacklight();
|
||||||
consoleInit(SCREEN_BOT, NULL);
|
consoleInit(SCREEN_BOT, NULL);
|
||||||
//CODEC_init();
|
//CODEC_init();
|
||||||
|
@ -238,10 +238,12 @@ static atp_pageopt_t config_adjust( atp_callerdata_t, atp_counter_t index, atp_b
|
|||||||
atp_error_t oaf_config_page()
|
atp_error_t oaf_config_page()
|
||||||
{
|
{
|
||||||
u8 base[sizeof(g_oafConfig)];
|
u8 base[sizeof(g_oafConfig)];
|
||||||
|
char title[64];
|
||||||
memcpy( base, &g_oafConfig, sizeof(g_oafConfig) );
|
memcpy( base, &g_oafConfig, sizeof(g_oafConfig) );
|
||||||
OafConfig *prev = (OafConfig*)&base[0];
|
OafConfig *prev = (OafConfig*)&base[0];
|
||||||
|
|
||||||
atp_error_t res = atp_select( "参数配置", 4, config_item, config_adjust, NULL, 0, 0, NULL );
|
ee_snprintf(title, sizeof(title), "参数配置 电量%d%%", MCU_getBatteryLevel());
|
||||||
|
atp_error_t res = atp_select( title, 4, config_item, config_adjust, NULL, 0, 0, NULL );
|
||||||
if( res == ATP_NO_ACTION )
|
if( res == ATP_NO_ACTION )
|
||||||
{
|
{
|
||||||
memcpy( &g_oafConfig, prev, sizeof(g_oafConfig) );
|
memcpy( &g_oafConfig, prev, sizeof(g_oafConfig) );
|
||||||
@ -682,7 +684,7 @@ static void gbaGfxHandler(void *args)
|
|||||||
// 0x18180000 <----------> screen_top + 16*240*3 + 120 是正确对准,左边对16求余为0,右边为8
|
// 0x18180000 <----------> screen_top + 16*240*3 + 120 是正确对准,左边对16求余为0,右边为8
|
||||||
// 现在右边加上8,是2|2/3个像素
|
// 现在右边加上8,是2|2/3个像素
|
||||||
GX_displayTransfer((u32*)(0x18180000 + 16*240*3), 368u<<16 | 240u,
|
GX_displayTransfer((u32*)(0x18180000 + 16*240*3), 368u<<16 | 240u,
|
||||||
GFX_getFramebuffer(SCREEN_TOP) + 16*240*2 + 80, 368u<<16 | 240u, 2u<<12 | 1u<<8);
|
GFX_getFramebuffer(SCREEN_TOP) + 16*240*3 + 96, 368u<<16 | 240u, 2u<<12 | 1u<<8);
|
||||||
}
|
}
|
||||||
else GX_displayTransfer((u32*)(0x18180000 + 16*240*3), 368u<<16 | 240u,
|
else GX_displayTransfer((u32*)(0x18180000 + 16*240*3), 368u<<16 | 240u,
|
||||||
GFX_getFramebuffer(SCREEN_TOP) + 16*240*3, 368u<<16 | 240u, 1u<<12 | 1u<<8);
|
GFX_getFramebuffer(SCREEN_TOP) + 16*240*3, 368u<<16 | 240u, 1u<<12 | 1u<<8);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user