Support PS3 by default
This commit is contained in:
parent
76da72b9d5
commit
0f038c3023
|
@ -36,5 +36,6 @@ struct DefaultConfiguration {
|
||||||
```
|
```
|
||||||
### `CustomConfiguration` macros
|
### `CustomConfiguration` macros
|
||||||
```c++
|
```c++
|
||||||
#define __USE_DEBUG_COLOR__ // Turns on colored rectangles during boot
|
#define __USE_DEBUG_COLOR__ // Turns on colored rectangles during boot (off by default)
|
||||||
|
#define __SUPPORT_PS3__ // Turns on PS3 support (on by default)
|
||||||
```
|
```
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "../Auxiliary/type_traits.hpp"
|
#include "../Auxiliary/type_traits.hpp"
|
||||||
#include "../System/IOPorts/gpu_io.hpp"
|
#include "../System/IOPorts/gpu_io.hpp"
|
||||||
|
#include "../jabyengine_config.hpp"
|
||||||
#include "gpu_primitives.hpp"
|
#include "gpu_primitives.hpp"
|
||||||
|
|
||||||
#if !defined(JABYENGINE_NTSC) && !defined(JABYENGINE_PAL)
|
#if !defined(JABYENGINE_NTSC) && !defined(JABYENGINE_PAL)
|
||||||
|
|
|
@ -29,5 +29,6 @@ namespace JabyEngine {
|
||||||
using Configuration = CustomConfiguration;
|
using Configuration = CustomConfiguration;
|
||||||
#else
|
#else
|
||||||
using Configuration = DefaultConfiguration;
|
using Configuration = DefaultConfiguration;
|
||||||
|
#define __SUPPORT_PS3__
|
||||||
#endif // has jabyengine_custom_config
|
#endif // has jabyengine_custom_config
|
||||||
}
|
}
|
|
@ -19,6 +19,7 @@ namespace JabyEngine {
|
||||||
|
|
||||||
((parameter_fifo.write(CD_IO::ParameterFifo{args})),...);
|
((parameter_fifo.write(CD_IO::ParameterFifo{args})),...);
|
||||||
cmd_fifo.write(CD_IO::CommandFifo {cmd.id});
|
cmd_fifo.write(CD_IO::CommandFifo {cmd.id});
|
||||||
|
cmd_interrupt_bit = bit::set(0, cmd.complete_irq);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename...ARGS>
|
template<typename T, typename...ARGS>
|
||||||
|
@ -29,8 +30,7 @@ namespace JabyEngine {
|
||||||
template<typename...ARGS>
|
template<typename...ARGS>
|
||||||
static void send_wait(IOPort<CD_IO::CommandFifo>& cmd_fifo, IOPort<CD_IO::ParameterFifo>& parameter_fifo, CD_IO::Command::Desc cmd, ARGS...args) {
|
static void send_wait(IOPort<CD_IO::CommandFifo>& cmd_fifo, IOPort<CD_IO::ParameterFifo>& parameter_fifo, CD_IO::Command::Desc cmd, ARGS...args) {
|
||||||
send(cmd_fifo, parameter_fifo, cmd, args...);
|
send(cmd_fifo, parameter_fifo, cmd, args...);
|
||||||
cmd_interrupt_bit = bit::set(0, cmd.complete_irq);
|
wait_completed();
|
||||||
wait_completed(); // TODO: This was moved because of Duckstation - but is it fine on real hardware?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename...ARGS>
|
template<typename T, typename...ARGS>
|
||||||
|
|
|
@ -66,10 +66,10 @@ namespace JabyEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace DMA {
|
namespace DMA {
|
||||||
#ifdef SUPPORT_PS3
|
#ifdef __SUPPORT_PS3__
|
||||||
// The PS3 doesn't autoincrement the GPU MADR register so we have to do it
|
// The PS3 doesn't autoincrement the GPU MADR register so we have to do it
|
||||||
extern uintptr_t MADR;
|
extern uintptr_t MADR;
|
||||||
#endif // SUPPORT_PS3
|
#endif // __SUPPORT_PS3__
|
||||||
|
|
||||||
static void wait() {
|
static void wait() {
|
||||||
::JabyEngine::DMA_IO::GPU.wait();
|
::JabyEngine::DMA_IO::GPU.wait();
|
||||||
|
@ -86,11 +86,11 @@ namespace JabyEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_src(uintptr_t adr) {
|
static void set_src(uintptr_t adr) {
|
||||||
#ifdef SUPPORT_PS3
|
#ifdef __SUPPORT_PS3__
|
||||||
MADR = adr;
|
MADR = adr;
|
||||||
#else
|
#else
|
||||||
DMA_IO::GPU.set_adr(adr);
|
DMA_IO::GPU.set_adr(adr);
|
||||||
#endif // SUPPORT_PS3
|
#endif // __SUPPORT_PS3__
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_dst(const PositionU16& position, const SizeU16& size) {
|
static void set_dst(const PositionU16& position, const SizeU16& size) {
|
||||||
|
@ -103,10 +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
|
#ifdef __SUPPORT_PS3__
|
||||||
DMA_IO::GPU.set_adr(MADR);
|
DMA_IO::GPU.set_adr(MADR);
|
||||||
MADR += (blockCount * wordsPerBlock) << 2;
|
MADR += (blockCount * wordsPerBlock) << 2;
|
||||||
#endif // SUPPORT_PS3
|
#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());
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,9 +9,9 @@ namespace JabyEngine {
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
namespace DMA {
|
namespace DMA {
|
||||||
#ifdef SUPPORT_PS3
|
#ifdef __SUPPORT_PS3__
|
||||||
uintptr_t MADR = 0;
|
uintptr_t MADR = 0;
|
||||||
#endif // SUPPORT_PS3
|
#endif // __SUPPORT_PS3__
|
||||||
}
|
}
|
||||||
|
|
||||||
static SysCall::InterruptVerifierResult interrupt_verifier();
|
static SysCall::InterruptVerifierResult interrupt_verifier();
|
||||||
|
|
Loading…
Reference in New Issue