X-Git-Url: https://jxself.org/git/?p=linux-libre-firmware.git;a=blobdiff_plain;f=aica%2Farm%2Faica.c;h=411922bbd4469a0c08b19558e69786e01aa98d90;hp=2ff2ca1058058efe3f35d4ed9936d00b7deaa8d3;hb=9837149c49ceabb347cdbe8e9a7900c528018acc;hpb=a4d24e3a224a19404bc3ac98389ff376198c85ef diff --git a/aica/arm/aica.c b/aica/arm/aica.c index 2ff2ca1..411922b 100644 --- a/aica/arm/aica.c +++ b/aica/arm/aica.c @@ -96,7 +96,6 @@ void aica_play(int ch, int delay) { uint32 freq_lo, freq_base = 5644800; int freq_hi = 7; - uint32 i; uint32 playCont; /* Stop the channel (if it's already playing) */ @@ -124,14 +123,13 @@ void aica_play(int ch, int delay) { /* Write resulting values */ CHNREG32(ch, 24) = (freq_hi << 11) | (freq_lo & 1023); - /* Set volume, pan */ + /* Convert the incoming pan into a hardware value and set it */ CHNREG8(ch, 36) = calc_aica_pan(pan); CHNREG8(ch, 37) = 0xf; /* turn off Low Pass Filter (LPF) */ CHNREG8(ch, 40) = 0x24; - /* Convert the incoming volume and pan into hardware values */ - /* Vol starts at zero so we can ramp */ - CHNREG8(ch, 41) = 0xff; + /* Convert the incoming volume into a hardware value and set it */ + CHNREG8(ch, 41) = calc_aica_vol(vol); /* If we supported volume envelopes (which we don't yet) then this value would set that up. The top 4 bits determine the @@ -149,21 +147,15 @@ void aica_play(int ch, int delay) { also set the bits to start playback here. */ CHNREG32(ch, 4) = smpptr & 0xffff; playCont = (mode << 7) | (smpptr >> 16); - vol = calc_aica_vol(vol); if(loopflag) playCont |= 0x0200; if(delay) { CHNREG32(ch, 0) = playCont; /* key off */ - CHNREG8(ch, 41) = vol; } else { CHNREG32(ch, 0) = 0xc000 | playCont; /* key on */ - - /* ramp up the volume */ - for(i = 0xff; i >= vol; i--) - CHNREG8(ch, 41) = i; } }