Prepare DMA support for PS3
This commit is contained in:
parent
0a89fed98a
commit
76da72b9d5
|
@ -66,6 +66,11 @@ namespace JabyEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace DMA {
|
namespace DMA {
|
||||||
|
#ifdef SUPPORT_PS3
|
||||||
|
// The PS3 doesn't autoincrement the GPU MADR register so we have to do it
|
||||||
|
extern uintptr_t MADR;
|
||||||
|
#endif // SUPPORT_PS3
|
||||||
|
|
||||||
static void wait() {
|
static void wait() {
|
||||||
::JabyEngine::DMA_IO::GPU.wait();
|
::JabyEngine::DMA_IO::GPU.wait();
|
||||||
}
|
}
|
||||||
|
@ -81,7 +86,11 @@ namespace JabyEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_src(uintptr_t adr) {
|
static void set_src(uintptr_t adr) {
|
||||||
|
#ifdef SUPPORT_PS3
|
||||||
|
MADR = adr;
|
||||||
|
#else
|
||||||
DMA_IO::GPU.set_adr(adr);
|
DMA_IO::GPU.set_adr(adr);
|
||||||
|
#endif // SUPPORT_PS3
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_dst(const PositionU16& position, const SizeU16& size) {
|
static void set_dst(const PositionU16& position, const SizeU16& size) {
|
||||||
|
@ -94,6 +103,10 @@ namespace JabyEngine {
|
||||||
static void start(uint16_t blockCount, uint16_t wordsPerBlock = 0x10) {
|
static void start(uint16_t blockCount, uint16_t wordsPerBlock = 0x10) {
|
||||||
typedef DMA_IO::BCR::SyncMode1 SyncMode1;
|
typedef DMA_IO::BCR::SyncMode1 SyncMode1;
|
||||||
|
|
||||||
|
#ifdef SUPPORT_PS3
|
||||||
|
DMA_IO::GPU.set_adr(MADR);
|
||||||
|
MADR += (blockCount * wordsPerBlock) << 2;
|
||||||
|
#endif // SUPPORT_PS3
|
||||||
DMA_IO::GPU.block_ctrl.write(DMA_IO::BCR::from(SyncMode1::BlockSize.with(wordsPerBlock), SyncMode1::BlockAmount.with(blockCount)));
|
DMA_IO::GPU.block_ctrl.write(DMA_IO::BCR::from(SyncMode1::BlockSize.with(wordsPerBlock), SyncMode1::BlockAmount.with(blockCount)));
|
||||||
DMA_IO::GPU.channel_ctrl.write(DMA_IO::CHCHR::StartGPUReceive());
|
DMA_IO::GPU.channel_ctrl.write(DMA_IO::CHCHR::StartGPUReceive());
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,6 @@ namespace JabyEngine {
|
||||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::Red(), DebugX, DebugY, DebugScale);
|
__debug_boot_color_at(::JabyEngine::GPU::Color24::Red(), DebugX, DebugY, DebugScale);
|
||||||
SPU::stop_voices();
|
SPU::stop_voices();
|
||||||
|
|
||||||
// TODO: v Might be the PS3 crash
|
|
||||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::Green(), DebugX, DebugY, DebugScale);
|
__debug_boot_color_at(::JabyEngine::GPU::Color24::Green(), DebugX, DebugY, DebugScale);
|
||||||
CD::setup();
|
CD::setup();
|
||||||
__debug_boot_color_at(::JabyEngine::GPU::Color24::Blue(), DebugX, DebugY, DebugScale);
|
__debug_boot_color_at(::JabyEngine::GPU::Color24::Blue(), DebugX, DebugY, DebugScale);
|
||||||
|
|
|
@ -8,6 +8,12 @@ namespace JabyEngine {
|
||||||
uint8_t Display :: current_id = 1; //< Setup will call exchange and set it to 0
|
uint8_t Display :: current_id = 1; //< Setup will call exchange and set it to 0
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
namespace DMA {
|
||||||
|
#ifdef SUPPORT_PS3
|
||||||
|
uintptr_t MADR = 0;
|
||||||
|
#endif // SUPPORT_PS3
|
||||||
|
}
|
||||||
|
|
||||||
static SysCall::InterruptVerifierResult interrupt_verifier();
|
static SysCall::InterruptVerifierResult interrupt_verifier();
|
||||||
static uint32_t interrupt_handler(uint32_t);
|
static uint32_t interrupt_handler(uint32_t);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue