X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fmain.c;h=53e3674a540d521ce43f6e8a5a7ac9ad88fb090f;hp=56b5cb761a39ba40ef95c191f7786160313615e6;hb=456f1b86b44a631e7c58e42ae72ce07970843944;hpb=2857d72e4ca743bba3cf55e298949e24d97dff02 diff --git a/frontend/main.c b/frontend/main.c index 56b5cb76..53e3674a 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -25,12 +25,14 @@ #include "../libpcsxcore/cheat.h" #include "../libpcsxcore/new_dynarec/new_dynarec.h" #include "../plugins/cdrcimg/cdrcimg.h" -#include "common/plat.h" -#include "common/readpng.h" -#include "common/input.h" -#include "linux/in_evdev.h" #include "revision.h" +#ifndef NO_FRONTEND +#include "libpicofe/input.h" +#include "libpicofe/plat.h" +#include "libpicofe/readpng.h" +#endif + // don't include debug.h - it breaks ARM build (R1 redefined) void StartDebugger(); void StopDebugger(); @@ -49,6 +51,8 @@ enum sched_action emu_action, emu_action_old; char hud_msg[64]; int hud_new_msg; +static void toggle_fast_forward(int force_off); + static void make_path(char *buf, size_t size, const char *dir, const char *fname) { if (fname) @@ -205,6 +209,7 @@ void do_emu_action(void) break; #ifndef NO_FRONTEND case SACTION_ENTER_MENU: + toggle_fast_forward(1); menu_loop(); return; case SACTION_NEXT_SSLOT: @@ -240,6 +245,10 @@ do_state_slot: GPU_open(&gpuDisp, "PCSX", NULL); } break; + case SACTION_FAST_FORWARD: + toggle_fast_forward(0); + plugin_call_rearmed_cbs(); + break; case SACTION_SCREENSHOT: { char buf[MAXPATHLEN]; @@ -262,7 +271,7 @@ do_state_slot: } case SACTION_VOLUME_UP: case SACTION_VOLUME_DOWN: - plat_step_volume(emu_action == SACTION_VOLUME_UP); + plat_target_step_volume(emu_action == SACTION_VOLUME_UP); return; case SACTION_MINIMIZE: if (GPU_close != NULL) @@ -586,6 +595,40 @@ int main(int argc, char *argv[]) return 0; } + +static void toggle_fast_forward(int force_off) +{ + static int fast_forward; + static int normal_g_opts; + static int normal_frameskip; + static int normal_enhancement_enable; + + if (force_off && !fast_forward) + return; + + fast_forward = !fast_forward; + if (fast_forward) { + normal_g_opts = g_opts; + normal_frameskip = pl_rearmed_cbs.frameskip; + normal_enhancement_enable = + pl_rearmed_cbs.gpu_neon.enhancement_enable; + + g_opts |= OPT_NO_FRAMELIM; + pl_rearmed_cbs.frameskip = 3; + pl_rearmed_cbs.gpu_neon.enhancement_enable = 0; + } else { + g_opts = normal_g_opts; + pl_rearmed_cbs.frameskip = normal_frameskip; + pl_rearmed_cbs.gpu_neon.enhancement_enable = + normal_enhancement_enable; + + pl_timing_prepare(Config.PsxType); + } + + if (!force_off) + snprintf(hud_msg, sizeof(hud_msg), "FAST FORWARD %s", + fast_forward ? "ON" : "OFF"); +} #endif void SysRunGui() { @@ -858,15 +901,6 @@ void *SysLoadLibrary(const char *lib) { return (void *)(long)(PLUGIN_DL_BASE + builtin_plugin_ids[i]); } -#if defined(__x86_64__) || defined(__i386__) - // convenience hack - if (strstr(lib, ".x86") == NULL) { - char name[MAXPATHLEN]; - snprintf(name, sizeof(name), "%s.x86_64", lib); - lib = name; - } -#endif - ret = dlopen(lib, RTLD_NOW); if (ret == NULL) fprintf(stderr, "dlopen: %s\n", dlerror());