|
| 1 | +/* |
| 2 | +# _____ ___ ____ ___ ____ |
| 3 | +# ____| | ____| | | |____| |
| 4 | +# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
| 5 | +#----------------------------------------------------------------------- |
| 6 | +# Copyright ps2dev - http://www.ps2dev.org |
| 7 | +# Licenced under Academic Free License version 2.0 |
| 8 | +# Review ps2sdk README & LICENSE files for further details. |
| 9 | +*/ |
| 10 | + |
| 11 | +/** |
| 12 | + * @file |
| 13 | + * Definitions for memory-mapped I/O for SPU2. |
| 14 | + */ |
| 15 | + |
| 16 | +#ifndef __SPU2_MMIO_HWPORT__ |
| 17 | +#define __SPU2_MMIO_HWPORT__ |
| 18 | + |
| 19 | +typedef struct spu2_u16pair_ |
| 20 | +{ |
| 21 | + vu16 m_pair[2]; |
| 22 | +} spu2_u16pair_t; |
| 23 | + |
| 24 | +typedef struct spu2_voice_params_ |
| 25 | +{ |
| 26 | + vu16 m_voll; |
| 27 | + vu16 m_volr; |
| 28 | + vu16 m_pitch; |
| 29 | + vu16 m_adsr1; |
| 30 | + vu16 m_adsr2; |
| 31 | + vu16 m_envx; |
| 32 | + vu16 m_volxl; |
| 33 | + vu16 m_volxr; |
| 34 | +} spu2_voice_params_t; |
| 35 | + |
| 36 | +typedef struct spu2_voice_address_ |
| 37 | +{ |
| 38 | + spu2_u16pair_t m_ssa; |
| 39 | + spu2_u16pair_t m_lsax; |
| 40 | + spu2_u16pair_t m_nax; |
| 41 | +} spu2_voice_address_t; |
| 42 | + |
| 43 | +typedef struct spu2_core_regs_ |
| 44 | +{ |
| 45 | + spu2_voice_params_t m_voice_params[24]; /* 0x000 */ |
| 46 | + spu2_u16pair_t m_pmon; /* 0x180 */ |
| 47 | + spu2_u16pair_t m_non; /* 0x184 */ |
| 48 | + spu2_u16pair_t m_vmixl; /* 0x188 */ |
| 49 | + spu2_u16pair_t m_vmixel; /* 0x18c */ |
| 50 | + spu2_u16pair_t m_vmixr; /* 0x190 */ |
| 51 | + spu2_u16pair_t m_vmixer; /* 0x194 */ |
| 52 | + vu16 m_mmix; /* 0x198 */ |
| 53 | + vu16 m_attr; /* 0x19a */ |
| 54 | + spu2_u16pair_t m_irqa; /* 0x19c */ |
| 55 | + spu2_u16pair_t m_kon; /* 0x1a0 */ |
| 56 | + spu2_u16pair_t m_koff; /* 0x1a4 */ |
| 57 | + spu2_u16pair_t m_tsa; /* 0x1a8 */ |
| 58 | + vu16 m_xferdata; /* 0x1ac */ |
| 59 | + vu16 m_unk1ae; /* 0x1ae */ |
| 60 | + vu16 m_admas; /* 0x1b0 */ |
| 61 | + vu16 unk1b2[7]; /* 0x1b2 */ |
| 62 | + spu2_voice_address_t m_voice_address[24]; /* 0x1c0 */ |
| 63 | + spu2_u16pair_t m_esa; /* 0x2e0 */ |
| 64 | + spu2_u16pair_t m_apf1_size; /* 0x2e4 */ |
| 65 | + spu2_u16pair_t m_apf2_size; /* 0x2e8 */ |
| 66 | + spu2_u16pair_t m_same_l_dst; /* 0x2EC */ |
| 67 | + spu2_u16pair_t m_same_r_dst; /* 0x2F0 */ |
| 68 | + spu2_u16pair_t m_comb1_l_src; /* 0x2F4 */ |
| 69 | + spu2_u16pair_t m_comb1_r_src; /* 0x2F8 */ |
| 70 | + spu2_u16pair_t m_comb2_l_src; /* 0x2FC */ |
| 71 | + spu2_u16pair_t m_comb2_r_src; /* 0x300 */ |
| 72 | + spu2_u16pair_t m_same_l_src; /* 0x304 */ |
| 73 | + spu2_u16pair_t m_same_r_src; /* 0x308 */ |
| 74 | + spu2_u16pair_t m_diff_l_dst; /* 0x30C */ |
| 75 | + spu2_u16pair_t m_diff_r_dst; /* 0x310 */ |
| 76 | + spu2_u16pair_t m_comb3_l_src; /* 0x314 */ |
| 77 | + spu2_u16pair_t m_comb3_r_src; /* 0x318 */ |
| 78 | + spu2_u16pair_t m_comb4_l_src; /* 0x31C */ |
| 79 | + spu2_u16pair_t m_comb4_r_src; /* 0x320 */ |
| 80 | + spu2_u16pair_t m_diff_l_src; /* 0x324 */ |
| 81 | + spu2_u16pair_t m_diff_r_src; /* 0x328 */ |
| 82 | + spu2_u16pair_t m_apf1_l_dst; /* 0x32C */ |
| 83 | + spu2_u16pair_t m_apf1_r_dst; /* 0x330 */ |
| 84 | + spu2_u16pair_t m_apf2_l_dst; /* 0x334 */ |
| 85 | + spu2_u16pair_t m_apf2_r_dst; /* 0x338 */ |
| 86 | + vu16 m_eea; /* 0x33C */ |
| 87 | + vu16 unk33e; /* 0x33E */ |
| 88 | + spu2_u16pair_t m_endx; /* 0x340 */ |
| 89 | + vu16 m_statx; /* 0x344 */ |
| 90 | + vu16 unk346[13]; /* 0x346 */ |
| 91 | +} spu2_core_regs_t; |
| 92 | + |
| 93 | +typedef struct spu2_different_regs_ |
| 94 | +{ |
| 95 | + vu16 m_mvoll; /* 0x760 */ |
| 96 | + vu16 m_mvolr; /* 0x762 */ |
| 97 | + vu16 m_evoll; /* 0x764 */ |
| 98 | + vu16 m_evolr; /* 0x766 */ |
| 99 | + vu16 m_avoll; /* 0x768 */ |
| 100 | + vu16 m_avolr; /* 0x76A */ |
| 101 | + vu16 m_bvoll; /* 0x76C */ |
| 102 | + vu16 m_bvolr; /* 0x76E */ |
| 103 | + vu16 m_mvolxl; /* 0x770 */ |
| 104 | + vu16 m_mvolxr; /* 0x772 */ |
| 105 | + vu16 m_iir_vol; /* 0x774 */ |
| 106 | + vu16 m_comb1_vol; /* 0x776 */ |
| 107 | + vu16 m_comb2_vol; /* 0x778 */ |
| 108 | + vu16 m_comb3_vol; /* 0x77A */ |
| 109 | + vu16 m_comb4_vol; /* 0x77C */ |
| 110 | + vu16 m_wall_vol; /* 0x77E */ |
| 111 | + vu16 m_apf1_vol; /* 0x780 */ |
| 112 | + vu16 m_apf2_vol; /* 0x782 */ |
| 113 | + vu16 m_in_coef_l; /* 0x784 */ |
| 114 | + vu16 m_in_coef_r; /* 0x786 */ |
| 115 | +} spu2_different_regs_t; |
| 116 | + |
| 117 | +typedef struct spu2_core_regs_padded_ |
| 118 | +{ |
| 119 | + spu2_core_regs_t m_cregs; |
| 120 | + vu16 padding[80]; |
| 121 | +} spu2_core_regs_padded_t; |
| 122 | + |
| 123 | +typedef struct spu2_regs_main_ |
| 124 | +{ |
| 125 | + spu2_core_regs_padded_t m_core_regs[2]; |
| 126 | +} spu2_regs_main_t; |
| 127 | + |
| 128 | +typedef struct spu2_regs_extra_ |
| 129 | +{ |
| 130 | + spu2_core_regs_t core0_regs; |
| 131 | + vu16 padding346[80]; |
| 132 | + spu2_core_regs_t core1_regs; /* 0x400 */ |
| 133 | + spu2_different_regs_t m_different_regs[2]; |
| 134 | + vu16 unk7b0[8]; |
| 135 | + vu16 m_spdif_out; /* 0x7c0 */ |
| 136 | + vu16 m_spdif_irqinfo; /* 0x7c2 */ |
| 137 | + vu16 unk7c4; /* 0x7c4 */ |
| 138 | + vu16 m_spdif_mode; /* 0x7c6 */ |
| 139 | + vu16 m_spdif_media; /* 0x7c8 */ |
| 140 | + vu16 m_unknown7ca; /* 0x7ca */ |
| 141 | + vu16 m_spdif_protect; /* 0x7cc */ |
| 142 | + vu16 unk7ce[25]; |
| 143 | +} spu2_regs_extra_t; |
| 144 | + |
| 145 | +typedef struct spu2_mmio_hwport_ /* base => 0xBF900000 */ |
| 146 | +{ |
| 147 | + union spu2_regs_union_ |
| 148 | + { |
| 149 | + spu2_regs_main_t m_m; |
| 150 | + spu2_regs_extra_t m_e; |
| 151 | + } m_u; |
| 152 | +} spu2_mmio_hwport_t; |
| 153 | + |
| 154 | +#if !defined(USE_SPU2_MMIO_HWPORT) && defined(_IOP) |
| 155 | +// cppcheck-suppress-macro constVariablePointer |
| 156 | +#define USE_SPU2_MMIO_HWPORT() spu2_mmio_hwport_t *const spu2_mmio_hwport = (spu2_mmio_hwport_t *)0xBF900000 |
| 157 | +#endif |
| 158 | +#if !defined(USE_SPU2_MMIO_HWPORT) |
| 159 | +#define USE_SPU2_MMIO_HWPORT() |
| 160 | +#endif |
| 161 | + |
| 162 | +#endif /* __SPU2_MMIO_HWPORT__ */ |
0 commit comments