Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
renderer.c File Reference
#include <ultra64.h>
#include <stdarg.h>
#include <macros.h>
#include <config.h>
#include "prevent_bss_reordering.h"
#include "gd_types.h"
#include "gd_macros.h"
#include "dynlists/dynlists.h"
#include "gd_tex_dl.h"
#include "renderer.h"
#include "gd_main.h"
#include "gd_memory.h"
#include "sfx.h"
#include "draw_objects.h"
#include "objects.h"
#include "dynlist_proc.h"
#include "debug_utils.h"
#include "skin.h"
#include "gd_math.h"
#include "shape_helper.h"

Data Structures

struct  GdDisplayList
 
union  UnkInternal
 
struct  Unk801BB1B8
 
struct  DynListBankInfo
 

Macros

#define MAX_GD_DLS   1000
 
#define OS_MESG_SI_COMPLETE   0x33333333
 
#define GD_VIRTUAL_TO_PHYSICAL(addr)   ((uintptr_t)(addr) &0x0FFFFFFF)
 
#define GD_LOWER_24(addr)   ((uintptr_t)(addr) &0x00FFFFFF)
 
#define GD_LOWER_29(addr)   (((uintptr_t)(addr)) & 0x1FFFFFFF)
 
#define MTX_INTPART_PACK(w1, w2)   (((w1) &0xFFFF0000) | (((w2) >> 16) & 0xFFFF))
 
#define MTX_FRACPART_PACK(w1, w2)   ((((w1) << 16) & 0xFFFF0000) | ((w2) &0xFFFF))
 
#define LOOKAT_PACK(c)   ((s32) MIN(((c) * (128.0)), 127.0) & 0xff)
 
#define FILL_RGBA5551(r, g, b, a)   ((GPACK_RGBA5551((r), (g), (b), (a)) << 16) | (GPACK_RGBA5551((r), (g), (b), (a))))
 
#define DL_CURRENT_VTX(dl)   ((dl)->vtx[(dl)->curVtxIdx])
 
#define DL_CURRENT_MTX(dl)   ((dl)->mtx[(dl)->curMtxIdx])
 
#define DL_CURRENT_LIGHT(dl)   ((dl)->light[(dl)->curLightIdx])
 
#define DL_LIGHT_IDX(dl, idx)   ((dl)->unk20[(idx)])
 
#define DL_CURRENT_GFX(dl)   ((dl)->gfx[(dl)->curGfxIdx])
 
#define DL_CURRENT_VP(dl)   ((dl)->vp[(dl)->curVpIdx])
 

Typedefs

typedef s32 intptr_t
 
typedef u32 uintptr_t
 

Enumerations

enum  DynListBankFlag { TABLE_END = -1, STD_LIST_BANK = 3 }
 

Functions

u32 new_gddl_from (Gfx *, s32)
 
void gd_setup_cursor (struct ObjGroup *)
 
void parse_p1_controller (void)
 
void update_cursor (void)
 
void update_view_and_dl (struct ObjView *)
 
void func_801A1A00 (void)
 
void func_801A2388 (s32)
 
void func_801A3370 (f32, f32, f32)
 
void gd_put_sprite (u16 *, s32, s32, s32, s32)
 
void reset_cur_dl_indices (void)
 
u32 get_alloc_mem_amt (void)
 
s32 gd_get_ostime (void)
 
f32 get_time_scale (void)
 
void dump_disp_list (void)
 
Gfxnext_gfx (void)
 
Lights4next_light (void)
 
Mtxnext_mtx (void)
 
Vtxnext_vtx (void)
 
Vpnext_vp (void)
 
f64 gd_sin_d (f64 x)
 
f64 gd_cos_d (f64 x)
 
f64 gd_sqrt_d (f64 x)
 
f64 Unknown8019B3D4 (UNUSED f64 x)
 
void gd_printf (const char *format,...)
 
void gd_exit (UNUSED s32 code)
 
void gd_free (void *ptr)
 
voidgd_allocblock (u32 size)
 
voidgd_malloc (u32 size, u8 perm)
 
voidgd_malloc_perm (u32 size)
 
voidgd_malloc_temp (u32 size)
 
voidUnknown8019BC88 (u32 size, u32 count)
 
voidUnknown8019BCD4 (u32 size)
 
void func_8019BD0C (s32 dlNum, s32 gfxIdx)
 
void branch_cur_dl_to_num (s32 dlNum)
 
GfxUnknown8019BE40 (s32 num)
 
void setup_stars (void)
 
void setup_timers (void)
 
void Unknown8019C270 (u8 *buf)
 
void Unknown8019C288 (s32 stickX, s32 stickY)
 
void gd_add_to_heap (void *addr, u32 size)
 
void gdm_init (void *blockpool, u32 size)
 
void gdm_setup (void)
 
void Unknown8019C448 (UNUSED u32 a0)
 
void print_gdm_stats (void)
 
struct ObjViewmake_view_withgrp (char *name, struct ObjGroup *grp)
 
void gdm_maketestdl (s32 id)
 
void set_time_scale (f32 factor)
 
void Unknown8019C840 (void)
 
void gd_vblank (void)
 
void gd_copy_p1_contpad (OSContPad *p1cont)
 
s32 gd_sfx_to_play (void)
 
voidgdm_gettestdl (s32 id)
 
void gdm_getpos (s32 id, struct GdVec3f *dst)
 
void bound_on_active_view (f32 *x, f32 *y)
 
void fatal_no_dl_mem (void)
 
struct GdDisplayListalloc_displaylist (u32 id)
 
void cpy_remaining_gddl (struct GdDisplayList *dst, struct GdDisplayList *src)
 
struct GdDisplayListcreate_child_gdl (s32 id, struct GdDisplayList *srcDl)
 
struct GdDisplayListnew_gd_dl (s32 id, s32 gfxs, s32 verts, s32 mtxs, s32 lights, s32 vps)
 
void gd_init_RSP (void)
 
