Using new IO Port
This commit is contained in:
parent
6719250fa7
commit
f953044f23
|
@ -100,11 +100,11 @@ public:
|
|||
return this->value;
|
||||
}
|
||||
|
||||
constexpr IOPort<T>& operator=(T value) {
|
||||
constexpr void operator=(T value) {
|
||||
this->value = value;
|
||||
}
|
||||
|
||||
constexpr volatile IOPort<T>& operator=(T value) volatile {
|
||||
constexpr void operator=(T value) volatile {
|
||||
this->value = value;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
#ifndef __JABYENGINE_SPU_IO_HPP__
|
||||
#define __JABYENGINE_SPU_IO_HPP__
|
||||
#include "../../Auxiliary/io_class_helper.hpp"
|
||||
#include "IOPort.hpp"
|
||||
#include <limits.h>
|
||||
|
||||
#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<DataTransferControl*>(0x1F801DAC);
|
||||
|
||||
uint16_t raw_value = 0;
|
||||
struct DataTransferControl {
|
||||
static inline __always_inline auto& Register = *reinterpret_cast<IOPort<uint16_t>*>(0x1F801DAC);
|
||||
static inline __always_inline volatile auto& vRegister = *reinterpret_cast<IOPort<uint16_t>*>(0x1F801DAC);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -33,15 +33,7 @@ namespace SPU {
|
|||
io_class__update_with(Control::Register, Control());
|
||||
}
|
||||
|
||||
void test() {
|
||||
static __always_inline volatile auto& Dino = *reinterpret_cast<IOPort<uint16_t>*>(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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue