Adding assertions

- Adding assertions to each specific sceGu function
- Also adding printf for verbose output
This commit is contained in:
Francisco Javier Trujillo Mata
2025-07-13 13:18:31 +02:00
parent 541277ebcc
commit b1bf44e88a
88 changed files with 595 additions and 10 deletions

View File

@@ -10,6 +10,13 @@
void sceGuDepthBuffer(void *zbp, int zbw)
{
#ifdef GU_DEBUG
printf("sceGuDepthBuffer(%p, %d);\n", zbp, zbw);
assert(gu_init && "GU not initialized");
assert((zbw & 0x1FFF) == 0 && "Depth buffer pointer must be 8192-byte aligned");
assert(zbw > 64 && zbw <= 1024 && (zbw & 0x3F) == 0 && "Invalid depth buffer width, must be multiple of 64");
#endif
sendCommandi(Z_BUF_PTR, ((unsigned int)zbp));
sendCommandi(Z_BUF_WIDTH, ((((unsigned int)zbp) & 0xff000000) >> 8) | zbw);