Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Functions | Variables
display.c File Reference
#include <ultra64.h>
#include "sm64.h"
#include "game.h"
#include "main.h"
#include "memory.h"
#include "profiler.h"
#include "buffers.h"
#include "audio/external.h"
#include "display.h"

Functions

void my_rdp_init (void)
 Initializes the Reality Display Processor (RDP). More...
 
void my_rsp_init (void)
 Initializes the RSP's built-in geometry and lighting engines. More...
 
void clear_z_buffer (void)
 Clear the Z buffer. More...
 
void display_frame_buffer (void)
 Sets up the final framebuffer image. More...
 
void clear_frame_buffer (s32 a)
 Clears the framebuffer, allowing it to be overwritten. More...
 
void clear_viewport (Vp *viewport, s32 b)
 Clears and initializes the viewport. More...
 
void draw_screen_borders (void)
 Draws the horizontal screen borders. More...
 
void make_viewport_clip_rect (Vp *viewport)
 
void create_task_structure (void)
 Loads the F3D microcodes. More...
 
void init_render_image (void)
 Starts rendering the scene. More...
 
void end_master_display_list (void)
 Ends the master display list. More...
 
void func_80247D84 (void)
 
void func_80247ED8 (void)
 
void func_80247FAC (void)
 
void display_and_vsync (void)
 Handles vsync. More...
 

Variables

int unused8032C690 = 0
 
u32 gGlobalTimer = 0
 
static u16 sCurrFBNum = 0
 
u16 frameBufferIndex = 0
 

Function Documentation

◆ clear_frame_buffer()

void clear_frame_buffer ( s32  a)

Clears the framebuffer, allowing it to be overwritten.

◆ clear_viewport()

void clear_viewport ( Vp viewport,
s32  b 
)

Clears and initializes the viewport.

◆ clear_z_buffer()

void clear_z_buffer ( void  )

Clear the Z buffer.

◆ create_task_structure()

void create_task_structure ( void  )

Loads the F3D microcodes.

Refer to this function if you would like to load other microcodes (i.e. S2DEX).

◆ display_and_vsync()

void display_and_vsync ( void  )

Handles vsync.

◆ display_frame_buffer()

void display_frame_buffer ( void  )

Sets up the final framebuffer image.

◆ draw_screen_borders()

void draw_screen_borders ( void  )

Draws the horizontal screen borders.

◆ end_master_display_list()

void end_master_display_list ( void  )

Ends the master display list.

◆ func_80247D84()

void func_80247D84 ( void  )

◆ func_80247ED8()

void func_80247ED8 ( void  )

◆ func_80247FAC()

void func_80247FAC ( void  )

◆ init_render_image()

void init_render_image ( void  )

Starts rendering the scene.

◆ make_viewport_clip_rect()

void make_viewport_clip_rect ( Vp viewport)

◆ my_rdp_init()

void my_rdp_init ( void  )

Initializes the Reality Display Processor (RDP).

This function initializes settings such as texture filtering mode, scissoring, and render mode (although keep in mind that this render mode is not used in-game, where it is set in render_graph_node.c).

◆ my_rsp_init()

void my_rsp_init ( void  )

Initializes the RSP's built-in geometry and lighting engines.

Most of these (with the notable exception of gSPNumLights), are almost immediately overwritten.

Bug:
Nintendo did not explicitly define the clipping ratio. For Fast3DEX2, this causes the dreaded warped vertices issue unless the clipping ratio is changed back to the intended value, as Fast3DEX2 uses a different initial value than Fast3D(EX).

Variable Documentation

◆ frameBufferIndex

u16 frameBufferIndex = 0

◆ gGlobalTimer

u32 gGlobalTimer = 0

◆ sCurrFBNum

u16 sCurrFBNum = 0
static

◆ unused8032C690

int unused8032C690 = 0