Search
lxdream.org :: lxdream/src/aica/aica.c
lxdream 0.9.1
released Jun 29
Download Now
filename src/aica/aica.c
changeset 23:1ec3acd0594d
prev16:f383e7640da4
next30:89b30313d757
author nkeynes
date Fri Dec 23 11:44:55 2005 +0000 (15 years ago)
permissions -rw-r--r--
last change Start of "real" time slices, general structure in place now
view annotate diff log raw
     1 /**
     2  * $Id: aica.c,v 1.4 2005-12-23 11:44:55 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 void aica_init( void );
    31 void aica_reset( void );
    32 void aica_start( void );
    33 void aica_stop( void );
    34 void aica_run_slice( int );
    37 struct dreamcast_module aica_module = { "AICA", aica_init, aica_reset, 
    38 					aica_start, aica_run_slice, aica_stop,
    39 					NULL, NULL, NULL };
    41 /**
    42  * Initialize the AICA subsystem. Note requires that 
    43  */
    44 void aica_init( void )
    45 {
    46     register_io_regions( mmio_list_spu );
    47     MMIO_NOTRACE(AICA0);
    48     MMIO_NOTRACE(AICA1);
    49     arm_mem_init();
    50 }
    52 void aica_reset( void )
    53 {
    55 }
    57 void aica_start( void )
    58 {
    60 }
    62 void aica_run_slice( int microsecs )
    63 {
    64     /* Run arm instructions */
    65     /* Generate audio buffer */
    66 }
    68 void aica_stop( void )
    69 {
    71 }
    73 /** Channel register structure:
    74  * 00
    75  * 04
    76  * 08  4  Loop start address
    77  * 0C  4  Loop end address
    78  * 10  4  Volume envelope
    79  * 14
    80  * 18  4  Frequency (floating point 
    81  * 1C
    82  * 20
    83  * 24  1  Pan
    84  * 25  1  ??
    85  * 26  
    86  * 27  
    87  * 28  1  ??
    88  * 29  1  Volume
    89  * 2C
    90  * 30
    91  * 
    93 /* Write to channels 0-31 */
    94 void mmio_region_AICA0_write( uint32_t reg, uint32_t val )
    95 {
    96     //    aica_write_channel( reg >> 7, reg % 128, val );
    98 }
   100 /* Write to channels 32-64 */
   101 void mmio_region_AICA1_write( uint32_t reg, uint32_t val )
   102 {
   103     //    aica_write_channel( (reg >> 7) + 32, reg % 128, val );
   105 }
   107 /* General registers */
   108 void mmio_region_AICA2_write( uint32_t reg, uint32_t val )
   109 {
   111 }
.