diff --git a/include/PSX/System/IOPorts/IOPort.hpp b/include/PSX/System/IOPorts/IOPort.hpp index d44651c2..82ee1ed8 100644 --- a/include/PSX/System/IOPorts/IOPort.hpp +++ b/include/PSX/System/IOPorts/IOPort.hpp @@ -100,11 +100,11 @@ public: return this->value; } - constexpr IOPort& operator=(T value) { + constexpr void operator=(T value) { this->value = value; } - constexpr volatile IOPort& operator=(T value) volatile { + constexpr void operator=(T value) volatile { this->value = value; } }; diff --git a/include/PSX/System/IOPorts/SPU_IO.hpp b/include/PSX/System/IOPorts/SPU_IO.hpp index a2cff798..94711dd3 100644 --- a/include/PSX/System/IOPorts/SPU_IO.hpp +++ b/include/PSX/System/IOPorts/SPU_IO.hpp @@ -1,8 +1,10 @@ #ifndef __JABYENGINE_SPU_IO_HPP__ #define __JABYENGINE_SPU_IO_HPP__ -#include "../../Auxiliary/io_class_helper.hpp" +#include "IOPort.hpp" #include +#include "../../Auxiliary/io_class_helper.hpp" + namespace SPU { struct __no_align ubus32_t { @@ -213,10 +215,9 @@ namespace SPU { io_class__2option_map_getter_is(bool, cd_audio_disable, cd_audio_enable, 0); }; - struct __no_align DataTransferControl { - static inline __always_inline auto& Register = *reinterpret_cast(0x1F801DAC); - - uint16_t raw_value = 0; + struct DataTransferControl { + static inline __always_inline auto& Register = *reinterpret_cast*>(0x1F801DAC); + static inline __always_inline volatile auto& vRegister = *reinterpret_cast*>(0x1F801DAC); }; } diff --git a/src/Library/src/BootLoader/boot_spu.cpp b/src/Library/src/BootLoader/boot_spu.cpp index 0970f2e4..15870d31 100644 --- a/src/Library/src/BootLoader/boot_spu.cpp +++ b/src/Library/src/BootLoader/boot_spu.cpp @@ -33,15 +33,7 @@ namespace SPU { io_class__update_with(Control::Register, Control()); } - void test() { - static __always_inline volatile auto& Dino = *reinterpret_cast*>(0x120); - - while(Dino.is_bit_set(0)); - } - void setup() { - test(); - clear_main_volume(); clear_keys(); disable_control(); @@ -50,7 +42,7 @@ namespace SPU { clear_voice(voice); } - io_class__update_with(DataTransferControl::Register, (2 << 1)); + DataTransferControl::Register = (2 << 1); enable_control(); } } \ No newline at end of file