summaryrefslogtreecommitdiff
path: root/src/code/z_construct.c
diff options
context:
space:
mode:
authorTharo <17233964+Thar0@users.noreply.github.com>2022-11-17 02:57:02 +0000
committerGitHub <noreply@github.com>2022-11-16 21:57:02 -0500
commit7ecafcfe7d357ff1cbcf49ce4d87a9efedae552e (patch)
treeba036ae7cdce859adb4e0f036fcc28284be22423 /src/code/z_construct.c
parent40639e698d0b4681d088194dc72a6a3b910e7d13 (diff)
More documentation for `z_std_dma.c` (#1415)
* More documentation for z_std_dma * uintptr casts for rom symbols in z64animation.h and z_kanfont.c * Format * Suggested changes, more defines for static texture sizes * PI Interface -> PI * Further suggested changes * Format * Comments about item_name and map_name texture assumptions
Diffstat (limited to 'src/code/z_construct.c')
-rw-r--r--src/code/z_construct.c74
1 files changed, 42 insertions, 32 deletions
diff --git a/src/code/z_construct.c b/src/code/z_construct.c
index 7748c0fba..414d38aee 100644
--- a/src/code/z_construct.c
+++ b/src/code/z_construct.c
@@ -37,42 +37,43 @@ void Interface_Init(PlayState* play) {
osSyncPrintf("parameter->parameterSegment=%x\n", interfaceCtx->parameterSegment);
ASSERT(interfaceCtx->parameterSegment != NULL, "parameter->parameterSegment != NULL", "../z_construct.c", 161);
- DmaMgr_SendRequest1(interfaceCtx->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, parameterSize,
- "../z_construct.c", 162);
+ DmaMgr_RequestSyncDebug(interfaceCtx->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, parameterSize,
+ "../z_construct.c", 162);
- interfaceCtx->doActionSegment = GameState_Alloc(&play->state, 0x480, "../z_construct.c", 166);
+ interfaceCtx->doActionSegment = GameState_Alloc(&play->state, 3 * DO_ACTION_TEX_SIZE, "../z_construct.c", 166);
- osSyncPrintf("DOアクション テクスチャ初期=%x\n", 0x480); // "DO Action Texture Initialization"
+ osSyncPrintf("DOアクション テクスチャ初期=%x\n", 3 * DO_ACTION_TEX_SIZE); // "DO Action Texture Initialization"
osSyncPrintf("parameter->do_actionSegment=%x\n", interfaceCtx->doActionSegment);
ASSERT(interfaceCtx->doActionSegment != NULL, "parameter->do_actionSegment != NULL", "../z_construct.c", 169);
if (gSaveContext.language == LANGUAGE_ENG) {
- doActionOffset = 0;
+ doActionOffset = LANGUAGE_ENG * DO_ACTION_MAX * DO_ACTION_TEX_SIZE;
} else if (gSaveContext.language == LANGUAGE_GER) {
- doActionOffset = 0x2B80;
+ doActionOffset = LANGUAGE_GER * DO_ACTION_MAX * DO_ACTION_TEX_SIZE;
} else {
- doActionOffset = 0x5700;
+ doActionOffset = LANGUAGE_FRA * DO_ACTION_MAX * DO_ACTION_TEX_SIZE;
}
- DmaMgr_SendRequest1(interfaceCtx->doActionSegment, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset,
- 0x300, "../z_construct.c", 174);
+ DmaMgr_RequestSyncDebug(interfaceCtx->doActionSegment, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset,
+ 2 * DO_ACTION_TEX_SIZE, "../z_construct.c", 174);
if (gSaveContext.language == LANGUAGE_ENG) {
- doActionOffset = 0x480;
+ doActionOffset = 3 * DO_ACTION_TEX_SIZE + LANGUAGE_ENG * DO_ACTION_MAX * DO_ACTION_TEX_SIZE;
} else if (gSaveContext.language == LANGUAGE_GER) {
- doActionOffset = 0x3000;
+ doActionOffset = 3 * DO_ACTION_TEX_SIZE + LANGUAGE_GER * DO_ACTION_MAX * DO_ACTION_TEX_SIZE;
} else {
- doActionOffset = 0x5B80;
+ doActionOffset = 3 * DO_ACTION_TEX_SIZE + LANGUAGE_FRA * DO_ACTION_MAX * DO_ACTION_TEX_SIZE;
}
- DmaMgr_SendRequest1(interfaceCtx->doActionSegment + 0x300,
- (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, 0x180, "../z_construct.c", 178);
+ DmaMgr_RequestSyncDebug(interfaceCtx->doActionSegment + 2 * DO_ACTION_TEX_SIZE,
+ (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, DO_ACTION_TEX_SIZE,
+ "../z_construct.c", 178);
- interfaceCtx->iconItemSegment = GameState_Alloc(&play->state, 0x4000, "../z_construct.c", 190);
+ interfaceCtx->iconItemSegment = GameState_Alloc(&play->state, 4 * ICON_ITEM_TEX_SIZE, "../z_construct.c", 190);
// "Icon Item Texture Initialization = %x"
- osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", 0x4000);
+ osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", 4 * ICON_ITEM_TEX_SIZE);
osSyncPrintf("parameter->icon_itemSegment=%x\n", interfaceCtx->iconItemSegment);
ASSERT(interfaceCtx->iconItemSegment != NULL, "parameter->icon_itemSegment != NULL", "../z_construct.c", 193);
@@ -82,31 +83,36 @@ void Interface_Init(PlayState* play) {
gSaveContext.equips.buttonItems[3]);
if (gSaveContext.equips.buttonItems[0] < 0xF0) {
- DmaMgr_SendRequest1(interfaceCtx->iconItemSegment,
- (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x1000,
- 0x1000, "../z_construct.c", 198);
+ DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment,
+ (uintptr_t)_icon_item_staticSegmentRomStart +
+ gSaveContext.equips.buttonItems[0] * ICON_ITEM_TEX_SIZE,
+ ICON_ITEM_TEX_SIZE, "../z_construct.c", 198);
} else if (gSaveContext.equips.buttonItems[0] != 0xFF) {
- DmaMgr_SendRequest1(interfaceCtx->iconItemSegment,
- (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x1000,
- 0x1000, "../z_construct.c", 203);
+ DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment,
+ (uintptr_t)_icon_item_staticSegmentRomStart +
+ gSaveContext.equips.buttonItems[0] * ICON_ITEM_TEX_SIZE,
+ ICON_ITEM_TEX_SIZE, "../z_construct.c", 203);
}
if (gSaveContext.equips.buttonItems[1] < 0xF0) {
- DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x1000,
- (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[1] * 0x1000,
- 0x1000, "../z_construct.c", 209);
+ DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + ICON_ITEM_TEX_SIZE,
+ (uintptr_t)_icon_item_staticSegmentRomStart +
+ gSaveContext.equips.buttonItems[1] * ICON_ITEM_TEX_SIZE,
+ ICON_ITEM_TEX_SIZE, "../z_construct.c", 209);
}
if (gSaveContext.equips.buttonItems[2] < 0xF0) {
- DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x2000,
- (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[2] * 0x1000,
- 0x1000, "../z_construct.c", 214);
+ DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + 2 * ICON_ITEM_TEX_SIZE,
+ (uintptr_t)_icon_item_staticSegmentRomStart +
+ gSaveContext.equips.buttonItems[2] * ICON_ITEM_TEX_SIZE,
+ ICON_ITEM_TEX_SIZE, "../z_construct.c", 214);
}
if (gSaveContext.equips.buttonItems[3] < 0xF0) {
- DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x3000,
- (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[3] * 0x1000,
- 0x1000, "../z_construct.c", 219);
+ DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + 3 * ICON_ITEM_TEX_SIZE,
+ (uintptr_t)_icon_item_staticSegmentRomStart +
+ gSaveContext.equips.buttonItems[3] * ICON_ITEM_TEX_SIZE,
+ ICON_ITEM_TEX_SIZE, "../z_construct.c", 219);
}
osSyncPrintf("EVENT=%d\n", ((void)0, gSaveContext.timerState));
@@ -182,7 +188,11 @@ void Message_Init(PlayState* play) {
View_Init(&msgCtx->view, play->state.gfxCtx);
- msgCtx->textboxSegment = GameState_Alloc(&play->state, 0x2200, "../z_construct.c", 349);
+ msgCtx->textboxSegment =
+ GameState_Alloc(&play->state,
+ MESSAGE_STATIC_TEX_SIZE +
+ MAX(MAX(ICON_ITEM_TEX_SIZE, ICON_ITEM_24_TEX_SIZE), 2 * MESSAGE_TEXTURE_STATIC_TEX_SIZE),
+ "../z_construct.c", 349);
osSyncPrintf("message->fukidashiSegment=%x\n", msgCtx->textboxSegment);