Search
lxdream.org :: lxdream/src/aica/aica.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/aica/aica.c
changeset 434:8af49a412d92
prev431:248dd77a9e44
next463:0655796f9bb5
author nkeynes
date Tue Oct 09 11:37:36 2007 +0000 (14 years ago)
permissions -rw-r--r--
last change Fix ADPCM (to some degree at least)
Fix key-on/off (triggers all channels at once)
file annotate diff log raw
1.1 --- a/src/aica/aica.c Tue Oct 09 08:12:29 2007 +0000
1.2 +++ b/src/aica/aica.c Tue Oct 09 11:37:36 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: aica.c,v 1.22 2007-10-09 08:11:51 nkeynes Exp $
1.6 + * $Id: aica.c,v 1.23 2007-10-09 11:37:36 nkeynes Exp $
1.7 *
1.8 * This is the core sound system (ie the bit which does the actual work)
1.9 *
1.10 @@ -289,6 +289,19 @@
1.11 return rate;
1.12 }
1.13
1.14 +void aica_start_stop_channels()
1.15 +{
1.16 + int i;
1.17 + for( i=0; i<32; i++ ) {
1.18 + uint32_t val = MMIO_READ( AICA0, i<<7 );
1.19 + audio_start_stop_channel(i, val&0x4000);
1.20 + }
1.21 + for( ; i<64; i++ ) {
1.22 + uint32_t val = MMIO_READ( AICA1, (i-32)<<7 );
1.23 + audio_start_stop_channel(i, val&0x4000);
1.24 + }
1.25 +}
1.26 +
1.27 /**
1.28 * Derived directly from Dan Potter's log table
1.29 */
1.30 @@ -334,16 +347,8 @@
1.31 channel->sample_format = AUDIO_FMT_ADPCM;
1.32 break;
1.33 }
1.34 - switch( (val >> 14) & 0x03 ) {
1.35 - case 2:
1.36 - audio_stop_channel( channelNo );
1.37 - break;
1.38 - case 3:
1.39 - audio_start_channel( channelNo );
1.40 - break;
1.41 - default:
1.42 - break;
1.43 - /* Hrmm... */
1.44 + if( val & 0x8000 ) {
1.45 + aica_start_stop_channels();
1.46 }
1.47 break;
1.48 case 0x04: /* Low 16 address bits */
.