X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2Fsh2%2Fsh2.h;h=8c37f43c7f28d3dd0f4787ab419dc18f2ed68db3;hb=ebf923683facb316a0e9fc8d26a7a0b4e4bacbfc;hp=d0b7377c796690b2cbb13f3cd0b8a67a997941a1;hpb=f81107f59093904c3daac2e9c257261fddc6caf0;p=picodrive.git diff --git a/cpu/sh2/sh2.h b/cpu/sh2/sh2.h index d0b7377..8c37f43 100644 --- a/cpu/sh2/sh2.h +++ b/cpu/sh2/sh2.h @@ -89,7 +89,23 @@ void sh2_do_irq(SH2 *sh2, int level, int vector); void sh2_pack(const SH2 *sh2, unsigned char *buff); void sh2_unpack(SH2 *sh2, const unsigned char *buff); -int sh2_execute(SH2 *sh2, int cycles); +int sh2_execute_drc(SH2 *sh2c, int cycles); +int sh2_execute_interpreter(SH2 *sh2c, int cycles); + +static INLINE int sh2_execute(SH2 *sh2, int cycles, int use_drc) +{ + int ret; + + sh2->cycles_timeslice = cycles; +#ifdef DRC_SH2 + if (use_drc) + ret = sh2_execute_drc(sh2, cycles); + else +#endif + ret = sh2_execute_interpreter(sh2, cycles); + + return sh2->cycles_timeslice - ret; +} // regs, pending_int*, cycles, reserved #define SH2_STATE_SIZE ((24 + 2 + 2 + 12) * 4)