X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2F32x%2Fpwm.c;h=018a200fad416ba58499b4d6cc2c10caa22b5175;hb=1889fe877cc7cb3c954925c452597498f3c82184;hp=64d672238e0bf54ff6de5620baa657e2f7b0e50c;hpb=07e5dbab71684189f10227108c1e71e2d002a734;p=picodrive.git diff --git a/pico/32x/pwm.c b/pico/32x/pwm.c index 64d6722..018a200 100644 --- a/pico/32x/pwm.c +++ b/pico/32x/pwm.c @@ -1,3 +1,10 @@ +/* + * PicoDrive + * (C) notaz, 2009,2010 + * + * This work is licensed under the terms of MAME license. + * See COPYING file in the top-level directory. + */ #include "../pico_int.h" static int pwm_line_samples; @@ -47,7 +54,7 @@ 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; @@ -55,17 +62,17 @@ void p32x_timers_do(int new_line) { tm = (Pico32x.regs[0x30 / 2] & 0x0f00) >> 8; if (tm != 0) { - if (new_line) + 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(); + p32x_update_irls(!line_call); } } } - if (!new_line) + if (!line_call) return; for (i = 0; i < 2; i++) { @@ -145,7 +152,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;