diff --git a/include/PSX/System/IOPorts/memory_io.hpp b/include/PSX/System/IOPorts/memory_io.hpp index 4a166444..fccf4f66 100644 --- a/include/PSX/System/IOPorts/memory_io.hpp +++ b/include/PSX/System/IOPorts/memory_io.hpp @@ -3,8 +3,6 @@ namespace JabyEngine { namespace Memory_IO { - using namespace Memory_IO_Values; - using CD_DELAY_IO = IOPort; using COM_DELAY_IO = IOPort; diff --git a/include/PSX/System/IOPorts/timer_io.hpp b/include/PSX/System/IOPorts/timer_io.hpp index 7d3f5a37..65ba1fbe 100644 --- a/include/PSX/System/IOPorts/timer_io.hpp +++ b/include/PSX/System/IOPorts/timer_io.hpp @@ -3,8 +3,6 @@ namespace JabyEngine { namespace Timer_IO { - using namespace Timer_IO_Values; - using CounterModeIO = IOPort; using CounterTargetIO = IOPort; using CounterValueIO = IOPort; @@ -17,14 +15,14 @@ namespace JabyEngine { uint32_t unused; inline uint16_t get_current_value() const { - return this->value.read().get(CounterValue::Value); + return this->value.read().get(Timer_IO_Values::CounterValue::Value); } inline void set_target_value(uint16_t value) { - this->target.write(CounterTarget{0}.set_range(CounterTarget::CounterTargetValue, value)); + this->target.write(Timer_IO_Values::CounterTarget{0}.set_range(Timer_IO_Values::CounterTarget::CounterTargetValue, value)); } - inline void set_mode(CounterMode mode) { + inline void set_mode(Timer_IO_Values::CounterMode mode) { this->mode.write(mode); } }; @@ -33,49 +31,49 @@ namespace JabyEngine { #pragma pack(push, 1) struct Counter0 : public Counter { struct SyncMode { - static constexpr auto Zero_At_Hblank = CounterMode::SyncMode.with(1u); - static constexpr auto Pause_During_Hblank = CounterMode::SyncMode.with(0u); - static constexpr auto Zero_At_Hblank_Pause_Outside_Hblank = CounterMode::SyncMode.with(2u); - static constexpr auto Pause_Until_Hblank_Then_Freerun = CounterMode::SyncMode.with(3u); + static constexpr auto Zero_At_Hblank = Timer_IO_Values::CounterMode::SyncMode.with(1u); + static constexpr auto Pause_During_Hblank = Timer_IO_Values::CounterMode::SyncMode.with(0u); + static constexpr auto Zero_At_Hblank_Pause_Outside_Hblank = Timer_IO_Values::CounterMode::SyncMode.with(2u); + static constexpr auto Pause_Until_Hblank_Then_Freerun = Timer_IO_Values::CounterMode::SyncMode.with(3u); }; struct Source { - static constexpr auto System_Clock = CounterMode::ClockSource.with(0u); - static constexpr auto Dot_Clock = CounterMode::ClockSource.with(1u); - static constexpr auto System_Clock_Too = CounterMode::ClockSource.with(2u); - static constexpr auto Dot_Clock_Too = CounterMode::ClockSource.with(3u); + static constexpr auto System_Clock = Timer_IO_Values::CounterMode::ClockSource.with(0u); + static constexpr auto Dot_Clock = Timer_IO_Values::CounterMode::ClockSource.with(1u); + static constexpr auto System_Clock_Too = Timer_IO_Values::CounterMode::ClockSource.with(2u); + static constexpr auto Dot_Clock_Too = Timer_IO_Values::CounterMode::ClockSource.with(3u); }; }; struct Counter1 : public Counter { struct SyncMode { - static constexpr auto Pause_During_Vblank = CounterMode::SyncMode.with(0u); - static constexpr auto Zero_At_Vblank = CounterMode::SyncMode.with(1u); - static constexpr auto Zero_At_Vblank_Pause_Outside_Vblank = CounterMode::SyncMode.with(2u); - static constexpr auto Pause_Until_Vblank_Then_FreeRun = CounterMode::SyncMode.with(3u); + static constexpr auto Pause_During_Vblank = Timer_IO_Values::CounterMode::SyncMode.with(0u); + static constexpr auto Zero_At_Vblank = Timer_IO_Values::CounterMode::SyncMode.with(1u); + static constexpr auto Zero_At_Vblank_Pause_Outside_Vblank = Timer_IO_Values::CounterMode::SyncMode.with(2u); + static constexpr auto Pause_Until_Vblank_Then_FreeRun = Timer_IO_Values::CounterMode::SyncMode.with(3u); }; struct Source { - static constexpr auto System_Clock = CounterMode::ClockSource.with(0u); - static constexpr auto Hblank = CounterMode::ClockSource.with(1u); - static constexpr auto System_Clock_Too = CounterMode::ClockSource.with(2u); - static constexpr auto Hblank_Too = CounterMode::ClockSource.with(3u); + static constexpr auto System_Clock = Timer_IO_Values::CounterMode::ClockSource.with(0u); + static constexpr auto Hblank = Timer_IO_Values::CounterMode::ClockSource.with(1u); + static constexpr auto System_Clock_Too = Timer_IO_Values::CounterMode::ClockSource.with(2u); + static constexpr auto Hblank_Too = Timer_IO_Values::CounterMode::ClockSource.with(3u); }; }; struct Counter2 : public Counter { struct SyncMode { - static constexpr auto Stop_Counter = CounterMode::SyncMode.with(0u); - static constexpr auto FreeRun = CounterMode::SyncMode.with(1u); - static constexpr auto FreeRun_Too = CounterMode::SyncMode.with(2u); - static constexpr auto Stop_Counter_Too = CounterMode::SyncMode.with(3u); + static constexpr auto Stop_Counter = Timer_IO_Values::CounterMode::SyncMode.with(0u); + static constexpr auto FreeRun = Timer_IO_Values::CounterMode::SyncMode.with(1u); + static constexpr auto FreeRun_Too = Timer_IO_Values::CounterMode::SyncMode.with(2u); + static constexpr auto Stop_Counter_Too = Timer_IO_Values::CounterMode::SyncMode.with(3u); }; struct Source { - static constexpr auto System_Clock = CounterMode::ClockSource.with(0u); - static constexpr auto System_Clock_Too = CounterMode::ClockSource.with(1u); - static constexpr auto System_Clock_Div_8 = CounterMode::ClockSource.with(2u); - static constexpr auto System_Clock_Div_8_Too = CounterMode::ClockSource.with(3u); + static constexpr auto System_Clock = Timer_IO_Values::CounterMode::ClockSource.with(0u); + static constexpr auto System_Clock_Too = Timer_IO_Values::CounterMode::ClockSource.with(1u); + static constexpr auto System_Clock_Div_8 = Timer_IO_Values::CounterMode::ClockSource.with(2u); + static constexpr auto System_Clock_Div_8_Too = Timer_IO_Values::CounterMode::ClockSource.with(3u); }; }; #pragma pack(pop) diff --git a/src/Library/src/BootLoader/cd_boot.cpp b/src/Library/src/BootLoader/cd_boot.cpp index 9d01bda3..2d91da03 100644 --- a/src/Library/src/BootLoader/cd_boot.cpp +++ b/src/Library/src/BootLoader/cd_boot.cpp @@ -22,8 +22,8 @@ namespace JabyEngine { __debug_boot_color_at(::JabyEngine::GPU::Color24::White(), DebugX, DebugY, DebugScale); SysCall::EnterCriticalSection(); - Memory_IO::COM_DELAY.write(Memory_IO::COM_DELAY::create()); - Memory_IO::CD_DELAY.write(Memory_IO::CD_DELAY::create()); + Memory_IO::COM_DELAY.write(Memory_IO_Values::COM_DELAY::create()); + Memory_IO::CD_DELAY.write(Memory_IO_Values::CD_DELAY::create()); SysCall::SysEnqIntRP(SysCall::Priority::CdromIoIrq, &::JabyEngine::CD::internal::irq_callback); diff --git a/src/Library/src/BootLoader/timer_boot.cpp b/src/Library/src/BootLoader/timer_boot.cpp index a8d833c3..76c75e15 100644 --- a/src/Library/src/BootLoader/timer_boot.cpp +++ b/src/Library/src/BootLoader/timer_boot.cpp @@ -13,6 +13,7 @@ namespace JabyEngine { void setup() { using namespace Timer_IO; + using namespace Timer_IO_Values; static constexpr auto Mode = CounterMode::from(CounterMode::FreeRun, Counter2::SyncMode::FreeRun, CounterMode::ResetAfterTarget, CounterMode::IRQAtTarget, CounterMode::IRQEveryTime, CounterMode::IRQPulse, Counter2::Source::System_Clock_Div_8);