more input wip
[libpicofe.git] / pandora / emu.c
index a749836..0b55405 100644 (file)
 #include <stdarg.h>\r
 \r
 #include "../gp2x/emu.h"\r
-#include "../gp2x/usbjoy.h"\r
 #include "../gp2x/menu.h"\r
 #include "../common/arm_utils.h"\r
 #include "../common/fonts.h"\r
 #include "../common/emu.h"\r
 #include "../common/config.h"\r
 #include "../common/common.h"\r
+#include "../linux/usbjoy.h"\r
+#include "../linux/sndout_oss.h"\r
 #include "asm_utils.h"\r
 \r
 #include <pico/pico_int.h>\r
@@ -101,18 +102,6 @@ void emu_Init(void)
 }\r
 \r
 \r
-static void scaling_update(void)\r
-{\r
-       PicoOpt &= ~0x4100;\r
-       switch (currentConfig.scaling) {\r
-               default: break; // off\r
-               case 1:  // hw hor\r
-               case 2:  PicoOpt |=  0x0100; break; // hw hor+vert\r
-               case 3:  PicoOpt |=  0x4000; break; // sw hor\r
-       }\r
-}\r
-\r
-\r
 void emu_Deinit(void)\r
 {\r
        // save SRAM\r
@@ -554,7 +543,7 @@ static void update_volume(int has_changed, int is_up)
                                if (vol >  0) vol--;\r
                        }\r
                        wait_frames = 0;\r
-                       gp2x_sound_volume(vol, vol);\r
+                       sndout_oss_setvol(vol, vol);\r
                        currentConfig.volume = vol;\r
                }\r
                sprintf(noticeMsg, "VOL: %02i", vol);\r
@@ -681,9 +670,9 @@ static void updateKeys(void)
        // add joy inputs\r
        if (num_of_joys > 0)\r
        {\r
-               gp2x_usbjoy_update();\r
+               usbjoy_update();\r
                for (joy = 0; joy < num_of_joys; joy++) {\r
-                       int btns = gp2x_usbjoy_check2(joy);\r
+                       int btns = usbjoy_check2(joy);\r
                        for (i = 0; i < 32; i++) {\r
                                if (btns & (1 << i)) {\r
                                        int acts = currentConfig.JoyBinds[joy][i];\r
@@ -729,7 +718,7 @@ static void updateSound(int len)
 \r
        /* avoid writing audio when lagging behind to prevent audio lag */\r
        if (PicoSkipFrame != 2)\r
-               gp2x_sound_write(PsndOut, len<<1);\r
+               sndout_oss_write(PsndOut, len<<1);\r
 }\r
 \r
 \r
@@ -813,7 +802,6 @@ void emu_Loop(void)
 \r
        // make sure we are in correct mode\r
        vidResetMode();\r
-       scaling_update();\r
        Pico.m.dirtyPal = 1;\r
        oldmodes = ((Pico.video.reg[12]&1)<<2) ^ 0xc;\r
        emu_findKeyBindCombos();\r
@@ -833,8 +821,8 @@ void emu_Loop(void)
                snd_excess_add = ((PsndRate - PsndLen*target_fps)<<16) / target_fps;\r
                printf("starting audio: %i len: %i (ex: %04x) stereo: %i, pal: %i\n",\r
                        PsndRate, PsndLen, snd_excess_add, (PicoOpt&8)>>3, Pico.m.pal);\r
-               gp2x_start_sound(PsndRate, 16, (PicoOpt&8)>>3);\r
-               gp2x_sound_volume(currentConfig.volume, currentConfig.volume);\r
+               sndout_oss_start(PsndRate, 16, (PicoOpt&8)>>3);\r
+               sndout_oss_setvol(currentConfig.volume, currentConfig.volume);\r
                PicoWriteSound = updateSound;\r
                update_volume(0, 0);\r
                memset(sndBuffer, 0, sizeof(sndBuffer));\r