Search
lxdream.org :: lxdream/src/aica/aica.c
lxdream 0.9.1
released Jun 29
Download Now
filename src/aica/aica.c
changeset 16:f383e7640da4
prev15:5194dd0fdb60
next23:1ec3acd0594d
author nkeynes
date Tue Dec 13 12:17:26 2005 +0000 (15 years ago)
permissions -rw-r--r--
last change Cleanup init config => dreamcast_config
file annotate diff log raw
nkeynes@11
     1
/**
nkeynes@16
     2
 * $Id: aica.c,v 1.3 2005-12-13 12:17:26 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@11
    38
    register_io_regions( mmio_list_spu );
nkeynes@11
    39
    MMIO_NOTRACE(AICA0);
nkeynes@11
    40
    MMIO_NOTRACE(AICA1);
nkeynes@11
    41
    arm_mem_init();
nkeynes@11
    42
}
nkeynes@11
    43
nkeynes@11
    44
void aica_reset( void )
nkeynes@11
    45
{
nkeynes@11
    46
nkeynes@11
    47
}
nkeynes@11
    48
nkeynes@11
    49
/** Channel register structure:
nkeynes@11
    50
 * 00
nkeynes@11
    51
 * 04
nkeynes@11
    52
 * 08  4  Loop start address
nkeynes@11
    53
 * 0C  4  Loop end address
nkeynes@11
    54
 * 10  4  Volume envelope
nkeynes@11
    55
 * 14
nkeynes@11
    56
 * 18  4  Frequency (floating point 
nkeynes@11
    57
 * 1C
nkeynes@11
    58
 * 20
nkeynes@11
    59
 * 24  1  Pan
nkeynes@11
    60
 * 25  1  ??
nkeynes@11
    61
 * 26  
nkeynes@11
    62
 * 27  
nkeynes@11
    63
 * 28  1  ??
nkeynes@11
    64
 * 29  1  Volume
nkeynes@11
    65
 * 2C
nkeynes@11
    66
 * 30
nkeynes@11
    67
 * 
nkeynes@11
    68
nkeynes@11
    69
/* Write to channels 0-31 */
nkeynes@11
    70
void mmio_region_AICA0_write( uint32_t reg, uint32_t val )
nkeynes@11
    71
{
nkeynes@11
    72
    //    aica_write_channel( reg >> 7, reg % 128, val );
nkeynes@11
    73
nkeynes@11
    74
}
nkeynes@11
    75
nkeynes@11
    76
/* Write to channels 32-64 */
nkeynes@11
    77
void mmio_region_AICA1_write( uint32_t reg, uint32_t val )
nkeynes@11
    78
{
nkeynes@11
    79
    //    aica_write_channel( (reg >> 7) + 32, reg % 128, val );
nkeynes@11
    80
nkeynes@11
    81
}
nkeynes@11
    82
nkeynes@11
    83
/* General registers */
nkeynes@11
    84
void mmio_region_AICA2_write( uint32_t reg, uint32_t val )
nkeynes@11
    85
{
nkeynes@11
    86
nkeynes@11
    87
}
.