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