Improve IOPort code
This commit is contained in:
@@ -10,7 +10,7 @@ namespace SPU {
|
||||
}
|
||||
|
||||
static void clear_main_volume() {
|
||||
static constexpr auto StartVol = SweepVolume() | !SweepVolume::SweepEnable | (SweepVolume::Volume << static_cast<int16_t>(I16_MAX >> 2));
|
||||
static constexpr auto StartVol = SweepVolume().set(!SweepVolume::SweepEnable).set(SweepVolume::Volume, 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() | ControlRegister::Enable | ControlRegister::Unmute | ControlRegister::CDAudioEnable;
|
||||
static constexpr auto SetupValue = ControlRegister().set(ControlRegister::Enable).set(ControlRegister::Unmute).set(ControlRegister::CDAudioEnable);
|
||||
|
||||
Control.write(SetupValue);
|
||||
}
|
||||
@@ -84,5 +84,6 @@ namespace SPU {
|
||||
|
||||
// Enable SPU DMA
|
||||
DPCR.write(DPCR.read() | DMAControlRegister::SPUEnable);
|
||||
while(!DPCR.read().is_bit_set(DMAControlRegister::SPUEnable));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user