mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 06:47:45 -04:00
some minor adjustments
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@304 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
6d741b3258
commit
426ecc582f
8 changed files with 39 additions and 8 deletions
|
@ -14,6 +14,7 @@ enum TPicoGameState {
|
|||
PGS_ReloadRom,
|
||||
PGS_Menu,
|
||||
PGS_RestartRun,
|
||||
PGS_Suspending,
|
||||
};
|
||||
|
||||
extern char romFileName[];
|
||||
|
|
|
@ -65,6 +65,10 @@ int pico_main(void)
|
|||
}
|
||||
break;
|
||||
|
||||
case PGS_Suspending:
|
||||
psp_wait_suspend();
|
||||
break;
|
||||
|
||||
case PGS_RestartRun:
|
||||
engineState = PGS_Running;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
23
psp/psp.c
23
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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue