#ifndef GD_MAIN_H1#define GD_MAIN_H23#include <PR/ultratypes.h>45// In various files of the Goddard subsystem, there are miscellaneous6// unused rodata strings. These are likely byproducts of a printf macro7// that was stubbed out as "#define printf", letting printf calls expand8// to no-op comma expressions. (IDO doesn't support variadic macros, so9// "#define printf(...) /* nothing */" wasn't an option.)10// This macro is separate from the gd_printf function; one probably11// forwarded to the other, but it is hard to tell in which direction.12#ifdef __GNUC__13#define printf(...) \14_Pragma ("GCC diagnostic push") \15_Pragma ("GCC diagnostic ignored \"-Wunused-value\"") \16(__VA_ARGS__); \17_Pragma ("GCC diagnostic pop")18#else19#define printf20#endif2122// structs23struct GdControl { // gGdCtrl24/* 0x00 */ s32 unk00; // set but never used25/* 0x04 */ u8 pad04[4];26/* 0x08 */ s32 dleft; // Dpad-left (mask)27/* 0x0C */ s32 dright; // Dpad-right (mask)28/* 0x10 */ s32 dup; // Dpad-up (mask)29/* 0x14 */ s32 ddown; // Dpad-down (mask)30/* 0x18 */ s32 cleft; // bool C-left31/* 0x1C */ s32 cright; // bool C-right32/* 0x20 */ s32 cup; // bool C-up33/* 0x24 */ s32 cdown; // bool C-down34/* 0x28 */ void * unk28; // null-checked ptr? symbol not deref-ed in extant code?35/* 0x2C */ void * unk2C; // some sort of old texture ptr? symbol not deref-ed in extant code?36/* 0x30 */ void * unk30; // null-checked ptr? symbol not deref-ed in extant code?37/* 0x34 */ s32 btnA; // bool A button38/* 0x38 */ s32 btnB; // bool B button39/* 0x3C */ u8 pad3C[0x44-0x3C];40/* 0x44 */ s32 trgL; // bool L trigger pressed41/* 0x48 */ s32 trgR; // bool R trigger pressed42/* 0x4C */ s32 unk4C;43/* 0x50 */ s32 unk50;44/* 0x54 */ s32 newStartPress; // toggle bit? start pressed?45/* 0x58 */ u8 pad58[0x7C-0x58];46/* 0x7C */ f32 stickXf;47/* 0x80 */ f32 stickYf;48/* 0x84 */ u8 pad84[4];49/* 0x88 */ f32 unk88; // set but never used50/* 0x8C */ u8 pad8c[0xA0-0x8C];51/* 0xA0 */ f32 unkA0; // set but never used52/* 0xA4 */ u8 padA4[0xAC-0xA4];53/* 0xAC */ f32 unkAC;54/* 0xB0 */ u8 padB0[0xB8-0xB0];55/* 0xB8 */ s32 dragStartX; // cursor x position when there was a new (A) press?56/* 0xBC */ s32 dragStartY; // cursor y position when there was a new (A) press?57/* 0xC0 */ s32 stickDeltaX;58/* 0xC4 */ s32 stickDeltaY;59/* 0xC8 */ s32 stickX;60/* 0xCC */ s32 stickY;61/* 0xD0 */ s32 csrX; // bounded by screen view62/* 0xD4 */ s32 csrY; // bounded by screen view63/* 0xD8 */ /* hand/cursor state bitfield? */64/* b80 */ u8 dragging : 1; // bool (A) pressed65/* b40 */ u8 unkD8b40 : 1; // set to FALSE and unused66/* b20 */ u8 unkD8b20 : 1; // set to FALSE and unused67/* b10 */ u8 startedDragging : 1; // bool new (A) press68/* b08 */ u8 unkD8b08 : 1;69/* b04 */ u8 unkD8b04 : 1;70/* b02 */ u8 AbtnPressWait : 1; // bool 10 frames between (A) presses (cursor cool down?)71/* 0xDC */ u32 dragStartFrame; // first frame of new a press72/* 0xE0 */ u8 padE0[0xE8-0xE0];73/* 0xE8 */ u32 currFrame; // frame count?74/* 0xEC */ u8 padEC[0xF0-0xEC];75/* 0xF0 */ struct GdControl *prevFrame; // previous frame data76};7778// data79extern s32 gGdMoveScene;80extern f32 D_801A8058;81extern s32 gGdUseVtxNormal;8283// bss84extern struct GdControl gGdCtrl;85extern struct GdControl gGdCtrlPrev;8687#endif // GD_MAIN_H888990