extracted OSS code to sndout_oss_*, BTN->PBTN, refactoring
[libpicofe.git] / common / menu.c
index 241af9f..611cee9 100644 (file)
@@ -350,7 +350,7 @@ static void mplayer_loop(void)
        while (1)\r
        {\r
                PDebugZ80Frame();\r
-               if (read_buttons_async(BTN_NORTH)) break;\r
+               if (read_buttons_async(PBTN_NORTH)) break;\r
                emu_waitSound();\r
        }\r
 \r
@@ -429,41 +429,41 @@ void debug_menu_loop(void)
                }\r
                menu_draw_end();\r
 \r
-               inp = read_buttons(BTN_EAST|BTN_SOUTH|BTN_WEST|BTN_NORTH|BTN_L|BTN_R|BTN_UP|BTN_DOWN|BTN_LEFT|BTN_RIGHT);\r
-               if (inp & BTN_SOUTH) return;\r
-               if (inp & BTN_L) { mode--; if (mode < 0) mode = 3; }\r
-               if (inp & BTN_R) { mode++; if (mode > 3) mode = 0; }\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
+               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
                {\r
                        case 0:\r
-                               if (inp & BTN_EAST) SekStepM68k();\r
-                               if (inp & BTN_NORTH) {\r
-                                       while (inp & BTN_NORTH) inp = read_buttons_async(BTN_NORTH);\r
+                               if (inp & PBTN_EAST) SekStepM68k();\r
+                               if (inp & PBTN_NORTH) {\r
+                                       while (inp & PBTN_NORTH) inp = read_buttons_async(PBTN_NORTH);\r
                                        mplayer_loop();\r
                                }\r
-                               if ((inp & (BTN_WEST|BTN_LEFT)) == (BTN_WEST|BTN_LEFT)) {\r
+                               if ((inp & (PBTN_WEST|PBTN_LEFT)) == (PBTN_WEST|PBTN_LEFT)) {\r
                                        mkdir("dumps", 0777);\r
                                        PDebugDumpMem();\r
-                                       while (inp & BTN_WEST) inp = read_buttons_async(BTN_WEST);\r
+                                       while (inp & PBTN_WEST) inp = read_buttons_async(PBTN_WEST);\r
                                        dumped = 1;\r
                                }\r
                                break;\r
                        case 1:\r
-                               if (inp & BTN_LEFT)  PicoDrawMask ^= PDRAW_LAYERB_ON;\r
-                               if (inp & BTN_RIGHT) PicoDrawMask ^= PDRAW_LAYERA_ON;\r
-                               if (inp & BTN_DOWN)  PicoDrawMask ^= PDRAW_SPRITES_LOW_ON;\r
-                               if (inp & BTN_UP)    PicoDrawMask ^= PDRAW_SPRITES_HI_ON;\r
-                               if (inp & BTN_EAST) {\r
+                               if (inp & PBTN_LEFT)  PicoDrawMask ^= PDRAW_LAYERB_ON;\r
+                               if (inp & PBTN_RIGHT) PicoDrawMask ^= PDRAW_LAYERA_ON;\r
+                               if (inp & PBTN_DOWN)  PicoDrawMask ^= PDRAW_SPRITES_LOW_ON;\r
+                               if (inp & PBTN_UP)    PicoDrawMask ^= PDRAW_SPRITES_HI_ON;\r
+                               if (inp & PBTN_EAST) {\r
                                        PsndOut = NULL; // just in case\r
                                        PicoSkipFrame = 1;\r
                                        PicoFrame();\r
                                        PicoSkipFrame = 0;\r
-                                       while (inp & BTN_EAST) inp = read_buttons_async(BTN_EAST);\r
+                                       while (inp & PBTN_EAST) inp = read_buttons_async(PBTN_EAST);\r
                                }\r
                                break;\r
                        case 3:\r
-                               if (inp & BTN_DOWN)  spr_offs++;\r
-                               if (inp & BTN_UP)    spr_offs--;\r
+                               if (inp & PBTN_DOWN)  spr_offs++;\r
+                               if (inp & PBTN_UP)    spr_offs--;\r
                                if (spr_offs < 0) spr_offs = 0;\r
                                break;\r
                }\r