Search
lxdream.org :: lxdream/src/aica/aica.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/aica/aica.c
changeset 463:0655796f9bb5
prev434:8af49a412d92
next465:3bd7be575792
author nkeynes
date Wed Oct 24 21:24:09 2007 +0000 (14 years ago)
permissions -rw-r--r--
last change Implement channel position readback
file annotate diff log raw
1.1 --- a/src/aica/aica.c Tue Oct 09 11:37:36 2007 +0000
1.2 +++ b/src/aica/aica.c Wed Oct 24 21:24:09 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: aica.c,v 1.23 2007-10-09 11:37:36 nkeynes Exp $
1.6 + * $Id: aica.c,v 1.24 2007-10-24 21:24:09 nkeynes Exp $
1.7 *
1.8 * This is the core sound system (ie the bit which does the actual work)
1.9 *
1.10 @@ -30,7 +30,6 @@
1.11
1.12 MMIO_REGION_READ_DEFFN( AICA0 )
1.13 MMIO_REGION_READ_DEFFN( AICA1 )
1.14 -MMIO_REGION_READ_DEFFN( AICA2 )
1.15
1.16 void aica_init( void );
1.17 void aica_reset( void );
1.18 @@ -226,6 +225,30 @@
1.19 }
1.20 }
1.21
1.22 +int32_t mmio_region_AICA2_read( uint32_t reg )
1.23 +{
1.24 + audio_channel_t channel;
1.25 + uint32_t channo;
1.26 + int32_t val;
1.27 + switch( reg ) {
1.28 + case AICA_CHANSTATE:
1.29 + channo = (MMIO_READ( AICA2, AICA_CHANSEL ) >> 8) & 0x3F;
1.30 + channel = audio_get_channel(channo);
1.31 + if( channel->loop == LOOP_LOOPED ) {
1.32 + val = 0x8000;
1.33 + channel->loop = LOOP_ON;
1.34 + } else {
1.35 + val = 0;
1.36 + }
1.37 + return val;
1.38 + case AICA_CHANPOSN:
1.39 + channo = (MMIO_READ( AICA2, AICA_CHANSEL ) >> 8) & 0x3F;
1.40 + channel = audio_get_channel(channo);
1.41 + return channel->posn;
1.42 + default:
1.43 + return MMIO_READ( AICA2, reg );
1.44 + }
1.45 +}
1.46
1.47 int32_t mmio_region_AICARTC_read( uint32_t reg )
1.48 {
1.49 @@ -332,9 +355,9 @@
1.50 case 0x00: /* Config + high address bits*/
1.51 channel->start = (channel->start & 0xFFFF) | ((val&0x1F) << 16);
1.52 if( val & 0x200 )
1.53 - channel->loop = TRUE;
1.54 + channel->loop = LOOP_ON;
1.55 else
1.56 - channel->loop = FALSE;
1.57 + channel->loop = LOOP_OFF;
1.58 switch( (val >> 7) & 0x03 ) {
1.59 case 0:
1.60 channel->sample_format = AUDIO_FMT_16BIT;
.