From e9ef645cb0f72e0db9602dc069e948f7516c4f6f Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Sun, 19 Apr 2009 13:24:27 +0000 Subject: [PATCH] Add titles --- Src/C64_SDL.h | 31 ++++++++++++++++--------------- Src/menu.cpp | 8 ++++---- Src/menu.h | 11 ++--------- Src/menutexts.c | 39 +++++++++++++++------------------------ 4 files changed, 37 insertions(+), 52 deletions(-) diff --git a/Src/C64_SDL.h b/Src/C64_SDL.h index d77345b..d86d474 100644 --- a/Src/C64_SDL.h +++ b/Src/C64_SDL.h @@ -253,7 +253,7 @@ void C64::networking_menu(Prefs *np) this->server_hostname); snprintf(buf[2], 255, "Port (%d)", this->server_port); - opt = menu_select(network_client_messages, NULL); + opt = menu_select("Networking", network_client_messages, NULL); if (opt >= 0 && opt <= 2) { @@ -313,7 +313,8 @@ void C64::advanced_options(Prefs *np) submenus[1] = 1; break; } - int opt = menu_select(new_advanced_options_menu_messages, + int opt = menu_select("Advanced options", + new_advanced_options_menu_messages, submenus); if (opt >= 0) { @@ -340,7 +341,7 @@ void C64::other_options(Prefs *np) int old_swap = ThePrefs.JoystickSwap == true ? 1 : 0; int submenus[3] = { old_swap, !np->Emul1541Proc, 0 }; - int opt = menu_select(new_options_menu_messages, + int opt = menu_select("Options", new_options_menu_messages, submenus); if (opt >= 0) { @@ -393,7 +394,7 @@ void C64::select_fake_key_sequence(Prefs *np) NULL}; int opt; - opt = menu_select(fake_key_messages, NULL); + opt = menu_select("Keyboard macros", fake_key_messages, NULL); if (opt < 0) return; @@ -655,17 +656,17 @@ void C64::VBlank(bool draw_frame) this->prefs_changed = false; TheSID->PauseSound(); - opt = menu_select(new_main_menu_messages, submenus); + opt = menu_select("Main menu", new_main_menu_messages, submenus); switch(opt) { - case 2: /* Insert disc/tape */ + case 0: /* Insert disc/tape */ this->select_disc(&np, submenus[0] == 1); break; - case 4: /* Save / load game */ + case 2: /* Save / load game */ this->save_load_state(&np, submenus[1]); break; - case 6: /* Bind keys to joystick */ + case 4: /* Bind keys to joystick */ switch (submenus[2]) { case 0: /* type */ @@ -682,23 +683,23 @@ void C64::VBlank(bool draw_frame) this->bind_keys(&np); break; } break; - case 9: /* Reset the C64 */ + case 7: /* Reset the C64 */ Reset(); break; - case 10: /* Networking */ + case 8: /* Networking */ this->networking_menu(&np); break; - case 11: /* Other options */ + case 9: /* Other options */ this->other_options(&np); break; - case 12: /* Advanced options */ + case 10: /* Advanced options */ this->advanced_options(&np); break; - case 13: + case 11: { - menu_select(welcome, NULL); + menu_select("Frodo help", welcome, NULL); } break; - case 15: /* Quit */ + case 12: /* Quit */ quit_thyself = true; break; case -1: diff --git a/Src/menu.cpp b/Src/menu.cpp index ed60744..b362c1f 100644 --- a/Src/menu.cpp +++ b/Src/menu.cpp @@ -861,15 +861,15 @@ int menu_select_sized(const char *title, const char **msgs, int *submenus, int s return out; } -static int menu_select(const char *title, const char **msgs, int *submenus, int sel) +int menu_select(const char *title, const char **msgs, int *submenus) { - return menu_select_sized(title, msgs, submenus, sel, + return menu_select_sized(title, msgs, submenus, 0, 32, 32, FULL_DISPLAY_X-32, FULL_DISPLAY_Y-64); } int menu_select(const char **msgs, int *submenus) { - return menu_select("", msgs, submenus, 0); + return menu_select("", msgs, submenus); } extern "C" const char **DirD64(const char *FileName); @@ -916,7 +916,7 @@ static const char *get_d64_file(const char *name) if (!dir) return NULL; - int which = menu_select("Select D64 file", dir, NULL, 0); + int which = menu_select("Select D64 file", dir, NULL); if (which >= 0) { diff --git a/Src/menu.h b/Src/menu.h index 17d5dc8..63c8c06 100644 --- a/Src/menu.h +++ b/Src/menu.h @@ -16,10 +16,6 @@ #include #include -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - #define KEY_UP 1 #define KEY_DOWN 2 #define KEY_LEFT 4 @@ -34,8 +30,9 @@ void menu_print_font(SDL_Surface *screen, int r, int g, int b, int x, int y, con void menu_print_font64(SDL_Surface *screen, int r, int g, int b, int x, int y, const char *msg); /* Various option selects */ +int menu_select(const char *title, const char **pp_msgs, int *p_submenus); int menu_select(const char **pp_msgs, int *p_submenus); -int menu_select_sized(char *title, const char **msgs, int *submenus, int sel, +int menu_select_sized(char *title, const char **msgs, int *submenus, int x, int y, int w, int h); const char *menu_select_file(const char *dir_path); const char *menu_select_file_start(const char *dir_path, const char **d64_name); @@ -50,8 +47,4 @@ extern bool msgYesNo(char *text, bool def,int x, int y); void menu_init(); -#if defined(__cplusplus) -}; -#endif /* __cplusplus */ - #endif /* !__MENU_H__ */ diff --git a/Src/menutexts.c b/Src/menutexts.c index 9f62115..a071f52 100644 --- a/Src/menutexts.c +++ b/Src/menutexts.c @@ -3,28 +3,25 @@ #include "menutexts.h" const char *welcome[] = { - /*01*/ "#1 WELCOME TO FRODO ON WII ", - /*02*/ " ------------------------------------------------- ", - /*03*/ " In the system, hit HOME on the Wiimote to get to ", - /*04*/ " the config-page. Load or autostart a D64, T64, or ", - /*05*/ " PRG image. Use the virtual keyboard or assign the ", - /*06*/ " key strokes to buttons on the Wiimote. ", - /*07*/ " Save the game state in the main menu of the game. ", - /*08*/ " Next time you can load that state instead and have", - /*09*/ " the game and everything configured directly. ", - /*10*/ " ", - /*11*/ " In the networking menu, you can host a game over ", - /*12*/ " the network or browse for active games. During ", - /*13*/ " network play, you can send messages to your peer ", - /*14*/ " by pressing ScrLk on the USB keyboard. ", - /*15*/ " ", - /*16*/ ".-------------------------------------------------.", + /*03*/ "In the system, hit HOME on the Wiimote to get to ", + /*04*/ "the config-page. Load or autostart a D64, T64, ", + /*05*/ "or PRG image. Use the virtual keyboard or assign ", + /*06*/ "key strokes to buttons on the Wiimote. ", + /*07*/ "You can save the game state in the main menu. ", + /*08*/ "The next time you can load that state instead ", + /*09*/ "and restore the game and everything configured. ", + /*10*/ " ", + /*11*/ "In the networking menu, you can host a game over ", + /*12*/ "the network or browse for active games. During ", + /*13*/ "network play, you can send messages to your peer ", + /*14*/ "by pressing ScrLk on the USB keyboard. ", + /*10*/ " ", + /*10*/ "In each menu, the '2' button selects and entry ", + /*10*/ "and '1' cancels. ", NULL }; const char *new_main_menu_messages[] = { - /*00*/ "#1.MAIN MENU ", - /*01*/ "#1-------------------------------------", /*02*/ ".File", /*03*/ "^|Insert|Start", /*04*/ ".States", @@ -37,14 +34,10 @@ const char *new_main_menu_messages[] = { /*11*/ ".Options", /*12*/ ".Advanced Options", /*13*/ ".Help", - /*14*/ "#1-------------------------------------", /*15*/ ".Quit", - /*17*/ "#1'2'=SELECT, '1'=CANCEL", NULL }; const char *new_options_menu_messages[] = { - /*00*/ "#1.OPTIONS MENU ", - /*01*/ "#1-------------------------------------", /*02*/ ".Map Wiimote 1 to:", /*03*/ "^|Port 1|Port 2", /*04*/ " ", @@ -58,8 +51,6 @@ const char *new_options_menu_messages[] = { NULL }; const char *new_advanced_options_menu_messages[] = { - /*00*/ "#1.ADVANCED OPTIONS MENU ", - /*01*/ "#1-------------------------------------", /*02*/ ".Display resolution", /*03*/ "^|double-center|stretched", /*04*/ " ",