From b603cefca062d1cd061fca2ae3301c550ec1bd5c Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 24 Sep 2023 11:52:18 +0200 Subject: [PATCH] Renamee IOPort 2 functions to original --- include/PSX/System/IOPorts/cd_io.hpp | 6 +++--- include/PSX/System/IOPorts/dma_io.hpp | 2 +- include/PSX/System/IOPorts/interrupt_io.hpp | 8 ++++---- include/PSX/System/IOPorts/ioport.hpp | 18 +++++++++--------- include/PSX/System/IOPorts/timer_io.hpp | 2 +- .../internal-include/CD/cd_internal.hpp | 2 +- .../internal-include/GPU/gpu_internal.hpp | 2 +- src/Library/src/BootLoader/start_boot.cpp | 2 +- src/Library/src/CD/cd.cpp | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/PSX/System/IOPorts/cd_io.hpp b/include/PSX/System/IOPorts/cd_io.hpp index b8644bd7..992e250f 100644 --- a/include/PSX/System/IOPorts/cd_io.hpp +++ b/include/PSX/System/IOPorts/cd_io.hpp @@ -126,7 +126,7 @@ namespace JabyEngine { }; static void enable(IOPort& port) { - port.write(port.read().set2(InterruptEnable::InterruptTypValue.range_max())); + port.write(port.read().set(InterruptEnable::InterruptTypValue.range_max())); } static void enable_extended(IOPort& port) { @@ -134,11 +134,11 @@ namespace JabyEngine { } static Type get_type(const IOPort& port) { - return static_cast(port.read().get2(InterruptFlag::InterruptTypValue)); + return static_cast(port.read().get(InterruptFlag::InterruptTypValue)); } static void ack(IOPort& port) { - port.write(port.read().set2(InterruptFlag::InterruptTypValue.range_max())); + port.write(port.read().set(InterruptFlag::InterruptTypValue.range_max())); } static void ack_extended(IOPort& port) { diff --git a/include/PSX/System/IOPorts/dma_io.hpp b/include/PSX/System/IOPorts/dma_io.hpp index d61d071c..b331da6d 100644 --- a/include/PSX/System/IOPorts/dma_io.hpp +++ b/include/PSX/System/IOPorts/dma_io.hpp @@ -99,7 +99,7 @@ namespace JabyEngine { } inline void wait() { - while(this->channel_ctrl.read().is_set2(CHCHR::Busy)); + while(this->channel_ctrl.read().is_set(CHCHR::Busy)); } }; #pragma pack(pop) diff --git a/include/PSX/System/IOPorts/interrupt_io.hpp b/include/PSX/System/IOPorts/interrupt_io.hpp index 4a2fce8e..f551ba06 100644 --- a/include/PSX/System/IOPorts/interrupt_io.hpp +++ b/include/PSX/System/IOPorts/interrupt_io.hpp @@ -27,19 +27,19 @@ namespace JabyEngine { __declare_io_port(inline, Mask, 0x1F801074); static bool is_irq(Bit irq) { - return Status.read().is_set2(irq); + return Status.read().is_set(irq); } static void ack_irq(Bit irq) { - Status.write(Status.read().clear2(irq)); + Status.write(Status.read().clear(irq)); } static void disable_irq(Bit irq) { - Mask.write(Mask.read().clear2(irq)); + Mask.write(Mask.read().clear(irq)); } static void enable_irq(Bit irq) { - Mask.write(Mask.read().set2(irq)); + Mask.write(Mask.read().set(irq)); } }; } diff --git a/include/PSX/System/IOPorts/ioport.hpp b/include/PSX/System/IOPorts/ioport.hpp index 8ff6eaa5..7ea3018c 100644 --- a/include/PSX/System/IOPorts/ioport.hpp +++ b/include/PSX/System/IOPorts/ioport.hpp @@ -22,15 +22,15 @@ namespace JabyEngine { template static constexpr T from(const ARGS&...args) { - return T{0}.set2(args...); + return T{0}.set(args...); } - constexpr T& set2(Bit bit) { + constexpr T& set(Bit bit) { this->raw = bit::set(this->raw, bit); return static_cast(*this); } - constexpr T& set2(ClearBit bit) { + constexpr T& set(ClearBit bit) { this->raw = bit::set(this->raw, bit); return static_cast(*this); } @@ -41,26 +41,26 @@ namespace JabyEngine { } template - constexpr T& set2(const BitRange::RangeValuePair& value) { + constexpr T& set(const BitRange::RangeValuePair& value) { this->raw = bit::value::set_normalized(this->raw, value); return static_cast(*this); } template - constexpr T& set2(const U& head, const ARGS&...tail) { - return this->set2(head).set2(tail...); + constexpr T& set(const U& head, const ARGS&...tail) { + return this->set(head).set(tail...); } - constexpr IOValue::UnderlyingType get2(BitRange bits) const { + constexpr IOValue::UnderlyingType get(BitRange bits) const { return bit::value::get_normalized(this->raw, bits.pos, bits.length); } - constexpr T& clear2(Bit bit) { + constexpr T& clear(Bit bit) { this->raw = bit::clear(this->raw, bit); return static_cast(*this); } - constexpr bool is_set2(Bit bit) const { + constexpr bool is_set(Bit bit) const { return bit::is_set(this->raw, bit); } }; diff --git a/include/PSX/System/IOPorts/timer_io.hpp b/include/PSX/System/IOPorts/timer_io.hpp index 40ed191f..0e96ef60 100644 --- a/include/PSX/System/IOPorts/timer_io.hpp +++ b/include/PSX/System/IOPorts/timer_io.hpp @@ -40,7 +40,7 @@ namespace JabyEngine { public: inline uint16_t get_current_value() const { - return this->value.read().get2(CounterValue::Value); + return this->value.read().get(CounterValue::Value); } inline void set_target_value(uint16_t value) { diff --git a/src/Library/internal-include/CD/cd_internal.hpp b/src/Library/internal-include/CD/cd_internal.hpp index 274d8900..05d8cb8d 100644 --- a/src/Library/internal-include/CD/cd_internal.hpp +++ b/src/Library/internal-include/CD/cd_internal.hpp @@ -16,7 +16,7 @@ namespace JabyEngine { template static void send(IOPort& cmd_fifo, IOPort& parameter_fifo, CD_IO::Command::Desc cmd, ARGS...args) { - while(CD_IO::IndexStatus.read().is_set2(CD_IO::IndexStatus::IsTransmissionBusy)); + while(CD_IO::IndexStatus.read().is_set(CD_IO::IndexStatus::IsTransmissionBusy)); ((parameter_fifo.write(CD_IO::ParameterFifo{args})),...); cmd_fifo.write(CD_IO::CommandFifo {cmd.id}); diff --git a/src/Library/internal-include/GPU/gpu_internal.hpp b/src/Library/internal-include/GPU/gpu_internal.hpp index 2ed1a027..956a7f2a 100644 --- a/src/Library/internal-include/GPU/gpu_internal.hpp +++ b/src/Library/internal-include/GPU/gpu_internal.hpp @@ -27,7 +27,7 @@ namespace JabyEngine { void wait_vsync(uint8_t syncs); static void wait_ready_for_CMD() { - while(!GPU_IO::GPUSTAT.read().is_set2(GPU_IO::GPUSTAT::GP0ReadyForCMD)); + while(!GPU_IO::GPUSTAT.read().is_set(GPU_IO::GPUSTAT::GP0ReadyForCMD)); } static void set_draw_area(const PositionU16& pos) { diff --git a/src/Library/src/BootLoader/start_boot.cpp b/src/Library/src/BootLoader/start_boot.cpp index 973dbdd2..2fd13df2 100644 --- a/src/Library/src/BootLoader/start_boot.cpp +++ b/src/Library/src/BootLoader/start_boot.cpp @@ -14,7 +14,7 @@ namespace JabyEngine { namespace boot { namespace Start { static void enable_DMA() { - DMA_IO::DPCR.write(DMA_IO::DPCR.read().set2(DMA_IO::DPCR::SPUEnable, DMA_IO::DPCR::GPUEnable, DMA_IO::DPCR::CDROMEnable)); + DMA_IO::DPCR.write(DMA_IO::DPCR.read().set(DMA_IO::DPCR::SPUEnable, DMA_IO::DPCR::GPUEnable, DMA_IO::DPCR::CDROMEnable)); } static void setup() { diff --git a/src/Library/src/CD/cd.cpp b/src/Library/src/CD/cd.cpp index 61676866..f998ad34 100644 --- a/src/Library/src/CD/cd.cpp +++ b/src/Library/src/CD/cd.cpp @@ -40,7 +40,7 @@ namespace JabyEngine { static void read_sector_dma(CD_IO::DataSector& sector) { static const auto WaitSectorReady = []() { - while(!CD_IO::IndexStatus.read().is_set2(CD_IO::IndexStatus::HasDataFifoData)); + while(!CD_IO::IndexStatus.read().is_set(CD_IO::IndexStatus::HasDataFifoData)); }; static const auto ReadSector = [](uint32_t* dst) {