mirror of
https://gitee.com/anod/open_agb_firm.git
synced 2025-05-07 06:14:12 +08:00
Merge branch 'dev_cheat' of https://gitee.com/anod/open_agb_firm into dev_cheat
This commit is contained in:
commit
1c128acd11
@ -60,8 +60,8 @@ const char *acf_put_text(int x, int y, int width, int height, int maxwidth, u8 c
|
||||
static void screen_clean()
|
||||
{
|
||||
memset(consoleGet()->frameBuffer, 0, WINDOW_WIDTH*WINDOW_HEIGHT*sizeof(uint16_t));
|
||||
acf_put_text( 5, 215, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH-10, ATP_COLOR_BLUE, ATP_PLACEMENT_LEFT, ta );
|
||||
acf_put_text( 5, 215, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH-10, ATP_COLOR_BLUE, ATP_PLACEMENT_RIGHT, tb );
|
||||
if( ta[0] ) acf_put_text( 5, 215, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH-10, ATP_COLOR_BLUE, ATP_PLACEMENT_LEFT, ta );
|
||||
if( tb[0] ) acf_put_text( 5, 215, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH-10, ATP_COLOR_BLUE, ATP_PLACEMENT_RIGHT, tb );
|
||||
}
|
||||
|
||||
// wait key pressed, if power key is pressed, return 0
|
||||
|
@ -51,7 +51,6 @@
|
||||
#define ENT_TYPE_FILE (0)
|
||||
#define ENT_TYPE_DIR (1)
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32 num; // Total number of entries.
|
||||
@ -60,19 +59,38 @@ typedef struct
|
||||
} DirList;
|
||||
|
||||
extern const char *acf_put_text(int x, int y, int width, int height, int maxwidth, u8 color, u8 placement, const char* text);
|
||||
|
||||
const char *acf_draw(int x, int y, int width, int height, int maxwidth, u8 color, const char* text)
|
||||
{
|
||||
return acf_put_text(x, y, width, height, maxwidth, color, ATP_PLACEMENT_LEFT, text);
|
||||
}
|
||||
|
||||
static const char *page[] = {
|
||||
"是这里吗?",
|
||||
"我不知道呢",
|
||||
"能再看一遍吗?",
|
||||
"原来是这样啊"
|
||||
"a ha",
|
||||
"舍不得璀璨俗世",
|
||||
"a ha",
|
||||
"躲不开痴恋的欣慰",
|
||||
"a ha",
|
||||
"找不到色相代替",
|
||||
"a ha",
|
||||
"参一生参不透这条难题",
|
||||
"吞风吻雨葬落日",
|
||||
"未曾彷徨",
|
||||
"欺山赶海践雪径",
|
||||
"也未绝望",
|
||||
"沾花把酒偏折煞",
|
||||
"世人情狂",
|
||||
"凭这两眼与百臂",
|
||||
"或千手不能防",
|
||||
"天阔阔雪漫漫",
|
||||
"风随怒航",
|
||||
"这砂滚滚水皱皱",
|
||||
"笑着浪荡",
|
||||
"贪欢一晌偏叫那",
|
||||
"女儿情长埋葬"
|
||||
};
|
||||
|
||||
static atp_error_t test_show( atp_callerdata_t data, atp_counter_t idx, atp_text_t *ptext, atp_itemval_t *pval, atp_color_t *c, atp_placement_t *p )
|
||||
static atp_error_t test_show( atp_callerdata_t , atp_counter_t idx, atp_text_t *ptext, atp_itemval_t *, atp_color_t *, atp_placement_t * )
|
||||
{
|
||||
if( idx < sizeof(page) ){
|
||||
*ptext = page[idx];
|
||||
@ -166,7 +184,7 @@ static void showDirList(const DirList *const dList, u32 start)
|
||||
|
||||
//ee_printf(printStr, i - start, &dList->ptrs[i][1]); // TODO: use acf to display
|
||||
const uint8_t fg = *dList -> ptrs[i] == ENT_TYPE_FILE ? 7 : 6;
|
||||
acf_draw(CLEFTMARGIN, LINENO_TO_Y(i-start), CWIDTH, CHEIGHT, CLINELIMIT, consoleGetRGB565Color(fg), &dList->ptrs[i][1] );
|
||||
acf_draw(CLEFTMARGIN, LINENO_TO_Y(i-start), CWIDTH, CHEIGHT, CLINELIMIT, fg, &dList->ptrs[i][1] );
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,13 +215,13 @@ Result browseFiles(const char *const basePath, char selected[512])
|
||||
if( oldCursorPos != cursorPos && windowPos <= (u32)oldCursorPos && (u32)oldCursorPos < windowPos + SCREEN_ROWS )
|
||||
{
|
||||
const uint8_t fg = *dList -> ptrs[oldCursorPos] == ENT_TYPE_FILE ? 7:6;
|
||||
acf_draw( CLEFTMARGIN, LINENO_TO_Y(oldCursorPos-windowPos), CWIDTH, CHEIGHT, CLINELIMIT, consoleGetRGB565Color(fg), &dList->ptrs[oldCursorPos][1] );
|
||||
acf_draw( CLEFTMARGIN, LINENO_TO_Y(oldCursorPos-windowPos), CWIDTH, CHEIGHT, CLINELIMIT, fg, &dList->ptrs[oldCursorPos][1] );
|
||||
}
|
||||
acf_draw( CLEFTMARGIN, LINENO_TO_Y(cursorPos-windowPos), CWIDTH, CHEIGHT, CLINELIMIT, consoleGetRGB565Color(3), &dList->ptrs[cursorPos][1] );
|
||||
acf_draw( CLEFTMARGIN, LINENO_TO_Y(cursorPos-windowPos), CWIDTH, CHEIGHT, CLINELIMIT, 3, &dList->ptrs[cursorPos][1] );
|
||||
}
|
||||
else {
|
||||
//ee_printf("\x1b[%lu;H\x1b[0m>%.51s", cursorPos - windowPos, "<no gba rom>");
|
||||
acf_draw( CLEFTMARGIN, LINENO_TO_Y(cursorPos-windowPos), CWIDTH, CHEIGHT, CLINELIMIT, consoleGetRGB565Color(7), "<NO GBA ROM>" );
|
||||
acf_draw( CLEFTMARGIN, LINENO_TO_Y(cursorPos-windowPos), CWIDTH, CHEIGHT, CLINELIMIT, 7, "<NO GBA ROM>" );
|
||||
}
|
||||
|
||||
u32 kDown;
|
||||
@ -278,7 +296,12 @@ Result browseFiles(const char *const basePath, char selected[512])
|
||||
}
|
||||
|
||||
if( kDown & KEY_X ){
|
||||
if( atp_show( 4, test_show, NULL ) == 0 ) goto end;
|
||||
atp_tips(curDir, NULL);
|
||||
if( atp_show( 22, test_show, NULL ) == ATP_POWER_OFF )
|
||||
{
|
||||
res = RES_NOT_FOUND;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user