From be9719ce038f254d554a65d33e95eaa2c496b0c9 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Sat, 14 Jan 2023 16:46:37 +0100 Subject: [PATCH] Made a few changes to the ordering of the display code, which fixes execution on real hardware. This also fixes the text overlay, which now renders on top of the 3D content. --- display.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/display.c b/display.c index f6c3dc4..28ca2b6 100644 --- a/display.c +++ b/display.c @@ -55,6 +55,10 @@ void display_init() // ISR subsystem to the kernel ResetGraph(0); + // Initialize GTE + InitGeom(); + gte_SetGeomScreen(180); // Screen depth for FOV control. Determines the distance of the camera to the near plane. + // Start the display in progressive mode int screenHeight; display_reset(GetVideoMode(), 0, &screenHeight); @@ -79,11 +83,6 @@ void display_init() // Open up a test font text stream FntOpen(0, 8, SCREENWIDTH, screenHeight, 0, 512); - - // Initialize GTE - InitGeom(); - gte_SetGeomOffset(SCREENWIDTH >> 1, screenHeight >> 1); - gte_SetGeomScreen(180); // Screen depth for FOV control. Determines the distance of the camera to the near plane. } void display_reset(int mode, u_char interlaced, int *outScreenHeight) @@ -173,8 +172,6 @@ void display_start() void display_finish() { - DrawOTag(curOT + OTLEN - 1); // This performs a DMA transfer to quickly send all the primitives off to the GPU - // Flip buffer index db = !db; @@ -191,6 +188,8 @@ void display_finish() // Enable display output, ResetGraph() disables it by default SetDispMask(1); + + DrawOTag(curOT + OTLEN - 1); // This performs a DMA transfer to quickly send all the primitives off to the GPU } void *display_allocPrim(size_t size)