1 #include "../pico_int.h"
2 #include "../sound/ym2612.h"
4 struct Pico32x Pico32x;
6 void Pico32xStartup(void)
8 elprintf(EL_STATUS|EL_32X, "32X startup");
20 Pico32x.vdp_regs[0] |= P32XV_nPAL;
25 void Pico32xInit(void)
29 void PicoPower32x(void)
31 memset(&Pico32x, 0, sizeof(Pico32x));
33 Pico32x.regs[0] = 0x0082; // SH2 reset?
34 Pico32x.vdp_regs[0x0a/2] = P32XV_VBLK|P32XV_HBLK|P32XV_PEN;
37 void PicoUnload32x(void)
39 if (Pico32xMem != NULL)
46 void PicoReset32x(void)
48 extern int p32x_csum_faked;
49 p32x_csum_faked = 0; // tmp
52 static void p32x_start_blank(void)
55 Pico32x.vdp_regs[0x0a/2] |= P32XV_VBLK|P32XV_PEN;
57 // swap waits until vblank
58 if ((Pico32x.vdp_regs[0x0a/2] ^ Pico32x.pending_fb) & P32XV_FS) {
59 Pico32x.vdp_regs[0x0a/2] &= ~P32XV_FS;
60 Pico32x.vdp_regs[0x0a/2] |= Pico32x.pending_fb;
61 Pico32xSwapDRAM(Pico32x.pending_fb ^ 1);
66 static __inline void SekRunM68k(int cyc)
70 if ((cyc_do=SekCycleAim-SekCycleCnt) <= 0) return;
71 #if defined(EMU_CORE_DEBUG)
72 // this means we do run-compare
73 SekCycleCnt+=CM_compareRun(cyc_do, 0);
74 #elif defined(EMU_C68K)
75 PicoCpuCM68k.cycles=cyc_do;
76 CycloneRun(&PicoCpuCM68k);
77 SekCycleCnt+=cyc_do-PicoCpuCM68k.cycles;
78 #elif defined(EMU_M68K)
79 SekCycleCnt+=m68k_execute(cyc_do);
80 #elif defined(EMU_F68K)
81 SekCycleCnt+=fm68k_emulate(cyc_do+1, 0, 0);
85 // ~1463.8, but due to cache misses and slow mem
86 // it's much lower than that
87 #define SH2_LINE_CYCLES 700
91 if (!(Pico32x.emu_flags & P32XF_MSH2POLL)) \
92 sh2_execute(&msh2, SH2_LINE_CYCLES);
94 #include "../pico_cmn.c"
96 void PicoFrame32x(void)
98 if ((Pico32x.vdp_regs[0] & 3 ) != 0) // no forced blanking
99 Pico32x.vdp_regs[0x0a/2] &= ~(P32XV_VBLK|P32XV_PEN); // get out of vblank