Establish VSyncCallback rendering

This commit is contained in:
2024-10-05 13:22:09 +02:00
parent ea38436e35
commit 77c7f391d1
4 changed files with 52 additions and 18 deletions

View File

@@ -24,6 +24,7 @@ namespace JabyEngine {
static uint32_t exchange_buffer_and_display();
};
extern bool vsync_lock_callback;
void wait_vsync(uint8_t syncs);
@@ -70,10 +71,12 @@ namespace JabyEngine {
static void wait() {
DMA_IO::GPU.wait();
vsync_lock_callback = false;
}
static void end() {
reset_cmd_buffer();
vsync_lock_callback = false;
}
struct Receive {
@@ -100,6 +103,7 @@ namespace JabyEngine {
static void start(uint16_t blockCount, uint16_t wordsPerBlock = 0x10) {
using SyncMode1 = DMA_IO_Values::BCR::SyncMode1;
vsync_lock_callback = true;
#ifdef __SUPPORT_PS3__
DMA_IO::GPU.set_adr(MADR);
DMA::MADR += (blockCount * wordsPerBlock) << 2;