// find top bit = highest irq number (0 <= irl <= 14/2) by binary search
// msh2
- irqs = Pico32x.sh2irqs | Pico32x.sh2irqi[0];
+ irqs = Pico32x.sh2irqi[0];
if (irqs >= 0x10) mlvl += 8, irqs >>= 4;
if (irqs >= 0x04) mlvl += 4, irqs >>= 2;
if (irqs >= 0x02) mlvl += 2, irqs >>= 1;
// ssh2
- irqs = Pico32x.sh2irqs | Pico32x.sh2irqi[1];
+ irqs = Pico32x.sh2irqi[1];
if (irqs >= 0x10) slvl += 8, irqs >>= 4;
if (irqs >= 0x04) slvl += 4, irqs >>= 2;
if (irqs >= 0x02) slvl += 2, irqs >>= 1;
// TODO: test on hw..
void p32x_trigger_irq(SH2 *sh2, unsigned int m68k_cycles, unsigned int mask)
{
- Pico32x.sh2irqs |= mask & P32XI_VRES;
+ Pico32x.sh2irqi[0] |= mask & P32XI_VRES;
+ Pico32x.sh2irqi[1] |= mask & P32XI_VRES;
Pico32x.sh2irqi[0] |= mask & (Pico32x.sh2irq_mask[0] << 3);
Pico32x.sh2irqi[1] |= mask & (Pico32x.sh2irq_mask[1] << 3);
p32x_sh2_poll_event(ssh2.poll_addr, &ssh2, SH2_IDLE_STATES, SekCyclesDone());
p32x_pwm_ctl_changed();
p32x_timers_recalc();
- Pico32x.vdp_regs[0] &= ~P32XV_Mx; // 32X graphics disabled
- Pico32x.pending_fb = Pico32x.vdp_regs[0x0a/2] & P32XV_FS;
}
}
// NB: 32X officially doesn't support H32 mode. However, it does work since the
// cartridge slot carries the EDCLK signal which is always H40 clock and is used
-// as video clock by the 32X. The H32 MD image is overlayed with the 320 px 32X
+// as video clock by the 32X. The H32 MD image is overlaid with the 320 px 32X
// image which has the same on-screen width. How the /YS signal on the cartridge
// slot (signalling the display of background color) is processed in this case
// is however unclear and might lead to glitches due to race conditions by the
}
r = Pico32x.sh2_regs;
sprintf(dstrp, "SH: %04x %04x %04x IRQs: %02x eflags: %02x\n",
- r[0], r[1], r[2], Pico32x.sh2irqs, Pico32x.emu_flags); MVP;
+ r[0], r[1], r[2], Pico32x.sh2irqi[0]|Pico32x.sh2irqi[1], Pico32x.emu_flags); MVP;
i = 0;
r = Pico32x.vdp_regs;
unsigned int emu_flags;\r
unsigned char sh2irq_mask[2];\r
unsigned char sh2irqi[2]; // individual\r
- unsigned int sh2irqs; // common irqs\r
+ unsigned int pad4; // was sh2irqs\r
unsigned short dmac_fifo[DMAC_FIFO_LEN];\r
unsigned int pad[4];\r
unsigned int dmac0_fifo_ptr;\r