diff options
Diffstat (limited to 'source/gui.c')
-rw-r--r-- | source/gui.c | 70 |
1 files changed, 33 insertions, 37 deletions
diff --git a/source/gui.c b/source/gui.c index 92f6836..2027a37 100644 --- a/source/gui.c +++ b/source/gui.c @@ -219,13 +219,13 @@ int GUI_Menu(const char *opts[]) { uint32 key=0; - FB_FillBox(x,y,w,h,FB_RGB(0,0,0)); - FB_Box(x,y,w,h,FB_RGB(31,31,31)); - FB_FillBox(x+1,y+sel*16+1,w-2,14,FB_RGB(8,8,31)); + FB_FillBox(x,y,w,h,COL_BLACK); + FB_Box(x,y,w,h,COL_WHITE); + FB_FillBox(x+1,y+sel*16+1,w-2,14,COL_GUISELECT); for(f=0;f<no;f++) { - FB_Centre(opts[f],y+4+f*16,FB_RGB(31,31,31),-1); + FB_Centre(opts[f],y+4+f*16,COL_WHITE,COL_TRANSPARENT); } do @@ -290,8 +290,8 @@ void GUI_Alert(int fatal, const char *text) } } - FB_FillBox(0,0,SCREEN_WIDTH,h,FB_RGB(0,0,0)); - FB_Box(1,1,SCREEN_WIDTH-2,h-2,FB_RGB(31,0,0)); + FB_FillBox(0,0,SCREEN_WIDTH,h,COL_BLACK); + FB_Box(1,1,SCREEN_WIDTH-2,h-2,COL_WHITE); p=text; h=4; @@ -303,7 +303,7 @@ void GUI_Alert(int fatal, const char *text) { *d++=0; p++; - FB_Centre(line,h,FB_RGB(31,31,31),-1); + FB_Centre(line,h,COL_WHITE,COL_TRANSPARENT); h+=8; d=line; } @@ -316,13 +316,13 @@ void GUI_Alert(int fatal, const char *text) if (d>line) { *d=0; - FB_Centre(line,h,FB_RGB(31,31,31),-1); + FB_Centre(line,h,COL_WHITE,COL_TRANSPARENT); h+=8; } if (!fatal) { - FB_Centre("PRESS ANY BUTTON OR SCREEN",h+16,FB_RGB(31,31,0),-1); + FB_Centre("PRESS ANY BUTTON OR SCREEN",h+16,COL_YELLOW,COL_TRANSPARENT); while(!keysDown()) { @@ -336,7 +336,7 @@ void GUI_Alert(int fatal, const char *text) } else { - FB_Centre("PLEASE RESET YOUR CONSOLE",h+16,FB_RGB(31,31,0),-1); + FB_Centre("PLEASE RESET YOUR CONSOLE",h+16,COL_YELLOW,COL_TRANSPARENT); while(1) { @@ -359,18 +359,18 @@ void GUI_Config(void) FB_Clear(); - FB_Centre("Up/Down to select",140,FB_RGB(31,31,0),-1); - FB_Centre("A to toggle",150,FB_RGB(31,31,0),-1); - FB_Centre("Or use touchscreen",160,FB_RGB(31,31,0),-1); - FB_Centre("START to finish",170,FB_RGB(31,31,0),-1); + FB_Centre("Up/Down to select",140,COL_YELLOW,COL_TRANSPARENT); + FB_Centre("A to toggle",150,COL_YELLOW,COL_TRANSPARENT); + FB_Centre("Or use touchscreen",160,COL_YELLOW,COL_TRANSPARENT); + FB_Centre("START to finish",170,COL_YELLOW,COL_TRANSPARENT); #ifndef DS81_DISABLE_FAT - FB_Centre("SELECT to finish and save",180,FB_RGB(31,31,0),-1); + FB_Centre("SELECT to finish and save",180,COL_YELLOW,COL_TRANSPARENT); #endif for(f=0;f<DS81_NUM_CONFIG_ITEMS;f++) { - FB_Print(ConfigDesc(f),14,20+f*14,FB_RGB(31,31,31),-1); + FB_Print(ConfigDesc(f),14,20+f*14,COL_WHITE,COL_TRANSPARENT); } while(!done) @@ -380,19 +380,19 @@ void GUI_Config(void) for(f=0;f<DS81_NUM_CONFIG_ITEMS;f++) { FB_FillBox(2,20+f*14-1,10,10, - DS81_Config[f] ? FB_RGB(31,31,31):FB_RGB(0,0,0)); + DS81_Config[f] ? COL_WHITE : COL_BLACK); - FB_Box(2,20+f*14-1,10,10,FB_RGB(18,18,18)); + FB_Box(2,20+f*14-1,10,10,COL_GREY); } - FB_Box(0,20+sel*14-3,SCREEN_WIDTH-1,14,FB_RGB(18,18,31)); + FB_Box(0,20+sel*14-3,SCREEN_WIDTH-1,14,COL_GUISELECT); do { swiWaitForVBlank(); } while(!(key=keysDownRepeat())); - FB_Box(0,20+sel*14-3,SCREEN_WIDTH-1,14,FB_RGB(0,0,0)); + FB_Box(0,20+sel*14-3,SCREEN_WIDTH-1,14,COL_BLACK); if (key & KEY_START) { @@ -448,8 +448,7 @@ bool GUI_FileSelect(char pwd[], char selected_file[], const char *filter) double bar_step; bool done; bool ret; - int pen; - int paper; + FB_Colour paper; int off; int f; bool drag; @@ -459,12 +458,12 @@ bool GUI_FileSelect(char pwd[], char selected_file[], const char *filter) FB_Clear(); - FB_printf(0,0,FB_RGB(0,0,0),FB_RGB(22,22,22),"%-32.32s",pwd); + FB_printf(0,0,COL_BLACK,COL_LIGHTGREY,"%-32.32s",pwd); - FB_Centre("Use pad and A to select",140,FB_RGB(31,31,0),-1); - FB_Centre("L and R to page up/down",150,FB_RGB(31,31,0),-1); - FB_Centre("Or use touchscreen",160,FB_RGB(31,31,0),-1); - FB_Centre("B to cancel",170,FB_RGB(31,31,0),-1); + FB_Centre("Use pad and A to select",140,COL_YELLOW,COL_TRANSPARENT); + FB_Centre("L and R to page up/down",150,COL_YELLOW,COL_TRANSPARENT); + FB_Centre("Or use touchscreen",160,COL_YELLOW,COL_TRANSPARENT); + FB_Centre("B to cancel",170,COL_YELLOW,COL_TRANSPARENT); no = LoadDir(pwd,filter); @@ -498,16 +497,14 @@ bool GUI_FileSelect(char pwd[], char selected_file[], const char *filter) { if (off == sel) { - pen = FB_RGB(0,0,0); - paper = FB_RGB(31,31,31); + paper = COL_GUISELECT; } else { - pen = FB_RGB(31,31,31); - paper = FB_RGB(0,0,0); + paper = COL_BLACK; } - FB_printf(8,FSEL_LIST_Y+f*8,pen,paper, + FB_printf(8,FSEL_LIST_Y+f*8,COL_WHITE,paper, "%-*s %s", FSEL_FILENAME_LEN, fsel[off].name, @@ -515,7 +512,7 @@ bool GUI_FileSelect(char pwd[], char selected_file[], const char *filter) } else { - FB_printf(8,FSEL_LIST_Y+f*8,FB_RGB(31,31,31),FB_RGB(0,0,0), + FB_printf(8,FSEL_LIST_Y+f*8,COL_WHITE,COL_BLACK, "%-*s %s", FSEL_FILENAME_LEN, off==0 ? "No Files!" : "", @@ -523,8 +520,8 @@ bool GUI_FileSelect(char pwd[], char selected_file[], const char *filter) } } - FB_FillBox(240,FSEL_LIST_Y,16,FSEL_LIST_H,FB_RGB(10,10,10)); - FB_FillBox(240,FSEL_LIST_Y+top*bar_step,16,bar_size,FB_RGB(31,31,31)); + FB_FillBox(240,FSEL_LIST_Y,16,FSEL_LIST_H,COL_DARKGREY); + FB_FillBox(240,FSEL_LIST_Y+top*bar_step,16,bar_size,COL_WHITE); if (drag) { @@ -681,8 +678,7 @@ bool GUI_FileSelect(char pwd[], char selected_file[], const char *filter) { AddPath(pwd,fsel[sel].name); - FB_printf(0,0,FB_RGB(0,0,0),FB_RGB(22,22,22), - "%-32.32s",pwd); + FB_printf(0,0,COL_BLACK,COL_LIGHTGREY,"%-32.32s",pwd); no = LoadDir(pwd,filter); |