summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandom06457 <28494085+Random06457@users.noreply.github.com>2023-11-20 23:07:03 +0100
committerRandom06457 <28494085+Random06457@users.noreply.github.com>2023-11-20 23:13:28 +0100
commit641bfa901b4b5e18ab25afa681427dbdd65ddd1e (patch)
tree39c254e513f0acbe60320d67baac7ca92c51af7f
parentb0e28c6b9d3778b0999f9ddc3cdc0c3a49a150f3 (diff)
fix a few interface issues
-rw-r--r--mm/include/z64interface.h19
-rw-r--r--mm/src/code/z_parameter.c149
2 files changed, 113 insertions, 55 deletions
diff --git a/mm/include/z64interface.h b/mm/include/z64interface.h
index d768254e2..0fc19bf9b 100644
--- a/mm/include/z64interface.h
+++ b/mm/include/z64interface.h
@@ -126,12 +126,29 @@ typedef enum {
/* 1 */ STORY_TYPE_GIANTS_LEAVING
} StoryType;
+typedef enum {
+ /* 0 */ A_BUTTON_ACTION,
+ /* 1 */ B_BUTTON_ACTION,
+ /* 2 */ START_BUTTON_ACTION,
+ /* 3 */ CLOCK_TIMER
+} ActionBtn;
+
+typedef enum {
+ /* 0 */ ACTION_MAIN,
+ /* 1 */ ACTION_SUB
+} ActionType;
+
+typedef struct {
+ char* mainTex;
+ char* subTex;
+} ActionLabel;
+
typedef struct {
/* 0x000 */ View view;
/* 0x168 */ Vtx* actionVtx;
/* 0x16C */ Vtx* beatingHeartVtx;
/* 0x170 */ u8* parameterSegment;
- /* 0x174 */ u8* doActionSegment;
+ /* 0x174 */ ActionLabel* doActionSegment;
/* 0x178 */ u8* iconItemSegment;
/* 0x17C */ u8* mapSegment;
/* 0x180 */ u8* unk_180; // unused segment?
diff --git a/mm/src/code/z_parameter.c b/mm/src/code/z_parameter.c
index 9b08fd3ea..18a2ebac0 100644
--- a/mm/src/code/z_parameter.c
+++ b/mm/src/code/z_parameter.c
@@ -11,6 +11,18 @@
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
#include "overlays/actors/ovl_En_Mm3/z_en_mm3.h"
+#include "interface/week_static/week_static.h"
+
+#include <string.h>
+
+#define dgEmptyTexture "__OTR__textures/virtual/gEmptyTexture"
+static const ALIGN_ASSET(2) char gEmptyTexture[] = dgEmptyTexture;
+
+static u8* sCounterDigits[] = {
+ (u8*)gCounterDigit0Tex, (u8*)gCounterDigit1Tex, (u8*)gCounterDigit2Tex, (u8*)gCounterDigit3Tex,
+ (u8*)gCounterDigit4Tex, (u8*)gCounterDigit5Tex, (u8*)gCounterDigit6Tex, (u8*)gCounterDigit7Tex,
+ (u8*)gCounterDigit8Tex, (u8*)gCounterDigit9Tex,
+};
typedef enum {
/* 0 */ PICTO_BOX_STATE_OFF, // Not using the pictograph
@@ -908,6 +920,12 @@ u32 Interface_GetCompressedTimerDigits(s16 timerId) {
(timerArr[4] << 4) | timerArr[5];
}
+static const char* sDoWeekTable[] = {
+ gClockDay1stTex,
+ gClockDay2ndTex,
+ gClockDayFinalTex,
+};
+
void Interface_NewDay(PlayState* play, s32 day) {
s32 pad;
s16 i = day - 1;
@@ -917,10 +935,7 @@ void Interface_NewDay(PlayState* play, s32 day) {
i = 0;
}
- // Loads day number from week_static for the three-day clock
- // BENTODO
- //DmaMgr_SendRequest0((void*)(play->interfaceCtx.doActionSegment + 0x780),
- // SEGMENT_ROM_START_OFFSET(week_static, i * 0x510), 0x510);
+ play->interfaceCtx.doActionSegment[CLOCK_TIMER].mainTex = sDoWeekTable[i];
// i is used to store sceneId
for (i = 0; i < ARRAY_COUNT(gSaveContext.save.saveInfo.permanentSceneFlags); i++) {
@@ -2474,8 +2489,8 @@ void Interface_InitMinigame(PlayState* play) {
void Interface_LoadItemIconImpl(PlayState* play, u8 btn) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
- CmpDma_LoadFile(SEGMENT_ROM_START(icon_item_static_yar), GET_CUR_FORM_BTN_ITEM(btn),
- &interfaceCtx->iconItemSegment[(u32)btn * 0x1000], 0x1000);
+ void* tex = ResourceMgr_LoadTexOrDListByName(gItemIcons[(s32)GET_CUR_FORM_BTN_ITEM(btn)]);
+ memcpy(&interfaceCtx->iconItemSegment[(u32)btn * 0x1000], tex, 0x1000);
}
void Interface_LoadItemIcon(PlayState* play, u8 btn) {
@@ -3284,6 +3299,18 @@ void Interface_LoadAButtonDoActionLabel(InterfaceContext* interfaceCtx, u16 acti
}
}
+static const char* doActionTbl[] = {
+ gDoActionAttackENGTex, gDoActionCheckENGTex, gDoActionEnterENGTex, gDoActionReturnENGTex, gDoActionOpenENGTex,
+ gDoActionJumpENGTex, gDoActionDecideENGTex, gDoActionDiveENGTex, gDoActionFasterENGTex, gDoActionThrowENGTex,
+ gDoActionNaviENGTex, gDoActionClimbENGTex, gDoActionDropENGTex, gDoActionDownENGTex, gDoActionQuitENGTex,
+ gDoActionSpeakENGTex, gDoActionNextENGTex, gDoActionGrabENGTex, gDoActionStopENGTex, gDoActionPutAwayENGTex,
+ gDoActionReelENGTex, gDoActionInfoENGTex, gDoActionWarpENGTex, gDoActionSnapENGTex, gDoActionExplodeENGTex,
+ gDoActionDanceENGTex, gDoActionMarchENGTex, gDoActionNum1ENGTex, gDoActionNum2ENGTex, gDoActionNum3ENGTex,
+ gDoActionNum4ENGTex, gDoActionNum5ENGTex, gDoActionNum6ENGTex, gDoActionNum7ENGTex, gDoActionNum8ENGTex,
+ gDoActionCurlENGTex, gDoActionSurfaceENGTex, gDoActionSwimENGTex, gDoActionPunchENGTex, gDoActionPoundENGTex,
+ gDoActionHookENGTex, gDoActionShootENGTex,
+};
+
void Interface_SetAButtonDoAction(PlayState* play, u16 aButtonDoAction) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
PauseContext* pauseCtx = &play->pauseCtx;
@@ -3803,7 +3830,7 @@ void Magic_Update(PlayState* play) {
// fallthrough
case MAGIC_STATE_CONSUME_GORON_ZORA:
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) &&
- (msgCtx->msgMode == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
+ (msgCtx->msgMode == MSGMODE_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) {
if (!Play_InCsMode(play)) {
interfaceCtx->magicConsumptionTimer--;
@@ -4018,8 +4045,8 @@ void Interface_DrawItemButtons(PlayState* play) {
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0);
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
- gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE * 2, G_IM_FMT_IA,
- DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment[START_BUTTON_ACTION].mainTex,
+ G_IM_FMT_IA, DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(OVERLAY_DISP++, 0x01F8, 0x0054, 0x02D4, 0x009C, G_TX_RENDERTILE, 0, 0, 0x04A6, 0x04A6);
}
@@ -4077,9 +4104,9 @@ void Interface_DrawItemButtons(PlayState* play) {
} else { // EQUIP_SLOT_C_RIGHT
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 240, 0, interfaceCtx->cRightAlpha);
}
- OVERLAY_DISP = Gfx_DrawTexRectIA8(OVERLAY_DISP, ((u8*)gButtonBackgroundTex + ((32 * 32) * (temp + 1))),
- 0x20, 0x20, D_801BF9D4[temp], D_801BF9DC[temp], D_801BFAF4[temp],
- D_801BFAF4[temp], D_801BF9E4[temp] * 2, D_801BF9E4[temp] * 2);
+ OVERLAY_DISP =
+ Gfx_DrawTexRectIA8(OVERLAY_DISP, gButtonBackgroundTex, 0x20, 0x20, D_801BF9D4[temp], D_801BF9DC[temp],
+ D_801BFAF4[temp], D_801BFAF4[temp], D_801BF9E4[temp] * 2, D_801BF9E4[temp] * 2);
}
}
@@ -4180,6 +4207,7 @@ void Interface_DrawBButtonIcons(PlayState* play) {
if ((interfaceCtx->unk_222 == 0) && (player->stateFlags3 & PLAYER_STATE3_1000000)) {
if (gSaveContext.buttonStatus[EQUIP_SLOT_B] != BTN_DISABLED) {
+ gSPInvalidateTexCache(OVERLAY_DISP++, interfaceCtx->iconItemSegment);
Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment, EQUIP_SLOT_B);
gDPPipeSync(OVERLAY_DISP++);
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
@@ -4206,7 +4234,7 @@ void Interface_DrawBButtonIcons(PlayState* play) {
(play->sceneId != SCENE_BOWLING) &&
((gSaveContext.minigameStatus != MINIGAME_STATUS_ACTIVE) ||
(gSaveContext.save.entrance != ENTRANCE(ROMANI_RANCH, 0))) &&
- ((gSaveContext.minigameStatus != MINIGAME_STATUS_ACTIVE) || !(CHECK_EVENTINF(EVENTINF_35))) &&
+ ((gSaveContext.minigameStatus != MINIGAME_STATUS_ACTIVE) || !CHECK_EVENTINF(EVENTINF_35)) &&
(!CHECK_WEEKEVENTREG(WEEKEVENTREG_31_80) || (play->bButtonAmmoPlusOne != 100))) {
Interface_DrawAmmoCount(play, EQUIP_SLOT_B, interfaceCtx->bAlpha);
}
@@ -4218,8 +4246,8 @@ void Interface_DrawBButtonIcons(PlayState* play) {
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha);
- gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + 0x480, G_IM_FMT_IA, 48, 16, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
+ gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment[B_BUTTON_ACTION].mainTex, G_IM_FMT_IA, 48,
+ 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
D_801BF9B0 = 1024.0f / (D_801BF9B4[gSaveContext.options.language] / 100.0f);
@@ -4233,8 +4261,8 @@ void Interface_DrawBButtonIcons(PlayState* play) {
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha);
- gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + 0x600, G_IM_FMT_IA, 48, 16, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
+ gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment[B_BUTTON_ACTION].subTex, G_IM_FMT_IA, 48,
+ 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
D_801BF9B0 = 1024.0f / (D_801BF9B4[gSaveContext.options.language] / 100.0f);
@@ -4299,6 +4327,8 @@ void Interface_DrawCButtonIcons(PlayState* play) {
}
void Interface_DrawAButton(PlayState* play) {
+ // BENTODO: Something here crashes somtimes?
+ return;
InterfaceContext* interfaceCtx = &play->interfaceCtx;
s16 aAlpha;
@@ -4354,10 +4384,10 @@ void Interface_DrawAButton(PlayState* play) {
// Draw Action Label
if (((interfaceCtx->aButtonState <= A_BTN_STATE_1) || (interfaceCtx->aButtonState == A_BTN_STATE_3))) {
- OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, interfaceCtx->doActionSegment, 3, DO_ACTION_TEX_WIDTH,
- DO_ACTION_TEX_HEIGHT, 0);
+ OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, interfaceCtx->doActionSegment[A_BUTTON_ACTION].mainTex, 3,
+ DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0);
} else {
- OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE, 3,
+ OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, interfaceCtx->doActionSegment[A_BUTTON_ACTION].subTex, 3,
DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0);
}
@@ -4423,9 +4453,10 @@ void Interface_DrawPauseMenuEquippingIcons(PlayState* play) {
}
gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[16], 4, 0);
- gDPLoadTextureBlock(OVERLAY_DISP++, gMagicArrowEquipEffectTex, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
- G_TX_NOLOD, G_TX_NOLOD);
+ // BENTODO
+ // gDPLoadTextureBlock(OVERLAY_DISP++, gMagicArrowEquipEffectTex, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0,
+ // G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
+ // G_TX_NOLOD, G_TX_NOLOD);
}
gSP1Quadrangle(OVERLAY_DISP++, 0, 2, 3, 1, 0);
@@ -4447,7 +4478,6 @@ void Interface_DrawClock(PlayState* play) {
CLOCK_TIME(10, 0), CLOCK_TIME(11, 0), CLOCK_TIME(12, 0), CLOCK_TIME(13, 0), CLOCK_TIME(14, 0),
CLOCK_TIME(15, 0), CLOCK_TIME(16, 0), CLOCK_TIME(17, 0), CLOCK_TIME(18, 0), CLOCK_TIME(19, 0),
CLOCK_TIME(20, 0), CLOCK_TIME(21, 0), CLOCK_TIME(22, 0), CLOCK_TIME(23, 0), CLOCK_TIME(24, 0) - 1,
- CLOCK_TIME(0, 0),
};
static TexturePtr sThreeDayClockHourTextures[] = {
gThreeDayClockHour12Tex, gThreeDayClockHour1Tex, gThreeDayClockHour2Tex, gThreeDayClockHour3Tex,
@@ -4572,7 +4602,7 @@ void Interface_DrawClock(PlayState* play) {
//! resulting in this reading into the next texture. This results in a white
//! dot in the bottom center of the clock. For the three-day clock, this is
//! covered by the diamond. However, it can be seen by the final-hours clock.
- OVERLAY_DISP = Gfx_DrawTexRect4b(OVERLAY_DISP, gThreeDayClockBorderTex, 4, 64, 50, 96, 168, 128, 50, 1, 6,
+ OVERLAY_DISP = Gfx_DrawTexRect4b(OVERLAY_DISP, gThreeDayClockBorderTex, 4, 64, 48, 96, 168, 128, 50, 1, 6,
0, 1 << 10, 1 << 10);
if (((CURRENT_DAY >= 4) ||
@@ -4677,8 +4707,8 @@ void Interface_DrawClock(PlayState* play) {
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 155, sThreeDayClockAlpha);
- OVERLAY_DISP = Gfx_DrawTexRectIA8(OVERLAY_DISP, interfaceCtx->doActionSegment + 0x780, 48, 27, 137, 192,
- 48, 27, 1 << 10, 1 << 10);
+ OVERLAY_DISP = Gfx_DrawTexRectIA8(OVERLAY_DISP, interfaceCtx->doActionSegment[CLOCK_TIMER].mainTex, 48,
+ 27, 137, 192, 48, 27, 1 << 10, 1 << 10);
/**
* Section: Draw Three-Day Clock's Star (for the Minute Tracker)
@@ -4835,7 +4865,8 @@ void Interface_DrawClock(PlayState* play) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 155, sThreeDayClockAlpha);
gSP1Quadrangle(OVERLAY_DISP++, 4, 6, 7, 5, 0);
- gSPDisplayList(OVERLAY_DISP++, D_0E000000.setScissor);
+ __gSPDisplayList(OVERLAY_DISP++,
+ 0x0E000000 + ((uintptr_t)&D_0E000000.setScissor - (uintptr_t)&D_0E000000) + 1);
// Final Hours
if ((CURRENT_DAY >= 4) ||
@@ -6011,7 +6042,7 @@ void Interface_DrawTimers(PlayState* play) {
// draw sTimerDigits[3] (10s of seconds) to sTimerDigits[6] (100s of milliseconds)
for (j = 0; j < 4; j++) {
OVERLAY_DISP = Gfx_DrawTexRectI8(
- OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sTimerDigits[j + 3])), 8, 0x10,
+ OVERLAY_DISP, sCounterDigits[sTimerDigits[j + 3]], 8, 0x10,
((void)0, gSaveContext.timerX[sTimerId]) + sTimerDigitsOffsetX[j],
((void)0, gSaveContext.timerY[sTimerId]), sTimerDigitsWidth[j], 0xFA, 0x370, 0x370);
}
@@ -6019,7 +6050,7 @@ void Interface_DrawTimers(PlayState* play) {
// draw sTimerDigits[3] (10s of seconds) to sTimerDigits[7] (10s of milliseconds)
for (j = 0; j < 5; j++) {
OVERLAY_DISP = Gfx_DrawTexRectI8(
- OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sTimerDigits[j + 3])), 8, 0x10,
+ OVERLAY_DISP, sCounterDigits[sTimerDigits[j + 3]], 8, 0x10,
((void)0, gSaveContext.timerX[sTimerId]) + sTimerDigitsOffsetX[j],
((void)0, gSaveContext.timerY[sTimerId]), sTimerDigitsWidth[j], 0xFA, 0x370, 0x370);
}
@@ -6028,7 +6059,7 @@ void Interface_DrawTimers(PlayState* play) {
// draw sTimerDigits[3] (6s of minutes) to sTimerDigits[7] (10s of milliseconds)
for (j = 0; j < 8; j++) {
OVERLAY_DISP = Gfx_DrawTexRectI8(
- OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sTimerDigits[j])), 8, 0x10,
+ OVERLAY_DISP, sCounterDigits[sTimerDigits[j]], 8, 0x10,
((void)0, gSaveContext.timerX[sTimerId]) + sTimerDigitsOffsetX[j],
((void)0, gSaveContext.timerY[sTimerId]), sTimerDigitsWidth[j], 0xFA, 0x370, 0x370);
}
@@ -6212,9 +6243,8 @@ void Interface_DrawMinigameIcons(PlayState* play) {
for (i = 0, numDigitsDrawn = 0; i < 4; i++) {
if ((sMinigameScoreDigits[i] != 0) || (numDigitsDrawn != 0) || (i >= 3)) {
- OVERLAY_DISP =
- Gfx_DrawTexRectI8(OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sMinigameScoreDigits[i])),
- 8, 0x10, rectX, rectY - 2, 9, 0xFA, 0x370, 0x370);
+ OVERLAY_DISP = Gfx_DrawTexRectI8(OVERLAY_DISP, sCounterDigits[sMinigameScoreDigits[i]], 8, 0x10,
+ rectX, rectY - 2, 9, 0xFA, 0x370, 0x370);
rectX += 9;
numDigitsDrawn++;
}
@@ -6271,6 +6301,8 @@ TexturePtr sStoryTLUTs[] = {
};
void Interface_Draw(PlayState* play) {
+ // BENTODO: there is a crash somewhere here
+ // return;
s32 pad;
InterfaceContext* interfaceCtx = &play->interfaceCtx;
Player* player = GET_PLAYER(play);
@@ -6287,7 +6319,10 @@ void Interface_Draw(PlayState* play) {
OPEN_DISPS(play->state.gfxCtx);
gSPSegment(OVERLAY_DISP++, 0x02, interfaceCtx->parameterSegment);
- gSPSegment(OVERLAY_DISP++, 0x09, interfaceCtx->doActionSegment);
+ // BENTODO: Find if this is the correct button
+
+ // BENTODO CRASH
+ gSPSegment(OVERLAY_DISP++, 0x09, interfaceCtx->doActionSegment[A_BUTTON_ACTION].mainTex);
gSPSegment(OVERLAY_DISP++, 0x08, interfaceCtx->iconItemSegment);
gSPSegment(OVERLAY_DISP++, 0x0B, interfaceCtx->mapSegment);
@@ -6368,9 +6403,8 @@ void Interface_Draw(PlayState* play) {
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, interfaceCtx->magicAlpha);
- OVERLAY_DISP =
- Gfx_DrawTexRectI8(OVERLAY_DISP, (u8*)gCounterDigit0Tex + (8 * 16 * counterDigits[2]), 8, 16,
- 43, 191, 8, 16, 1 << 10, 1 << 10);
+ OVERLAY_DISP = Gfx_DrawTexRectI8(OVERLAY_DISP, sCounterDigits[counterDigits[2]], 8, 16, 43, 191,
+ 8, 16, 1 << 10, 1 << 10);
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha);
@@ -6383,8 +6417,8 @@ void Interface_Draw(PlayState* play) {
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, interfaceCtx->magicAlpha);
- OVERLAY_DISP = Gfx_DrawTexRectI8(OVERLAY_DISP, (u8*)gCounterDigit0Tex + (8 * 16 * counterDigits[3]),
- 8, 16, sp2CA + 1, 191, 8, 16, 1 << 10, 1 << 10);
+ OVERLAY_DISP = Gfx_DrawTexRectI8(OVERLAY_DISP, sCounterDigits[counterDigits[3]], 8, 16, sp2CA + 1,
+ 191, 8, 16, 1 << 10, 1 << 10);
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha);
@@ -6424,8 +6458,8 @@ void Interface_Draw(PlayState* play) {
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, interfaceCtx->magicAlpha);
- OVERLAY_DISP = Gfx_DrawTexRectI8(OVERLAY_DISP, (u8*)gCounterDigit0Tex + (8 * 16 * counterDigits[2]),
- 8, 16, 43, 191, 8, 16, 1 << 10, 1 << 10);
+ OVERLAY_DISP = Gfx_DrawTexRectI8(OVERLAY_DISP, sCounterDigits[counterDigits[2]], 8, 16, 43, 191, 8,
+ 16, 1 << 10, 1 << 10);
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha);
@@ -6437,8 +6471,8 @@ void Interface_Draw(PlayState* play) {
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, interfaceCtx->magicAlpha);
- OVERLAY_DISP = Gfx_DrawTexRectI8(OVERLAY_DISP, (u8*)gCounterDigit0Tex + (8 * 16 * counterDigits[3]), 8,
- 16, sp2CA + 1, 191, 8, 16, 1 << 10, 1 << 10);
+ OVERLAY_DISP = Gfx_DrawTexRectI8(OVERLAY_DISP, sCounterDigits[counterDigits[3]], 8, 16, sp2CA + 1, 191,
+ 8, 16, 1 << 10, 1 << 10);
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha);
@@ -6484,8 +6518,8 @@ void Interface_Draw(PlayState* play) {
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, magicAlpha);
- OVERLAY_DISP = Gfx_DrawTexRectI8(OVERLAY_DISP, (u8*)gCounterDigit0Tex + (8 * 16 * counterDigits[sp2CC]), 8,
- 16, sp2CA + 1, 207, 8, 16, 1 << 10, 1 << 10);
+ OVERLAY_DISP = Gfx_DrawTexRectI8(OVERLAY_DISP, sCounterDigits[counterDigits[sp2CC]], 8, 16, sp2CA + 1, 207,
+ 8, 16, 1 << 10, 1 << 10);
gDPPipeSync(OVERLAY_DISP++);
@@ -6571,7 +6605,6 @@ void Interface_Draw(PlayState* play) {
Interface_DrawMinigameIcons(play);
Interface_DrawTimers(play);
}
-
// Draw pictograph focus icons
if (sPictoState == PICTO_BOX_STATE_LENS) {
@@ -6671,7 +6704,8 @@ void Interface_Draw(PlayState* play) {
gDPPipeSync(OVERLAY_DISP++);
gSPDisplayList(OVERLAY_DISP++, sScreenFillSetupDL);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, interfaceCtx->screenFillAlpha);
- gSPDisplayList(OVERLAY_DISP++, D_0E000000.fillRect);
+
+ __gSPDisplayList(OVERLAY_DISP++, 0x0E000000 + ((uintptr_t)&D_0E000000.fillRect - (uintptr_t)&D_0E000000) + 1);
}
CLOSE_DISPS(play->state.gfxCtx);
@@ -7221,13 +7255,20 @@ void Interface_Init(PlayState* play) {
parameterStaticSize = SEGMENT_ROM_SIZE(parameter_static);
interfaceCtx->parameterSegment = THA_AllocTailAlign16(&play->state.tha, parameterStaticSize);
- DmaMgr_SendRequest0(interfaceCtx->parameterSegment, SEGMENT_ROM_START(parameter_static), parameterStaticSize);
+ // OTRTODO
+ // DmaMgr_SendRequest0(interfaceCtx->parameterSegment, SEGMENT_ROM_START(parameter_static), parameterStaticSize);
- interfaceCtx->doActionSegment = THA_AllocTailAlign16(&play->state.tha, 0xC90);
- // BENTODO
- //DmaMgr_SendRequest0(interfaceCtx->doActionSegment, SEGMENT_ROM_START(do_action_static), 0x300);
- //DmaMgr_SendRequest0(interfaceCtx->doActionSegment + 0x300, SEGMENT_ROM_START_OFFSET(do_action_static, 0x480),
- // 0x180);
+ interfaceCtx->doActionSegment = THA_AllocTailAlign16(&play->state.tha, sizeof(ActionLabel) * 4);
+ for (size_t id = 0; id < 4; id++) {
+ ActionLabel lbl = { gEmptyTexture, gEmptyTexture };
+ interfaceCtx->doActionSegment[id] = lbl;
+ }
+
+ interfaceCtx->doActionSegment[A_BUTTON_ACTION].mainTex = doActionTbl[0];
+ interfaceCtx->doActionSegment[A_BUTTON_ACTION].subTex = doActionTbl[1];
+ interfaceCtx->doActionSegment[START_BUTTON_ACTION].mainTex = doActionTbl[3];
+ // DmaMgr_SendRequest0(interfaceCtx->doActionSegment, SEGMENT_ROM_START(do_action_static), 0x300);
+ // DmaMgr_SendRequest0(interfaceCtx->doActionSegment + 0x300, SEGMENT_ROM_START(do_action_static) + 0x480, 0x180);
Interface_NewDay(play, CURRENT_DAY);