From c9d4af93768bb64dd1c17cf09ce115d2787b1cba Mon Sep 17 00:00:00 2001 From: jaby Date: Wed, 7 Sep 2022 19:08:11 +0200 Subject: [PATCH] Final clean up of IOPort --- include/PSX/System/IOPorts/SPU_IO.hpp | 11 ++++++----- src/Library/src/BootLoader/boot_spu.cpp | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/PSX/System/IOPorts/SPU_IO.hpp b/include/PSX/System/IOPorts/SPU_IO.hpp index f56a2aeb..ea4ecf4a 100644 --- a/include/PSX/System/IOPorts/SPU_IO.hpp +++ b/include/PSX/System/IOPorts/SPU_IO.hpp @@ -41,8 +41,9 @@ namespace SPU { __io_port_inherit_complex_bit_map(SweepVolume); // For Volume Mode - static constexpr Bit SweepEnable = 15; // 0 Volume Mode; 1 Sweep Mode - static constexpr BitRange Volume = BitRange::from_to(0, 14); + static constexpr Bit SweepEnable = 15; // 0 Volume Mode; 1 Sweep Mode + static constexpr auto VolumeEnable = !SweepEnable; + static constexpr BitRange Volume = BitRange::from_to(0, 14); // For Sweep Mode static constexpr Bit SweepMode = 14; @@ -74,9 +75,9 @@ namespace SPU { }; struct __no_align Voice { - IOPort volumeLeft; //Offset: 0x0 - IOPort volumeRight; //Offset: 0x2 - IOPort sampleRate; //Offset: 0x4; + IOPort volumeLeft; //Offset: 0x0 + IOPort volumeRight; //Offset: 0x2 + IOPort sampleRate; //Offset: 0x4; IOPort adr; //Offset: 0x6 IOPort ad; //Offset: 0x8 IOPort sr; //Offset: 0xA diff --git a/src/Library/src/BootLoader/boot_spu.cpp b/src/Library/src/BootLoader/boot_spu.cpp index 4d2eac7e..8505efcd 100644 --- a/src/Library/src/BootLoader/boot_spu.cpp +++ b/src/Library/src/BootLoader/boot_spu.cpp @@ -10,7 +10,7 @@ namespace SPU { } static void clear_main_volume() { - static constexpr auto StartVol = SweepVolume::with(!SweepVolume::SweepEnable, SweepVolume::Volume.with(I16_MAX >> 2)); + static constexpr auto StartVol = SweepVolume::with(SweepVolume::VolumeEnable, SweepVolume::Volume.with(I16_MAX >> 2)); MainVolume::left.write(StartVol); MainVolume::right.write(StartVol);