X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=pico%2F32x%2Fpwm.c;h=8e365892689d604bdc263d8373fe6b70c320c7eb;hb=1f1ff763e661bab664151c4821c65dad35777976;hp=0e7307829175b33b15284fa6ed46676ad5f73ac8;hpb=1d7a28a723d59da67b58e42a61bc9f1905044fd5;p=picodrive.git diff --git a/pico/32x/pwm.c b/pico/32x/pwm.c index 0e73078..8e36589 100644 --- a/pico/32x/pwm.c +++ b/pico/32x/pwm.c @@ -47,21 +47,25 @@ void p32x_timers_recalc(void) } // PWM irq for every tm samples -void p32x_timers_do(int new_line) +void p32x_timers_do(int line_call) { int tm, cnt, i; - tm = (Pico32x.regs[0x30 / 2] & 0x0f00) >> 8; - if (tm != 0) { - if (new_line) - Pico32x.pwm_irq_sample_cnt += pwm_line_samples; - if (Pico32x.pwm_irq_sample_cnt >= (tm << 16)) { - Pico32x.pwm_irq_sample_cnt -= tm << 16; - Pico32x.sh2irqs |= P32XI_PWM; - p32x_update_irls(); + + if (PicoOpt & POPT_EN_PWM) + { + tm = (Pico32x.regs[0x30 / 2] & 0x0f00) >> 8; + if (tm != 0) { + if (line_call) + Pico32x.pwm_irq_sample_cnt += pwm_line_samples; + if (Pico32x.pwm_irq_sample_cnt >= (tm << 16)) { + Pico32x.pwm_irq_sample_cnt -= tm << 16; + Pico32x.sh2irqs |= P32XI_PWM; + p32x_update_irls(!line_call); + } } } - if (!new_line) + if (!line_call) return; for (i = 0; i < 2; i++) {