Almost finished setup SPU

This commit is contained in:
2022-09-02 18:05:21 +02:00
parent cf663aee73
commit 16bf7ac465
2 changed files with 85 additions and 10 deletions

View File

@@ -74,14 +74,14 @@ namespace SPU {
};
struct __no_align Voice {
SweepVolume volumeLeft;
SweepVolume volumeRight;
SampleRate sampleRate;
IOPort<uint16_t> adr;
IOPort<AD> ad;
IOPort<SR> sr;
IOPort<SweepVolume> currentVolume; //Not used
IOPort<uint16_t> repeatAdr;
SweepVolume volumeLeft; //Offset: 0x0
SweepVolume volumeRight; //Offset: 0x2
SampleRate sampleRate; //Offset: 0x4;
IOPort<uint16_t> adr; //Offset: 0x6
IOPort<AD> ad; //Offset: 0x8
IOPort<SR> sr; //Offset: 0xA
IOPort<SweepVolume> currentVolume; //Offset: 0xC
IOPort<uint16_t> repeatAdr; //Offset: 0xE
};
struct __no_align ControlRegister : public IOPort<uint16_t> {
@@ -107,6 +107,24 @@ namespace SPU {
static constexpr Bit<uint16_t> CDAudioEnable = 0;
};
struct __no_align PitchModFlags : public IOPort<uint16_t> {
__io_port_inherit(PitchModFlags);
static constexpr BitRange<uint16_t> EnableBits = BitRange<uint16_t>::from_to(1, 23);
};
struct __no_align NoiseGenerator : public IOPort<uint16_t> {
__io_port_inherit(NoiseGenerator);
static constexpr BitRange<uint16_t> NoiseBits = BitRange<uint16_t>::from_to(0, 23);
};
struct __no_align EchoOn : public IOPort<uint16_t> {
__io_port_inherit(EchoOn);
static constexpr BitRange<uint16_t> EchoBits = BitRange<uint16_t>::from_to(0, 23);
};
static constexpr size_t VoiceCount = 24;
namespace Key {
@@ -120,8 +138,31 @@ namespace SPU {
__declare_io_port_global(SweepVolume, right, 0x1F801D82);
}
__declare_io_port_global(ControlRegister, Control, 0x1F801DAA);
__declare_io_port_global_array(Voice, Voices, 0x1F801C00, VoiceCount);
namespace CDVolume {
__declare_io_port_global(int16_t, left, 0x1F801DB0);
__declare_io_port_global(int16_t, right, 0x1F801DB2);
}
namespace ExternalAudioInputVolume {
__declare_io_port_global(int16_t, left, 0x1F801DB4);
__declare_io_port_global(int16_t, right, 0x1F801DB6);
}
namespace Reverb {
namespace Volume {
__declare_io_port_global(int16_t, left, 0x1F801D84);
__declare_io_port_global(int16_t, right, 0x1F801D86);
}
__declare_io_port_global(uint16_t, work_area_adr, 0x1F801DA2);
}
__declare_io_port_global(ControlRegister, Control, 0x1F801DAA);
__declare_io_port_global(uint16_t, DataTransferControl, 0x1F801DAC);
__declare_io_port_global(PitchModFlags, PMON, 0x1F801D90);
__declare_io_port_global(NoiseGenerator, NON, 0x1F801D94);
__declare_io_port_global(EchoOn, EON, 0x1F801D98);
__declare_io_port_global_array(Voice, Voices, 0x1F801C00, VoiceCount);
}
}