Support 'with'

This commit is contained in:
Jaby
2022-09-05 22:35:38 +02:00
parent 34876bf23e
commit beb3d6cb86
2 changed files with 31 additions and 11 deletions

View File

@@ -10,7 +10,7 @@ namespace SPU {
}
static void clear_main_volume() {
static constexpr auto StartVol = SweepVolume().set(!SweepVolume::SweepEnable).set(SweepVolume::Volume, I16_MAX >> 2);
static constexpr auto StartVol = SweepVolume::with(!SweepVolume::SweepEnable, SweepVolume::Volume.with(I16_MAX >> 2));
MainVolume::left.write(StartVol);
MainVolume::right.write(StartVol);
@@ -58,7 +58,7 @@ namespace SPU {
}
static void setup_control_register() {
static constexpr auto SetupValue = ControlRegister().set(ControlRegister::Enable).set(ControlRegister::Unmute).set(ControlRegister::CDAudioEnable);
static constexpr auto SetupValue = ControlRegister::with(ControlRegister::Enable, ControlRegister::Unmute, ControlRegister::CDAudioEnable);
Control.write(SetupValue);
}