void gd_init_RDP (void)
 
void gd_draw_rect (f32 ulx, f32 uly, f32 lrx, f32 lry)
 
void gd_draw_border_rect (f32 ulx, f32 uly, f32 lrx, f32 lry)
 
void gd_set_fill (struct GdColour *colour)
 
void gd_set_view_zbuf (void)
 
void gd_set_view_framebuf (void)
 
void reset_dlnum_indices (s32 num)
 
void stash_current_gddl (void)
 
void pop_gddl_stash (void)
 
s32 gd_startdisplist (s32 memarea)
 
void gd_enddisplist (void)
 
s32 gd_end_dl (void)
 
void Unknown8019EBCC (s32 num, uintptr_t gfxptr)
 
u32 new_gddl_from (Gfx *dl, UNUSED s32 arg1)
 
u32 Unknown8019EC88 (Gfx *dl, UNUSED s32 arg1)
 
void mat4_to_Mtx (const Mat4f *src, Mtx *dst)
 
void add_mat4_to_dl (Mat4f *mtx)
 
void add_mat4_load_to_dl (Mat4f *mtx)
 
void Unknown8019EFC0 (void)
 
void push_idn_mtx_cur_gddl (void)
 
void pop_mtx_gddl (void)
 
void translate_mtx_gddl (f32 x, f32 y, f32 z)
 
void translate_load_mtx_gddl (f32 x, f32 y, f32 z)
 
void func_8019F258 (f32 x, f32 y, f32 z)
 
void func_8019F2C4 (f32 arg0, s8 arg1)
 
void func_8019F318 (struct ObjCamera *cam, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7)
 
void check_tri_display (s32 vtxcount)
 
Vtxmake_Vtx_if_new (f32 x, f32 y, f32 z, f32 alpha)
 
void func_8019FEF0 (void)
 
void add_tri_to_dl (f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2, f32 x3, f32 y3, f32 z3)
 
void func_801A0038 (void)
 
void func_801A0070 (void)
 
void func_801A01EC (void)
 
void func_801A025C (void)
 
void func_801A02B8 (f32 arg0)
 
void func_801A0324 (s32 arg0)
 
void set_light_num (s32 n)
 
s32 create_mtl_gddl (UNUSED s32 mtlType)
 
void branch_to_gddl (s32 dlNum)
 
void func_801A0478 (s32 idx, struct ObjCamera *cam, UNUSED struct GdVec3f *arg2, UNUSED struct GdVec3f *arg3, struct GdVec3f *arg4, struct GdColour *colour)
 
s32 func_801A086C (s32 id, struct GdColour *colour, s32 arg2)
 
void set_Vtx_norm_buf_1 (struct GdVec3f *norm)
 
void set_Vtx_norm_buf_2 (struct GdVec3f *norm)
 
void set_gd_mtx_parameters (s32 paramType)
 
void func_801A180C (void)
 
void Unknown801A1B30 (void)
 
void Unknown801A1E70 (void)
 
void gd_set_one_cycle (void)
 
void Unknown801A2360 (void)
 
void func_801A2374 (UNUSED s32 arg0)
 
void start_view_dl (struct ObjView *view)
 
void Unknown801A324C (f32 arg0)
 
void Unknown801A32F4 (s32 arg0)
 
void func_801A3324 (f32 x, f32 y, f32 z)
 
void Unknown801A33F8 (f32 x, f32 y, f32 z)
 
void Unknown801A347C (f32 x, f32 y, f32 z)
 
void border_active_view (void)
 
void gd_shading (s32 model)
 
s32 gd_getproperty (s32 prop, UNUSED void *arg1)
 
void gd_setproperty (enum GdProperty prop, f32 f1, f32 f2, f32 f3)
 
void stub_801A3AE0 (void)
 
void func_801A3AF0 (f32 l, f32 r, f32 b, f32 t, f32 n, f32 f)
 
void func_801A3C8C (f32 fovy, f32 aspect, f32 near, f32 far)
 
s32 setup_view_buffers (const char *name, struct ObjView *view, UNUSED s32 ulx, UNUSED s32 uly, UNUSED s32 lrx, UNUSED s32 lry)
 
void gd_init_controllers (void)
 
void Proc801A43DC (UNUSED struct GdObj *obj)
 
voidfunc_801A43F0 (UNUSED const char *menufmt,...)
 
void Proc801A4410 (UNUSED void *arg0)
 
void Proc801A4424 (UNUSED void *arg0)
 
void func_801A4438 (f32 arg0, f32 arg1, f32 arg2)
 
s32 gd_gentexture (void *texture, s32 fmt, s32 size, UNUSED u32 arg3, UNUSED u32 arg4)
 
voidUnknown801A45E4 (const char *file, s32 fmt, s32 size, u32 arg3, u32 arg4)
 
void Unknown801A47B8 (struct ObjView *v)
 
void stub_801A47DC (void)
 
void Unknown801A47F4 (UNUSED u32 arg0)
 
void func_801A4808 (void)
 
void func_801A4848 (s32 linkDl)
 
void func_801A48B4 (void)
 
void func_801A48C4 (UNUSED u32 arg0)
 
void func_801A48D8 (UNUSED char *s)
 
void set_active_view (struct ObjView *v)
 
void stub_801A4908 (void)
 
void func_801A4918 (void)
 
void Unknown801A4B04 (void)
 
void Unknown801A4F58 (void)
 
void Proc801A5110 (struct ObjView *view)
 
void func_801A520C (void)
 
void Unknown801A5344 (void)
 
void gd_init (void)
 
void Unknown801A5910 (char *arg0, s32 len)
 
void func_801A5998 (UNUSED s8 *arg0)
 
void func_801A59AC (UNUSED void *arg0)
 
void func_801A59C0 (UNUSED s8 *arg0)
 
void init_pick_buf (s16 *buf, s32 len)
 
void store_in_pickbuf (s16 data)
 
s32 get_cur_pickbuf_offset (UNUSED s16 *arg0)
 
void Unknown801A5A80 (UNUSED u32 arg0)
 
void Unknown801A5A94 (UNUSED u32 arg0)
 
void stub_801A5AA8 (void)
 
voidUnknown801A5AB8 (s32 texnum)
 
void Unknown801A5AE0 (s32 arg0)
 
void set_Vtx_tc_buf (f32 tcS, f32 tcT)
 
void func_801A5BE8 (struct ObjView *view)
 
union ObjVarValcvrt_val_to_kb (union ObjVarVal *dst, union ObjVarVal src)
 
void Unknown801A5C80 (struct ObjGroup *parentGroup)
 
void Unknown801A5D90 (struct ObjGroup *arg0)
 
void Unknown801A5FF8 (struct ObjGroup *arg0)
 
void view_proc_print_timers (struct ObjView *self)
 254F94 -> 254FE4; orig name: Proc801A67C4 This prints all timers if the view was not updated for a frame More...
 
void make_timer_gadgets (void)
 
void Unknown801A6E30 (UNUSED u32 a0)
 
void Unknown801A6E44 (UNUSED u32 a0)
 
void gd_block_dma (u32 devAddr, void *vAddr, s32 size)
 
struct GdObjload_dynlist (struct DynList *dynlist)
 
void stub_801A71B8 (UNUSED u32 a0)
 
void func_801A71CC (struct ObjNet *net)
 
void stub_801A76E0 (void)
 

Variables

static OSContStatus D_801BAE60 [4]
 
static OSContPad sGdContPads [4]
 
static OSContPad sPrevFrameCont [4]
 
static u8 D_801BAEA0
 
static struct ObjGadgetsTimerGadgets [GD_NUM_TIMERS]
 
static u32 D_801BAF28
 
static s16 D_801BAF30 [13][8]
 
static u32 unref_801bb000 [3]
 
static u8sMemBlockPoolBase
 
static u32 sAllocMemory
 
static u32 unref_801bb014
 
static s32 D_801BB018
 
static s32 D_801BB01C
 
static voidD_801BB020 [0x10]
 
static s32 D_801BB060 [0x10]
 
static s16 sVtxCvrtTCBuf [2]
 
static s32 sCarGdDlNum
 
static struct ObjGroupsYoshiSceneGrp
 
static s32 D_801BB0AC
 
static struct ObjGroupsMarioSceneGrp
 
static s32 D_801BB0B4
 
static struct ObjGroupsCarSceneGrp
 
static s32 D_801BB0BC
 
static struct ObjViewsYoshiSceneView
 
static s32 D_801BB0C4
 
static struct ObjViewsMSceneView
 
static s32 D_801BB0CC
 
static struct ObjViewsCarSceneView
 
static s32 sUpdateYoshiScene
 
static s32 sUpdateMarioScene
 
static u32 unref_801bb0dc
 
static s32 sUpdateCarScene
 
static u32 unref_801bb0e4
 
static struct GdVec3f D_801BB0E8
 
static u32 unref_801bb0f8 [2]
 
static Mtx sIdnMtx
 
static Mat4f sInitIdnMat4
 
static s8 sVtxCvrtNormBuf [3]
 
static s16 D_801BB184
 
static s32 D_801BB188
 
static struct GdColour sAmbScaleColour
 
static struct GdColour sLightScaleColours [2]
 
static struct Unk801BB1B8 D_801BB1B8 [2]
 
static s32 D_801BB1D0
 
static Hilite D_801BB1D8 [600]
 
static struct GdVec3f D_801BD758
 
static struct GdVec3f D_801BD768
 
static u32 D_801BD774
 
static struct GdObjsMenuGadgets [9]
 
static struct ObjViewD_801BD7A0 [2]
 
static struct GdDisplayListsStaticDl
 
static struct GdDisplayListsDynDlSet1 [2]
 
static struct GdDisplayListsGdDlStash
 
static struct GdDisplayListsMHeadMainDls [2]
 
static struct GdDisplayListD_801BD7C8 [3][2]
 
static struct GdDisplayListsGdDLArray [MAX_GD_DLS]
 
static s32 sPickBufLen
 
static s32 sPickBufPosition
 
static s16sPickBuf
 
static LookAt D_801BE790 [2]
 
static LookAt D_801BE7D0 [3]
 
static OSMesgQueue D_801BE830
 
static OSMesg D_801BE848 [10]
 
static u32 unref_801be870 [16]
 
static OSMesgQueue D_801BE8B0
 
static OSMesgQueue sGdDMAQueue
 
static u32 unref_801be8e0 [25]
 
static OSMesg sGdMesgBuf [1]
 
static u32 unref_801be948 [13]
 
static OSMesg D_801BE97C
 
static OSIoMesg D_801BE980
 
static struct ObjViewD_801BE994
 
static u32 unref_801a8670 = 0
 
static s32 D_801A8674 = 0
 
static u32 unref_801a8678 = 0
 
static s32 D_801A867C = 0
 
static s32 D_801A8680 = 0
 
static f32 sTracked1FrameTime = 0.0f
 
static f32 sDynamicsTime = 0.0f
 
static f32 sDLGenTime = 0.0f
 
static f32 sRCPTime = 0.0f
 
static f32 sTimeScaleFactor = 1.0f
 
static u32 sMemBlockPoolSize = 1
 
static s32 sMemBlockPoolUsed = 0
 
static s32 D_801A86A0 = 0
 
static struct GdTimerD_801A86A4 = NULL
 
static struct GdTimerD_801A86A8 = NULL
 
static struct GdTimerD_801A86AC = NULL
 
s32 gGdFrameBuf = 0
 
static u32 unref_801a86B4 = 0
 
static struct ObjShapesHandShape = NULL
 
static s32 D_801A86BC = 1
 
static s32 D_801A86C0 = 0
 
static u32 unref_801a86C4 = 10
 
static s32 sMtxParameters = (G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH)
 
static struct GdVec3f D_801A86CC = { 1.0f, 1.0f, 1.0f }
 
static struct ObjViewsActiveView = NULL
 
static struct ObjViewsScreenView2 = NULL
 
static struct ObjViewD_801A86E0 = NULL
 
static struct ObjViewsHandView = NULL
 
static struct ObjViewsMenuView = NULL
 
static u32 sItemsInMenu = 0
 
static s32 D_801A86F0 = 0
 
static s32 sNewZPresses = 0
 
static u32 unref_801a86F8 = 0
 
static struct GdDisplayListsCurrentGdDl = NULL
 
static u32 sGdDlCount = 0
 
static struct DynListBankInfo sDynLists []
 
static u64 strayDlEndCmd = 0xB800000000000000
 
u8 _gd_dynlistsSegmentRomStart []
 
u8 _gd_dynlistsSegmentRomEnd []
 

Macro Definition Documentation

◆ DL_CURRENT_GFX

#define DL_CURRENT_GFX (   dl)    ((dl)->gfx[(dl)->curGfxIdx])

◆ DL_CURRENT_LIGHT

#define DL_CURRENT_LIGHT (   dl)    ((dl)->light[(dl)->curLightIdx])

◆ DL_CURRENT_MTX

#define DL_CURRENT_MTX (   dl)    ((dl)->mtx[(dl)->curMtxIdx])

◆ DL_CURRENT_VP

#define DL_CURRENT_VP (   dl)    ((dl)->vp[(dl)->curVpIdx])

◆ DL_CURRENT_VTX

#define DL_CURRENT_VTX (   dl)    ((dl)->vtx[(dl)->curVtxIdx])

◆ DL_LIGHT_IDX

#define DL_LIGHT_IDX (   dl,
  idx 
)    ((dl)->unk20[(idx)])

◆ FILL_RGBA5551

#define FILL_RGBA5551 (   r,
  g,
  b,
  a 
)    ((GPACK_RGBA5551((r), (g), (b), (a)) << 16) | (GPACK_RGBA5551((r), (g), (b), (a))))

◆ GD_LOWER_24

#define GD_LOWER_24 (   addr)    ((uintptr_t)(addr) &0x00FFFFFF)

◆ GD_LOWER_29

#define GD_LOWER_29 (   addr)    (((uintptr_t)(addr)) & 0x1FFFFFFF)

◆ GD_VIRTUAL_TO_PHYSICAL

#define GD_VIRTUAL_TO_PHYSICAL (   addr)    ((uintptr_t)(addr) &0x0FFFFFFF)

◆ LOOKAT_PACK

#define LOOKAT_PACK (   c)    ((s32) MIN(((c) * (128.0)), 127.0) & 0xff)

◆ MAX_GD_DLS

#define MAX_GD_DLS   1000

◆ MTX_FRACPART_PACK

#define MTX_FRACPART_PACK (   w1,
  w2 
)    ((((w1) << 16) & 0xFFFF0000) | ((w2) &0xFFFF))

◆ MTX_INTPART_PACK

#define MTX_INTPART_PACK (   w1,
  w2 
)    (((w1) &0xFFFF0000) | (((w2) >> 16) & 0xFFFF))

◆ OS_MESG_SI_COMPLETE

#define OS_MESG_SI_COMPLETE   0x33333333

Typedef Documentation

◆ intptr_t

◆ uintptr_t

Enumeration Type Documentation

◆ DynListBankFlag

Enumerator
TABLE_END 
STD_LIST_BANK 

Function Documentation

◆ add_mat4_load_to_dl()

void add_mat4_load_to_dl ( Mat4f mtx)

◆ add_mat4_to_dl()

void add_mat4_to_dl ( Mat4f mtx)

◆ add_tri_to_dl()

void add_tri_to_dl ( f32  x1,
f32  y1,
f32  z1,
f32  x2,
f32  y2,
f32  z2,
f32  x3,
f32  y3,
f32  z3 
)

◆ alloc_displaylist()

struct GdDisplayList* alloc_displaylist ( u32  id)

◆ border_active_view()

void border_active_view ( void  )

◆ bound_on_active_view()

void bound_on_active_view ( f32 x,
f32 y 
)

◆ branch_cur_dl_to_num()

void branch_cur_dl_to_num ( s32  dlNum)

◆ branch_to_gddl()

void branch_to_gddl ( s32  dlNum)

◆ check_tri_display()

void check_tri_display ( s32  vtxcount)

◆ cpy_remaining_gddl()

void cpy_remaining_gddl ( struct GdDisplayList dst,
struct GdDisplayList src 
)

◆ create_child_gdl()

struct GdDisplayList* create_child_gdl ( s32  id,
struct GdDisplayList srcDl 
)
Bug:
No return statement, despite return value being used. Goddard lucked out that v0 return from alloc_displaylist() is not overwriten, as that pointer is what should be returned

◆ create_mtl_gddl()

s32 create_mtl_gddl ( UNUSED s32  mtlType)

◆ cvrt_val_to_kb()

union ObjVarVal* cvrt_val_to_kb ( union ObjVarVal dst,
union ObjVarVal  src 
)

◆ dump_disp_list()

void dump_disp_list ( void  )

◆ fatal_no_dl_mem()

void fatal_no_dl_mem ( void  )

◆ func_8019BD0C()

void func_8019BD0C ( s32  dlNum,
s32  gfxIdx 
)

◆ func_8019F258()

void func_8019F258 ( f32  x,
f32  y,
f32  z 
)

◆ func_8019F2C4()

void func_8019F2C4 ( f32  arg0,
s8  arg1 
)

◆ func_8019F318()

void func_8019F318 ( struct ObjCamera cam,
f32  arg1,
f32  arg2,
f32  arg3,
f32  arg4,
f32  arg5,
f32  arg6,
f32  arg7 
)

◆ func_8019FEF0()

