Set the opb counter

This commit is contained in:
Luke Benstead 2024-03-11 19:11:35 +00:00
parent 1b2ab9fe4e
commit c85aed2d28
2 changed files with 10 additions and 1 deletions

View File

@ -445,7 +445,7 @@ static inline void CompilePolyHeader(PolyHeader *dst, const PolyContext *src) {
dst->d3 = dst->d4 = 0xffffffff;
}
#ifdef BACKEND_KOSPVR
#ifdef __DREAMCAST__
#include "platforms/sh4.h"
#else
#include "platforms/software.h"

View File

@ -30,6 +30,15 @@ void InitGPU(_Bool autosort, _Bool fsaa) {
(autosort) ? 0 : 1 /* Disable translucent auto-sorting to match traditional GL */
};
/* Newer versions of KOS add an extra parameter to pvr_init_params_t
* called opb_overflow_count. To remain compatible we set that last
* parameter to something only if it exists */
const int opb_offset = offsetof(pvr_init_params_t, autosort_disabled) + 4;
if(sizeof(pvr_init_params_t) > opb_offset) {
int* opb_count = (int*)(((char*)&params) + opb_offset);
*opb_count = 2; // Two should be enough for anybody.. right?
}
pvr_init(&params);
#ifndef _arch_sub_naomi