#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/PicoInt.h>\r
-#include <Pico/Patch.h>\r
-#include <Pico/sound/mix.h>\r
+#include <pico/pico_int.h>\r
+#include <pico/patch.h>\r
+#include <pico/sound/mix.h>\r
#include <zlib/zlib.h>\r
\r
//#define PFRAMES\r
}\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
defaultConfig.EmuOpt = 0x8f | 0x00600; // | <- confirm_save, cd_leds\r
defaultConfig.s_PicoOpt = 0x0f | POPT_EXT_FM|POPT_EN_MCD_PCM|POPT_EN_MCD_CDDA|POPT_EN_SVP_DRC;\r
defaultConfig.s_PicoOpt |= POPT_ACC_SPRITES|POPT_EN_MCD_GFX;\r
- defaultConfig.s_PicoOpt &= ~POPT_EN_SVP_DRC; // crashes :(\r
+// defaultConfig.s_PicoOpt &= ~POPT_EN_SVP_DRC; // crashes :(\r
defaultConfig.EmuOpt &= ~8; // no save gzip\r
defaultConfig.s_PsndRate = 44100;\r
defaultConfig.s_PicoRegion = 0;\r
len = 256;\r
}\r
\r
- if (!sh && (rendstatus & PDRAW_ACC_SPRITES))\r
- mask=0x3f; // accurate sprites, upper bits are priority stuff\r
+ if (!sh && (rendstatus & PDRAW_SPR_LO_ON_HI))\r
+ mask=0x3f; // messed sprites, upper bits are priority stuff\r
\r
#if 1\r
clut_line(pd, ps, pal, (mask<<16) | len);\r
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
// 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
\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
currentConfig.EmuOpt = eo_old;\r
}\r
\r
+void emu_platformDebugCat(char *str)\r
+{\r
+ // nothing\r
+}\r
+\r
static void simpleWait(int thissec, int lim_time)\r
{\r
struct timeval tval;\r
\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
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
\r
if (currentConfig.Frameskip < 0 && tval.tv_usec - lim_time >= 300000) // slowdown detection\r
reset_timing = 1;\r
-/* else if (PsndOut != NULL || currentConfig.Frameskip < 0)\r
+#if 1\r
+ else if (PsndOut != NULL || currentConfig.Frameskip < 0)\r
{\r
// sleep or vsync if we are still too fast\r
// usleep sleeps for ~20ms minimum, so it is not a solution here\r
}\r
}\r
}\r
-*/\r
+#endif\r
blit(fpsbuff, notice);\r
\r
pframes_done++; pframes_shown++;\r