void func_8019FEF0 ( void  )

◆ func_801A0038()

void func_801A0038 ( void  )

◆ func_801A0070()

void func_801A0070 ( void  )

◆ func_801A01EC()

void func_801A01EC ( void  )

◆ func_801A025C()

void func_801A025C ( void  )

◆ func_801A02B8()

void func_801A02B8 ( f32  arg0)

◆ func_801A0324()

void func_801A0324 ( s32  arg0)

◆ func_801A0478()

void func_801A0478 ( s32  idx,
struct ObjCamera cam,
UNUSED struct GdVec3f arg2,
UNUSED struct GdVec3f arg3,
struct GdVec3f arg4,
struct GdColour colour 
)

◆ func_801A086C()

s32 func_801A086C ( s32  id,
struct GdColour colour,
s32  arg2 
)

◆ func_801A180C()

void func_801A180C ( void  )

◆ func_801A1A00()

void func_801A1A00 ( void  )

◆ func_801A2374()

void func_801A2374 ( UNUSED s32  arg0)

◆ func_801A2388()

void func_801A2388 ( s32  gotoDl)

◆ func_801A3324()

void func_801A3324 ( f32  x,
f32  y,
f32  z 
)

◆ func_801A3370()

void func_801A3370 ( f32  x,
f32  y,
f32  z 
)

◆ func_801A3AF0()

void func_801A3AF0 ( f32  l,
f32  r,
f32  b,
f32  t,
f32  n,
f32  f 
)

◆ func_801A3C8C()

void func_801A3C8C ( f32  fovy,
f32  aspect,
f32  near,
f32  far 
)

◆ func_801A43F0()

void* func_801A43F0 ( UNUSED const char menufmt,
  ... 
)
Bug:
no return; function was stubbed

◆ func_801A4438()

void func_801A4438 ( f32  arg0,
f32  arg1,
f32  arg2 
)

◆ func_801A4808()

void func_801A4808 ( void  )

◆ func_801A4848()

void func_801A4848 ( s32  linkDl)

◆ func_801A48B4()

void func_801A48B4 ( void  )

◆ func_801A48C4()

void func_801A48C4 ( UNUSED u32  arg0)

◆ func_801A48D8()

void func_801A48D8 ( UNUSED char s)

◆ func_801A4918()

void func_801A4918 ( void  )

◆ func_801A520C()

void func_801A520C ( void  )

◆ func_801A5998()

void func_801A5998 ( UNUSED s8 arg0)

◆ func_801A59AC()

void func_801A59AC ( UNUSED void arg0)

◆ func_801A59C0()

void func_801A59C0 ( UNUSED s8 arg0)

◆ func_801A5BE8()

void func_801A5BE8 ( struct ObjView view)

◆ func_801A71CC()

void func_801A71CC ( struct ObjNet net)

◆ gd_add_to_heap()

void gd_add_to_heap ( void addr,
u32  size 
)

◆ gd_allocblock()

void* gd_allocblock ( u32  size)

◆ gd_block_dma()

void gd_block_dma ( u32  devAddr,
void vAddr,
s32  size 
)

◆ gd_copy_p1_contpad()

void gd_copy_p1_contpad ( OSContPad *  p1cont)

◆ gd_cos_d()

f64 gd_cos_d ( f64  x)

◆ gd_draw_border_rect()

void gd_draw_border_rect ( f32  ulx,
f32  uly,
f32  lrx,
f32  lry 
)

◆ gd_draw_rect()

void gd_draw_rect ( f32  ulx,
f32  uly,
f32  lrx,
f32  lry 
)

◆ gd_end_dl()

s32 gd_end_dl ( void  )

◆ gd_enddisplist()

void gd_enddisplist ( void  )

◆ gd_exit()

void gd_exit ( UNUSED s32  code)

◆ gd_free()

void gd_free ( void ptr)

◆ gd_gentexture()

s32 gd_gentexture ( void texture,
s32  fmt,
s32  size,
UNUSED u32  arg3,
UNUSED u32  arg4 
)

◆ gd_get_ostime()

s32 gd_get_ostime ( void  )

◆ gd_getproperty()

s32 gd_getproperty ( s32  prop,
UNUSED void arg1 
)

◆ gd_init()

void gd_init ( void  )

◆ gd_init_controllers()

void gd_init_controllers ( void  )

◆ gd_init_RDP()

void gd_init_RDP ( void  )

◆ gd_init_RSP()

void gd_init_RSP ( void  )

◆ gd_malloc()

void* gd_malloc ( u32  size,
u8  perm 
)

◆ gd_malloc_perm()

void* gd_malloc_perm ( u32  size)

◆ gd_malloc_temp()

void* gd_malloc_temp ( u32  size)

◆ gd_printf()

void gd_printf ( const char format,
  ... 
)
Bug:
formatter 'c' uses s32 for va_arg instead of char

◆ gd_put_sprite()

void gd_put_sprite ( u16 sprite,
s32  x,
s32  y,
s32  wx,
s32  wy 
)

◆ gd_set_fill()

void gd_set_fill ( struct GdColour colour)

◆ gd_set_one_cycle()

void gd_set_one_cycle ( void  )

◆ gd_set_view_framebuf()

void gd_set_view_framebuf ( void  )

◆ gd_set_view_zbuf()

void gd_set_view_zbuf ( void  )

◆ gd_setproperty()

void gd_setproperty ( enum GdProperty  prop,
f32  f1,
f32  f2,
f32  f3 
)

◆ gd_setup_cursor()

void gd_setup_cursor ( struct ObjGroup parentgrp)

◆ gd_sfx_to_play()

s32 gd_sfx_to_play ( void  )

◆ gd_shading()

void gd_shading ( s32  model)

◆ gd_sin_d()

f64 gd_sin_d ( f64  x)

◆ gd_sqrt_d()

f64 gd_sqrt_d ( f64  x)

◆ gd_startdisplist()

