continuing input framework integration
[libpicofe.git] / common / menu.c
index 611cee9..c3ef87f 100644 (file)
@@ -13,6 +13,7 @@
 #include "readpng.h"\r
 #include "lprintf.h"\r
 #include "common.h"\r
+#include "input.h"\r
 #include "emu.h"\r
 \r
 \r
@@ -350,7 +351,7 @@ static void mplayer_loop(void)
        while (1)\r
        {\r
                PDebugZ80Frame();\r
-               if (read_buttons_async(PBTN_NORTH)) break;\r
+               if (in_menu_wait_any(0) & PBTN_NORTH) break;\r
                emu_waitSound();\r
        }\r
 \r
@@ -429,8 +430,8 @@ void debug_menu_loop(void)
                }\r
                menu_draw_end();\r
 \r
-               inp = read_buttons(PBTN_EAST|PBTN_SOUTH|PBTN_WEST|PBTN_NORTH|PBTN_L|PBTN_R|PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT);\r
-               if (inp & PBTN_SOUTH) return;\r
+               inp = in_menu_wait(PBTN_EAST|PBTN_MBACK|PBTN_WEST|PBTN_NORTH|PBTN_L|PBTN_R|PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT);\r
+               if (inp & PBTN_MBACK) return;\r
                if (inp & PBTN_L) { mode--; if (mode < 0) mode = 3; }\r
                if (inp & PBTN_R) { mode++; if (mode > 3) mode = 0; }\r
                switch (mode)\r
@@ -438,13 +439,13 @@ void debug_menu_loop(void)
                        case 0:\r
                                if (inp & PBTN_EAST) SekStepM68k();\r
                                if (inp & PBTN_NORTH) {\r
-                                       while (inp & PBTN_NORTH) inp = read_buttons_async(PBTN_NORTH);\r
+                                       while (inp & PBTN_NORTH) inp = in_menu_wait_any(-1);\r
                                        mplayer_loop();\r
                                }\r
                                if ((inp & (PBTN_WEST|PBTN_LEFT)) == (PBTN_WEST|PBTN_LEFT)) {\r
                                        mkdir("dumps", 0777);\r
                                        PDebugDumpMem();\r
-                                       while (inp & PBTN_WEST) inp = read_buttons_async(PBTN_WEST);\r
+                                       while (inp & PBTN_WEST) inp = in_menu_wait_any(-1);\r
                                        dumped = 1;\r
                                }\r
                                break;\r
@@ -458,7 +459,7 @@ void debug_menu_loop(void)
                                        PicoSkipFrame = 1;\r
                                        PicoFrame();\r
                                        PicoSkipFrame = 0;\r
-                                       while (inp & PBTN_EAST) inp = read_buttons_async(PBTN_EAST);\r
+                                       while (inp & PBTN_EAST) inp = in_menu_wait_any(-1);\r
                                }\r
                                break;\r
                        case 3:\r