psp memhandlers, vsync, stuff
[picodrive.git] / platform / gp2x / menu.c
index 1a67e43..7dd2e58 100644 (file)
@@ -14,8 +14,9 @@
 #include "emu.h"\r
 #include "menu.h"\r
 #include "usbjoy.h"\r
-#include "../common/arm_utils.h"\r
+#include "../common/emu.h"\r
 #include "../common/menu.h"\r
+#include "../common/arm_utils.h"\r
 #include "../common/readpng.h"\r
 #include "version.h"\r
 \r
 #error "need d_type for file browser\r
 #endif\r
 \r
-extern char romFileName[PATH_MAX];\r
-extern char *rom_data;\r
 extern int  mmuhack_status;\r
-extern int  state_slot;\r
-extern int  config_slot, config_slot_current;\r
 \r
 static const char *gp2xKeyNames[] = {\r
        "UP",    "???",    "LEFT", "???",  "DOWN", "???", "RIGHT",    "???",\r
@@ -40,8 +37,6 @@ static const char *gp2xKeyNames[] = {
        "???",   "???",    "???",  "PUSH", "???",  "???", "???",      "???"\r
 };\r
 \r
-char menuErrorMsg[40] = {0, };\r
-\r
 static void menu_darken_bg(void *dst, int pixels, int darker);\r
 static void menu_prepare_bg(int use_game_bg);\r
 \r
@@ -452,7 +447,7 @@ static void state_check_slots(void)
 \r
        for (slot = 0; slot < 10; slot++)\r
        {\r
-               if (emu_check_save_file(slot))\r
+               if (emu_checkSaveFile(slot))\r
                {\r
                        state_slot_flags |= 1 << slot;\r
                }\r
@@ -480,10 +475,10 @@ static void draw_savestate_bg(int slot)
 \r
        if (strcmp(fname + strlen(fname) - 3, ".gz") == 0) {\r
                file = gzopen(fname, "rb");\r
-               emu_set_save_cbs(1);\r
+               emu_setSaveStateCbs(1);\r
        } else {\r
                file = fopen(fname, "rb");\r
-               emu_set_save_cbs(0);\r
+               emu_setSaveStateCbs(0);\r
        }\r
 \r
        if (file) {\r
@@ -501,7 +496,7 @@ static void draw_savestate_bg(int slot)
                areaClose(file);\r
        }\r
 \r
-       emu_forced_frame();\r
+       emu_forcedFrame();\r
        menu_prepare_bg(1);\r
 \r
        memcpy(Pico.vram, tmp_vram, sizeof(Pico.vram));\r
@@ -739,7 +734,7 @@ static void key_config_loop(const bind_action_t *opts, int opt_cnt, int player_i
                                        if (count_bound_keys(opts[sel].mask, player_idx, 0) >= 2)\r
                                             currentConfig.KeyBinds[i] &= ~opts[sel].mask; // allow to unbind only\r
                                        else currentConfig.KeyBinds[i] ^=  opts[sel].mask;\r
-                                       if (player_idx >= 0 && currentConfig.KeyBinds[i] & opts[sel].mask) {\r
+                                       if (player_idx >= 0 && (currentConfig.KeyBinds[i] & opts[sel].mask)) {\r
                                                currentConfig.KeyBinds[i] &= ~(3 << 16);\r
                                                currentConfig.KeyBinds[i] |= player_idx << 16;\r
                                        }\r
@@ -928,17 +923,17 @@ static void cd_menu_loop_options(void)
        menu_id selected_id;\r
        char *bios, *p;\r
 \r
-       if (find_bios(4, &bios)) { // US\r
+       if (emu_findBios(4, &bios)) { // US\r
                for (p = bios+strlen(bios)-1; p > bios && *p != '/'; p--); p++;\r
                strncpy(bios_names.us, p, sizeof(bios_names.us)); bios_names.us[sizeof(bios_names.us)-1] = 0;\r
        } else  strcpy(bios_names.us, "NOT FOUND");\r
 \r
-       if (find_bios(8, &bios)) { // EU\r
+       if (emu_findBios(8, &bios)) { // EU\r
                for (p = bios+strlen(bios)-1; p > bios && *p != '/'; p--); p++;\r
                strncpy(bios_names.eu, p, sizeof(bios_names.eu)); bios_names.eu[sizeof(bios_names.eu)-1] = 0;\r
        } else  strcpy(bios_names.eu, "NOT FOUND");\r
 \r
-       if (find_bios(1, &bios)) { // JP\r
+       if (emu_findBios(1, &bios)) { // JP\r
                for (p = bios+strlen(bios)-1; p > bios && *p != '/'; p--); p++;\r
                strncpy(bios_names.jp, p, sizeof(bios_names.jp)); bios_names.jp[sizeof(bios_names.jp)-1] = 0;\r
        } else  strcpy(bios_names.jp, "NOT FOUND");\r
@@ -972,21 +967,21 @@ static void cd_menu_loop_options(void)
                if (inp & GP2X_START) { // BIOS testers\r
                        switch (selected_id) {\r
                                case MA_CDOPT_TESTBIOS_USA:\r
-                                       if (find_bios(4, &bios)) { // test US\r
+                                       if (emu_findBios(4, &bios)) { // test US\r
                                                strcpy(romFileName, bios);\r
                                                engineState = PGS_ReloadRom;\r
                                                return;\r
                                        }\r
                                        break;\r
                                case MA_CDOPT_TESTBIOS_EUR:\r
-                                       if (find_bios(8, &bios)) { // test EU\r
+                                       if (emu_findBios(8, &bios)) { // test EU\r
                                                strcpy(romFileName, bios);\r
                                                engineState = PGS_ReloadRom;\r
                                                return;\r
                                        }\r
                                        break;\r
                                case MA_CDOPT_TESTBIOS_JAP:\r
-                                       if (find_bios(1, &bios)) { // test JP\r
+                                       if (emu_findBios(1, &bios)) { // test JP\r
                                                strcpy(romFileName, bios);\r
                                                engineState = PGS_ReloadRom;\r
                                                return;\r
@@ -1259,7 +1254,6 @@ static void menu_options_save(void)
                // unbind XYZ MODE, just in case\r
                unbind_action(0xf00, -1, -1);\r
        }\r
-       scaling_update();\r
 }\r
 \r
 static int menu_loop_options(void)\r
@@ -1400,7 +1394,7 @@ static void draw_menu_credits(void)
        text_out16(tl_x, 20, "PicoDrive v" VERSION " (c) notaz, 2006,2007");\r
        y = tl_y;\r
        text_out16(tl_x, y, "Credits:");\r
-       text_out16(tl_x, (y+=10), "Dave: Cyclone 68000 core,");\r
+       text_out16(tl_x, (y+=10), "fDave: Cyclone 68000 core,");\r
        text_out16(tl_x, (y+=10), "      base code of PicoDrive");\r
        text_out16(tl_x, (y+=10), "Reesy & FluBBa: DrZ80 core");\r
        text_out16(tl_x, (y+=10), "MAME devs: YM2612 and SN76496 cores");\r
@@ -1697,7 +1691,7 @@ int menu_loop_tray(void)
                                        selfname = romsel_loop(curr_path);\r
                                        if (selfname) {\r
                                                int ret = -1, cd_type;\r
-                                               cd_type = emu_cd_check(NULL);\r
+                                               cd_type = emu_cdCheck(NULL);\r
                                                if (cd_type > 0)\r
                                                        ret = Insert_CD(romFileName, cd_type == 2);\r
                                                if (ret != 0) {\r