mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
fixes for idle and other stuff
This commit is contained in:
parent
8ad1d2adf2
commit
0219d379de
6 changed files with 26 additions and 14 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 1f9661c5a2919ba91c0f4b89985e0712871e5762
|
||||
Subproject commit 7ddcd35c8b2a8248257bd89ef989095639c29c08
|
|
@ -40012,20 +40012,18 @@ RET(8)
|
|||
}
|
||||
|
||||
|
||||
extern int SekIsIdleReady(void);
|
||||
extern int SekIsIdleCode(unsigned short *dst, int bytes);
|
||||
extern int SekRegisterIdlePatch(unsigned int pc, int oldop, int newop, void *ctx);
|
||||
|
||||
OPCODE(idle_detector_bcc8)
|
||||
{
|
||||
extern int idledet_start_frame;
|
||||
extern char Pico[];
|
||||
int frame_count, cond_true, bytes, ret, newop;
|
||||
u16 *dest_pc;
|
||||
|
||||
dest_pc = PC + (((s8)(Opcode & 0xFE)) >> 1);
|
||||
|
||||
frame_count = *(int *)(Pico+0x22208+0x1c); // Pico.m.frame_count
|
||||
if (frame_count < idledet_start_frame)
|
||||
if (!SekIsIdleReady())
|
||||
goto end;
|
||||
|
||||
bytes = 0 - (s8)(Opcode & 0xFE) - 2;
|
||||
|
|
|
@ -3126,6 +3126,7 @@ int sh2_execute(SH2 *sh2c, int cycles)
|
|||
if (ret_cycles > 0)
|
||||
dbg(1, "warning: drc returned with cycles: %d", ret_cycles);
|
||||
|
||||
sh2c->sr &= 0x3f3;
|
||||
return sh2c->cycles_timeslice - ret_cycles;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue