36 lines
1.2 KiB
C++
36 lines
1.2 KiB
C++
#include <PSX/SPU/SPU_Ports.hpp>
|
|
#include <stdio.h>
|
|
|
|
namespace JabyEngine {
|
|
namespace SPU {
|
|
static void clear_voice(::SPU::Voice& voice) {
|
|
io_class__volatile_assign(voice.volumeLeft, ::SPU::SweepVolume());
|
|
io_class__volatile_assign(voice.volumeRight, ::SPU::SweepVolume());
|
|
|
|
io_class__volatile_assign(voice.sampleRate, ::SPU::SampleRate::from_HZ(0.0));
|
|
io_class__volatile_assign(voice.adsr, ::SPU::ADSR());
|
|
io_class__volatile_assign(voice.currentVolume, ::SPU::SweepVolume());
|
|
|
|
voice.adr = 0x200;
|
|
voice.repeatAdr = 0x200;
|
|
}
|
|
|
|
static void setup() {
|
|
static constexpr auto StartVol = ::SPU::SweepVolume().set_volume_mode().set_volume_percent(50.0);
|
|
|
|
io_class__volatile_assign(::SPU::MainVolume::Left, StartVol);
|
|
io_class__volatile_assign(::SPU::MainVolume::Right, StartVol);
|
|
|
|
for(auto& voice : ::SPU::Voice::Channel) {
|
|
clear_voice(voice);
|
|
}
|
|
}
|
|
}
|
|
|
|
void start() {
|
|
printf("Hello Planschbecken\n");
|
|
|
|
SPU::setup();
|
|
printf("Setup done!\n");
|
|
}
|
|
} |