enable evdev also for GP2X
[libpicofe.git] / gp2x / 940ctl.c
index 11890bd..38a9f9d 100644 (file)
 #include "../common/arm_utils.h"\r
 #include "../common/menu.h"\r
 #include "../common/emu.h"\r
+#include "../common/input.h"\r
 #include "../../pico/pico_int.h"\r
 #include "../../pico/sound/ym2612.h"\r
 #include "../../pico/sound/mix.h"\r
 \r
-extern int reset_timing;\r
 static unsigned char *shared_mem = 0;\r
 static _940_data_t *shared_data = 0;\r
 _940_ctl_t *shared_ctl = 0;\r
@@ -295,16 +295,11 @@ void YM2612Init_940(int baseclock, int rate)
        if (crashed_940)\r
        {\r
                unsigned char ucData[1024];\r
-               int nRead, i, nLen = 0;\r
-               char binpath[1024];\r
+               int nRead, nLen = 0;\r
+               char binpath[512];\r
                FILE *fp;\r
 \r
-               strncpy(binpath, g_argv[0], 1023);\r
-               binpath[1023] = 0;\r
-               for (i = strlen(binpath); i > 0; i--)\r
-                       if (binpath[i] == '/') { binpath[i] = 0; break; }\r
-               strcat(binpath, "/" CODE940_FILE);\r
-\r
+               emu_make_path(binpath, CODE940_FILE, sizeof(binpath));\r
                fp = fopen(binpath, "rb");\r
                if(!fp)\r
                {\r
@@ -312,6 +307,7 @@ void YM2612Init_940(int baseclock, int rate)
                        text_out16(10, 100, "failed to open required file:");\r
                        text_out16(10, 110, CODE940_FILE);\r
                        gp2x_video_flip2();\r
+                       in_menu_wait(PBTN_MOK|PBTN_MBACK, 100);\r
                        printf("failed to open %s\n", binpath);\r
                        exit(1);\r
                }\r