diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-09-19 19:15:08 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-09-19 19:15:08 +0000 |
commit | 03ba4131783cc9e872f8bb26a03f15bc11f27564 (patch) | |
tree | 88db8dba75ae06ba3bad08e42c5e52efc162535c /arch/m68k/atari/atasound.c | |
parent | 257730f99381dd26e10b832fce4c94cae7ac1176 (diff) |
- Merge with Linux 2.1.121.
- Bugfixes.
Diffstat (limited to 'arch/m68k/atari/atasound.c')
-rw-r--r-- | arch/m68k/atari/atasound.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/m68k/atari/atasound.c b/arch/m68k/atari/atasound.c index 8223ce95c..7b401d17f 100644 --- a/arch/m68k/atari/atasound.c +++ b/arch/m68k/atari/atasound.c @@ -61,17 +61,21 @@ void atari_mksound (unsigned int hz, unsigned int ticks) save_flags(flags); cli(); - /* Convert from frequency value to PSG period value (base - frequency 125 kHz). */ - period = PSG_FREQ / hz; - - if (period > 0xfff) period = 0xfff; /* Disable generator A in mixer control. */ sound_ym.rd_data_reg_sel = 7; tmp = sound_ym.rd_data_reg_sel; tmp |= 011; sound_ym.wd_data = tmp; + + if (hz) { + /* Convert from frequency value to PSG period value (base + frequency 125 kHz). */ + + period = PSG_FREQ / hz; + + if (period > 0xfff) period = 0xfff; + /* Set generator A frequency to hz. */ sound_ym.rd_data_reg_sel = 0; sound_ym.wd_data = period & 0xff; @@ -101,6 +105,6 @@ void atari_mksound (unsigned int hz, unsigned int ticks) sound_ym.rd_data_reg_sel = 7; tmp &= ~1; sound_ym.wd_data = tmp; - + } restore_flags(flags); } |