This commit is contained in:
2024-09-22 14:29:05 +02:00
parent efd887268b
commit f138ca9a9d
3 changed files with 48 additions and 13 deletions

View File

@@ -104,18 +104,16 @@ namespace JabyEngine {
};
#pragma pack(pop)
// TODO: This is ubus32_t
__declare_io_value(PMON, uint16_t) {
static constexpr auto EnableBits = BitRange::from_to(1, 23);
};
// TODO: This is ubus32_t
__declare_io_value(NON, uint16_t) {
static constexpr auto NoiseBits = BitRange::from_to(0, 23);
};
__declare_io_value(EON, uint16_t) {
static constexpr auto EchoBits = BitRange::from_to(0, 23);
};
static constexpr size_t VoiceCount = 24;
static constexpr size_t ReverbCount = 1;
@@ -152,8 +150,7 @@ namespace JabyEngine {
return {static_cast<int16_t>(static_cast<long double>(I16_MAX)*fraction)};
}
struct SRAMTransferAddressIO : public IOPort<SRAM_Adr> {};
//---------------------------------------------------------------------------------------------------
struct ControlRegisterIO : public IOPort<SPU_IO_Values::ControlRegister> {
using TransferMode = Value::RAMTransferMode;
@@ -163,18 +160,29 @@ namespace JabyEngine {
}
};
struct StatusRegisterIO : public IOPort<SPU_IO_Values::StatusRegister> {};
struct EchoIO : public IOPort<SPU_IO_Values::Echo> {
};
struct StatusRegisterIO : public IOPort<SPU_IO_Values::StatusRegister> {
};
struct SRAMTransferAddressIO : public IOPort<SPU_IO_Values::SRAM_Adr> {
};
// TODO: The new way? v Parse with a Macro?
static auto& EON = *reinterpret_cast<EchoIO*>(0x1F801D98);
static auto& SRAMTransferAdr = *reinterpret_cast<SRAMTransferAddressIO*>(0x1F801DA6);
static auto& ControlRegister = *reinterpret_cast<ControlRegisterIO*>(0x1F801DAA);
static auto& StatusRegister = *reinterpret_cast<StatusRegisterIO*>(0x1F801DAE);
static auto& SRAMTransferAdr = *reinterpret_cast<SRAMTransferAddressIO*>(0x1F801DA6);
//---------------------------------------------------------------------------------------------------
//__declare_io_port(, ControlRegister, 0x1F801DAA);
__declare_io_port(, DataTransferControl, 0x1F801DAC);
__declare_io_port(, PMON, 0x1F801D90);
__declare_io_port(, NON, 0x1F801D94);
__declare_io_port(, EON, 0x1F801D98);
//__declare_io_port(, EON, 0x1F801D98);
__declare_io_port_array(, Voice, VoiceCount, 0x1F801C00);
}