Browse Source

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.
tess_experiment
Nico de Poel 3 years ago
parent
commit
be9719ce03
  1. 13
      display.c

13
display.c

@ -55,6 +55,10 @@ void display_init()
// ISR subsystem to the kernel // ISR subsystem to the kernel
ResetGraph(0); 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 // Start the display in progressive mode
int screenHeight; int screenHeight;
display_reset(GetVideoMode(), 0, &screenHeight); display_reset(GetVideoMode(), 0, &screenHeight);
@ -79,11 +83,6 @@ void display_init()
// Open up a test font text stream // Open up a test font text stream
FntOpen(0, 8, SCREENWIDTH, screenHeight, 0, 512); 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) void display_reset(int mode, u_char interlaced, int *outScreenHeight)
@ -173,8 +172,6 @@ void display_start()
void display_finish() 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 // Flip buffer index
db = !db; db = !db;
@ -191,6 +188,8 @@ void display_finish()
// Enable display output, ResetGraph() disables it by default // Enable display output, ResetGraph() disables it by default
SetDispMask(1); 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) void *display_allocPrim(size_t size)

Loading…
Cancel
Save