void pl_frame_limit(void)
{
/* called once per frame, make psxCpu->Execute() above return */
- stop = 1;
+ stop++;
}
void pl_timing_prepare(int is_pal)
void emu_core_ask_exit(void)
{
- stop = 1;
+ stop++;
g_emu_want_quit = 1;
}
if (action_ == SACTION_NONE)
emu_action_old = 0;
else if (action_ != emu_action_old)
- stop = 1;
+ stop++;
emu_action = action_;
}
lightrec_plugin_execute_internal(false);
}
-static void lightrec_plugin_execute_block(void)
+static void lightrec_plugin_execute_block(enum blockExecCaller caller)
{
lightrec_plugin_execute_internal(true);
}
char exename[256];
if (!Config.HLE) {
- if (!BiosBooted) return 0; // custom BIOS
- if (psxRegs.pc != 0x80030000) return 0; // BiosBootBypass'ed
- if (Config.SlowBoot) return 0;
+ if (psxRegs.pc != 0x80030000) // BiosBootBypass'ed or custom BIOS?
+ return 0;
+ if (Config.SlowBoot)
+ return 0;
}
time[0] = itob(0); time[1] = itob(2); time[2] = itob(0x10);
}
}
+static void ari64_execute_block(enum blockExecCaller caller)
+{
+ if (caller == EXEC_CALLER_BOOT)
+ stop++;
+
+ ari64_execute_until();
+
+ if (caller == EXEC_CALLER_BOOT)
+ stop--;
+}
+
static void ari64_clear(u32 addr, u32 size)
{
size *= 4; /* PCSX uses DMA units (words) */
ari64_init,
ari64_reset,
ari64_execute,
- ari64_execute_until,
+ ari64_execute_block,
ari64_clear,
ari64_notify,
ari64_apply_config,
hleSoftCall = TRUE;
- while (pc0 != 0x80001000) psxCpu->ExecuteBlock();
+ while (pc0 != 0x80001000) psxCpu->ExecuteBlock(EXEC_CALLER_HLE);
hleSoftCall = FALSE;
}
hleSoftCall = TRUE;
- while (pc0 != 0x80001000) psxCpu->ExecuteBlock();
+ while (pc0 != 0x80001000) psxCpu->ExecuteBlock(EXEC_CALLER_HLE);
ra = sra;
hleSoftCall = FALSE;
PcsxConfig Config;
boolean NetOpened = FALSE;
-boolean BiosBooted = FALSE;
int Log = 0;
FILE *emuLog = NULL;
extern PcsxConfig Config;
extern boolean NetOpened;
-extern boolean BiosBooted;
struct PcsxSaveFuncs {
void *(*open)(const char *name, const char *mode);
execI_(memRLUT, regs_);
}
-void intExecuteBlock() {
+void intExecuteBlock(enum blockExecCaller caller) {
psxRegisters *regs_ = &psxRegs;
u8 **memRLUT = psxMemRLUT;
BiosLikeGPUSetup(); // a bit of a hack but whatever
- BiosBooted = FALSE;
if (!Config.HLE) {
psxExecuteBios();
if (psxRegs.pc == 0x80030000 && !Config.SlowBoot)
void psxExecuteBios() {
int i;
- for (i = 0; psxRegs.pc != 0x80030000 && i < 5000000; i++)
- psxCpu->ExecuteBlock();
- if (psxRegs.pc == 0x80030000)
- BiosBooted = TRUE;
- else
- SysPrintf("BIOS boot timeout - custom BIOS?\n");
+ for (i = 0; i < 5000000; i++) {
+ psxCpu->ExecuteBlock(EXEC_CALLER_BOOT);
+ if ((psxRegs.pc & 0xff800000) == 0x80000000)
+ break;
+ }
+ if (psxRegs.pc != 0x80030000)
+ SysPrintf("non-standard BIOS detected (%d, %08x)\n", i, psxRegs.pc);
}
R3000ACPU_NOTIFY_AFTER_LOAD,
};
+enum blockExecCaller {
+ EXEC_CALLER_BOOT,
+ EXEC_CALLER_HLE,
+};
+
typedef struct {
int (*Init)();
void (*Reset)();
- void (*Execute)(); /* executes up to a break */
- void (*ExecuteBlock)(); /* executes up to a jump */
+ void (*Execute)();
+ void (*ExecuteBlock)(enum blockExecCaller caller); /* executes up to a jump */
void (*Clear)(u32 Addr, u32 Size);
void (*Notify)(enum R3000Anote note, void *data);
void (*ApplyConfig)();