Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
gd_main.h
Go to the documentation of this file.
1 #ifndef GD_MAIN_H
2 #define GD_MAIN_H
3 
4 #include <ultra64.h>
5 
6 // In various files of the Goddard subsystem, there are miscellaneous
7 // unused rodata strings. These can be generated via a printf call that
8 // is stubbed out, but not via define printf(...), as IDO 5.3 C
9 // preprocessor did not support va_arg defines. Goddard, however, did
10 // use gd_printf, which is distinct from this type of stubbed call, as
11 // gd_printf actually is called. This could be because gd_printf could
12 // forward to printf (currently unclear whether it might or might not,
13 // gd_printf is awaiting decompilation), which would indicate goddard was
14 // in the middle of moving these calls to the wrapper function. The unmoved
15 // calls result in the unused rodata strings.
16 #ifdef __GNUC__
17 #define printf(...) \
18  _Pragma ("GCC diagnostic push") \
19  _Pragma ("GCC diagnostic ignored \"-Wunused-value\"") \
20  (__VA_ARGS__); \
21  _Pragma ("GCC diagnostic pop")
22 #else
23 #define printf
24 #endif
25 
26 // structs
27 struct GdControl { // gGdCtrl
28  /* 0x00 */ s32 unk00;
29  /* 0x04 */ u8 pad04[4];
30  /* 0x08 */ s32 dleft; // Dpad-left (mask)
31  /* 0x0C */ s32 dright; // Dpad-right (mask)
32  /* 0x10 */ s32 dup; // Dpad-up (mask)
33  /* 0x14 */ s32 ddown; // Dpad-down (mask)
34  /* 0x18 */ s32 cleft; // bool C-left
35  /* 0x1C */ s32 cright; // bool C-right
36  /* 0x20 */ s32 cup; // bool C-up
37  /* 0x24 */ s32 cdown; // bool C-down
38  /* 0x28 */ void * unk28; // null-checked ptr? symbol not deref-ed in extant code?
39  /* 0x2C */ void * unk2C; // some sort of old texture ptr? symbol not deref-ed in extant code?
40  /* 0x30 */ void * unk30; // null-checked ptr? symbol not deref-ed in extant code?
41  /* 0x34 */ s32 btnA; // bool A button
42  /* 0x38 */ s32 btnB; // bool B button
43  /* 0x3C */ u8 pad3C[0x44-0x3C];
44  /* 0x44 */ s32 trgL; // bool L trigger pressed
45  /* 0x48 */ s32 trgR; // bool R trigger pressed
46  /* 0x4C */ s32 unk4C;
47  /* 0x50 */ s32 unk50;
48  /* 0x54 */ s32 newStartPress; // toggle bit? start pressed?
49  /* 0x58 */ u8 pad58[0x7C-0x58];
50  /* 0x7C */ f32 stickXf;
51  /* 0x80 */ f32 stickYf;
52  /* 0x84 */ u8 pad84[4];
53  /* 0x88 */ f32 unk88;
54  /* 0x8C */ u8 pad8c[0xA0-0x8C];
55  /* 0xA0 */ f32 unkA0;
56  /* 0xA4 */ u8 padA4[0xAC-0xA4];
57  /* 0xAC */ f32 unkAC;
58  /* 0xB0 */ u8 padB0[0xB8-0xB0];
59  /* 0xB8 */ s32 csrXatApress; // cursor x position when there was a new (A) press?
60  /* 0xBC */ s32 csrYatApress; // cursor y position when there was a new (A) press?
61  /* 0xC0 */ s32 stickDeltaX;
62  /* 0xC4 */ s32 stickDeltaY;
63  /* 0xC8 */ s32 stickX;
64  /* 0xCC */ s32 stickY;
65  /* 0xD0 */ s32 csrX; // bounded by screen view
66  /* 0xD4 */ s32 csrY; // bounded by screen view
67  /* 0xD8 */ /* hand/cursor state bitfield? */
68  /* b80 */ u8 btnApressed : 1; // bool (A) pressed
69  /* b40 */ u8 unkD8b40 : 1; // set to FALSE and unused
70  /* b20 */ u8 unkD8b20 : 1; // set to FALSE and unused
71  /* b10 */ u8 btnAnewPress : 1; // bool new (A) press
72  /* b08 */ u8 unkD8b08 : 1;
73  /* b04 */ u8 unkD8b04 : 1;
74  /* b02 */ u8 AbtnPressWait : 1; // bool 10 frames between (A) presses (cursor cool down?)
75  /* 0xDC */ u32 frameAbtnPressed; // first frame of new a press
76  /* 0xE0 */ u8 padE0[0xE8-0xE0];
77  /* 0xE8 */ u32 frameCount; // frame count?
78  /* 0xEC */ u8 padEC[0xF0-0xEC];
79  /* 0xF0 */ struct GdControl *prevFrame; // previous frame data
80 };
81 
82 // data
83 extern s32 gGdMoveScene;
84 extern f32 D_801A8058;
85 extern s32 gGdUseVtxNormal;
86 
87 // bss
88 extern struct GdControl gGdCtrl;
89 extern struct GdControl gGdCtrlPrev;
90 
91 #endif /* GD_MAIN_H */
u8 unkD8b20
Definition: gd_main.h:70
f32 D_801A8058
Definition: gd_main.c:17
s32 csrXatApress
Definition: gd_main.h:59
s32 unk50
Definition: gd_main.h:47
s32 gGdUseVtxNormal
Definition: gd_main.c:18
struct GdControl gGdCtrl
Definition: gd_main.c:23
s32 csrX
Definition: gd_main.h:65
u8 unkD8b40
Definition: gd_main.h:69
u8 pad58[0x7C-0x58]
Definition: gd_main.h:49
u32 frameCount
Definition: gd_main.h:77
f32 unkAC
Definition: gd_main.h:57
s32 cdown
Definition: gd_main.h:37
f32 stickXf
Definition: gd_main.h:50
void * unk28
Definition: gd_main.h:38
u8 unkD8b04
Definition: gd_main.h:73
f32 unkA0
Definition: gd_main.h:55
s32 cleft
Definition: gd_main.h:34
u8 AbtnPressWait
Definition: gd_main.h:74
u8 padA4[0xAC-0xA4]
Definition: gd_main.h:56
s32 csrYatApress
Definition: gd_main.h:60
u8 pad84[4]
Definition: gd_main.h:52
void * unk30
Definition: gd_main.h:40
s32 dup
Definition: gd_main.h:32
float f32
Definition: ultratypes.h:29
f32 unk88
Definition: gd_main.h:53
s32 dleft
Definition: gd_main.h:30
s32 cright
Definition: gd_main.h:35
s32 btnB
Definition: gd_main.h:42
u8 padB0[0xB8-0xB0]
Definition: gd_main.h:58
s32 ddown
Definition: gd_main.h:33
u8 padE0[0xE8-0xE0]
Definition: gd_main.h:76
s32 unk4C
Definition: gd_main.h:46
s32 csrY
Definition: gd_main.h:66
Definition: gd_main.h:27
u8 padEC[0xF0-0xEC]
Definition: gd_main.h:78
u8 btnApressed
Definition: gd_main.h:68
s32 stickDeltaX
Definition: gd_main.h:61
s32 newStartPress
Definition: gd_main.h:48
u8 pad04[4]
Definition: gd_main.h:29
s32 unk00
Definition: gd_main.h:28
s32 gGdMoveScene
Definition: gd_main.c:15
s32 stickDeltaY
Definition: gd_main.h:62
s32 stickY
Definition: gd_main.h:64
struct GdControl gGdCtrlPrev
Definition: gd_main.c:24
u32 frameAbtnPressed
Definition: gd_main.h:75
unsigned char u8
Definition: ultratypes.h:12
s32 btnA
Definition: gd_main.h:41
struct GdControl * prevFrame
Definition: gd_main.h:79
void * unk2C
Definition: gd_main.h:39
s32 trgR
Definition: gd_main.h:45
signed int s32
Definition: ultratypes.h:15
s32 stickX
Definition: gd_main.h:63
f32 stickYf
Definition: gd_main.h:51
u8 unkD8b08
Definition: gd_main.h:72
u8 pad8c[0xA0-0x8C]
Definition: gd_main.h:54
u8 btnAnewPress
Definition: gd_main.h:71
unsigned int u32
Definition: ultratypes.h:16
s32 trgL
Definition: gd_main.h:44
u8 pad3C[0x44-0x3C]
Definition: gd_main.h:43
s32 cup
Definition: gd_main.h:36
s32 dright
Definition: gd_main.h:31