Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
src
goddard
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 */
GdControl::unkD8b20
u8 unkD8b20
Definition:
gd_main.h:70
D_801A8058
f32 D_801A8058
Definition:
gd_main.c:17
GdControl::csrXatApress
s32 csrXatApress
Definition:
gd_main.h:59
GdControl::unk50
s32 unk50
Definition:
gd_main.h:47
gGdUseVtxNormal
s32 gGdUseVtxNormal
Definition:
gd_main.c:18
gGdCtrl
struct GdControl gGdCtrl
Definition:
gd_main.c:23
GdControl::csrX
s32 csrX
Definition:
gd_main.h:65
GdControl::unkD8b40
u8 unkD8b40
Definition:
gd_main.h:69
GdControl::pad58
u8 pad58[0x7C-0x58]
Definition:
gd_main.h:49
GdControl::frameCount
u32 frameCount
Definition:
gd_main.h:77
GdControl::unkAC
f32 unkAC
Definition:
gd_main.h:57
GdControl::cdown
s32 cdown
Definition:
gd_main.h:37
GdControl::stickXf
f32 stickXf
Definition:
gd_main.h:50
GdControl::unk28
void * unk28
Definition:
gd_main.h:38
GdControl::unkD8b04
u8 unkD8b04
Definition:
gd_main.h:73
GdControl::unkA0
f32 unkA0
Definition:
gd_main.h:55
GdControl::cleft
s32 cleft
Definition:
gd_main.h:34
GdControl::AbtnPressWait
u8 AbtnPressWait
Definition:
gd_main.h:74
GdControl::padA4
u8 padA4[0xAC-0xA4]
Definition:
gd_main.h:56
GdControl::csrYatApress
s32 csrYatApress
Definition:
gd_main.h:60
GdControl::pad84
u8 pad84[4]
Definition:
gd_main.h:52
GdControl::unk30
void * unk30
Definition:
gd_main.h:40
GdControl::dup
s32 dup
Definition:
gd_main.h:32
f32
float f32
Definition:
ultratypes.h:29
GdControl::unk88
f32 unk88
Definition:
gd_main.h:53
GdControl::dleft
s32 dleft
Definition:
gd_main.h:30
GdControl::cright
s32 cright
Definition:
gd_main.h:35
GdControl::btnB
s32 btnB
Definition:
gd_main.h:42
GdControl::padB0
u8 padB0[0xB8-0xB0]
Definition:
gd_main.h:58
GdControl::ddown
s32 ddown
Definition:
gd_main.h:33
GdControl::padE0
u8 padE0[0xE8-0xE0]
Definition:
gd_main.h:76
GdControl::unk4C
s32 unk4C
Definition:
gd_main.h:46
GdControl::csrY
s32 csrY
Definition:
gd_main.h:66
GdControl
Definition:
gd_main.h:27
GdControl::padEC
u8 padEC[0xF0-0xEC]
Definition:
gd_main.h:78
GdControl::btnApressed
u8 btnApressed
Definition:
gd_main.h:68
GdControl::stickDeltaX
s32 stickDeltaX
Definition:
gd_main.h:61
GdControl::newStartPress
s32 newStartPress
Definition:
gd_main.h:48
GdControl::pad04
u8 pad04[4]
Definition:
gd_main.h:29
GdControl::unk00
s32 unk00
Definition:
gd_main.h:28
gGdMoveScene
s32 gGdMoveScene
Definition:
gd_main.c:15
GdControl::stickDeltaY
s32 stickDeltaY
Definition:
gd_main.h:62
GdControl::stickY
s32 stickY
Definition:
gd_main.h:64
gGdCtrlPrev
struct GdControl gGdCtrlPrev
Definition:
gd_main.c:24
ultra64.h
GdControl::frameAbtnPressed
u32 frameAbtnPressed
Definition:
gd_main.h:75
u8
unsigned char u8
Definition:
ultratypes.h:12
GdControl::btnA
s32 btnA
Definition:
gd_main.h:41
GdControl::prevFrame
struct GdControl * prevFrame
Definition:
gd_main.h:79
GdControl::unk2C
void * unk2C
Definition:
gd_main.h:39
GdControl::trgR
s32 trgR
Definition:
gd_main.h:45
s32
signed int s32
Definition:
ultratypes.h:15
GdControl::stickX
s32 stickX
Definition:
gd_main.h:63
GdControl::stickYf
f32 stickYf
Definition:
gd_main.h:51
GdControl::unkD8b08
u8 unkD8b08
Definition:
gd_main.h:72
GdControl::pad8c
u8 pad8c[0xA0-0x8C]
Definition:
gd_main.h:54
GdControl::btnAnewPress
u8 btnAnewPress
Definition:
gd_main.h:71
u32
unsigned int u32
Definition:
ultratypes.h:16
GdControl::trgL
s32 trgL
Definition:
gd_main.h:44
GdControl::pad3C
u8 pad3C[0x44-0x3C]
Definition:
gd_main.h:43
GdControl::cup
s32 cup
Definition:
gd_main.h:36
GdControl::dright
s32 dright
Definition:
gd_main.h:31
Generated by
1.8.13