summaryrefslogtreecommitdiff
path: root/soh/src/code/z_construct.c
diff options
context:
space:
mode:
authorrozlette <Rozelette@users.noreply.github.com>2022-06-22 21:24:20 -0500
committerlouist103 <35883445+louist103@users.noreply.github.com>2022-06-22 23:13:32 -0400
commitfd06827e2b4072ef5298cce03760cda942cf3ef0 (patch)
tree206355912371fce01911aad0b58dd420c39257b8 /soh/src/code/z_construct.c
parent57fb04accc6617cee731aaf39e39532c9c893c3f (diff)
DPad items
Diffstat (limited to 'soh/src/code/z_construct.c')
-rw-r--r--soh/src/code/z_construct.c46
1 files changed, 17 insertions, 29 deletions
diff --git a/soh/src/code/z_construct.c b/soh/src/code/z_construct.c
index c74d3c14c..0bdf4a9d4 100644
--- a/soh/src/code/z_construct.c
+++ b/soh/src/code/z_construct.c
@@ -25,8 +25,9 @@ void func_801109B0(GlobalContext* globalCtx) {
interfaceCtx->minimapAlpha = 0;
interfaceCtx->unk_260 = 0;
interfaceCtx->unk_244 = interfaceCtx->aAlpha = interfaceCtx->bAlpha = interfaceCtx->cLeftAlpha =
- interfaceCtx->cDownAlpha = interfaceCtx->cRightAlpha = interfaceCtx->healthAlpha = interfaceCtx->startAlpha =
- interfaceCtx->magicAlpha = 0;
+ interfaceCtx->cDownAlpha = interfaceCtx->cRightAlpha = interfaceCtx->dpadUpAlpha = interfaceCtx->dpadDownAlpha =
+ interfaceCtx->dpadLeftAlpha = interfaceCtx->dpadRightAlpha = interfaceCtx->healthAlpha =
+ interfaceCtx->startAlpha = interfaceCtx->magicAlpha = 0;
parameterSize = (uintptr_t)_parameter_staticSegmentRomEnd - (uintptr_t)_parameter_staticSegmentRomStart;
@@ -73,7 +74,8 @@ void func_801109B0(GlobalContext* globalCtx) {
//DmaMgr_SendRequest1(interfaceCtx->doActionSegment + 0x300, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset,
//0x180, "../z_construct.c", 178);
- interfaceCtx->iconItemSegment = GameState_Alloc(&globalCtx->state, 0x4000, "../z_construct.c", 190);
+ interfaceCtx->iconItemSegment = GameState_Alloc(
+ &globalCtx->state, 0x1000 * ARRAY_COUNT(gSaveContext.equips.buttonItems), "../z_construct.c", 190);
// "Icon Item Texture Initialization = %x"
osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", 0x4000);
@@ -85,32 +87,18 @@ void func_801109B0(GlobalContext* globalCtx) {
gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2],
gSaveContext.equips.buttonItems[3]);
- if (gSaveContext.equips.buttonItems[0] < 0xF0) {
- DmaMgr_SendRequest1(interfaceCtx->iconItemSegment,
- _icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x1000, 0x1000,
- "../z_construct.c", 198);
- } else if (gSaveContext.equips.buttonItems[0] != 0xFF) {
- DmaMgr_SendRequest1(interfaceCtx->iconItemSegment,
- _icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x1000, 0x1000,
- "../z_construct.c", 203);
- }
-
- if (gSaveContext.equips.buttonItems[1] < 0xF0) {
- DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x1000,
- _icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[1] * 0x1000, 0x1000,
- "../z_construct.c", 209);
- }
-
- if (gSaveContext.equips.buttonItems[2] < 0xF0) {
- DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x2000,
- _icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[2] * 0x1000, 0x1000,
- "../z_construct.c", 214);
- }
-
- if (gSaveContext.equips.buttonItems[3] < 0xF0) {
- DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x3000,
- _icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[3] * 0x1000, 0x1000,
- "../z_construct.c", 219);
+ for (int buttonIndex = 0; buttonIndex < ARRAY_COUNT(gSaveContext.equips.buttonItems); buttonIndex++) {
+ if (gSaveContext.equips.buttonItems[buttonIndex] < 0xF0) {
+ DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x1000 * buttonIndex,
+ _icon_item_staticSegmentRomStart +
+ gSaveContext.equips.buttonItems[buttonIndex] * 0x1000,
+ 0x1000, "../z_construct.c", 198);
+ } else if (buttonIndex == 0 && gSaveContext.equips.buttonItems[buttonIndex] != 0xFF) {
+ DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x1000 * buttonIndex,
+ _icon_item_staticSegmentRomStart +
+ gSaveContext.equips.buttonItems[buttonIndex] * 0x1000,
+ 0x1000, "../z_construct.c", 203);
+ }
}
osSyncPrintf("EVENT=%d\n", ((void)0, gSaveContext.timer1State));