DMA SPU memory
This commit is contained in:
15
include/PSX/Auxiliary/word_helper.hpp
Normal file
15
include/PSX/Auxiliary/word_helper.hpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
#include <stddef.hpp>
|
||||
|
||||
namespace JabyEngine {
|
||||
using word_t = uint32_t;
|
||||
|
||||
static constexpr size_t bytes_to_words(size_t bytes) {
|
||||
return bytes/sizeof(word_t);
|
||||
}
|
||||
|
||||
static constexpr size_t words_to_bytes(size_t words) {
|
||||
return words*sizeof(word_t);
|
||||
}
|
||||
}
|
||||
|
@@ -24,6 +24,22 @@ namespace JabyEngine {
|
||||
static constexpr auto CDAudioEnable = Bit(0);
|
||||
};
|
||||
|
||||
__declare_io_value(StatusRegister, uint16_t) {
|
||||
static constexpr auto Unused = BitRange::from_to(12, 15);
|
||||
static constexpr auto CaputreBufferHalf = Bit(11); // TODO: Turn into enum?; Writing to First/Second half of Capture Buffers (0=First, 1=Second)
|
||||
static constexpr auto TransferBusy = Bit(10);
|
||||
static constexpr auto IsDMARead = Bit(9);
|
||||
static constexpr auto isDMAWrite = Bit(8);
|
||||
static constexpr auto isDMA = Bit(7);
|
||||
static constexpr auto isIRQ = Bit(6);
|
||||
// Copies of ControlRegister
|
||||
static constexpr auto TransferMode = BitRange::from_to(4, 5);
|
||||
static constexpr auto ExternalAudioReverb = Bit(3);
|
||||
static constexpr auto CDAudioReverb = Bit(2);
|
||||
static constexpr auto ExternalAudioEnable = Bit(1);
|
||||
static constexpr auto CDAudioEnable = Bit(0);
|
||||
};
|
||||
|
||||
__declare_io_value(SRAM_Adr, uint16_t) {};
|
||||
}
|
||||
}
|
@@ -163,8 +163,11 @@ namespace JabyEngine {
|
||||
}
|
||||
};
|
||||
|
||||
struct StatusRegisterIO : public IOPort<SPU_IO_Values::StatusRegister> {};
|
||||
|
||||
// TODO: The new way? v Parse with a Macro?
|
||||
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);
|
||||
|
Reference in New Issue
Block a user