Renamee IOPort 2 functions to original

This commit is contained in:
jaby 2023-09-24 11:52:18 +02:00
parent fb9e346e51
commit a9da459823
9 changed files with 22 additions and 22 deletions

View File

@ -126,7 +126,7 @@ namespace JabyEngine {
};
static void enable(IOPort<InterruptEnable>& port) {
port.write(port.read().set2(InterruptEnable::InterruptTypValue.range_max<uint8_t>()));
port.write(port.read().set(InterruptEnable::InterruptTypValue.range_max<uint8_t>()));
}
static void enable_extended(IOPort<InterruptEnable>& port) {
@ -134,11 +134,11 @@ namespace JabyEngine {
}
static Type get_type(const IOPort<InterruptFlag>& port) {
return static_cast<Type>(port.read().get2(InterruptFlag::InterruptTypValue));
return static_cast<Type>(port.read().get(InterruptFlag::InterruptTypValue));
}
static void ack(IOPort<InterruptFlag>& port) {
port.write(port.read().set2(InterruptFlag::InterruptTypValue.range_max<uint8_t>()));
port.write(port.read().set(InterruptFlag::InterruptTypValue.range_max<uint8_t>()));
}
static void ack_extended(IOPort<InterruptFlag>& port) {

View File

@ -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)

View File

@ -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));
}
};
}

View File

@ -22,15 +22,15 @@ namespace JabyEngine {
template<typename...ARGS>
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<T&>(*this);
}
constexpr T& set2(ClearBit bit) {
constexpr T& set(ClearBit bit) {
this->raw = bit::set(this->raw, bit);
return static_cast<T&>(*this);
}
@ -41,26 +41,26 @@ namespace JabyEngine {
}
template<typename U>
constexpr T& set2(const BitRange::RangeValuePair<U>& value) {
constexpr T& set(const BitRange::RangeValuePair<U>& value) {
this->raw = bit::value::set_normalized(this->raw, value);
return static_cast<T&>(*this);
}
template<typename U, typename...ARGS>
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<T, S>::UnderlyingType get2(BitRange bits) const {
constexpr IOValue<T, S>::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<T&>(*this);
}
constexpr bool is_set2(Bit bit) const {
constexpr bool is_set(Bit bit) const {
return bit::is_set(this->raw, bit);
}
};

View File

@ -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) {

View File

@ -16,7 +16,7 @@ namespace JabyEngine {
template<typename...ARGS>
static void send(IOPort<CD_IO::CommandFifo>& cmd_fifo, IOPort<CD_IO::ParameterFifo>& 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});

View File

@ -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) {

View File

@ -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() {

View File

@ -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) {