From a47fce5a52aa40bacc10a7f32ed3d9867b3436ea Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Tue, 13 May 2025 17:36:50 +0200 Subject: [PATCH] Fix missing regions --- src/gu/sceGuDisable.c | 9 +++++++-- src/gu/sceGuEnable.c | 9 +++++++-- src/gu/sceGuScissor.c | 9 +++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/gu/sceGuDisable.c b/src/gu/sceGuDisable.c index 8b05eaad..c978e0a6 100644 --- a/src/gu/sceGuDisable.c +++ b/src/gu/sceGuDisable.c @@ -21,9 +21,14 @@ void sceGuDisable(int state) case GU_SCISSOR_TEST: { GuContext *context = &gu_contexts[gu_curr_context]; + int orig = 0; + int end = ((gu_draw_buffer.height - 1) << 10) | (gu_draw_buffer.width - 1); + context->scissor_enable = 0; - sendCommandi(SCISSOR1, 0); - sendCommandi(SCISSOR2, ((gu_draw_buffer.height - 1) << 10) | (gu_draw_buffer.width - 1)); + sendCommandi(SCISSOR1, orig); + sendCommandi(SCISSOR2, end); + sendCommandi(REGION1, orig); + sendCommandi(REGION2, end); } break; case GU_STENCIL_TEST: diff --git a/src/gu/sceGuEnable.c b/src/gu/sceGuEnable.c index 770752b3..ba2b78f5 100644 --- a/src/gu/sceGuEnable.c +++ b/src/gu/sceGuEnable.c @@ -21,9 +21,14 @@ void sceGuEnable(int state) case GU_SCISSOR_TEST: { GuContext *context = &gu_contexts[gu_curr_context]; + int orig = (context->scissor_start[1] << 10) | context->scissor_start[0]; + int end = (context->scissor_end[1] << 10) | context->scissor_end[0]; + context->scissor_enable = 1; - sendCommandi(SCISSOR1, (context->scissor_start[1] << 10) | context->scissor_start[0]); - sendCommandi(SCISSOR2, (context->scissor_end[1] << 10) | context->scissor_end[0]); + sendCommandi(SCISSOR1, orig); + sendCommandi(SCISSOR2, end); + sendCommandi(REGION1, orig); + sendCommandi(REGION2, end); } break; case GU_STENCIL_TEST: diff --git a/src/gu/sceGuScissor.c b/src/gu/sceGuScissor.c index 34485e11..b76278cf 100644 --- a/src/gu/sceGuScissor.c +++ b/src/gu/sceGuScissor.c @@ -19,7 +19,12 @@ void sceGuScissor(int x, int y, int w, int h) if (context->scissor_enable) { - sendCommandi(SCISSOR1, (context->scissor_start[1] << 10) | context->scissor_start[0]); - sendCommandi(SCISSOR2, (context->scissor_end[1] << 10) | context->scissor_end[0]); + int orig = (context->scissor_start[1] << 10) | context->scissor_start[0]; + int end = (context->scissor_end[1] << 10) | context->scissor_end[0]; + + sendCommandi(SCISSOR1, orig); + sendCommandi(SCISSOR2, end); + sendCommandi(REGION1, orig); + sendCommandi(REGION2, end); } }