Search
lxdream.org :: lxdream/src/aica/aica.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/aica/aica.c
changeset 953:f4a156508ad1
prev829:517425d04f1b
next975:007bf7eb944f
author nkeynes
date Tue Jan 13 11:56:28 2009 +0000 (13 years ago)
permissions -rw-r--r--
last change Merge lxdream-mem branch back to trunk
file annotate diff log raw
1.1 --- a/src/aica/aica.c Mon Aug 25 09:16:44 2008 +0000
1.2 +++ b/src/aica/aica.c Tue Jan 13 11:56:28 2009 +0000
1.3 @@ -70,7 +70,6 @@
1.4 register_io_regions( mmio_list_spu );
1.5 MMIO_NOTRACE(AICA0);
1.6 MMIO_NOTRACE(AICA1);
1.7 - arm_mem_init();
1.8 aica_reset();
1.9 }
1.10
1.11 @@ -194,16 +193,18 @@
1.12 */
1.13
1.14 /* Write to channels 0-31 */
1.15 -void mmio_region_AICA0_write( uint32_t reg, uint32_t val )
1.16 +MMIO_REGION_WRITE_FN( AICA0, reg, val )
1.17 {
1.18 + reg &= 0xFFF;
1.19 MMIO_WRITE( AICA0, reg, val );
1.20 aica_write_channel( reg >> 7, reg % 128, val );
1.21 // DEBUG( "AICA0 Write %08X => %08X", val, reg );
1.22 }
1.23
1.24 /* Write to channels 32-64 */
1.25 -void mmio_region_AICA1_write( uint32_t reg, uint32_t val )
1.26 +MMIO_REGION_WRITE_FN( AICA1, reg, val )
1.27 {
1.28 + reg &= 0xFFF;
1.29 MMIO_WRITE( AICA1, reg, val );
1.30 aica_write_channel( (reg >> 7) + 32, reg % 128, val );
1.31 // DEBUG( "AICA1 Write %08X => %08X", val, reg );
1.32 @@ -212,10 +213,11 @@
1.33 /**
1.34 * AICA control registers
1.35 */
1.36 -void mmio_region_AICA2_write( uint32_t reg, uint32_t val )
1.37 +MMIO_REGION_WRITE_FN( AICA2, reg, val )
1.38 {
1.39 uint32_t tmp;
1.40 -
1.41 + reg &= 0xFFF;
1.42 +
1.43 switch( reg ) {
1.44 case AICA_RESET:
1.45 tmp = MMIO_READ( AICA2, AICA_RESET );
1.46 @@ -241,11 +243,12 @@
1.47 }
1.48 }
1.49
1.50 -int32_t mmio_region_AICA2_read( uint32_t reg )
1.51 +MMIO_REGION_READ_FN( AICA2, reg )
1.52 {
1.53 audio_channel_t channel;
1.54 uint32_t channo;
1.55 int32_t val;
1.56 + reg &= 0xFFF;
1.57 switch( reg ) {
1.58 case AICA_CHANSTATE:
1.59 channo = (MMIO_READ( AICA2, AICA_CHANSEL ) >> 8) & 0x3F;
1.60 @@ -266,9 +269,10 @@
1.61 }
1.62 }
1.63
1.64 -int32_t mmio_region_AICARTC_read( uint32_t reg )
1.65 +MMIO_REGION_READ_FN( AICARTC, reg )
1.66 {
1.67 int32_t rv = 0;
1.68 + reg &= 0xFFF;
1.69 switch( reg ) {
1.70 case AICA_RTCHI:
1.71 rv = (aica_state.time_of_day >> 16) & 0xFFFF;
1.72 @@ -281,9 +285,9 @@
1.73 return rv;
1.74 }
1.75
1.76 -
1.77 -void mmio_region_AICARTC_write( uint32_t reg, uint32_t val )
1.78 +MMIO_REGION_WRITE_FN( AICARTC, reg, val )
1.79 {
1.80 + reg &= 0xFFF;
1.81 switch( reg ) {
1.82 case AICA_RTCEN:
1.83 MMIO_WRITE( AICARTC, reg, val&0x01 );
.