X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2F32x%2Fpwm.c;h=defbf0db990cf9f96c5f56c57aa4d5cc1127118e;hb=e743be2070a13d14cae39a55b815b62b0edb6776;hp=0e7307829175b33b15284fa6ed46676ad5f73ac8;hpb=1d7a28a723d59da67b58e42a61bc9f1905044fd5;p=picodrive.git diff --git a/pico/32x/pwm.c b/pico/32x/pwm.c index 0e73078..defbf0d 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++) { @@ -141,7 +145,6 @@ void p32x_pwm_write16(unsigned int a, unsigned int d) void p32x_pwm_update(int *buf32, int length, int stereo) { - extern int pwm_ptr; short *pwmb; int step; int p = 0;