Nugget
Loading...
Searching...
No Matches
spu.h
Go to the documentation of this file.
1/*
2
3MIT License
4
5Copyright (c) 2019 PCSX-Redux authors
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25*/
26
27#pragma once
28
29#include "hwregs.h"
30
31struct SPUVoice {
32 uint16_t volumeLeft;
33 uint16_t volumeRight;
34 uint16_t sampleRate;
36 uint16_t ad;
37 uint16_t sr;
38 uint16_t currentVolume;
40};
41
42#define SPU_VOICES ((volatile struct SPUVoice *)0x1f801c00)
43
44#define SPU_VOL_MAIN_LEFT HW_U16(0x1f801d80)
45#define SPU_VOL_MAIN_RIGHT HW_U16(0x1f801d82)
46#define SPU_REVERB_LEFT HW_U16(0x1f801d84)
47#define SPU_REVERB_RIGHT HW_U16(0x1f801d86)
48#define SPU_KEY_ON_LOW HW_U16(0x1f801d88)
49#define SPU_KEY_ON_HIGH HW_U16(0x1f801d8a)
50#define SPU_KEY_OFF_LOW HW_U16(0x1f801d8c)
51#define SPU_KEY_OFF_HIGH HW_U16(0x1f801d8e)
52#define SPU_PITCH_MOD_LOW HW_U16(0x1f801d90)
53#define SPU_PITCH_MOD_HIGH HW_U16(0x1f801d92)
54#define SPU_NOISE_EN_LOW HW_U16(0x1f801d94)
55#define SPU_NOISE_EN_HIGH HW_U16(0x1f801d96)
56#define SPU_REVERB_EN_LOW HW_U16(0x1f801d98)
57#define SPU_REVERB_EN_HIGH HW_U16(0x1f801d9a)
58
59#define SPU_RAM_DTA HW_U16(0x1f801da6)
60#define SPU_CTRL HW_U16(0x1f801daa)
61#define SPU_RAM_DTC HW_U16(0x1f801dac)
62#define SPU_STATUS HW_U16(0x1f801dae)
63#define SPU_VOL_CD_LEFT HW_U16(0x1f801db0)
64#define SPU_VOL_CD_RIGHT HW_U16(0x1f801db2)
65#define SPU_VOL_EXT_LEFT HW_U16(0x1f801db4)
66#define SPU_VOL_EXT_RIGHT HW_U16(0x1f801db6)
67
68static __inline__ void muteSpu() {
73}
#define SPU_VOL_MAIN_LEFT
Definition spu.h:44
#define SPU_REVERB_RIGHT
Definition spu.h:47
#define SPU_VOL_MAIN_RIGHT
Definition spu.h:45
#define SPU_REVERB_LEFT
Definition spu.h:46
Definition spu.h:31
uint16_t volumeLeft
Definition spu.h:32
uint16_t ad
Definition spu.h:36
uint16_t volumeRight
Definition spu.h:33
uint16_t sr
Definition spu.h:37
uint16_t currentVolume
Definition spu.h:38
uint16_t sampleRepeatAddr
Definition spu.h:39
uint16_t sampleRate
Definition spu.h:34
uint16_t sampleStartAddr
Definition spu.h:35