diff --git a/arm9/source/common/colors.h b/arm9/source/common/colors.h new file mode 100644 index 0000000..5119bb8 --- /dev/null +++ b/arm9/source/common/colors.h @@ -0,0 +1,62 @@ +#pragma once + + +#define RGB(r,g,b) ((r)<<24|(b)<<16|(g)<<8|(r)) + +// a base set of colors below +#define COLOR_BLACK RGB(0x00, 0x00, 0x00) +#define COLOR_WHITE RGB(0xFF, 0xFF, 0xFF) +#define COLOR_GREY RGB(0x80, 0x80, 0x80) + +#define COLOR_RED RGB(0xFF, 0x00, 0x00) +#define COLOR_GREEN RGB(0x00, 0xFF, 0x00) +#define COLOR_BLUE RGB(0x00, 0x00, 0xFF) +#define COLOR_YELLOW RGB(0xFF, 0xFF, 0x00) +#define COLOR_CYAN RGB(0xFF, 0x00, 0xFF) +#define COLOR_ORANGE RGB(0xFF, 0xA5, 0x00) + +#define COLOR_BRIGHTRED RGB(0xFF, 0x30, 0x30) +#define COLOR_DARKRED RGB(0x80, 0x00, 0x00) +#define COLOR_BRIGHTYELLOW RGB(0xFF, 0xFF, 0x30) +#define COLOR_BRIGHTGREEN RGB(0x30, 0xFF, 0x30) +#define COLOR_BRIGHTBLUE RGB(0x30, 0x30, 0xFF) + +#define COLOR_TINTEDBLUE RGB(0x60, 0x60, 0x80) +#define COLOR_TINTEDYELLOW RGB(0xD0, 0xD0, 0x60) +#define COLOR_TINTEDGREEN RGB(0x70, 0x80, 0x70) +#define COLOR_LIGHTGREY RGB(0xB0, 0xB0, 0xB0) +#define COLOR_LIGHTERGREY RGB(0xD0, 0xD0, 0xD0) +#define COLOR_DARKGREY RGB(0x50, 0x50, 0x50) +#define COLOR_DARKESTGREY RGB(0x20, 0x20, 0x20) +#define COLOR_SUPERFUCHSIA RGB(0xFF, 0x00, 0xEF) + +// standard colors - used everywhere +#define COLOR_STD_BG COLOR_BLACK +#define COLOR_STD_FONT COLOR_WHITE + +// colors for GodMode9 file browser +#define COLOR_SIDE_BAR COLOR_DARKGREY +#define COLOR_MARKED COLOR_TINTEDYELLOW +#define COLOR_FILE COLOR_TINTEDGREEN +#define COLOR_DIR COLOR_TINTEDBLUE +#define COLOR_ROOT COLOR_GREY + +// hex viewer colors +#define COLOR_HVOFFS RGB(0x40, 0x60, 0x50) +#define COLOR_HVOFFSI COLOR_DARKESTGREY +#define COLOR_HVASCII RGB(0x40, 0x80, 0x50) +#define COLOR_HVHEX(i) ((i % 2) ? RGB(0x30, 0x90, 0x30) : RGB(0x30, 0x80, 0x30)) + +// text viewer / script viewer colors +#define COLOR_TVOFFS RGB(0x40, 0x40, 0x40) +#define COLOR_TVOFFSL RGB(0x30, 0x30, 0x30) +#define COLOR_TVTEXT RGB(0xA0, 0xA0, 0xA0) +#define COLOR_TVRUN RGB(0xC0, 0x00, 0x00) +#define COLOR_TVCMT RGB(0x60, 0x60, 0x70) +#define COLOR_TVCMD RGB(0xA0, 0xA0, 0xA0) + +// battery symbol colors +#define COLOR_BATTERY_CHARGING RGB(0x3D, 0xB7, 0xE4) +#define COLOR_BATTERY_FULL RGB(0x0F, 0xB0, 0x1B) +#define COLOR_BATTERY_MEDIUM RGB(0xFF, 0x88, 0x49) +#define COLOR_BATTERY_LOW RGB(0xB4, 0x00, 0x00) diff --git a/arm9/source/common/hid.h b/arm9/source/common/hid.h index e59f41f..e400415 100644 --- a/arm9/source/common/hid.h +++ b/arm9/source/common/hid.h @@ -33,5 +33,6 @@ #define SD_EJECT (1 << 17) #define TIMEOUT_HID (1 << 31) + u32 InputWait(u32 timeout_sec); bool CheckButton(u32 button); diff --git a/arm9/source/common/ui.h b/arm9/source/common/ui.h index d7f9303..6ac8ba4 100644 --- a/arm9/source/common/ui.h +++ b/arm9/source/common/ui.h @@ -6,6 +6,7 @@ #include #include "common.h" +#include "colors.h" #define BYTES_PER_PIXEL 3 @@ -24,38 +25,6 @@ #define FONT_HEIGHT_EXT 8 #endif -#define RGB(r,g,b) ((r)<<24|(b)<<16|(g)<<8|(r)) - -#define COLOR_BLACK RGB(0x00, 0x00, 0x00) -#define COLOR_WHITE RGB(0xFF, 0xFF, 0xFF) -#define COLOR_GREY RGB(0x80, 0x80, 0x80) - -#define COLOR_RED RGB(0xFF, 0x00, 0x00) -#define COLOR_GREEN RGB(0x00, 0xFF, 0x00) -#define COLOR_BLUE RGB(0x00, 0x00, 0xFF) -#define COLOR_YELLOW RGB(0xFF, 0xFF, 0x00) -#define COLOR_CYAN RGB(0xFF, 0x00, 0xFF) -#define COLOR_ORANGE RGB(0xFF, 0xA5, 0x00) - -#define COLOR_BRIGHTRED RGB(0xFF, 0x30, 0x30) -#define COLOR_DARKRED RGB(0x80, 0x00, 0x00) -#define COLOR_BRIGHTYELLOW RGB(0xFF, 0xFF, 0x30) -#define COLOR_BRIGHTGREEN RGB(0x30, 0xFF, 0x30) -#define COLOR_BRIGHTBLUE RGB(0x30, 0x30, 0xFF) - -#define COLOR_TINTEDBLUE RGB(0x60, 0x60, 0x80) -#define COLOR_TINTEDYELLOW RGB(0xD0, 0xD0, 0x60) -#define COLOR_TINTEDGREEN RGB(0x70, 0x80, 0x70) -#define COLOR_LIGHTGREY RGB(0xB0, 0xB0, 0xB0) -#define COLOR_LIGHTERGREY RGB(0xD0, 0xD0, 0xD0) -#define COLOR_DARKGREY RGB(0x50, 0x50, 0x50) -#define COLOR_DARKESTGREY RGB(0x20, 0x20, 0x20) - -#define COLOR_TRANSPARENT RGB(0xFF, 0x00, 0xEF) // otherwise known as 'super fuchsia' - -#define COLOR_STD_BG COLOR_BLACK -#define COLOR_STD_FONT COLOR_WHITE - #define TOP_SCREEN ((u8*)VRAM_TOP_LA) #define BOT_SCREEN ((u8*)VRAM_BOT_A) @@ -71,6 +40,9 @@ #define SCREEN_WIDTH_ALT SCREEN_WIDTH_TOP #endif +#define COLOR_TRANSPARENT COLOR_SUPERFUCHSIA + + void ClearScreen(unsigned char *screen, int color); void ClearScreenF(bool clear_main, bool clear_alt, int color); void DrawRectangle(u8* screen, int x, int y, int width, int height, int color); diff --git a/arm9/source/godmode.c b/arm9/source/godmode.c index c582275..21e7e92 100644 --- a/arm9/source/godmode.c +++ b/arm9/source/godmode.c @@ -20,24 +20,9 @@ #define N_PANES 2 #define COLOR_TOP_BAR (PERM_RED ? COLOR_RED : PERM_ORANGE ? COLOR_ORANGE : PERM_BLUE ? COLOR_BRIGHTBLUE : \ - PERM_YELLOW ? COLOR_BRIGHTYELLOW : PERM_GREEN ? COLOR_GREEN : COLOR_WHITE) -#define COLOR_SIDE_BAR COLOR_DARKGREY -#define COLOR_MARKED COLOR_TINTEDYELLOW -#define COLOR_FILE COLOR_TINTEDGREEN -#define COLOR_DIR COLOR_TINTEDBLUE -#define COLOR_ROOT COLOR_GREY + PERM_YELLOW ? COLOR_BRIGHTYELLOW : PERM_GREEN ? COLOR_GREEN : COLOR_WHITE) #define COLOR_ENTRY(e) (((e)->marked) ? COLOR_MARKED : ((e)->type == T_DIR) ? COLOR_DIR : ((e)->type == T_FILE) ? COLOR_FILE : ((e)->type == T_ROOT) ? COLOR_ROOT : COLOR_GREY) -#define COLOR_HVOFFS RGB(0x40, 0x60, 0x50) -#define COLOR_HVOFFSI COLOR_DARKESTGREY -#define COLOR_HVASCII RGB(0x40, 0x80, 0x50) -#define COLOR_HVHEX(i) ((i % 2) ? RGB(0x30, 0x90, 0x30) : RGB(0x30, 0x80, 0x30)) - -#define COLOR_BATTERY_CHARGING RGB(0x3D, 0xB7, 0xE4) -#define COLOR_BATTERY_FULL RGB(0x0F, 0xB0, 0x1B) -#define COLOR_BATTERY_MEDIUM RGB(0xFF, 0x88, 0x49) -#define COLOR_BATTERY_LOW RGB(0xB4, 0x00, 0x00) - #define BOOTPAUSE_KEY (BUTTON_R1|BUTTON_UP) #define BOOTMENU_KEY (BUTTON_R1|BUTTON_LEFT) #define BOOTFIRM_PATHS "0:/bootonce.firm", "0:/boot.firm", "1:/boot.firm" diff --git a/arm9/source/utils/scripting.c b/arm9/source/utils/scripting.c index 2a099c2..690315f 100644 --- a/arm9/source/utils/scripting.c +++ b/arm9/source/utils/scripting.c @@ -29,14 +29,6 @@ #define TV_NLIN_DISP (SCREEN_HEIGHT / (FONT_HEIGHT_EXT + (2*TV_VPAD))) #define TV_LLEN_DISP (((SCREEN_WIDTH_TOP - (2*TV_HPAD)) / FONT_WIDTH_EXT) - (TV_LNOS + 1)) -// text viewer colors -#define COLOR_TVOFFS RGB(0x40, 0x40, 0x40) -#define COLOR_TVOFFSL RGB(0x30, 0x30, 0x30) -#define COLOR_TVTEXT RGB(0xA0, 0xA0, 0xA0) -#define COLOR_TVRUN RGB(0xC0, 0x00, 0x00) -#define COLOR_TVCMT RGB(0x60, 0x60, 0x70) -#define COLOR_TVCMD RGB(0xA0, 0xA0, 0xA0) - // some useful macros #define IS_WHITESPACE(c) ((c == ' ') || (c == '\t') || (c == '\r') || (c == '\n'))