s32 gd_startdisplist ( s32  memarea)

◆ gd_vblank()

void gd_vblank ( void  )

◆ gdm_getpos()

void gdm_getpos ( s32  id,
struct GdVec3f dst 
)

◆ gdm_gettestdl()

void* gdm_gettestdl ( s32  id)
Bug:
Code treats sYoshiSceneView as group; not called in game though
Bug:
Code treats sCarSceneView as group; not called in game though

◆ gdm_init()

void gdm_init ( void blockpool,
u32  size 
)

◆ gdm_maketestdl()

void gdm_maketestdl ( s32  id)

◆ gdm_setup()

void gdm_setup ( void  )

◆ get_alloc_mem_amt()

u32 get_alloc_mem_amt ( void  )

◆ get_cur_pickbuf_offset()

s32 get_cur_pickbuf_offset ( UNUSED s16 arg0)

◆ get_time_scale()

f32 get_time_scale ( void  )

◆ init_pick_buf()

void init_pick_buf ( s16 buf,
s32  len 
)

◆ load_dynlist()

struct GdObj* load_dynlist ( struct DynList dynlist)

◆ make_timer_gadgets()

void make_timer_gadgets ( void  )

◆ make_view_withgrp()

struct ObjView* make_view_withgrp ( char name,
struct ObjGroup grp 
)

◆ make_Vtx_if_new()

Vtx* make_Vtx_if_new ( f32  x,
f32  y,
f32  z,
f32  alpha 
)

◆ mat4_to_Mtx()

void mat4_to_Mtx ( const Mat4f src,
Mtx dst 
)

◆ new_gd_dl()

struct GdDisplayList* new_gd_dl ( s32  id,
s32  gfxs,
s32  verts,
s32  mtxs,
s32  lights,
s32  vps 
)

◆ new_gddl_from() [1/2]

u32 new_gddl_from ( Gfx ,
s32   
)

◆ new_gddl_from() [2/2]

u32 new_gddl_from ( Gfx dl,
UNUSED s32  arg1 
)

◆ next_gfx()

Gfx* next_gfx ( void  )

◆ next_light()

Lights4* next_light ( void  )

◆ next_mtx()

Mtx* next_mtx ( void  )

◆ next_vp()

Vp* next_vp ( void  )

◆ next_vtx()

Vtx* next_vtx ( void  )

◆ parse_p1_controller()

void parse_p1_controller ( void  )

◆ pop_gddl_stash()

void pop_gddl_stash ( void  )

◆ pop_mtx_gddl()

void pop_mtx_gddl ( void  )

◆ print_gdm_stats()

void print_gdm_stats ( void  )

◆ Proc801A43DC()

void Proc801A43DC ( UNUSED struct GdObj obj)

◆ Proc801A4410()

void Proc801A4410 ( UNUSED void arg0)

◆ Proc801A4424()

void Proc801A4424 ( UNUSED void arg0)

◆ Proc801A5110()

void Proc801A5110 ( struct ObjView view)

◆ push_idn_mtx_cur_gddl()

void push_idn_mtx_cur_gddl ( void  )

◆ reset_cur_dl_indices()

void reset_cur_dl_indices ( void  )

◆ reset_dlnum_indices()

void reset_dlnum_indices ( s32  num)

◆ set_active_view()

void set_active_view ( struct ObjView v)

◆ set_gd_mtx_parameters()

void set_gd_mtx_parameters ( s32  paramType)

◆ set_light_num()

void set_light_num ( s32  n)

◆ set_time_scale()

void set_time_scale ( f32  factor)

◆ set_Vtx_norm_buf_1()

void set_Vtx_norm_buf_1 ( struct GdVec3f norm)

◆ set_Vtx_norm_buf_2()

void set_Vtx_norm_buf_2 ( struct GdVec3f norm)

◆ set_Vtx_tc_buf()

void set_Vtx_tc_buf ( f32  tcS,
f32  tcT 
)

◆ setup_stars()

void setup_stars ( void  )

◆ setup_timers()

void setup_timers ( void  )

◆ setup_view_buffers()

s32 setup_view_buffers ( const char name,
struct ObjView view,
UNUSED s32  ulx,
UNUSED s32  uly,
UNUSED s32  lrx,
UNUSED s32  lry 
)
Bug:
No actual return, but the return value is used. There is no obvious value to return. Since the function doesn't use four of its parameters, this function may have had a fair amount of its code commented out. In game, the returned value is always 0, so the fix returns that value

◆ start_view_dl()

void start_view_dl ( struct ObjView view)

◆ stash_current_gddl()

void stash_current_gddl ( void  )

◆ store_in_pickbuf()

void store_in_pickbuf ( s16  data)

◆ stub_801A3AE0()

void stub_801A3AE0 ( void  )

◆ stub_801A47DC()

void stub_801A47DC ( void  )

◆ stub_801A4908()

void stub_801A4908 ( void  )

◆ stub_801A5AA8()

void stub_801A5AA8 ( void  )

◆ stub_801A71B8()

void stub_801A71B8 ( UNUSED u32  a0)

◆ stub_801A76E0()

void stub_801A76E0 ( void  )

◆ translate_load_mtx_gddl()

void translate_load_mtx_gddl ( f32  x,
f32  y,
f32  z 
)

◆ translate_mtx_gddl()

void translate_mtx_gddl ( f32  x,
f32  y,
f32  z 
)

◆ Unknown8019B3D4()

f64 Unknown8019B3D4 ( UNUSED f64  x)

◆ Unknown8019BC88()

void* Unknown8019BC88 ( u32  size,
u32  count 
)

◆ Unknown8019BCD4()

void* Unknown8019BCD4 ( u32  size)

◆ Unknown8019BE40()

Gfx* Unknown8019BE40 ( s32  num)

◆ Unknown8019C270()

void Unknown8019C270 ( u8 buf)

◆ Unknown8019C288()

void Unknown8019C288 ( s32  stickX,
s32  stickY 
)

