X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fgp2x%2Femu.c;h=b9079a925112ee75569db477e92b59f7828b0f32;hb=b682092681909a8c8e8165b9c3898833e36708b7;hp=8e726e353b9d0dd6b3c608dd3ec024976e8651b8;hpb=7b3f44c6b677a60b63b092f825a2b6c58166b70c;p=picodrive.git diff --git a/platform/gp2x/emu.c b/platform/gp2x/emu.c index 8e726e3..b9079a9 100644 --- a/platform/gp2x/emu.c +++ b/platform/gp2x/emu.c @@ -16,12 +16,14 @@ #include "emu.h" #include "gp2x.h" -#include "usbjoy.h" #include "menu.h" +#include "../linux/usbjoy.h" #include "../common/arm_utils.h" #include "../common/fonts.h" #include "../common/emu.h" #include "../common/config.h" +#include "../common/input.h" +#include "../linux/sndout_oss.h" #include "cpuctrl.h" #include @@ -122,12 +124,8 @@ void emu_Deinit(void) SRam.changed = 0; } - if (!(currentConfig.EmuOpt & 0x20)) { - config_writelrom(PicoConfigFile); -#ifndef NO_SYNC - sync(); -#endif - } + if (!(currentConfig.EmuOpt & EOPT_NO_AUTOSVCFG)) + emu_writelrom(); free(PicoDraw2FB); @@ -487,7 +485,7 @@ static void update_volume(int has_changed, int is_up) if (vol > 0) vol--; } wait_frames = 0; - gp2x_sound_volume(vol, vol); + sndout_oss_setvol(vol, vol); currentConfig.volume = vol; } sprintf(noticeMsg, "VOL: %02i", vol); @@ -583,6 +581,10 @@ static void updateKeys(void) keys &= CONFIGURABLE_KEYS; keys2 = keys; +#if 1 + /* FIXME: combos, player2 */ + allActions[0] = in_update(); +#else for (i = 0; i < 32; i++) { if (keys2 & (1 << i)) @@ -610,13 +612,14 @@ static void updateKeys(void) } } } +#endif // add joy inputs if (num_of_joys > 0) { - gp2x_usbjoy_update(); + usbjoy_update(); for (joy = 0; joy < num_of_joys; joy++) { - int btns = gp2x_usbjoy_check2(joy); + int btns = usbjoy_check2(joy); for (i = 0; i < 32; i++) { if (btns & (1 << i)) { int acts = currentConfig.JoyBinds[joy][i]; @@ -662,7 +665,7 @@ static void updateSound(int len) /* avoid writing audio when lagging behind to prevent audio lag */ if (PicoSkipFrame != 2) - gp2x_sound_write(PsndOut, len<<1); + sndout_oss_write(PsndOut, len<<1); } void emu_startSound(void) @@ -683,8 +686,8 @@ void emu_startSound(void) snd_excess_add = ((PsndRate - PsndLen*target_fps)<<16) / target_fps; printf("starting audio: %i len: %i (ex: %04x) stereo: %i, pal: %i\n", PsndRate, PsndLen, snd_excess_add, (PicoOpt&8)>>3, Pico.m.pal); - gp2x_start_sound(PsndRate, 16, (PicoOpt&8)>>3); - gp2x_sound_volume(currentConfig.volume, currentConfig.volume); + sndout_oss_start(PsndRate, 16, (PicoOpt&8)>>3); + sndout_oss_setvol(currentConfig.volume, currentConfig.volume); PicoWriteSound = updateSound; update_volume(0, 0); memset(sndBuffer, 0, sizeof(sndBuffer));