sm64

A Super Mario 64 decompilation
Log | Files | Refs | README | LICENSE

gd_main.c (1533B)


      1 #include <PR/ultratypes.h>
      2 
      3 #include "debug_utils.h"
      4 #include "gd_main.h"
      5 #include "gd_memory.h"
      6 #include "macros.h"
      7 #include "objects.h"
      8 #include "renderer.h"
      9 
     10 /* This file was spilt out of debug_memory.asm based on rodata.
     11  * The rodata for functions after this "__main__" function have string literals following
     12  * f32 literal, which implies that this is its own file
     13  */
     14 
     15 // data
     16 s32 gGdMoveScene = TRUE; // @ 801A8050
     17 UNUSED static s32 sUnref801A8054 = TRUE;
     18 f32 D_801A8058 = -600.0f;
     19 s32 gGdUseVtxNormal = TRUE; // @ 801A805C; instead of face normals
     20 UNUSED static s32 sUnrefScnWidth = 320;
     21 UNUSED static s32 sUnrefScnHeight = 240;
     22 
     23 // bss
     24 struct GdControl gGdCtrl;     // @ 801B9920; processed controller info
     25 struct GdControl gGdCtrlPrev; // @ 801B9A18; previous frame's controller info
     26 
     27 /**
     28  * Unused main function possibly from when this was a standalone demo
     29  */
     30 u32 __main__(void) {
     31     UNUSED u8 filler[4];
     32 
     33     gd_printf("%x, %x\n", (u32) (uintptr_t) &D_801A8058, (u32) (uintptr_t) &gGdMoveScene);
     34     imin("main");
     35     gd_init();
     36 
     37     gGdCtrl.unk88 = 0.46799f;
     38     gGdCtrl.unkA0 = -34.0f;
     39     gGdCtrl.unkAC = 34.0f;
     40     gGdCtrl.unk00 = 2;
     41     gGdCtrl.newStartPress = FALSE;
     42     gGdCtrl.prevFrame = &gGdCtrlPrev;
     43 
     44     imin("main - make_scene");
     45     make_scene();  // make_scene does nothing, though
     46     imout();
     47 
     48     gd_init_controllers();
     49     print_all_memtrackers();
     50 
     51     start_timer("dlgen");
     52     stop_timer("dlgen");
     53     mem_stats();
     54 
     55     while (TRUE) {
     56         func_801A520C();
     57     }
     58 
     59     imout();
     60     return 0;
     61 }