◆ Unknown8019C448()

void Unknown8019C448 ( UNUSED u32  a0)

◆ Unknown8019C840()

void Unknown8019C840 ( void  )

◆ Unknown8019EBCC()

void Unknown8019EBCC ( s32  num,
uintptr_t  gfxptr 
)

◆ Unknown8019EC88()

u32 Unknown8019EC88 ( Gfx dl,
UNUSED s32  arg1 
)

◆ Unknown8019EFC0()

void Unknown8019EFC0 ( void  )

◆ Unknown801A1B30()

void Unknown801A1B30 ( void  )

◆ Unknown801A1E70()

void Unknown801A1E70 ( void  )

◆ Unknown801A2360()

void Unknown801A2360 ( void  )

◆ Unknown801A324C()

void Unknown801A324C ( f32  arg0)

◆ Unknown801A32F4()

void Unknown801A32F4 ( s32  arg0)

◆ Unknown801A33F8()

void Unknown801A33F8 ( f32  x,
f32  y,
f32  z 
)

◆ Unknown801A347C()

void Unknown801A347C ( f32  x,
f32  y,
f32  z 
)

◆ Unknown801A45E4()

void* Unknown801A45E4 ( const char file,
s32  fmt,
s32  size,
u32  arg3,
u32  arg4 
)

◆ Unknown801A47B8()

void Unknown801A47B8 ( struct ObjView v)

◆ Unknown801A47F4()

void Unknown801A47F4 ( UNUSED u32  arg0)

◆ Unknown801A4B04()

void Unknown801A4B04 ( void  )

◆ Unknown801A4F58()

void Unknown801A4F58 ( void  )

◆ Unknown801A5344()

void Unknown801A5344 ( void  )

◆ Unknown801A5910()

void Unknown801A5910 ( char arg0,
s32  len 
)

◆ Unknown801A5A80()

void Unknown801A5A80 ( UNUSED u32  arg0)

◆ Unknown801A5A94()

void Unknown801A5A94 ( UNUSED u32  arg0)

◆ Unknown801A5AB8()

void* Unknown801A5AB8 ( s32  texnum)

◆ Unknown801A5AE0()

void Unknown801A5AE0 ( s32  arg0)

◆ Unknown801A5C80()

void Unknown801A5C80 ( struct ObjGroup parentGroup)

◆ Unknown801A5D90()

void Unknown801A5D90 ( struct ObjGroup arg0)

◆ Unknown801A5FF8()

void Unknown801A5FF8 ( struct ObjGroup arg0)

◆ Unknown801A6E30()

void Unknown801A6E30 ( UNUSED u32  a0)

◆ Unknown801A6E44()

void Unknown801A6E44 ( UNUSED u32  a0)

◆ update_cursor()

void update_cursor ( void  )

◆ update_view_and_dl()

void update_view_and_dl ( struct ObjView view)

◆ view_proc_print_timers()

void view_proc_print_timers ( struct ObjView self)

254F94 -> 254FE4; orig name: Proc801A67C4 This prints all timers if the view was not updated for a frame

Variable Documentation

◆ _gd_dynlistsSegmentRomEnd

u8 _gd_dynlistsSegmentRomEnd[]

◆ _gd_dynlistsSegmentRomStart

u8 _gd_dynlistsSegmentRomStart[]

◆ D_801A8674

s32 D_801A8674 = 0
static

◆ D_801A867C

s32 D_801A867C = 0
static

◆ D_801A8680

s32 D_801A8680 = 0
static

◆ D_801A86A0

s32 D_801A86A0 = 0
static

◆ D_801A86A4

struct GdTimer* D_801A86A4 = NULL
static

◆ D_801A86A8

struct GdTimer* D_801A86A8 = NULL
static

◆ D_801A86AC

struct GdTimer* D_801A86AC = NULL
static

◆ D_801A86BC

s32 D_801A86BC = 1
static

◆ D_801A86C0

s32 D_801A86C0 = 0
static

◆ D_801A86CC

struct GdVec3f D_801A86CC = { 1.0f, 1.0f, 1.0f }
static

◆ D_801A86E0

struct ObjView* D_801A86E0 = NULL
static

◆ D_801A86F0

s32 D_801A86F0 = 0
static

◆ D_801BAE60

OSContStatus D_801BAE60[4]
static

◆ D_801BAEA0

u8 D_801BAEA0
static

◆ D_801BAF28

u32 D_801BAF28
static

◆ D_801BAF30

s16 D_801BAF30[13][8]
static

◆ D_801BB018

s32 D_801BB018
static

◆ D_801BB01C

s32 D_801BB01C
static

◆ D_801BB020

void* D_801BB020[0x10]
static

◆ D_801BB060

s32 D_801BB060[0x10]
static

◆ D_801BB0AC

s32 D_801BB0AC
static

◆ D_801BB0B4

s32 D_801BB0B4
static

◆ D_801BB0BC

s32 D_801BB0BC
static

◆ D_801BB0C4

s32 D_801BB0C4
static

◆ D_801BB0CC

s32 D_801BB0CC
static

◆ D_801BB0E8

struct GdVec3f D_801BB0E8
static

◆ D_801BB184

s16 D_801BB184
static

◆ D_801BB188

s32 D_801BB188
static

◆ D_801BB1B8

struct Unk801BB1B8 D_801BB1B8[2]
static

◆ D_801BB1D0

s32 D_801BB1D0
static

◆ D_801BB1D8

Hilite D_801BB1D8[600]
static

◆ D_801BD758

struct GdVec3f D_801BD758
static

◆ D_801BD768

struct GdVec3f D_801BD768
static

◆ D_801BD774

u32 D_801BD774
static

◆ D_801BD7A0

struct ObjView* D_801BD7A0[2]
static

◆ D_801BD7C8

struct GdDisplayList* D_801BD7C8[3][2]
static

◆ D_801BE790

