frontend: update libpicofe
[pcsx_rearmed.git] / frontend / main.c
index df2af8f..1caec4b 100644 (file)
@@ -251,7 +251,11 @@ do_state_slot:
                }
        case SACTION_VOLUME_UP:
        case SACTION_VOLUME_DOWN:
-               plat_target_step_volume(emu_action == SACTION_VOLUME_UP);
+               {
+                       static int volume;
+                       plat_target_step_volume(&volume,
+                               emu_action == SACTION_VOLUME_UP ? 1 : -1);
+               }
                return;
        case SACTION_MINIMIZE:
                if (GPU_close != NULL)
@@ -402,7 +406,14 @@ int emu_core_preinit(void)
        // it may be redefined by -cfg on the command line
        strcpy(cfgfile_basename, "pcsx.cfg");
 
+#ifdef IOS
+       emuLog = fopen("/User/Documents/pcsxr.log", "w");
+       if (emuLog == NULL)
+               emuLog = fopen("pcsxr.log", "w");
+       if (emuLog == NULL)
+#endif
        emuLog = stdout;
+
        SetIsoFile(NULL);
 
        memset(&Config, 0, sizeof(Config));
@@ -680,6 +691,12 @@ static void toggle_fast_forward(int force_off)
                snprintf(hud_msg, sizeof(hud_msg), "FAST FORWARD %s",
                        fast_forward ? "ON" : "OFF");
 }
+
+static void SignalExit(int sig) {
+       // only to restore framebuffer/resolution on some devices
+       plat_finish();
+       exit(1);
+}
 #endif
 
 void SysRunGui() {
@@ -782,6 +799,7 @@ void SysPrintf(const char *fmt, ...) {
        va_start(list, fmt);
        vfprintf(emuLog, fmt, list);
        va_end(list);
+       fflush(emuLog);
 }
 
 #else
@@ -813,10 +831,6 @@ void SysMessage(const char *fmt, ...) {
        SysPrintf("%s\n", msg);
 }
 
-static void SignalExit(int sig) {
-       emu_core_ask_exit();
-}
-
 #define PARSEPATH(dst, src) \
        ptr = src + strlen(src); \
        while (*ptr != '\\' && ptr != src) ptr--; \
@@ -827,8 +841,10 @@ static void SignalExit(int sig) {
 static int _OpenPlugins(void) {
        int ret;
 
+#ifndef NO_FRONTEND
        signal(SIGINT, SignalExit);
        signal(SIGPIPE, SignalExit);
+#endif
 
        GPU_clearDynarec(clearDynarec);
 
@@ -919,8 +935,11 @@ int OpenPlugins() {
 void ClosePlugins() {
        int ret;
 
+#ifndef NO_FRONTEND
        signal(SIGINT, SIG_DFL);
        signal(SIGPIPE, SIG_DFL);
+#endif
+
        ret = CDR_close();
        if (ret < 0) { SysMessage(_("Error closing CD-ROM plugin!")); return; }
        ret = SPU_close();