Search
lxdream.org :: lxdream/src/aica/aica.c
lxdream 0.9.1
released Jun 29
Download Now
filename src/aica/aica.c
changeset 15:5194dd0fdb60
prev11:0a82ef380c45
next16:f383e7640da4
author nkeynes
date Mon Dec 12 13:11:11 2005 +0000 (14 years ago)
permissions -rw-r--r--
last change Add dreamcast_module module structure
view annotate diff log raw
     1 /**
     2  * $Id: aica.c,v 1.2 2005-12-12 13:11:11 nkeynes Exp $
     3  * 
     4  * This is the core sound system (ie the bit which does the actual work)
     5  *
     6  * Copyright (c) 2005 Nathan Keynes.
     7  *
     8  * This program is free software; you can redistribute it and/or modify
     9  * it under the terms of the GNU General Public License as published by
    10  * the Free Software Foundation; either version 2 of the License, or
    11  * (at your option) any later version.
    12  *
    13  * This program is distributed in the hope that it will be useful,
    14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  * GNU General Public License for more details.
    17  */
    19 #include "dream.h"
    20 #include "modules.h"
    21 #include "mem.h"
    22 #include "aica.h"
    23 #define MMIO_IMPL
    24 #include "aica.h"
    26 MMIO_REGION_READ_DEFFN( AICA0 )
    27 MMIO_REGION_READ_DEFFN( AICA1 )
    28 MMIO_REGION_READ_DEFFN( AICA2 )
    30 struct dreamcast_module aica_module = { "AICA", aica_init, aica_reset, NULL, NULL,
    31 					NULL, NULL };
    33 /**
    34  * Initialize the AICA subsystem. Note requires that 
    35  */
    36 void aica_init( void )
    37 {
    38     mem_create_ram_region( 0x00800000, 2 MB, MEM_REGION_AUDIO );
    39     mem_create_ram_region( 0x00703000, 8 KB, MEM_REGION_AUDIO_SCRATCH ); /*???*/
    40     register_io_regions( mmio_list_spu );
    41     MMIO_NOTRACE(AICA0);
    42     MMIO_NOTRACE(AICA1);
    43     arm_mem_init();
    44 }
    46 void aica_reset( void )
    47 {
    49 }
    51 /** Channel register structure:
    52  * 00
    53  * 04
    54  * 08  4  Loop start address
    55  * 0C  4  Loop end address
    56  * 10  4  Volume envelope
    57  * 14
    58  * 18  4  Frequency (floating point 
    59  * 1C
    60  * 20
    61  * 24  1  Pan
    62  * 25  1  ??
    63  * 26  
    64  * 27  
    65  * 28  1  ??
    66  * 29  1  Volume
    67  * 2C
    68  * 30
    69  * 
    71 /* Write to channels 0-31 */
    72 void mmio_region_AICA0_write( uint32_t reg, uint32_t val )
    73 {
    74     //    aica_write_channel( reg >> 7, reg % 128, val );
    76 }
    78 /* Write to channels 32-64 */
    79 void mmio_region_AICA1_write( uint32_t reg, uint32_t val )
    80 {
    81     //    aica_write_channel( (reg >> 7) + 32, reg % 128, val );
    83 }
    85 /* General registers */
    86 void mmio_region_AICA2_write( uint32_t reg, uint32_t val )
    87 {
    89 }
.