patch-2.1.120 linux/arch/m68k/atari/atasound.c

Next file: linux/arch/m68k/atari/config.c
Previous file: linux/arch/m68k/amiga/config.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.119/linux/arch/m68k/atari/atasound.c linux/arch/m68k/atari/atasound.c
@@ -61,17 +61,21 @@
 	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 @@
 	sound_ym.rd_data_reg_sel = 7;
 	tmp &= ~1;
 	sound_ym.wd_data = tmp;
-
+	}
 	restore_flags(flags);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov