// but mars test disagrees
pwm.mult = 0;
if ((control & 0x0f) != 0)
- pwm.mult = 0x10000 / cycles;
+ pwm.mult = (0x10000<<8) / (cycles+1);
pwm.irq_timer = (control & 0x0f00) >> 8;
pwm.irq_timer = ((pwm.irq_timer - 1) & 0x0f) + 1;
{
if (v > pwm.cycles)
v = pwm.cycles;
- if (v == 0)
- return 0;
- return v * pwm.mult - 0x10000/2;
+ return (v * pwm.mult >> 8) - 0x10000/2;
}
#define consume_fifo(sh2, m68k_cycles) { \