LookAt D_801BE790[2]
static

◆ D_801BE7D0

LookAt D_801BE7D0[3]
static

◆ D_801BE830

OSMesgQueue D_801BE830
static

◆ D_801BE848

OSMesg D_801BE848[10]
static

◆ D_801BE8B0

OSMesgQueue D_801BE8B0
static

◆ D_801BE97C

OSMesg D_801BE97C
static

◆ D_801BE980

OSIoMesg D_801BE980
static

◆ D_801BE994

struct ObjView* D_801BE994
static

◆ gGdFrameBuf

s32 gGdFrameBuf = 0

◆ sActiveView

struct ObjView* sActiveView = NULL
static

◆ sAllocMemory

u32 sAllocMemory
static

◆ sAmbScaleColour

struct GdColour sAmbScaleColour
static

◆ sCarGdDlNum

s32 sCarGdDlNum
static

◆ sCarSceneGrp

struct ObjGroup* sCarSceneGrp
static

◆ sCarSceneView

struct ObjView* sCarSceneView
static

◆ sCurrentGdDl

struct GdDisplayList* sCurrentGdDl = NULL
static

◆ sDLGenTime

f32 sDLGenTime = 0.0f
static

◆ sDynamicsTime

f32 sDynamicsTime = 0.0f
static

◆ sDynDlSet1

struct GdDisplayList* sDynDlSet1[2]
static

◆ sDynLists

struct DynListBankInfo sDynLists[]
static
Initial value:
= {
}
struct DynList dynlist_unused[62]
Definition: dynlist_unused.c:6
Definition: renderer.c:89
struct DynList dynlist_test_cube[67]
Definition: dynlist_test_cube.c:8
Definition: renderer.c:89
#define NULL
Definition: mbi.h:101
struct DynList dynlist_mario_master[1026]
Definition: dynlist_mario_master.c:9

◆ sGdContPads

OSContPad sGdContPads[4]
static

◆ sGdDLArray

struct GdDisplayList* sGdDLArray[MAX_GD_DLS]
static

◆ sGdDlCount

u32 sGdDlCount = 0
static

◆ sGdDlStash

struct GdDisplayList* sGdDlStash
static

◆ sGdDMAQueue

OSMesgQueue sGdDMAQueue
static

◆ sGdMesgBuf

OSMesg sGdMesgBuf[1]
static

◆ sHandShape

struct ObjShape* sHandShape = NULL
static

◆ sHandView

struct ObjView* sHandView = NULL
static

◆ sIdnMtx

Mtx sIdnMtx
static

◆ sInitIdnMat4

Mat4f sInitIdnMat4
static

◆ sItemsInMenu

u32 sItemsInMenu = 0
static

◆ sLightScaleColours

struct GdColour sLightScaleColours[2]
static

◆ sMarioSceneGrp

struct ObjGroup* sMarioSceneGrp
static

◆ sMemBlockPoolBase

u8* sMemBlockPoolBase
static

◆ sMemBlockPoolSize

u32 sMemBlockPoolSize = 1
static

◆ sMemBlockPoolUsed

s32 sMemBlockPoolUsed = 0
static

◆ sMenuGadgets

struct GdObj* sMenuGadgets[9]
static

◆ sMenuView

struct ObjView* sMenuView = NULL
static

◆ sMHeadMainDls

struct GdDisplayList* sMHeadMainDls[2]
static

◆ sMSceneView

struct ObjView* sMSceneView
static

◆ sMtxParameters

s32 sMtxParameters = (G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH)
static

◆ sNewZPresses

s32 sNewZPresses = 0
static

◆ sPickBuf

s16* sPickBuf
static

◆ sPickBufLen

s32 sPickBufLen
static

◆ sPickBufPosition

s32 sPickBufPosition
static

◆ sPrevFrameCont

OSContPad sPrevFrameCont[4]
static

◆ sRCPTime

f32 sRCPTime = 0.0f
static

◆ sScreenView2

struct ObjView* sScreenView2 = NULL
static

◆ sStaticDl

struct GdDisplayList* sStaticDl
static

◆ sTimerGadgets

struct ObjGadget* sTimerGadgets[GD_NUM_TIMERS]
static

◆ sTimeScaleFactor

f32 sTimeScaleFactor = 1.0f
static

◆ sTracked1FrameTime

f32 sTracked1FrameTime = 0.0f
static

◆ strayDlEndCmd

u64 strayDlEndCmd = 0xB800000000000000
static

◆ sUpdateCarScene

s32 sUpdateCarScene
static

◆ sUpdateMarioScene

s32 sUpdateMarioScene
static

◆ sUpdateYoshiScene

s32 sUpdateYoshiScene
static

◆ sVtxCvrtNormBuf

s8 sVtxCvrtNormBuf[3]
static

◆ sVtxCvrtTCBuf

s16 sVtxCvrtTCBuf[2]
static

◆ sYoshiSceneGrp

struct ObjGroup* sYoshiSceneGrp
static

◆ sYoshiSceneView

struct ObjView* sYoshiSceneView
static

◆ unref_801a8670

u32 unref_801a8670 = 0
static

◆ unref_801a8678

u32 unref_801a8678 = 0
static

◆ unref_801a86B4

u32 unref_801a86B4 = 0
static

◆ unref_801a86C4

u32 unref_801a86C4 = 10
static

◆ unref_801a86F8

u32 unref_801a86F8 = 0
static

◆ unref_801bb000

u32 unref_801bb000[3]
static

◆ unref_801bb014

u32 unref_801bb014
static

◆ unref_801bb0dc

u32 unref_801bb0dc
static

◆ unref_801bb0e4

u32 unref_801bb0e4
static

◆ unref_801bb0f8

u32 unref_801bb0f8[2]
static

◆ unref_801be870

u32 unref_801be870[16]
static

◆ unref_801be8e0

u32 unref_801be8e0[25]
static

◆ unref_801be948

u32 unref_801be948[13]
static