X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fpico_int.h;h=6e4917b33c8ce336e30df934b95cea6d4361a550;hb=895d15121be3762c7007a3afe24c5d78bbdc8be7;hp=2a793e5ed83b1cc42632dd6cdee7b22fa6755e42;hpb=8a847c12e6a82869b7ff6f1742f53e0da1ad2db6;p=picodrive.git diff --git a/pico/pico_int.h b/pico/pico_int.h index 2a793e5..6e4917b 100644 --- a/pico/pico_int.h +++ b/pico/pico_int.h @@ -283,6 +283,9 @@ extern SH2 sh2s[2]; #define sh2_set_vbr(c, v) \ { if (c) ssh2.vbr = v; else msh2.vbr = v; } +#define elprintf_sh2(sh2, w, f, ...) \ + elprintf(w,"%csh2 "f,(sh2)->is_slave?'s':'m',##__VA_ARGS__) + // --------------------------------------------------------- // main oscillator clock which controls timing @@ -350,7 +353,7 @@ struct Pico unsigned short vsram[0x40]; // 0x22180 unsigned char *rom; // 0x22200 - unsigned int romsize; // 0x22204 + unsigned int romsize; // 0x22204 (on 32bits) struct PicoMisc m; struct PicoVideo video; @@ -438,6 +441,7 @@ typedef struct unsigned char pcm_ram[0x10000]; unsigned char pcm_ram_b[0x10][0x1000]; }; + // FIXME: should be short unsigned char s68k_regs[0x200]; // 110000: GA, not CPU regs unsigned char bram[0x2000]; // 110200: 8K struct mcd_misc m; // 112200: misc @@ -479,8 +483,9 @@ typedef struct #define P32XP_FULL (1<<15) // PWM pulse #define P32XP_EMPTY (1<<14) -#define P32XF_68KCPOLL (1 << 0) -#define P32XF_68KVPOLL (1 << 1) +#define P32XF_68KCPOLL (1 << 0) +#define P32XF_68KVPOLL (1 << 1) +#define P32XF_Z80_32X_IO (1 << 7) // z80 does 32x io #define P32XI_VRES (1 << 14/2) // IRL/2 #define P32XI_VINT (1 << 12/2) @@ -539,12 +544,19 @@ struct Pico32xMem #ifdef DRC_SH2 unsigned short drcblk_da[2][1 << (12 - SH2_DRCBLK_DA_SHIFT)]; #endif - unsigned char sh2_rom_m[0x800]; - unsigned char sh2_rom_s[0x400]; + union { + unsigned char b[0x800]; + unsigned short w[0x800/2]; + } sh2_rom_m; + union { + unsigned char b[0x400]; + unsigned short w[0x400/2]; + } sh2_rom_s; unsigned short pal[0x100]; unsigned short pal_native[0x100]; // converted to native (for renderer) signed short pwm[2*PWM_BUFF_LEN]; // PWM buffer for current frame - signed short pwm_fifo[2][4]; // [0] - current, others - fifo entries + signed short pwm_current[2]; // current converted samples + unsigned short pwm_fifo[2][4]; // [0] - current raw, others - fifo entries }; // area.c @@ -595,7 +607,6 @@ unsigned int PicoRead8_io(unsigned int a); unsigned int PicoRead16_io(unsigned int a); void PicoWrite8_io(unsigned int a, unsigned int d); void PicoWrite16_io(unsigned int a, unsigned int d); -void p32x_dreq1_trigger(void); // pico/memory.c PICO_INTERNAL void PicoMemSetupPico(void); @@ -746,6 +757,7 @@ extern struct Pico32x Pico32x; enum p32x_event { P32X_EVENT_PWM, P32X_EVENT_FILLEND, + P32X_EVENT_HINT, P32X_EVENT_COUNT, }; extern unsigned int event_times[P32X_EVENT_COUNT]; @@ -760,9 +772,12 @@ void Pico32xStateLoaded(int is_early); void p32x_sync_sh2s(unsigned int m68k_target); void p32x_sync_other_sh2(SH2 *sh2, unsigned int m68k_target); void p32x_update_irls(SH2 *active_sh2, int m68k_cycles); +void p32x_trigger_irq(SH2 *sh2, int m68k_cycles, unsigned int mask); +void p32x_update_cmd_irq(SH2 *sh2, int m68k_cycles); void p32x_reset_sh2s(void); void p32x_event_schedule(unsigned int now, enum p32x_event event, int after); void p32x_event_schedule_sh2(SH2 *sh2, enum p32x_event event, int after); +void p32x_schedule_hint(SH2 *sh2, int m68k_cycles); // 32x/memory.c struct Pico32xMem *Pico32xMem; @@ -799,6 +814,7 @@ void p32x_pwm_update(int *buf32, int length, int stereo); void p32x_pwm_ctl_changed(void); void p32x_pwm_schedule(unsigned int m68k_now); void p32x_pwm_schedule_sh2(SH2 *sh2); +void p32x_pwm_sync_to_sh2(SH2 *sh2); void p32x_pwm_irq_event(unsigned int m68k_now); void p32x_pwm_state_loaded(void);