#define EL_ANOMALY 0x8000 /* some unexpected conditions (during emulation) */\r
\r
#if EL_LOGMASK\r
+extern void lprintf(const char *fmt, ...);\r
#define elprintf(w,f,...) \\r
{ \\r
if ((w) & EL_LOGMASK) \\r
- printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__); \\r
+ lprintf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__); \\r
}\r
#else\r
#define elprintf(w,f,...)\r
1.35b\r
* PSP: mp3 code should no longer fail on 1.5 firmware.\r
+ PSP: added gamma adjustment option.\r
- + Added .cso format support. Useful for non-FMV games.\r
+ + Added .cso ISO format support. Useful for non-FMV games.\r
+ * It is now possile to force a region after the ROM is loaded.\r
* Fixed a sram bug in memhandlers (fixes Shining in the Darkness saves).\r
* PSP: fixed another bug in memhanlers, which crashed the emu for some games\r
- (like NBA Jam).\r
+ (like NBA Jam and NHL 9x).\r
+ * Some other small tweaks I forgot about.\r
\r
1.35a\r
* PSP: fixed a bug which prevented to load any ROMs after testing the BIOS.\r
#include <stdio.h>
#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
PicoOpt = currentConfig.PicoOpt;\r
PsndRate = currentConfig.PsndRate;\r
PicoRegionOverride = currentConfig.PicoRegion;\r
+ if (PicoRegionOverride) {\r
+ // force setting possibly changed..\r
+ Pico.m.pal = (PicoRegionOverride == 2 || PicoRegionOverride == 8) ? 1 : 0;\r
+ }\r
if (!(PicoOpt & 0x20)) {\r
// unbind XYZ MODE, just in case\r
unbind_action(0xf00);\r
PicoOpt = currentConfig.PicoOpt;\r
PsndRate = currentConfig.PsndRate;\r
PicoRegionOverride = currentConfig.PicoRegion;\r
+ if (PicoRegionOverride) {\r
+ // force setting possibly changed..\r
+ Pico.m.pal = (PicoRegionOverride == 2 || PicoRegionOverride == 8) ? 1 : 0;\r
+ }\r
if (!(PicoOpt & 0x20)) {\r
// unbind XYZ MODE, just in case\r
unbind_action(0xf00, -1, -1);\r
PGS_ReloadRom,
PGS_Menu,
PGS_RestartRun,
+ PGS_Suspending,
};
extern char romFileName[];
}
break;
+ case PGS_Suspending:
+ psp_wait_suspend();
+ break;
+
case PGS_RestartRun:
engineState = PGS_Running;
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);
/* 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;
}
return buff;
}
+void psp_wait_suspend(void)
+{
+ // probably should do something smarter here?
+ sceDisplayWaitVblankStart();
+}
+
/* alt logging */
#define LOG_FILE "log.txt"
static log_entry *le_root = NULL;
#endif
-void lprintf_f(const char *fmt, ...)
+void lprintf(const char *fmt, ...)
{
va_list vl;
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