From 7d0143a2de0f5551c90b29c1b1ee94e9c52b0952 Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 25 Nov 2007 13:39:05 +0000 Subject: [PATCH] some minor adjustments git-svn-id: file:///home/notaz/opt/svn/PicoDrive@304 be3aeb3a-fb24-0410-a615-afba39da0efa --- Pico/PicoInt.h | 3 ++- platform/base_readme.txt | 6 ++++-- platform/common/lprintf.h | 3 +-- platform/gizmondo/menu.c | 4 ++++ platform/gp2x/menu.c | 4 ++++ platform/psp/emu.h | 1 + platform/psp/main.c | 4 ++++ platform/psp/menu.c | 4 ++++ platform/psp/psp.c | 23 +++++++++++++++++++---- platform/psp/psp.h | 2 ++ 10 files changed, 45 insertions(+), 9 deletions(-) diff --git a/Pico/PicoInt.h b/Pico/PicoInt.h index 0c3e687a..1a7df25f 100644 --- a/Pico/PicoInt.h +++ b/Pico/PicoInt.h @@ -484,10 +484,11 @@ PICO_INTERNAL void z80_exit(void); #define EL_ANOMALY 0x8000 /* some unexpected conditions (during emulation) */ #if EL_LOGMASK +extern void lprintf(const char *fmt, ...); #define elprintf(w,f,...) \ { \ if ((w) & EL_LOGMASK) \ - printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__); \ + lprintf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__); \ } #else #define elprintf(w,f,...) diff --git a/platform/base_readme.txt b/platform/base_readme.txt index 97334e08..ab4174af 100644 --- a/platform/base_readme.txt +++ b/platform/base_readme.txt @@ -636,10 +636,12 @@ Changelog 1.35b * PSP: mp3 code should no longer fail on 1.5 firmware. + PSP: added gamma adjustment option. - + Added .cso format support. Useful for non-FMV games. + + Added .cso ISO format support. Useful for non-FMV games. + * It is now possile to force a region after the ROM is loaded. * Fixed a sram bug in memhandlers (fixes Shining in the Darkness saves). * PSP: fixed another bug in memhanlers, which crashed the emu for some games - (like NBA Jam). + (like NBA Jam and NHL 9x). + * Some other small tweaks I forgot about. 1.35a * PSP: fixed a bug which prevented to load any ROMs after testing the BIOS. diff --git a/platform/common/lprintf.h b/platform/common/lprintf.h index e917547d..1d304721 100644 --- a/platform/common/lprintf.h +++ b/platform/common/lprintf.h @@ -2,8 +2,7 @@ #include #define lprintf printf #elif defined(PSP) - extern void lprintf_f(const char *fmt, ...); - #define lprintf lprintf_f + extern void lprintf(const char *fmt, ...); #else #include "giz.h" #endif diff --git a/platform/gizmondo/menu.c b/platform/gizmondo/menu.c index c00eee53..5da9c23b 100644 --- a/platform/gizmondo/menu.c +++ b/platform/gizmondo/menu.c @@ -1211,6 +1211,10 @@ static void menu_options_save(void) PicoOpt = currentConfig.PicoOpt; PsndRate = currentConfig.PsndRate; PicoRegionOverride = currentConfig.PicoRegion; + if (PicoRegionOverride) { + // force setting possibly changed.. + Pico.m.pal = (PicoRegionOverride == 2 || PicoRegionOverride == 8) ? 1 : 0; + } if (!(PicoOpt & 0x20)) { // unbind XYZ MODE, just in case unbind_action(0xf00); diff --git a/platform/gp2x/menu.c b/platform/gp2x/menu.c index 7acfa53d..afac0bb5 100644 --- a/platform/gp2x/menu.c +++ b/platform/gp2x/menu.c @@ -1250,6 +1250,10 @@ static void menu_options_save(void) PicoOpt = currentConfig.PicoOpt; PsndRate = currentConfig.PsndRate; PicoRegionOverride = currentConfig.PicoRegion; + if (PicoRegionOverride) { + // force setting possibly changed.. + Pico.m.pal = (PicoRegionOverride == 2 || PicoRegionOverride == 8) ? 1 : 0; + } if (!(PicoOpt & 0x20)) { // unbind XYZ MODE, just in case unbind_action(0xf00, -1, -1); diff --git a/platform/psp/emu.h b/platform/psp/emu.h index affd5402..7a3dbb10 100644 --- a/platform/psp/emu.h +++ b/platform/psp/emu.h @@ -14,6 +14,7 @@ enum TPicoGameState { PGS_ReloadRom, PGS_Menu, PGS_RestartRun, + PGS_Suspending, }; extern char romFileName[]; diff --git a/platform/psp/main.c b/platform/psp/main.c index befc427f..dbe20b7c 100644 --- a/platform/psp/main.c +++ b/platform/psp/main.c @@ -65,6 +65,10 @@ int pico_main(void) } break; + case PGS_Suspending: + psp_wait_suspend(); + break; + case PGS_RestartRun: engineState = PGS_Running; diff --git a/platform/psp/menu.c b/platform/psp/menu.c index fc444462..bc7c8757 100644 --- a/platform/psp/menu.c +++ b/platform/psp/menu.c @@ -1394,6 +1394,10 @@ static void menu_options_save(void) PicoOpt = currentConfig.PicoOpt; PsndRate = currentConfig.PsndRate; PicoRegionOverride = currentConfig.PicoRegion; + if (PicoRegionOverride) { + // force setting possibly changed.. + Pico.m.pal = (PicoRegionOverride == 2 || PicoRegionOverride == 8) ? 1 : 0; + } if (!(PicoOpt & 0x20)) { // unbind XYZ MODE, just in case unbind_action(0xf00); diff --git a/platform/psp/psp.c b/platform/psp/psp.c index c507e5da..cdf26ae2 100644 --- a/platform/psp/psp.c +++ b/platform/psp/psp.c @@ -70,12 +70,21 @@ static int exit_callback(int arg1, int arg2, void *common) /* Power Callback */ static int power_callback(int unknown, int pwrflags, void *common) { + static int old_state = PGS_Menu; + + lprintf("power_callback: flags: 0x%08X\n", pwrflags); + /* check for power switch and suspending as one is manual and the other automatic */ - if (pwrflags & PSP_POWER_CB_POWER_SWITCH || pwrflags & PSP_POWER_CB_SUSPENDING) + if (pwrflags & PSP_POWER_CB_POWER_SWITCH || pwrflags & PSP_POWER_CB_SUSPENDING || pwrflags & PSP_POWER_CB_STANDBY) { - lprintf("power_callback: flags: 0x%08X: suspending\n", pwrflags); - engineState = PGS_Menu; + if (engineState != PGS_Suspending) { + old_state = engineState; + engineState = PGS_Suspending; + } } + else if (pwrflags & PSP_POWER_CB_RESUME_COMPLETE) + engineState = old_state; + //sceDisplayWaitVblankStart(); return 0; } @@ -238,6 +247,12 @@ char *psp_get_status_line(void) return buff; } +void psp_wait_suspend(void) +{ + // probably should do something smarter here? + sceDisplayWaitVblankStart(); +} + /* alt logging */ #define LOG_FILE "log.txt" @@ -251,7 +266,7 @@ typedef struct _log_entry static log_entry *le_root = NULL; #endif -void lprintf_f(const char *fmt, ...) +void lprintf(const char *fmt, ...) { va_list vl; diff --git a/platform/psp/psp.h b/platform/psp/psp.h index d4a3d0e7..d94d3ec9 100644 --- a/platform/psp/psp.h +++ b/platform/psp/psp.h @@ -43,6 +43,8 @@ int psp_set_cpu_clock(int clock); char *psp_get_status_line(void); +void psp_wait_suspend(void); + /* shorter btn names */ #define BTN_UP PSP_CTRL_UP #define BTN_LEFT PSP_CTRL_LEFT -- 2.39.5