Improve readability of code slightly

This commit is contained in:
Jaby
2023-03-21 21:51:56 +01:00
committed by Jaby
parent 94f12db6f8
commit 163662ba75
11 changed files with 127 additions and 117 deletions

View File

@@ -11,8 +11,8 @@ namespace JabyEngine {
static void clear_main_volume() {
static constexpr auto StartVol = SweepVolume_t::from(SweepVolume_t::VolumeEnable, SweepVolume_t::Volume.with(static_cast<int16_t>(I16_MAX >> 2)));
MainVolume::Left = *StartVol;
MainVolume::Right = *StartVol;
MainVolume::Left = StartVol;
MainVolume::Right = StartVol;
}
static void clear_cd_and_ext_audio_volume() {
@@ -29,11 +29,11 @@ namespace JabyEngine {
static void clear_voice() {
for(auto& voice : SPU_IO::Voice) {
voice.volumeLeft = *SweepVolume_t();
voice.volumeRight = *SweepVolume_t();
voice.sampleRate = *SampleRate_t();
voice.ad = *AD_t();
voice.sr = *SR_t();
voice.volumeLeft = SweepVolume_t();
voice.volumeRight = SweepVolume_t();
voice.sampleRate = SampleRate_t();
voice.ad = AD_t();
voice.sr = SR_t();
voice.currentVolume = 0;
voice.adr = 0x200;
@@ -42,12 +42,12 @@ namespace JabyEngine {
}
static void clear_pmon() {
SPU_IO::PMON = *PMON_t();
SPU_IO::PMON = PMON_t();
}
static void clear_noise_and_echo() {
SPU_IO::NON = *NON_t();
SPU_IO::EON = *EON_t();
SPU_IO::NON = NON_t();
SPU_IO::EON = EON_t();
}
static void clear_reverb() {
@@ -59,7 +59,7 @@ namespace JabyEngine {
static void setup_control_register() {
static constexpr auto SetupValue = ControlRegister_t::from(ControlRegister_t::Enable, ControlRegister_t::Unmute, ControlRegister_t::CDAudioEnable);
SPU_IO::ControlRegister = *SetupValue;
SPU_IO::ControlRegister = SetupValue;
}
static void setup_data_transfer_control() {