diff --git a/src/menu.c b/src/menu.c index 34efb5c..1421188 100644 --- a/src/menu.c +++ b/src/menu.c @@ -8,11 +8,6 @@ #include "timer.h" -#define color_menu (0xFFFFFFFFU) -#define color_highlight (0xFFeeee00U) -#define color_error (0xFFff4444U) - - static int get_input(nes_Input_Reader* reader, nes_input* input, int *last) { int status = nes_input_update(reader, input); @@ -121,6 +116,11 @@ static inline int n_visible(void) { return ((nes_ppu_render_h - 20) / 11); } +static const uint32_t menu_colors[6] = { + color_red, color_orange, color_yellow, + color_green, color_blue, color_purple, +}; + static void show_menu(const menu_state* menu, int dim, int x, nes_Renderer* rend, const file_list* files) { @@ -145,11 +145,11 @@ static void show_menu(const menu_state* menu, int dim, int x, "..." : filename, x, y, (menu->cursor == n) ? - color_highlight : color_menu + color_white : menu_colors[n % 6] ); if (menu->cursor == n) { nes_draw_text(rend, ">", x - 10, y, - color_highlight); + color_white); } } diff --git a/src/menu.h b/src/menu.h index 41a56bc..f137bf1 100644 --- a/src/menu.h +++ b/src/menu.h @@ -6,6 +6,22 @@ #include "input.h" +#define color_white (0xFFffffffU) +#define color_black (0xFF000000U) +#define color_red (0xFFff371aU) +#define color_orange (0xFFff7b59U) +#define color_yellow (0xFFffa233U) +#define color_green (0xFF51d96aU) +#define color_blue (0xFF6f84ffU) +#define color_purple (0xFFd56fffU) + + +#define color_background color_blue +#define color_menu color_white +#define color_highlight color_yellow +#define color_error color_red + + typedef struct { int cursor; int top; diff --git a/src/nese.c b/src/nese.c index 9f13dfd..7f28c81 100644 --- a/src/nese.c +++ b/src/nese.c @@ -128,7 +128,7 @@ static int select_rom(menu_state* menu, nes_Renderer* rend, if (NULL != cart.filename) { char message[1024]; snprintf(message, sizeof(message) - 1, - "Could not load\n%s", cart.filename); + "Could not load\n%s", cart.filename + 4); int button = modal_popup(message, rend, input, sys); if (input_Result_Quit == (button >> 8)) { // Program closed inside modal diff --git a/src/sdl_render.c b/src/sdl_render.c index d7ed959..bae0318 100644 --- a/src/sdl_render.c +++ b/src/sdl_render.c @@ -5,6 +5,7 @@ #include "render.h" #include "ppu.h" #include "mapper.h" +#include "menu.h" #include "sdl_overlay.h" @@ -148,7 +149,7 @@ static int sdl_render_init(nes_Renderer* rend) { } else { SDL_LockTextureToSurface(data->texture, NULL, &data->target); - SDL_FillRect(data->target, NULL, 0x006677FF); + SDL_FillRect(data->target, NULL, color_background); } }