Continue setup SPU
This commit is contained in:
@@ -1,23 +1,32 @@
|
||||
#include <PSX/System/IOPorts/SPU_IO.hpp>
|
||||
|
||||
namespace SPU {
|
||||
static void clear_voice(Voice& voice) {
|
||||
io_class__volatile_assign(voice.volumeLeft, SweepVolume());
|
||||
io_class__volatile_assign(voice.volumeRight, SweepVolume());
|
||||
static void clear_main_volume() {
|
||||
static constexpr auto StartVol = SweepVolume().set_volume_mode().set_volume_percent(50.0);
|
||||
|
||||
io_class__volatile_assign(voice.sampleRate, SampleRate::from_HZ(0.0));
|
||||
io_class__volatile_assign(voice.adsr, ADSR());
|
||||
io_class__volatile_assign(voice.currentVolume, SweepVolume());
|
||||
io_class__update_with(MainVolume::Left, StartVol);
|
||||
io_class__update_with(MainVolume::Right, StartVol);
|
||||
}
|
||||
|
||||
static void clear_keys() {
|
||||
io_class__update_with(Key::off, KeyW::All1());
|
||||
}
|
||||
|
||||
static void clear_voice(Voice& voice) {
|
||||
io_class__update_with(voice.volumeLeft, SweepVolume());
|
||||
io_class__update_with(voice.volumeRight, SweepVolume());
|
||||
|
||||
io_class__update_with(voice.sampleRate, SampleRate::from_HZ(0.0));
|
||||
io_class__update_with(voice.adsr, ADSR());
|
||||
io_class__update_with(voice.currentVolume, SweepVolume());
|
||||
|
||||
voice.adr = 0x200;
|
||||
voice.repeatAdr = 0x200;
|
||||
}
|
||||
|
||||
void setup() {
|
||||
static constexpr auto StartVol = SweepVolume().set_volume_mode().set_volume_percent(50.0);
|
||||
|
||||
io_class__volatile_assign(MainVolume::Left, StartVol);
|
||||
io_class__volatile_assign(MainVolume::Right, StartVol);
|
||||
clear_main_volume();
|
||||
clear_keys();
|
||||
|
||||
for(auto& voice : Voice::Channel) {
|
||||
clear_voice(voice);
|
||||
|
Reference in New Issue
Block a user