X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fpico_int.h;h=a654c5aa92779502dc24bd1681932a2080d60d92;hb=6d7979571d08d7b020022fa169a34a29fc20dfdc;hp=bcb971e064b7c4c33a554ff2cc843c752a2b7628;hpb=6a98f03eefe99c0e316199fa2e8da4eae7653a1f;p=picodrive.git diff --git a/pico/pico_int.h b/pico/pico_int.h index bcb971e..a654c5a 100644 --- a/pico/pico_int.h +++ b/pico/pico_int.h @@ -237,27 +237,27 @@ extern SH2 sh2s[2]; #define ssh2 sh2s[1] #ifndef DRC_SH2 -# define ash2_end_run(after) do { \ - if (sh2->icount > (after)) { \ - sh2->cycles_timeslice -= sh2->icount; \ - sh2->icount = after; \ +# define ash2_end_run(sh2, after) do { \ + if ((sh2)->icount > (after)) { \ + (sh2)->cycles_timeslice -= (sh2)->icount; \ + (sh2)->icount = after; \ } \ } while (0) -# define ash2_cycles_done() (sh2->cycles_timeslice - sh2->icount) +# define ash2_cycles_done(sh2) ((sh2)->cycles_timeslice - (sh2)->icount) +# define sh2_pc(c) (c) ? ssh2.ppc : msh2.ppc #else -# define ash2_end_run(after) do { \ - int left = sh2->sr >> 12; \ +# define ash2_end_run(sh2, after) do { \ + int left = (sh2)->sr >> 12; \ if (left > (after)) { \ - sh2->cycles_timeslice -= left; \ - sh2->sr &= 0xfff; \ - sh2->sr |= (after) << 12; \ + (sh2)->cycles_timeslice -= left; \ + (sh2)->sr &= 0xfff; \ + (sh2)->sr |= (after) << 12; \ } \ } while (0) -# define ash2_cycles_done() (sh2->cycles_timeslice - (sh2->sr >> 12)) +# define ash2_cycles_done(sh2) ((sh2)->cycles_timeslice - ((sh2)->sr >> 12)) +# define sh2_pc(c) (c) ? ssh2.pc : msh2.pc #endif -//#define sh2_pc(c) (c) ? ssh2.ppc : msh2.ppc -#define sh2_pc(c) (c) ? ssh2.pc : msh2.pc #define sh2_reg(c, x) (c) ? ssh2.r[x] : msh2.r[x] #define sh2_gbr(c) (c) ? ssh2.gbr : msh2.gbr #define sh2_vbr(c) (c) ? ssh2.vbr : msh2.vbr @@ -735,6 +735,7 @@ void PicoReset32x(void); void Pico32xStartup(void); void PicoUnload32x(void); void PicoFrame32x(void); +void Pico32xStateLoaded(int is_early); void p32x_sync_sh2s(unsigned int m68k_target); void p32x_update_irls(int nested_call); void p32x_reset_sh2s(void); @@ -748,7 +749,7 @@ void PicoWrite8_32x(unsigned int a, unsigned int d); void PicoWrite16_32x(unsigned int a, unsigned int d); void PicoMemSetup32x(void); void Pico32xSwapDRAM(int b); -void Pico32xStateLoaded(void); +void Pico32xMemStateLoaded(void); void p32x_poll_event(int cpu_mask, int is_vdp); // 32x/draw.c