Update IOPort code and prepare DMA usage - needs all testing
This commit is contained in:
@@ -42,8 +42,6 @@ namespace JabyEngine {
|
||||
return this->raw;
|
||||
}
|
||||
};
|
||||
__declare_io_value(Adr, uint16_t) {
|
||||
};
|
||||
|
||||
__declare_io_value(SampleRate, uint16_t) {
|
||||
static constexpr SampleRate from_HZ(uint32_t freq) {
|
||||
@@ -94,13 +92,13 @@ namespace JabyEngine {
|
||||
IOPort<SweepVolume> volumeLeft; //Offset: 0x0
|
||||
IOPort<SweepVolume> volumeRight; //Offset: 0x2
|
||||
IOPort<SampleRate> sampleRate; //Offset: 0x4;
|
||||
IOPort<Adr> adr; //Offset: 0x6
|
||||
IOPort<SRAM_Adr> adr; //Offset: 0x6
|
||||
IOPort<AD> ad; //Offset: 0x8
|
||||
IOPort<SR> sr; //Offset: 0xA
|
||||
IOPort<SimpleVolume> currentVolume; //Offset: 0xC
|
||||
IOPort<Adr> repeatAdr; //Offset: 0xE
|
||||
IOPort<SRAM_Adr> repeatAdr; //Offset: 0xE
|
||||
|
||||
static constexpr Adr start_adr() {
|
||||
static constexpr SRAM_Adr start_adr() {
|
||||
return {0x200};
|
||||
}
|
||||
};
|
||||
@@ -147,16 +145,16 @@ namespace JabyEngine {
|
||||
__declare_io_port_w_type(inline, SimpleVolume, Left, 0x1F801D84);
|
||||
__declare_io_port_w_type(inline, SimpleVolume, Right, 0x1F801D86);
|
||||
};
|
||||
__declare_io_port_w_type(inline, Adr, WorkAreaAdr, 0x1F801DA2);
|
||||
__declare_io_port_w_type(inline, SRAM_Adr, WorkAreaAdr, 0x1F801DA2);
|
||||
};
|
||||
|
||||
static constexpr SimpleVolume operator""_vol(long double fraction) {
|
||||
return {static_cast<int16_t>(static_cast<long double>(I16_MAX)*fraction)};
|
||||
}
|
||||
|
||||
struct SRAMTransferAddressIO : public IOPortX<SRAM_Adr, SRAM_Adr> {};
|
||||
struct SRAMTransferAddressIO : public IOPort<SRAM_Adr> {};
|
||||
|
||||
struct ControlRegisterIO : public IOPortX<SPU_IO_Values::ControlRegister> {
|
||||
struct ControlRegisterIO : public IOPort<SPU_IO_Values::ControlRegister> {
|
||||
using TransferMode = Value::RAMTransferMode;
|
||||
|
||||
void set_transfer_mode(TransferMode mode) {
|
||||
|
Reference in New Issue
Block a user