X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fpico_int.h;h=4804ad17a4fe2f3f13790f187bc0abf30dcac05f;hb=72f63cf06ca04f5619205d9b0cedebd84037f969;hp=b84b1316a15d80d5e54de734ab7fde988764c13c;hpb=5fadfb1c3732909f8e870954aeea82b761457784;p=picodrive.git diff --git a/pico/pico_int.h b/pico/pico_int.h index b84b131..4804ad1 100644 --- a/pico/pico_int.h +++ b/pico/pico_int.h @@ -237,20 +237,34 @@ typedef void (z80_write_f)(unsigned int a, unsigned char data); // ----------------------- SH2 CPU ----------------------- -#include "cpu/sh2mame/sh2.h" +#include "cpu/sh2/sh2.h" extern SH2 sh2s[2]; #define msh2 sh2s[0] #define ssh2 sh2s[1] -#define ash2_end_run(after) if (sh2_icount > (after)) sh2_icount = after -#define ash2_cycles_done() (sh2->cycles_aim - sh2_icount) +#ifndef DRC_SH2 +# define ash2_end_run(after) if (sh2->icount > (after)) sh2->icount = after +# define ash2_cycles_done() (sh2->cycles_aim - sh2->icount) +#else +# define ash2_end_run(after) { \ + if ((sh2->sr >> 12) > (after)) \ + { sh2->sr &= 0xfff; sh2->sr |= (after) << 12; } \ +} +# define ash2_cycles_done() (sh2->cycles_aim - (sh2->sr >> 12)) +#endif -#define sh2_pc(c) (c) ? ssh2.ppc : msh2.ppc +//#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 -#define sh2_sr(c) (c) ? ssh2.sr : msh2.sr +#define sh2_sr(c) (((c) ? ssh2.sr : msh2.sr) & 0xfff) + +#define sh2_set_gbr(c, v) \ + { if (c) ssh2.gbr = v; else msh2.gbr = v; } +#define sh2_set_vbr(c, v) \ + { if (c) ssh2.vbr = v; else msh2.vbr = v; } // --------------------------------------------------------- @@ -416,6 +430,9 @@ typedef struct // 32X #define P32XS_FM (1<<15) +#define P32XS_REN (1<< 7) +#define P32XS_nRES (1<< 1) +#define P32XS_ADEN (1<< 0) #define P32XS2_ADEN (1<< 9) #define P32XS_FULL (1<< 7) // DREQ FIFO full #define P32XS_68S (1<< 2) @@ -514,6 +531,7 @@ extern areaseek *areaSeek; extern areaclose *areaClose; // cart.c +void Byteswap(void *dst, const void *src, int len); extern void (*PicoCartMemSetup)(void); extern void (*PicoCartUnloadHook)(void); @@ -680,6 +698,7 @@ void Pico32xStartup(void); void PicoUnload32x(void); void PicoFrame32x(void); void p32x_update_irls(void); +void p32x_reset_sh2s(void); // 32x/memory.c struct Pico32xMem *Pico32xMem;