mirror of
https://github.com/zeldaret/oot.git
synced 2025-02-09 14:06:54 +00:00
Cleanup z_debug (reg editor) (#1290)
* Cleanup z_debug * misc * pad reg names column to """allow""" 40 characters because why not * safety parentheses in regs.h * More safety parentheses, in named regs defines * sort named regs in order, except for message system regs (?) * put all regs in order (message system ones too)
This commit is contained in:
parent
79cb1f8d5c
commit
9647f50451
5 changed files with 337 additions and 277 deletions
|
@ -805,7 +805,7 @@ void SaveContext_Init(void);
|
|||
s32 func_800635D0(s32);
|
||||
void func_800636C0(void);
|
||||
void func_8006375C(s32 arg0, s32 arg1, const char* text);
|
||||
void func_8006376C(u8 x, u8 y, u8 colorId, const char* text);
|
||||
void func_8006376C(u8 x, u8 y, u8 colorIndex, const char* text);
|
||||
// ? func_80063828(?);
|
||||
void func_8006390C(Input* input);
|
||||
// ? func_80063C04(?);
|
||||
|
|
318
include/regs.h
318
include/regs.h
|
@ -3,167 +3,167 @@
|
|||
|
||||
#define REG_GROUPS 29 // number of REG groups, i.e. REG, SREG, OREG, etc.
|
||||
#define REG_PAGES 6
|
||||
#define REG_PER_PAGE 16
|
||||
#define REG_PER_GROUP REG_PAGES * REG_PER_PAGE
|
||||
#define REGS_PER_PAGE 16
|
||||
#define REGS_PER_GROUP (REG_PAGES * REGS_PER_PAGE)
|
||||
|
||||
#define BASE_REG(n, r) gGameInfo->data[n * REG_PER_GROUP + r]
|
||||
#define BASE_REG(n, r) gGameInfo->data[(n) * REGS_PER_GROUP + (r)]
|
||||
|
||||
#define REG(r) BASE_REG(0, r)
|
||||
#define SREG(r) BASE_REG(1, r)
|
||||
#define OREG(r) BASE_REG(2, r)
|
||||
#define PREG(r) BASE_REG(3, r)
|
||||
#define QREG(r) BASE_REG(4, r)
|
||||
#define MREG(r) BASE_REG(5, r)
|
||||
#define YREG(r) BASE_REG(6, r)
|
||||
#define DREG(r) BASE_REG(7, r)
|
||||
#define UREG(r) BASE_REG(8, r)
|
||||
#define IREG(r) BASE_REG(9, r)
|
||||
#define ZREG(r) BASE_REG(10, r)
|
||||
#define CREG(r) BASE_REG(11, r)
|
||||
#define NREG(r) BASE_REG(12, r)
|
||||
#define KREG(r) BASE_REG(13, r)
|
||||
#define XREG(r) BASE_REG(14, r)
|
||||
#define cREG(r) BASE_REG(15, r)
|
||||
#define sREG(r) BASE_REG(16, r)
|
||||
#define iREG(r) BASE_REG(17, r)
|
||||
#define WREG(r) BASE_REG(18, r)
|
||||
#define AREG(r) BASE_REG(19, r)
|
||||
#define VREG(r) BASE_REG(20, r)
|
||||
#define HREG(r) BASE_REG(21, r)
|
||||
#define GREG(r) BASE_REG(22, r)
|
||||
#define mREG(r) BASE_REG(23, r)
|
||||
#define nREG(r) BASE_REG(24, r)
|
||||
#define BREG(r) BASE_REG(25, r)
|
||||
#define dREG(r) BASE_REG(26, r)
|
||||
#define kREG(r) BASE_REG(27, r)
|
||||
#define bREG(r) BASE_REG(28, r)
|
||||
#define REG(r) BASE_REG(0, (r))
|
||||
#define SREG(r) BASE_REG(1, (r))
|
||||
#define OREG(r) BASE_REG(2, (r))
|
||||
#define PREG(r) BASE_REG(3, (r))
|
||||
#define QREG(r) BASE_REG(4, (r))
|
||||
#define MREG(r) BASE_REG(5, (r))
|
||||
#define YREG(r) BASE_REG(6, (r))
|
||||
#define DREG(r) BASE_REG(7, (r))
|
||||
#define UREG(r) BASE_REG(8, (r))
|
||||
#define IREG(r) BASE_REG(9, (r))
|
||||
#define ZREG(r) BASE_REG(10, (r))
|
||||
#define CREG(r) BASE_REG(11, (r))
|
||||
#define NREG(r) BASE_REG(12, (r))
|
||||
#define KREG(r) BASE_REG(13, (r))
|
||||
#define XREG(r) BASE_REG(14, (r))
|
||||
#define cREG(r) BASE_REG(15, (r))
|
||||
#define sREG(r) BASE_REG(16, (r))
|
||||
#define iREG(r) BASE_REG(17, (r))
|
||||
#define WREG(r) BASE_REG(18, (r))
|
||||
#define AREG(r) BASE_REG(19, (r))
|
||||
#define VREG(r) BASE_REG(20, (r))
|
||||
#define HREG(r) BASE_REG(21, (r))
|
||||
#define GREG(r) BASE_REG(22, (r))
|
||||
#define mREG(r) BASE_REG(23, (r))
|
||||
#define nREG(r) BASE_REG(24, (r))
|
||||
#define BREG(r) BASE_REG(25, (r))
|
||||
#define dREG(r) BASE_REG(26, (r))
|
||||
#define kREG(r) BASE_REG(27, (r))
|
||||
#define bREG(r) BASE_REG(28, (r))
|
||||
|
||||
#define R_ENV_AMBIENT_COLOR(i) REG(0 + i)
|
||||
#define R_ENV_LIGHT1_COLOR(i) REG(3 + i)
|
||||
#define R_ENV_LIGHT2_COLOR(i) REG(6 + i)
|
||||
#define R_ENV_DISABLE_DBG REG(9)
|
||||
#define R_ENV_FOG_COLOR(i) REG(10 + i)
|
||||
#define R_ENV_FOG_FAR REG(13)
|
||||
#define R_ENV_FOG_NEAR REG(14)
|
||||
#define R_ENV_TIME_SPEED_OLD REG(15) // Most likely used during development. Unused in the final game.
|
||||
#define R_RUN_SPEED_LIMIT REG(45)
|
||||
#define R_ENABLE_PLAY_LOGS HREG(63)
|
||||
#define R_ENABLE_ARENA_DBG SREG(0)
|
||||
#define R_UPDATE_RATE SREG(30)
|
||||
#define R_ENABLE_AUDIO_DBG SREG(36)
|
||||
#define R_FB_FILTER_TYPE SREG(80)
|
||||
#define R_FB_FILTER_PRIM_COLOR(c) SREG(81 + c)
|
||||
#define R_FB_FILTER_A SREG(84)
|
||||
#define R_FB_FILTER_ENV_COLOR(c) SREG(85 + c)
|
||||
#define R_ENABLE_FB_FILTER SREG(88)
|
||||
#define R_PAUSE_MENU_MODE SREG(94)
|
||||
#define R_CAM_MAX_PHI OREG(5)
|
||||
#define R_CAM_DEFA_PHI_UPDRATE OREG(7)
|
||||
#define R_DEFA_CAM_ANIM_TIME OREG(23)
|
||||
#define R_CAM_MIN_PHI OREG(34)
|
||||
#define R_CAM_MIN_PHI2 OREG(35)
|
||||
#define R_AT_LERP_MIN OREG(41)
|
||||
#define R_AT_LERP_SCALE OREG(42)
|
||||
#define R_CAM_YOFFSET_NORM OREG(46)
|
||||
#define R_CAM_DATA(type) PREG(type)
|
||||
#define R_DBG_CAM_UPDATE PREG(80)
|
||||
#define R_DBG_REG_UPDATE PREG(82)
|
||||
#define R_RELOAD_CAM_PARAMS QREG(0)
|
||||
#define R_SCENE_CAM_TYPE YREG(15)
|
||||
#define R_C_UP_ICON_X YREG(88)
|
||||
#define R_C_UP_ICON_Y YREG(89)
|
||||
#define R_MAGIC_FILL_COLOR(i) ZREG(0 + i)
|
||||
#define R_C_BTN_COLOR(i) ZREG(39 + i)
|
||||
#define R_B_BTN_COLOR(i) ZREG(43 + i)
|
||||
#define R_START_LABEL_DD(i) ZREG(48 + i)
|
||||
#define R_START_LABEL_Y(i) ZREG(51 + i)
|
||||
#define R_START_LABEL_X(i) ZREG(54 + i)
|
||||
#define R_C_UP_BTN_X ZREG(62)
|
||||
#define R_C_UP_BTN_Y ZREG(63)
|
||||
#define R_START_BTN_X ZREG(68)
|
||||
#define R_START_BTN_Y ZREG(69)
|
||||
#define R_ITEM_BTN_X(i) ZREG(70 + i)
|
||||
#define R_ITEM_BTN_Y(i) ZREG(74 + i)
|
||||
#define R_ITEM_BTN_DD(i) ZREG(78 + i)
|
||||
#define R_ITEM_ICON_X(i) ZREG(82 + i)
|
||||
#define R_ITEM_ICON_Y(i) ZREG(86 + i)
|
||||
#define R_ITEM_ICON_DD(i) ZREG(90 + i)
|
||||
#define R_TRANS_DBG_ENABLED CREG(11)
|
||||
#define R_TRANS_DBG_TYPE CREG(12)
|
||||
#define R_ENV_WIND_DIR(i) CREG(16 + i)
|
||||
#define R_ENV_WIND_SPEED CREG(19)
|
||||
#define R_A_BTN_Y XREG(16)
|
||||
#define R_A_BTN_X XREG(17)
|
||||
#define R_A_ICON_Y XREG(19)
|
||||
#define R_A_ICON_X XREG(20)
|
||||
#define R_A_BTN_COLOR(i) XREG(22 + i)
|
||||
#define R_MAGIC_METER_Y_HIGHER XREG(48)
|
||||
#define R_MAGIC_METER_X XREG(49)
|
||||
#define R_MAGIC_METER_Y_LOWER XREG(50)
|
||||
#define R_MAGIC_FILL_X XREG(51)
|
||||
#define R_ENV_LIGHT1_DIR(i) cREG(3 + i)
|
||||
#define R_ENV_LIGHT2_DIR(i) cREG(6 + i)
|
||||
#define R_B_LABEL_DD WREG(0)
|
||||
#define R_OW_MINIMAP_X WREG(29)
|
||||
#define R_OW_MINIMAP_Y WREG(30)
|
||||
#define R_MINIMAP_DISABLED WREG(31)
|
||||
#define R_B_LABEL_X(i) WREG(40 + i)
|
||||
#define R_B_LABEL_Y(i) WREG(43 + i)
|
||||
#define R_DGN_MINIMAP_X WREG(68)
|
||||
#define R_DGN_MINIMAP_Y WREG(69)
|
||||
#define R_MAP_INDEX VREG(11)
|
||||
#define R_MAP_TEX_INDEX_BASE VREG(12)
|
||||
#define R_MAP_TEX_INDEX VREG(13)
|
||||
#define R_COMPASS_SCALE_X VREG(14)
|
||||
#define R_COMPASS_SCALE_Y VREG(15)
|
||||
#define R_COMPASS_OFFSET_X VREG(16)
|
||||
#define R_COMPASS_OFFSET_Y VREG(17)
|
||||
#define R_MINIMAP_COLOR(i) VREG(18 + i)
|
||||
#define R_ITEM_AMMO_X(i) VREG(64 + i)
|
||||
#define R_ITEM_AMMO_Y(i) VREG(68 + i)
|
||||
#define R_ITEM_ICON_WIDTH(i) VREG(76 + i)
|
||||
#define R_ITEM_BTN_WIDTH(i) VREG(80 + i)
|
||||
#define R_DISABLE_INPUT_DISPLAY HREG(47)
|
||||
#define R_EN_GOROIWA_SPEED mREG(12)
|
||||
#define R_NAVI_MSG_REGION_ALPHA nREG(87)
|
||||
#define R_TEXT_DROP_SHADOW_OFFSET XREG(60)
|
||||
#define R_TEXTBOX_X_TARGET XREG(72)
|
||||
#define R_TEXTBOX_Y_TARGET XREG(73)
|
||||
#define R_TEXTBOX_TEXWIDTH YREG(16)
|
||||
#define R_TEXTBOX_TEXHEIGHT YREG(17)
|
||||
#define R_TEXTBOX_WIDTH YREG(22)
|
||||
#define R_TEXTBOX_HEIGHT YREG(23)
|
||||
#define R_MESSAGE_DEBUGGER_SELECT YREG(78)
|
||||
#define R_MESSAGE_DEBUGGER_TEXTID YREG(79)
|
||||
#define R_TEXT_LINE_SPACING XREG(56)
|
||||
#define R_TEXT_CHAR_SCALE XREG(57)
|
||||
#define R_TEXTBOX_ICON_XPOS YREG(71)
|
||||
#define R_TEXTBOX_ICON_YPOS YREG(72)
|
||||
#define R_TEXTBOX_ICON_SIZE YREG(75)
|
||||
#define R_TEXTBOX_X VREG(0)
|
||||
#define R_TEXTBOX_Y VREG(1)
|
||||
#define R_TEXTBOX_END_XPOS XREG(64)
|
||||
#define R_TEXTBOX_END_YPOS XREG(65)
|
||||
#define R_TEXTBOX_WIDTH_TARGET XREG(74)
|
||||
#define R_TEXTBOX_HEIGHT_TARGET XREG(75)
|
||||
#define R_TEXTBOX_TEXWIDTH_TARGET XREG(76)
|
||||
#define R_TEXTBOX_TEXHEIGHT_TARGET XREG(77)
|
||||
#define R_TEXT_ADJUST_COLOR_1_R VREG(33)
|
||||
#define R_TEXT_ADJUST_COLOR_1_G VREG(34)
|
||||
#define R_TEXT_ADJUST_COLOR_1_B VREG(35)
|
||||
#define R_TEXT_ADJUST_COLOR_2_R VREG(36)
|
||||
#define R_TEXT_ADJUST_COLOR_2_G VREG(37)
|
||||
#define R_TEXT_ADJUST_COLOR_2_B VREG(38)
|
||||
#define R_TEXT_CHOICE_XPOS XREG(66)
|
||||
#define R_TEXT_CHOICE_YPOS(choice) XREG(67 + (choice))
|
||||
#define R_TEXT_INIT_XPOS XREG(54)
|
||||
#define R_TEXT_INIT_YPOS XREG(55)
|
||||
#define R_TEXTBOX_BG_YPOS XREG(61)
|
||||
#define R_TEXTBOX_CLEF_XPOS VREG(7)
|
||||
#define R_TEXTBOX_CLEF_YPOS VREG(8)
|
||||
#define R_OCARINA_BUTTONS_XPOS VREG(28)
|
||||
#define R_OCARINA_BUTTONS_YPOS(note) VREG(45 + (note))
|
||||
#define R_OCARINA_BUTTONS_XPOS_OFFSET VREG(29)
|
||||
#define R_OCARINA_BUTTONS_YPOS_OFFSET VREG(51)
|
||||
#define R_ENV_AMBIENT_COLOR(i) REG(0 + (i))
|
||||
#define R_ENV_LIGHT1_COLOR(i) REG(3 + (i))
|
||||
#define R_ENV_LIGHT2_COLOR(i) REG(6 + (i))
|
||||
#define R_ENV_DISABLE_DBG REG(9)
|
||||
#define R_ENV_FOG_COLOR(i) REG(10 + (i))
|
||||
#define R_ENV_FOG_FAR REG(13)
|
||||
#define R_ENV_FOG_NEAR REG(14)
|
||||
#define R_ENV_TIME_SPEED_OLD REG(15) // Most likely used during development. Unused in the final game.
|
||||
#define R_RUN_SPEED_LIMIT REG(45)
|
||||
#define R_ENABLE_ARENA_DBG SREG(0)
|
||||
#define R_UPDATE_RATE SREG(30)
|
||||
#define R_ENABLE_AUDIO_DBG SREG(36)
|
||||
#define R_FB_FILTER_TYPE SREG(80)
|
||||
#define R_FB_FILTER_PRIM_COLOR(c) SREG(81 + (c))
|
||||
#define R_FB_FILTER_A SREG(84)
|
||||
#define R_FB_FILTER_ENV_COLOR(c) SREG(85 + (c))
|
||||
#define R_ENABLE_FB_FILTER SREG(88)
|
||||
#define R_PAUSE_MENU_MODE SREG(94)
|
||||
#define R_CAM_MAX_PHI OREG(5)
|
||||
#define R_CAM_DEFA_PHI_UPDRATE OREG(7)
|
||||
#define R_DEFA_CAM_ANIM_TIME OREG(23)
|
||||
#define R_CAM_MIN_PHI OREG(34)
|
||||
#define R_CAM_MIN_PHI2 OREG(35)
|
||||
#define R_AT_LERP_MIN OREG(41)
|
||||
#define R_AT_LERP_SCALE OREG(42)
|
||||
#define R_CAM_YOFFSET_NORM OREG(46)
|
||||
#define R_CAM_DATA(type) PREG(0 + (type))
|
||||
#define R_DBG_CAM_UPDATE PREG(80)
|
||||
#define R_DBG_REG_UPDATE PREG(82)
|
||||
#define R_RELOAD_CAM_PARAMS QREG(0)
|
||||
#define R_SCENE_CAM_TYPE YREG(15)
|
||||
#define R_TEXTBOX_TEXWIDTH YREG(16)
|
||||
#define R_TEXTBOX_TEXHEIGHT YREG(17)
|
||||
#define R_TEXTBOX_WIDTH YREG(22)
|
||||
#define R_TEXTBOX_HEIGHT YREG(23)
|
||||
#define R_TEXTBOX_ICON_XPOS YREG(71)
|
||||
#define R_TEXTBOX_ICON_YPOS YREG(72)
|
||||
#define R_TEXTBOX_ICON_SIZE YREG(75)
|
||||
#define R_MESSAGE_DEBUGGER_SELECT YREG(78)
|
||||
#define R_MESSAGE_DEBUGGER_TEXTID YREG(79)
|
||||
#define R_C_UP_ICON_X YREG(88)
|
||||
#define R_C_UP_ICON_Y YREG(89)
|
||||
#define R_MAGIC_FILL_COLOR(i) ZREG(0 + (i))
|
||||
#define R_C_BTN_COLOR(i) ZREG(39 + (i))
|
||||
#define R_B_BTN_COLOR(i) ZREG(43 + (i))
|
||||
#define R_START_LABEL_DD(i) ZREG(48 + (i))
|
||||
#define R_START_LABEL_Y(i) ZREG(51 + (i))
|
||||
#define R_START_LABEL_X(i) ZREG(54 + (i))
|
||||
#define R_C_UP_BTN_X ZREG(62)
|
||||
#define R_C_UP_BTN_Y ZREG(63)
|
||||
#define R_START_BTN_X ZREG(68)
|
||||
#define R_START_BTN_Y ZREG(69)
|
||||
#define R_ITEM_BTN_X(i) ZREG(70 + (i))
|
||||
#define R_ITEM_BTN_Y(i) ZREG(74 + (i))
|
||||
#define R_ITEM_BTN_DD(i) ZREG(78 + (i))
|
||||
#define R_ITEM_ICON_X(i) ZREG(82 + (i))
|
||||
#define R_ITEM_ICON_Y(i) ZREG(86 + (i))
|
||||
#define R_ITEM_ICON_DD(i) ZREG(90 + (i))
|
||||
#define R_TRANS_DBG_ENABLED CREG(11)
|
||||
#define R_TRANS_DBG_TYPE CREG(12)
|
||||
#define R_ENV_WIND_DIR(i) CREG(16 + (i))
|
||||
#define R_ENV_WIND_SPEED CREG(19)
|
||||
#define R_A_BTN_Y XREG(16)
|
||||
#define R_A_BTN_X XREG(17)
|
||||
#define R_A_ICON_Y XREG(19)
|
||||
#define R_A_ICON_X XREG(20)
|
||||
#define R_A_BTN_COLOR(i) XREG(22 + (i))
|
||||
#define R_MAGIC_METER_Y_HIGHER XREG(48)
|
||||
#define R_MAGIC_METER_X XREG(49)
|
||||
#define R_MAGIC_METER_Y_LOWER XREG(50)
|
||||
#define R_MAGIC_FILL_X XREG(51)
|
||||
#define R_TEXT_INIT_XPOS XREG(54)
|
||||
#define R_TEXT_INIT_YPOS XREG(55)
|
||||
#define R_TEXT_LINE_SPACING XREG(56)
|
||||
#define R_TEXT_CHAR_SCALE XREG(57)
|
||||
#define R_TEXT_DROP_SHADOW_OFFSET XREG(60)
|
||||
#define R_TEXTBOX_BG_YPOS XREG(61)
|
||||
#define R_TEXTBOX_END_XPOS XREG(64)
|
||||
#define R_TEXTBOX_END_YPOS XREG(65)
|
||||
#define R_TEXT_CHOICE_XPOS XREG(66)
|
||||
#define R_TEXT_CHOICE_YPOS(choice) XREG(67 + (choice))
|
||||
#define R_TEXTBOX_X_TARGET XREG(72)
|
||||
#define R_TEXTBOX_Y_TARGET XREG(73)
|
||||
#define R_TEXTBOX_WIDTH_TARGET XREG(74)
|
||||
#define R_TEXTBOX_HEIGHT_TARGET XREG(75)
|
||||
#define R_TEXTBOX_TEXWIDTH_TARGET XREG(76)
|
||||
#define R_TEXTBOX_TEXHEIGHT_TARGET XREG(77)
|
||||
#define R_ENV_LIGHT1_DIR(i) cREG(3 + (i))
|
||||
#define R_ENV_LIGHT2_DIR(i) cREG(6 + (i))
|
||||
#define R_B_LABEL_DD WREG(0)
|
||||
#define R_OW_MINIMAP_X WREG(29)
|
||||
#define R_OW_MINIMAP_Y WREG(30)
|
||||
#define R_MINIMAP_DISABLED WREG(31)
|
||||
#define R_B_LABEL_X(i) WREG(40 + (i))
|
||||
#define R_B_LABEL_Y(i) WREG(43 + (i))
|
||||
#define R_DGN_MINIMAP_X WREG(68)
|
||||
#define R_DGN_MINIMAP_Y WREG(69)
|
||||
#define R_TEXTBOX_X VREG(0)
|
||||
#define R_TEXTBOX_Y VREG(1)
|
||||
#define R_TEXTBOX_CLEF_XPOS VREG(7)
|
||||
#define R_TEXTBOX_CLEF_YPOS VREG(8)
|
||||
#define R_MAP_INDEX VREG(11)
|
||||
#define R_MAP_TEX_INDEX_BASE VREG(12)
|
||||
#define R_MAP_TEX_INDEX VREG(13)
|
||||
#define R_COMPASS_SCALE_X VREG(14)
|
||||
#define R_COMPASS_SCALE_Y VREG(15)
|
||||
#define R_COMPASS_OFFSET_X VREG(16)
|
||||
#define R_COMPASS_OFFSET_Y VREG(17)
|
||||
#define R_MINIMAP_COLOR(i) VREG(18 + (i))
|
||||
#define R_OCARINA_BUTTONS_XPOS VREG(28)
|
||||
#define R_OCARINA_BUTTONS_XPOS_OFFSET VREG(29)
|
||||
#define R_TEXT_ADJUST_COLOR_1_R VREG(33)
|
||||
#define R_TEXT_ADJUST_COLOR_1_G VREG(34)
|
||||
#define R_TEXT_ADJUST_COLOR_1_B VREG(35)
|
||||
#define R_TEXT_ADJUST_COLOR_2_R VREG(36)
|
||||
#define R_TEXT_ADJUST_COLOR_2_G VREG(37)
|
||||
#define R_TEXT_ADJUST_COLOR_2_B VREG(38)
|
||||
#define R_OCARINA_BUTTONS_YPOS(note) VREG(45 + (note))
|
||||
#define R_OCARINA_BUTTONS_YPOS_OFFSET VREG(51)
|
||||
#define R_ITEM_AMMO_X(i) VREG(64 + (i))
|
||||
#define R_ITEM_AMMO_Y(i) VREG(68 + (i))
|
||||
#define R_ITEM_ICON_WIDTH(i) VREG(76 + (i))
|
||||
#define R_ITEM_BTN_WIDTH(i) VREG(80 + (i))
|
||||
#define R_DISABLE_INPUT_DISPLAY HREG(47)
|
||||
#define R_ENABLE_PLAY_LOGS HREG(63)
|
||||
#define R_EN_GOROIWA_SPEED mREG(12)
|
||||
#define R_NAVI_MSG_REGION_ALPHA nREG(87)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -82,15 +82,13 @@ typedef struct{
|
|||
/* 0x04 */ MtxF mf;
|
||||
} HorseStruct;
|
||||
|
||||
// Game Info aka. Static Context (dbg ram start: 80210A10)
|
||||
// Data normally accessed through REG macros (see regs.h)
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 regPage; // 1 is first page
|
||||
/* 0x04 */ s32 regGroup; // "register" group (R, RS, RO, RP etc.)
|
||||
/* 0x08 */ s32 regCur; // selected register within page
|
||||
/* 0x0C */ s32 dpadLast;
|
||||
/* 0x10 */ s32 repeat;
|
||||
/* 0x14 */ s16 data[REG_GROUPS * REG_PER_GROUP]; // 0xAE0 entries
|
||||
/* 0x00 */ s32 regPage; // 0: no page selected (reg editor is not active); 1: first page; `REG_PAGES`: last page
|
||||
/* 0x04 */ s32 regGroup; // Indexed from 0 to `REG_GROUPS`-1. Each group has its own character to identify it.
|
||||
/* 0x08 */ s32 regCur; // Selected reg, indexed from 0 as the page start
|
||||
/* 0x0C */ s32 dPadInputPrev;
|
||||
/* 0x10 */ s32 inputRepeatTimer;
|
||||
/* 0x14 */ s16 data[REG_GROUPS * REGS_PER_GROUP]; // Accessed through *REG macros, see regs.h
|
||||
} GameInfo; // size = 0x15D4
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -1700,7 +1700,7 @@ s32 DbCamera_ClearCallback(char* c) {
|
|||
return Mempak_DeleteFile(2, *c);
|
||||
}
|
||||
|
||||
void DbCamera_DrawSlotLetters(char* str, s16 y, s16 x, s32 colorId) {
|
||||
void DbCamera_DrawSlotLetters(char* str, s16 y, s16 x, s32 colorIndex) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) {
|
||||
|
@ -1709,9 +1709,9 @@ void DbCamera_DrawSlotLetters(char* str, s16 y, s16 x, s32 colorId) {
|
|||
}
|
||||
|
||||
str[0x14] = str[i * 2 + 1] = '\0';
|
||||
func_8006376C(x, y, colorId, str);
|
||||
func_8006376C(x, y, colorIndex, str);
|
||||
str[0x14] = str[i * 2 + 0] = '-';
|
||||
func_8006376C(x + 0x14, y, colorId, str + 0x14);
|
||||
func_8006376C(x + 0x14, y, colorIndex, str + 0x14);
|
||||
}
|
||||
|
||||
void DbCamera_PrintAllCuts(Camera* cam) {
|
||||
|
|
|
@ -3,37 +3,96 @@
|
|||
typedef struct {
|
||||
u8 x;
|
||||
u8 y;
|
||||
u8 colorId;
|
||||
char text[0x15];
|
||||
} PrintTextBuffer;
|
||||
u8 colorIndex;
|
||||
char text[21];
|
||||
} PrintTextBufferEntry; // size = 0x18
|
||||
|
||||
typedef struct {
|
||||
u16 push;
|
||||
u16 held;
|
||||
} InputCombo;
|
||||
u16 hold;
|
||||
u16 press;
|
||||
} InputCombo; // size = 0x4
|
||||
|
||||
GameInfo* gGameInfo;
|
||||
s32 D_8015FA94; // no known symbols
|
||||
PrintTextBuffer D_8015FA98[0x16];
|
||||
|
||||
s16 D_8011E0B0 = 0; // PrintTextBuffer index
|
||||
Color_RGBA8 printTextColors[] = {
|
||||
{ 255, 255, 32, 192 }, { 255, 150, 128, 192 }, { 128, 96, 0, 64 }, { 192, 128, 16, 128 },
|
||||
{ 255, 192, 32, 128 }, { 230, 230, 220, 64 }, { 128, 150, 255, 128 }, { 128, 255, 32, 128 },
|
||||
PrintTextBufferEntry sDebugPrintTextBuffer[22];
|
||||
s16 sDebugPrintTextBufferNumUsed = 0;
|
||||
Color_RGBA8 sDebugPrintTextColors[] = {
|
||||
{ 255, 255, 32, 192 }, // 0
|
||||
{ 255, 150, 128, 192 }, // 1
|
||||
{ 128, 96, 0, 64 }, // 2
|
||||
{ 192, 128, 16, 128 }, // 3
|
||||
{ 255, 192, 32, 128 }, // 4
|
||||
{ 230, 230, 220, 64 }, // 5
|
||||
{ 128, 150, 255, 128 }, // 6
|
||||
{ 128, 255, 32, 128 }, // 7
|
||||
};
|
||||
|
||||
InputCombo inputCombos[REG_GROUPS] = {
|
||||
{ BTN_L, BTN_CUP }, { BTN_L, BTN_CLEFT }, { BTN_L, BTN_CDOWN }, { BTN_L, BTN_A }, { BTN_R, BTN_CDOWN },
|
||||
{ BTN_L, BTN_CRIGHT }, { BTN_L, BTN_R }, { BTN_L, BTN_DLEFT }, { BTN_L, BTN_DRIGHT }, { BTN_L, BTN_DUP },
|
||||
{ BTN_L, BTN_B }, { BTN_L, BTN_Z }, { BTN_L, BTN_DDOWN }, { BTN_R, BTN_A }, { BTN_R, BTN_B },
|
||||
{ BTN_R, BTN_Z }, { BTN_R, BTN_L }, { BTN_R, BTN_CUP }, { BTN_R, BTN_CRIGHT }, { BTN_R, BTN_DLEFT },
|
||||
{ BTN_R, BTN_CLEFT }, { BTN_R, BTN_START }, { BTN_L, BTN_START }, { BTN_R, BTN_DRIGHT }, { BTN_R, BTN_DUP },
|
||||
{ BTN_START, BTN_R }, { BTN_START, BTN_A }, { BTN_START, BTN_B }, { BTN_START, BTN_CRIGHT },
|
||||
InputCombo sRegGroupInputCombos[REG_GROUPS] = {
|
||||
{ BTN_L, BTN_CUP }, // REG
|
||||
{ BTN_L, BTN_CLEFT }, // SREG
|
||||
{ BTN_L, BTN_CDOWN }, // OREG
|
||||
{ BTN_L, BTN_A }, // PREG
|
||||
{ BTN_R, BTN_CDOWN }, // QREG
|
||||
{ BTN_L, BTN_CRIGHT }, // MREG
|
||||
{ BTN_L, BTN_R }, // YREG
|
||||
{ BTN_L, BTN_DLEFT }, // DREG
|
||||
{ BTN_L, BTN_DRIGHT }, // UREG
|
||||
{ BTN_L, BTN_DUP }, // IREG
|
||||
{ BTN_L, BTN_B }, // ZREG
|
||||
{ BTN_L, BTN_Z }, // CREG
|
||||
{ BTN_L, BTN_DDOWN }, // NREG
|
||||
{ BTN_R, BTN_A }, // KREG
|
||||
{ BTN_R, BTN_B }, // XREG
|
||||
{ BTN_R, BTN_Z }, // cREG
|
||||
{ BTN_R, BTN_L }, // sREG
|
||||
{ BTN_R, BTN_CUP }, // iREG
|
||||
{ BTN_R, BTN_CRIGHT }, // WREG
|
||||
{ BTN_R, BTN_DLEFT }, // AREG
|
||||
{ BTN_R, BTN_CLEFT }, // VREG
|
||||
{ BTN_R, BTN_START }, // HREG
|
||||
{ BTN_L, BTN_START }, // GREG
|
||||
{ BTN_R, BTN_DRIGHT }, // mREG
|
||||
{ BTN_R, BTN_DUP }, // nREG
|
||||
{ BTN_START, BTN_R }, // BREG
|
||||
{ BTN_START, BTN_A }, // dREG
|
||||
{ BTN_START, BTN_B }, // kREG
|
||||
{ BTN_START, BTN_CRIGHT }, // bREG
|
||||
|
||||
};
|
||||
|
||||
char regChar[] = " SOPQMYDUIZCNKXcsiWAVHGmnBdkb";
|
||||
char sRegGroupChars[REG_GROUPS] = {
|
||||
' ', // REG
|
||||
'S', // SREG
|
||||
'O', // OREG
|
||||
'P', // PREG
|
||||
'Q', // QREG
|
||||
'M', // MREG
|
||||
'Y', // YREG
|
||||
'D', // DREG
|
||||
'U', // UREG
|
||||
'I', // IREG
|
||||
'Z', // ZREG
|
||||
'C', // CREG
|
||||
'N', // NREG
|
||||
'K', // KREG
|
||||
'X', // XREG
|
||||
'c', // cREG
|
||||
's', // sREG
|
||||
'i', // iREG
|
||||
'W', // WREG
|
||||
'A', // AREG
|
||||
'V', // VREG
|
||||
'H', // HREG
|
||||
'G', // GREG
|
||||
'm', // mREG
|
||||
'n', // nREG
|
||||
'B', // BREG
|
||||
'd', // dREG
|
||||
'k', // kREG
|
||||
'b', // bREG
|
||||
};
|
||||
|
||||
// initialize GameInfo
|
||||
// Initialize GameInfo
|
||||
void func_800636C0(void) {
|
||||
s32 i;
|
||||
|
||||
|
@ -41,166 +100,168 @@ void func_800636C0(void) {
|
|||
gGameInfo->regPage = 0;
|
||||
gGameInfo->regGroup = 0;
|
||||
gGameInfo->regCur = 0;
|
||||
gGameInfo->dpadLast = 0;
|
||||
gGameInfo->repeat = 0;
|
||||
gGameInfo->dPadInputPrev = 0;
|
||||
gGameInfo->inputRepeatTimer = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(gGameInfo->data); i++) {
|
||||
gGameInfo->data[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Called when free movement is active.
|
||||
// 8011D394 to enable camera debugger
|
||||
void func_8006375C(s32 arg0, s32 arg1, const char* text) {
|
||||
}
|
||||
|
||||
// Copy Camera Debugger Text
|
||||
void func_8006376C(u8 x, u8 y, u8 colorId, const char* text) {
|
||||
PrintTextBuffer* buf;
|
||||
char* bufText;
|
||||
s16 i;
|
||||
// Store text during Update, to be drawn later during Draw
|
||||
void func_8006376C(u8 x, u8 y, u8 colorIndex, const char* text) {
|
||||
PrintTextBufferEntry* entry;
|
||||
char* textDest;
|
||||
s16 charCount;
|
||||
|
||||
buf = &D_8015FA98[D_8011E0B0];
|
||||
if (D_8011E0B0 < 0x16) {
|
||||
buf->x = x;
|
||||
buf->y = y;
|
||||
buf->colorId = colorId;
|
||||
entry = &sDebugPrintTextBuffer[sDebugPrintTextBufferNumUsed];
|
||||
if (sDebugPrintTextBufferNumUsed < ARRAY_COUNT(sDebugPrintTextBuffer)) {
|
||||
entry->x = x;
|
||||
entry->y = y;
|
||||
entry->colorIndex = colorIndex;
|
||||
|
||||
i = 0;
|
||||
bufText = buf->text;
|
||||
while ((*bufText++ = *text++) != '\0') {
|
||||
if (i++ > 0x14) {
|
||||
// Copy text into the entry, truncating if needed
|
||||
charCount = 0;
|
||||
textDest = entry->text;
|
||||
while ((*textDest++ = *text++) != '\0') {
|
||||
if (charCount++ > (ARRAY_COUNT(entry->text) - 1)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
*textDest = '\0';
|
||||
|
||||
*bufText = '\0';
|
||||
D_8011E0B0++;
|
||||
sDebugPrintTextBufferNumUsed++;
|
||||
}
|
||||
}
|
||||
|
||||
// Draw Text
|
||||
// Draw text previously stored by calls to `func_8006376C`
|
||||
void func_80063828(GfxPrint* printer) {
|
||||
s32 i;
|
||||
Color_RGBA8* color;
|
||||
PrintTextBuffer* buffer;
|
||||
char* text;
|
||||
PrintTextBufferEntry* entry;
|
||||
|
||||
i = 0;
|
||||
if (D_8011E0B0 > 0) {
|
||||
do {
|
||||
buffer = &D_8015FA98[i];
|
||||
text = buffer->text;
|
||||
for (i = 0; i < sDebugPrintTextBufferNumUsed; i++) {
|
||||
entry = &sDebugPrintTextBuffer[i];
|
||||
|
||||
color = &printTextColors[buffer->colorId];
|
||||
GfxPrint_SetColor(printer, color->r, color->g, color->b, color->a);
|
||||
GfxPrint_SetPos(printer, buffer->x, buffer->y);
|
||||
GfxPrint_Printf(printer, "%s", text);
|
||||
i += 1;
|
||||
} while (i < D_8011E0B0);
|
||||
color = &sDebugPrintTextColors[entry->colorIndex];
|
||||
GfxPrint_SetColor(printer, color->r, color->g, color->b, color->a);
|
||||
GfxPrint_SetPos(printer, entry->x, entry->y);
|
||||
GfxPrint_Printf(printer, "%s", entry->text);
|
||||
}
|
||||
}
|
||||
|
||||
// Edit REG
|
||||
// Process inputs to control the reg editor
|
||||
void func_8006390C(Input* input) {
|
||||
|
||||
s32 dpad;
|
||||
s32 regGroup;
|
||||
s32 dPadInputCur;
|
||||
s32 pageDataStart = ((gGameInfo->regGroup * REG_PAGES) + gGameInfo->regPage - 1) * REGS_PER_PAGE;
|
||||
s32 increment;
|
||||
InputCombo* input_combo;
|
||||
s32 i;
|
||||
|
||||
regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE;
|
||||
dpad = input->cur.button & (BTN_DUP | BTN_DLEFT | BTN_DRIGHT | BTN_DDOWN);
|
||||
dPadInputCur = input->cur.button & (BTN_DUP | BTN_DLEFT | BTN_DRIGHT | BTN_DDOWN);
|
||||
if (CHECK_BTN_ALL(input->cur.button, BTN_L) || CHECK_BTN_ALL(input->cur.button, BTN_R) ||
|
||||
CHECK_BTN_ALL(input->cur.button, BTN_START)) {
|
||||
input_combo = inputCombos;
|
||||
|
||||
for (i = 0; i < REG_GROUPS; i++) {
|
||||
if (~(~input_combo->push | input->cur.button) || ~(~input_combo->held | input->press.button)) {
|
||||
input_combo++;
|
||||
} else {
|
||||
if (CHECK_BTN_ALL(input->cur.button, sRegGroupInputCombos[i].hold) &&
|
||||
CHECK_BTN_ALL(input->press.button, sRegGroupInputCombos[i].press)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If a combo corresponding to a reg group was found
|
||||
if (i < REG_GROUPS) {
|
||||
if (i == gGameInfo->regGroup) {
|
||||
// Same reg group as current, advance page index
|
||||
gGameInfo->regPage = (gGameInfo->regPage + 1) % (REG_PAGES + 1);
|
||||
return;
|
||||
} else {
|
||||
gGameInfo->regGroup = i; // Switch current reg group
|
||||
gGameInfo->regPage = 0; // Disable reg editor
|
||||
}
|
||||
gGameInfo->regGroup = i;
|
||||
gGameInfo->regPage = 0;
|
||||
}
|
||||
} else {
|
||||
switch (gGameInfo->regPage - 1) {
|
||||
case 0:
|
||||
switch (gGameInfo->regPage) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
|
||||
if (dpad == gGameInfo->dpadLast) {
|
||||
gGameInfo->repeat--;
|
||||
if (gGameInfo->repeat < 0) {
|
||||
gGameInfo->repeat = 1;
|
||||
if (dPadInputCur == gGameInfo->dPadInputPrev) {
|
||||
gGameInfo->inputRepeatTimer--;
|
||||
if (gGameInfo->inputRepeatTimer < 0) {
|
||||
gGameInfo->inputRepeatTimer = 1;
|
||||
} else {
|
||||
dpad ^= gGameInfo->dpadLast;
|
||||
dPadInputCur ^= gGameInfo->dPadInputPrev;
|
||||
}
|
||||
} else {
|
||||
gGameInfo->repeat = 0x10;
|
||||
gGameInfo->dpadLast = dpad;
|
||||
gGameInfo->inputRepeatTimer = 16;
|
||||
gGameInfo->dPadInputPrev = dPadInputCur;
|
||||
}
|
||||
|
||||
increment = CHECK_BTN_ANY(dpad, BTN_DRIGHT) ? (CHECK_BTN_ALL(input->cur.button, BTN_A | BTN_B) ? 1000
|
||||
increment =
|
||||
CHECK_BTN_ANY(dPadInputCur, BTN_DRIGHT) ? (CHECK_BTN_ALL(input->cur.button, BTN_A | BTN_B) ? 1000
|
||||
: CHECK_BTN_ALL(input->cur.button, BTN_A) ? 100
|
||||
: CHECK_BTN_ALL(input->cur.button, BTN_B) ? 10
|
||||
: 1)
|
||||
: CHECK_BTN_ANY(dpad, BTN_DLEFT) ? (CHECK_BTN_ALL(input->cur.button, BTN_A | BTN_B) ? -1000
|
||||
: CHECK_BTN_ANY(dPadInputCur, BTN_DLEFT) ? (CHECK_BTN_ALL(input->cur.button, BTN_A | BTN_B) ? -1000
|
||||
: CHECK_BTN_ALL(input->cur.button, BTN_A) ? -100
|
||||
: CHECK_BTN_ALL(input->cur.button, BTN_B) ? -10
|
||||
: -1)
|
||||
: 0;
|
||||
|
||||
gGameInfo->data[gGameInfo->regCur + regGroup] += increment;
|
||||
if (CHECK_BTN_ANY(dpad, BTN_DUP)) {
|
||||
gGameInfo->data[gGameInfo->regCur + pageDataStart] += increment;
|
||||
|
||||
if (CHECK_BTN_ANY(dPadInputCur, BTN_DUP)) {
|
||||
gGameInfo->regCur--;
|
||||
if (gGameInfo->regCur < 0) {
|
||||
gGameInfo->regCur = REG_PER_PAGE - 1;
|
||||
gGameInfo->regCur = REGS_PER_PAGE - 1;
|
||||
}
|
||||
} else if (CHECK_BTN_ANY(dpad, BTN_DDOWN)) {
|
||||
} else if (CHECK_BTN_ANY(dPadInputCur, BTN_DDOWN)) {
|
||||
gGameInfo->regCur++;
|
||||
if (gGameInfo->regCur >= REG_PER_PAGE) {
|
||||
if (gGameInfo->regCur >= REGS_PER_PAGE) {
|
||||
gGameInfo->regCur = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (iREG(0)) {
|
||||
iREG(0) = 0;
|
||||
func_800AA000(0, iREG(1), iREG(2), iREG(3));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Draw Memory Viewer
|
||||
// Draw the reg editor
|
||||
void func_80063C04(GfxPrint* printer) {
|
||||
s32 i;
|
||||
s32 page = (gGameInfo->regPage * REG_PER_PAGE) - REG_PER_PAGE;
|
||||
s32 regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE;
|
||||
s32 pageStart = (gGameInfo->regPage - 1) * REGS_PER_PAGE;
|
||||
s32 pageDataStart = ((gGameInfo->regGroup * REG_PAGES) + gGameInfo->regPage - 1) * REGS_PER_PAGE;
|
||||
s32 pad;
|
||||
char name[3];
|
||||
char regGroupName[3];
|
||||
|
||||
regGroupName[0] = 'R';
|
||||
regGroupName[1] = sRegGroupChars[gGameInfo->regGroup];
|
||||
regGroupName[2] = '\0';
|
||||
|
||||
// set up register name string
|
||||
name[0] = 'R';
|
||||
name[1] = regChar[gGameInfo->regGroup]; // r_group type char
|
||||
name[2] = '\0';
|
||||
GfxPrint_SetColor(printer, 0, 128, 128, 128);
|
||||
|
||||
for (i = 0; i != REG_PER_PAGE; i++) {
|
||||
for (i = 0; i < REGS_PER_PAGE; i++) {
|
||||
if (i == gGameInfo->regCur) {
|
||||
GfxPrint_SetColor(printer, 0, 255, 255, 255);
|
||||
}
|
||||
|
||||
GfxPrint_SetPos(printer, 3, i + 5);
|
||||
GfxPrint_Printf(printer, "%s%02d%6d", &name, page + i, gGameInfo->data[i + regGroup]);
|
||||
GfxPrint_Printf(printer, "%s%02d%6d", regGroupName, pageStart + i, gGameInfo->data[i + pageDataStart]);
|
||||
|
||||
if (i == gGameInfo->regCur) {
|
||||
GfxPrint_SetColor(printer, 0, 128, 128, 128);
|
||||
}
|
||||
|
@ -208,18 +269,18 @@ void func_80063C04(GfxPrint* printer) {
|
|||
}
|
||||
|
||||
void func_80063D7C(GraphicsContext* gfxCtx) {
|
||||
Gfx* sp7C;
|
||||
Gfx* sp78;
|
||||
Gfx* gfx;
|
||||
Gfx* opaStart;
|
||||
GfxPrint printer;
|
||||
Gfx* tempRet;
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(gfxCtx, "../z_debug.c", 628);
|
||||
|
||||
GfxPrint_Init(&printer);
|
||||
sp78 = POLY_OPA_DISP;
|
||||
tempRet = Graph_GfxPlusOne(POLY_OPA_DISP);
|
||||
gSPDisplayList(OVERLAY_DISP++, tempRet);
|
||||
GfxPrint_Open(&printer, tempRet);
|
||||
opaStart = POLY_OPA_DISP;
|
||||
gfx = Graph_GfxPlusOne(POLY_OPA_DISP);
|
||||
gSPDisplayList(OVERLAY_DISP++, gfx);
|
||||
GfxPrint_Open(&printer, gfx);
|
||||
|
||||
if ((OREG(0) == 1) || (OREG(0) == 8)) {
|
||||
func_80063828(&printer);
|
||||
|
@ -229,11 +290,12 @@ void func_80063D7C(GraphicsContext* gfxCtx) {
|
|||
func_80063C04(&printer);
|
||||
}
|
||||
|
||||
D_8011E0B0 = 0;
|
||||
sp7C = GfxPrint_Close(&printer);
|
||||
gSPEndDisplayList(sp7C++);
|
||||
Graph_BranchDlist(sp78, sp7C);
|
||||
POLY_OPA_DISP = sp7C;
|
||||
sDebugPrintTextBufferNumUsed = 0;
|
||||
|
||||
gfx = GfxPrint_Close(&printer);
|
||||
gSPEndDisplayList(gfx++);
|
||||
Graph_BranchDlist(opaStart, gfx);
|
||||
POLY_OPA_DISP = gfx;
|
||||
|
||||
if (1) {}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue