summaryrefslogtreecommitdiff
path: root/src/code/z_parameter.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_parameter.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_parameter.c')
-rw-r--r--src/code/z_parameter.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c
index f23bc9348..90996bc9f 100644
--- a/src/code/z_parameter.c
+++ b/src/code/z_parameter.c
@@ -4,11 +4,6 @@
#include "assets/textures/do_action_static/do_action_static.h"
#include "assets/textures/icon_item_static/icon_item_static.h"
-// TODO extract this information from the texture definitions themselves
-#define DO_ACTION_TEX_WIDTH 48
-#define DO_ACTION_TEX_HEIGHT 16
-#define DO_ACTION_TEX_SIZE ((DO_ACTION_TEX_WIDTH * DO_ACTION_TEX_HEIGHT) / 2) // (sizeof(gCheckDoActionENGTex))
-
typedef struct {
/* 0x00 */ u8 sceneId;
/* 0x01 */ u8 flags1;
@@ -1277,10 +1272,10 @@ void Interface_LoadItemIcon1(PlayState* play, u16 button) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
- DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->iconItemSegment + button * 0x1000,
+ DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_160, interfaceCtx->iconItemSegment + button * ICON_ITEM_TEX_SIZE,
(uintptr_t)_icon_item_staticSegmentRomStart +
- (gSaveContext.equips.buttonItems[button] * 0x1000),
- 0x1000, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1171);
+ (gSaveContext.equips.buttonItems[button] * ICON_ITEM_TEX_SIZE),
+ ICON_ITEM_TEX_SIZE, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1171);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
}
@@ -1288,10 +1283,10 @@ void Interface_LoadItemIcon2(PlayState* play, u16 button) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
- DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_180, interfaceCtx->iconItemSegment + button * 0x1000,
+ DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_180, interfaceCtx->iconItemSegment + button * ICON_ITEM_TEX_SIZE,
(uintptr_t)_icon_item_staticSegmentRomStart +
- (gSaveContext.equips.buttonItems[button] * 0x1000),
- 0x1000, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1193);
+ (gSaveContext.equips.buttonItems[button] * ICON_ITEM_TEX_SIZE),
+ ICON_ITEM_TEX_SIZE, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1193);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
}
@@ -2086,7 +2081,7 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 l
if ((action != DO_ACTION_NONE) && (action != DO_ACTION_MAX + DO_ACTION_NONE) &&
(action != 2 * DO_ACTION_MAX + DO_ACTION_NONE)) {
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
- DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160,
+ DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_160,
interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE),
(uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE),
DO_ACTION_TEX_SIZE, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145);
@@ -2150,7 +2145,7 @@ void Interface_LoadActionLabelB(PlayState* play, u16 action) {
interfaceCtx->unk_1FC = action;
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
- DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE,
+ DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE,
(uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE,
0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2228);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);