From 880e7c937c81cc55fea876b1d85294ffba43a4d8 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Tue, 13 Dec 2022 03:45:54 +0100 Subject: [PATCH] Some cleanup/doc on the item icons (#1263) * Some cleanup/doc on the item enum and icons * `gItemIconBigBottlePoeTex` -> `gItemIconBottleBigPoeTex` * Biggoron sword / giant knife items (?) * `SPSTONE_` -> `SPIRITUAL_` ? * `gItemIconBrokenBiggoronSwordTex` -> `gItemIconBrokenGoronsSwordTex` * `gQuestIcon...MedallionTex` -> `gQuestIconMedallion...Tex` * `ITEM_MAGIC_` -> `ITEM_MAGIC_JAR_`small/big * `ITEM_BOW_ARROW_` -> `ITEM_BOW_` * `MASK_BUNNY` -> `MASK_BUNNY_HOOD` * Update `GID_` enum from `ITEM_` enum * ITEM/GID`_ARROW_`small/medium/large -> 5/10/30 * Run formatter * . * fix regressions and revert bad ideas * chicken * obey the newline police and also prevent the range police from intervening * fixups * dimensions -> dimension (singular) * Note on inconsequential oddities about the `gItemIcons` mapping --- assets/xml/textures/icon_item_24_static.xml | 40 +-- assets/xml/textures/icon_item_static.xml | 180 ++++++------ assets/xml/textures/parameter_static.xml | 10 +- include/regs.h | 2 +- include/z64interface.h | 28 ++ include/z64item.h | 8 - src/code/code_80097A00.c | 265 +++++++++--------- src/code/z_construct.c | 54 ++-- src/code/z_message_PAL.c | 41 +-- src/code/z_parameter.c | 18 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 5 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.h | 2 +- .../ovl_kaleido_scope/z_kaleido_collect.c | 17 +- .../ovl_kaleido_scope/z_kaleido_equipment.c | 17 +- .../misc/ovl_kaleido_scope/z_kaleido_item.c | 4 +- .../ovl_kaleido_scope/z_kaleido_map_PAL.c | 8 +- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 6 +- 17 files changed, 369 insertions(+), 336 deletions(-) diff --git a/assets/xml/textures/icon_item_24_static.xml b/assets/xml/textures/icon_item_24_static.xml index 0c5f7621e1..395da30bb7 100644 --- a/assets/xml/textures/icon_item_24_static.xml +++ b/assets/xml/textures/icon_item_24_static.xml @@ -1,24 +1,24 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/icon_item_static.xml b/assets/xml/textures/icon_item_static.xml index 7b61cf35c4..411f0f2015 100644 --- a/assets/xml/textures/icon_item_static.xml +++ b/assets/xml/textures/icon_item_static.xml @@ -1,95 +1,95 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/parameter_static.xml b/assets/xml/textures/parameter_static.xml index 4fd642c7cf..4cfe67916e 100644 --- a/assets/xml/textures/parameter_static.xml +++ b/assets/xml/textures/parameter_static.xml @@ -23,11 +23,11 @@ - - - - - + + + + + diff --git a/include/regs.h b/include/regs.h index c063705313..fbbd3bbf9c 100644 --- a/include/regs.h +++ b/include/regs.h @@ -99,7 +99,7 @@ #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_TEXTBOX_ICON_DIMENSION YREG(75) #define R_MESSAGE_DEBUGGER_SELECT YREG(78) #define R_MESSAGE_DEBUGGER_TEXTID YREG(79) #define R_C_UP_ICON_X YREG(88) diff --git a/include/z64interface.h b/include/z64interface.h index de3913abae..781b1e6fb6 100644 --- a/include/z64interface.h +++ b/include/z64interface.h @@ -1,6 +1,34 @@ #ifndef Z64INTERFACE_H #define Z64INTERFACE_H +extern u8 _icon_item_staticSegmentRomStart[]; +extern u8 _icon_item_24_staticSegmentRomStart[]; + +// An "item icon" (gItemIcon*Tex) is 32x32 rgba32 +#define ITEM_ICON_WIDTH 32 +#define ITEM_ICON_HEIGHT 32 +#define ITEM_ICON_SIZE (ITEM_ICON_WIDTH * ITEM_ICON_HEIGHT * 4) // The size in bytes of an item icon + +/** + * Get the VROM address of the item icon for the specified item. + * + * @param itemId An ItemId value in the range `ITEM_DEKU_STICK`..`ITEM_FISHING_POLE` + */ +#define GET_ITEM_ICON_VROM(itemId) ((uintptr_t)_icon_item_staticSegmentRomStart + ((itemId)*ITEM_ICON_SIZE)) + +// A "quest icon" (gQuestIcon*Tex) is 24x24 rgba32 +#define QUEST_ICON_WIDTH 24 +#define QUEST_ICON_HEIGHT 24 +#define QUEST_ICON_SIZE (QUEST_ICON_WIDTH * QUEST_ICON_HEIGHT * 4) // The size in bytes of a quest icon + +/** + * Get the VROM address of the quest icon for the specified item. + * + * @param itemId An ItemId value in the range `ITEM_MEDALLION_FOREST`..`ITEM_MAGIC_JAR_BIG` + */ +#define GET_QUEST_ICON_VROM(itemId) \ + ((uintptr_t)_icon_item_24_staticSegmentRomStart + (((itemId)-ITEM_MEDALLION_FOREST) * QUEST_ICON_SIZE)) + /** * Button HUD Positions (Upper Left) */ diff --git a/include/z64item.h b/include/z64item.h index a642841b96..7bfe188478 100644 --- a/include/z64item.h +++ b/include/z64item.h @@ -1,14 +1,6 @@ #ifndef Z64ITEM_H #define Z64ITEM_H -#define ICON_ITEM_TEX_WIDTH 32 -#define ICON_ITEM_TEX_HEIGHT 32 -#define ICON_ITEM_TEX_SIZE ((ICON_ITEM_TEX_WIDTH * ICON_ITEM_TEX_HEIGHT) * 4) // 32x32 RGBA32 texture - -#define ICON_ITEM_24_TEX_WIDTH 24 -#define ICON_ITEM_24_TEX_HEIGHT 24 -#define ICON_ITEM_24_TEX_SIZE ((ICON_ITEM_24_TEX_WIDTH * ICON_ITEM_24_TEX_HEIGHT) * 4) // 24x24 RGBA32 texture - // Note that z_kaleido_scope_PAL.c assumes that the dimensions and texture format here also matches the dimensions and // texture format for MAP_NAME_TEX1_* #define ITEM_NAME_TEX_WIDTH 128 diff --git a/src/code/code_80097A00.c b/src/code/code_80097A00.c index 8b9e76f1b6..550fb8396a 100644 --- a/src/code/code_80097A00.c +++ b/src/code/code_80097A00.c @@ -78,136 +78,141 @@ u32 gGsFlagsMasks[] = { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 }; u32 gGsFlagsShifts[] = { 0, 8, 16, 24 }; void* gItemIcons[] = { - gDekuStickIconTex, - gDekuNutIconTex, - gBombIconTex, - gFairyBowIconTex, - gFireArrowIconTex, - gDinsFireIconTex, - gFairySlingshotIconTex, - gFairyOcarinaIconTex, - gOcarinaofTimeIconTex, - gBombchuIconTex, - gHookshotIconTex, - gLongshotIconTex, - gIceArrowIconTex, - gFaroresWindIconTex, - gBoomerangIconTex, - gLensofTruthIconTex, - gMagicBeansIconTex, - gMegatonHammerIconTex, - gLightArrowIconTex, - gNayrusLoveIconTex, - gEmptyBottleIconTex, - gRedPotionIconTex, - gGreenPotionIconTex, - gBluePotionIconTex, - gBottledFairyIconTex, - gFishIconTex, - gMilkFullIconTex, - gRutosLetterIconTex, - gBlueFireIconTex, - gBugIconTex, - gBigPoeIconTex, - gMilkhalfIconTex, - gPoeIconTex, - gWeirdEggIconTex, - gCuccoIconTex, - gZeldasLetterIconTex, - gKeatonMaskIconTex, - gSkullMaskIconTex, - gSpookyMaskIconTex, - gBunnyHoodIconTex, - gGoronMaskIconTex, - gZoraMaskIconTex, - gGerudoMaskIconTex, - gMaskofTruthIconTex, - gSoldOutIconTex, - gPocketEggIconTex, - gPocketCuccoIconTex, - gCojiroIconTex, - gOddMushroomIconTex, - gOddPotionIconTex, - gPoachersSawIconTex, - gBrokenBiggoronSwordIconTex, - gPrescriptionIconTex, - gEyeBallFrogIconTex, - gEyeDropsIconTex, - gClaimCheckIconTex, - gFairyBowFireIconTex, - gFairyBowIceIconTex, - gFairyBowLightIconTex, - gKokiriSwordIconTex, - gMasterSwordIconTex, - gBiggoronSwordIconTex, - gDekuShieldIconTex, - gHylianShieldIconTex, - gMirrorShieldIconTex, - gKokiriTunicIconTex, - gGoronTunicIconTex, - gZoraTunicIconTex, - gKokiriBootsIconTex, - gIronBootsIconTex, - gHoverBootsIconTex, - gBulletBag30IconTex, - gBulletBag40IconTex, - gBulletBag50IconTex, - gQuiver30IconTex, - gQuiver40IconTex, - gQuiver50IconTex, - gBombBag20IconTex, - gBombBag30IconTex, - gBombBag40IconTex, - gGoronsBraceletIconTex, - gSilverGauntletsIconTex, - gGoldenGauntletsIconTex, - gSilverScaleIconTex, - gGoldenScaleIconTex, - gBrokenGiantsKnifeIconTex, - gAdultsWalletIconTex, - gGiantsWalletIconTex, - gDekuSeedsIconTex, - gFishingPoleIconTex, - gSongNoteTex, - gSongNoteTex, - gSongNoteTex, - gSongNoteTex, - gSongNoteTex, - gSongNoteTex, - gSongNoteTex, - gSongNoteTex, - gSongNoteTex, - gSongNoteTex, - gSongNoteTex, - gSongNoteTex, - gForestMedallionIconTex, - gFireMedallionIconTex, - gWaterMedallionIconTex, - gSpiritMedallionIconTex, - gShadowMedallionIconTex, - gLightMedallionIconTex, - gKokiriEmeraldIconTex, - gGoronRubyIconTex, - gZoraSapphireIconTex, - gStoneOfAgonyIconTex, - gGerudosCardIconTex, - gGoldSkulltulaIconTex, - gHeartContainerIconTex, - gUnusedPieceOfHeartIconTex, - gBossKeyIconTex, - gDungeonMapIconTex, - gCompassIconTex, - gBossKeyIconTex, - gSmallMagicJarIconTex, - gBigMagicJarIconTex, - gHeartPieceIcon1Tex, - gHeartPieceIcon2Tex, - gHeartPieceIcon3Tex, - gOcarinaCUpTex, - gOcarinaCDownTex, - gOcarinaCLeftTex, - gOcarinaCRightTex, - gOcarinaATex, + // icon_item_static 32x32 rgba32 + gItemIconDekuStickTex, // ITEM_DEKU_STICK + gItemIconDekuNutTex, // ITEM_DEKU_NUT + gItemIconBombTex, // ITEM_BOMB + gItemIconBowTex, // ITEM_BOW + gItemIconArrowFireTex, // ITEM_ARROW_FIRE + gItemIconDinsFireTex, // ITEM_DINS_FIRE + gItemIconSlingshotTex, // ITEM_SLINGSHOT + gItemIconOcarinaFairyTex, // ITEM_OCARINA_FAIRY + gItemIconOcarinaOfTimeTex, // ITEM_OCARINA_OF_TIME + gItemIconBombchuTex, // ITEM_BOMBCHU + gItemIconHookshotTex, // ITEM_HOOKSHOT + gItemIconLongshotTex, // ITEM_LONGSHOT + gItemIconArrowIceTex, // ITEM_ARROW_ICE + gItemIconFaroresWindTex, // ITEM_FARORES_WIND + gItemIconBoomerangTex, // ITEM_BOOMERANG + gItemIconLensOfTruthTex, // ITEM_LENS_OF_TRUTH + gItemIconMagicBeanTex, // ITEM_MAGIC_BEAN + gItemIconHammerTex, // ITEM_HAMMER + gItemIconArrowLightTex, // ITEM_ARROW_LIGHT + gItemIconNayrusLoveTex, // ITEM_NAYRUS_LOVE + gItemIconBottleEmptyTex, // ITEM_BOTTLE_EMPTY + gItemIconBottlePotionRedTex, // ITEM_BOTTLE_POTION_RED + gItemIconBottlePotionGreenTex, // ITEM_BOTTLE_POTION_GREEN + gItemIconBottlePotionBlueTex, // ITEM_BOTTLE_POTION_BLUE + gItemIconBottleFairyTex, // ITEM_BOTTLE_FAIRY + gItemIconBottleFishTex, // ITEM_BOTTLE_FISH + gItemIconBottleMilkFullTex, // ITEM_BOTTLE_MILK_FULL + gItemIconBottleRutosLetterTex, // ITEM_BOTTLE_RUTOS_LETTER + gItemIconBottleBlueFireTex, // ITEM_BOTTLE_BLUE_FIRE + gItemIconBottleBugTex, // ITEM_BOTTLE_BUG + gItemIconBottleBigPoeTex, // ITEM_BOTTLE_BIG_POE + gItemIconBottleMilkHalfTex, // ITEM_BOTTLE_MILK_HALF + gItemIconBottlePoeTex, // ITEM_BOTTLE_POE + gItemIconWeirdEggTex, // ITEM_WEIRD_EGG + gItemIconChickenTex, // ITEM_CHICKEN + gItemIconZeldasLetterTex, // ITEM_ZELDAS_LETTER + gItemIconMaskKeatonTex, // ITEM_MASK_KEATON + gItemIconMaskSkullTex, // ITEM_MASK_SKULL + gItemIconMaskSpookyTex, // ITEM_MASK_SPOOKY + gItemIconMaskBunnyHoodTex, // ITEM_MASK_BUNNY_HOOD + gItemIconMaskGoronTex, // ITEM_MASK_GORON + gItemIconMaskZoraTex, // ITEM_MASK_ZORA + gItemIconMaskGerudoTex, // ITEM_MASK_GERUDO + gItemIconMaskTruthTex, // ITEM_MASK_TRUTH + gItemIconSoldOutTex, // ITEM_SOLD_OUT + gItemIconPocketEggTex, // ITEM_POCKET_EGG + gItemIconPocketCuccoTex, // ITEM_POCKET_CUCCO + gItemIconCojiroTex, // ITEM_COJIRO + gItemIconOddMushroomTex, // ITEM_ODD_MUSHROOM + gItemIconOddPotionTex, // ITEM_ODD_POTION + gItemIconPoachersSawTex, // ITEM_POACHERS_SAW + gItemIconBrokenGoronsSwordTex, // ITEM_BROKEN_GORONS_SWORD + gItemIconPrescriptionTex, // ITEM_PRESCRIPTION + gItemIconEyeballFrogTex, // ITEM_EYEBALL_FROG + gItemIconEyeDropsTex, // ITEM_EYE_DROPS + gItemIconClaimCheckTex, // ITEM_CLAIM_CHECK + gItemIconBowFireTex, // ITEM_BOW_FIRE + gItemIconBowIceTex, // ITEM_BOW_ICE + gItemIconBowLightTex, // ITEM_BOW_LIGHT + gItemIconSwordKokiriTex, // ITEM_SWORD_KOKIRI + gItemIconSwordMasterTex, // ITEM_SWORD_MASTER + gItemIconSwordBiggoronTex, // ITEM_SWORD_BIGGORON + gItemIconShieldDekuTex, // ITEM_SHIELD_DEKU + gItemIconShieldHylianTex, // ITEM_SHIELD_HYLIAN + gItemIconShieldMirrorTex, // ITEM_SHIELD_MIRROR + gItemIconTunicKokiriTex, // ITEM_TUNIC_KOKIRI + gItemIconTunicGoronTex, // ITEM_TUNIC_GORON + gItemIconTunicZoraTex, // ITEM_TUNIC_ZORA + gItemIconBootsKokiriTex, // ITEM_BOOTS_KOKIRI + gItemIconBootsIronTex, // ITEM_BOOTS_IRON + gItemIconBootsHoverTex, // ITEM_BOOTS_HOVER + gItemIconBulletBag30Tex, // ITEM_BULLET_BAG_30 + gItemIconBulletBag40Tex, // ITEM_BULLET_BAG_40 + gItemIconBulletBag50Tex, // ITEM_BULLET_BAG_50 + gItemIconQuiver30Tex, // ITEM_QUIVER_30 + gItemIconQuiver40Tex, // ITEM_QUIVER_40 + gItemIconQuiver50Tex, // ITEM_QUIVER_50 + gItemIconBombBag20Tex, // ITEM_BOMB_BAG_20 + gItemIconBombBag30Tex, // ITEM_BOMB_BAG_30 + gItemIconBombBag40Tex, // ITEM_BOMB_BAG_40 + gItemIconGoronsBraceletTex, // ITEM_STRENGTH_GORONS_BRACELET + gItemIconSilverGauntletsTex, // ITEM_STRENGTH_SILVER_GAUNTLETS + gItemIconGoldenGauntletsTex, // ITEM_STRENGTH_GOLD_GAUNTLETS + gItemIconScaleSilverTex, // ITEM_SCALE_SILVER + gItemIconScaleGoldenTex, // ITEM_SCALE_GOLDEN + gItemIconBrokenGiantsKnifeTex, // ITEM_GIANTS_KNIFE + gItemIconAdultsWalletTex, // ITEM_ADULTS_WALLET + gItemIconGiantsWalletTex, // ITEM_GIANTS_WALLET + gItemIconDekuSeedsTex, // ITEM_DEKU_SEEDS + gItemIconFishingPoleTex, // ITEM_FISHING_POLE + // icon_item_static 16x24 ia8 + gSongNoteTex, // ITEM_SONG_MINUET + gSongNoteTex, // ITEM_SONG_BOLERO + gSongNoteTex, // ITEM_SONG_SERENADE + gSongNoteTex, // ITEM_SONG_REQUIEM + gSongNoteTex, // ITEM_SONG_NOCTURNE + gSongNoteTex, // ITEM_SONG_PRELUDE + gSongNoteTex, // ITEM_SONG_LULLABY + gSongNoteTex, // ITEM_SONG_EPONA + gSongNoteTex, // ITEM_SONG_SARIA + gSongNoteTex, // ITEM_SONG_SUN + gSongNoteTex, // ITEM_SONG_TIME + gSongNoteTex, // ITEM_SONG_STORMS + // icon_item_24static 24x24 rgba32 + gQuestIconMedallionForestTex, // ITEM_MEDALLION_FOREST + gQuestIconMedallionFireTex, // ITEM_MEDALLION_FIRE + gQuestIconMedallionWaterTex, // ITEM_MEDALLION_WATER + gQuestIconMedallionSpiritTex, // ITEM_MEDALLION_SPIRIT + gQuestIconMedallionShadowTex, // ITEM_MEDALLION_SHADOW + gQuestIconMedallionLightTex, // ITEM_MEDALLION_LIGHT + gQuestIconKokiriEmeraldTex, // ITEM_KOKIRI_EMERALD + gQuestIconGoronRubyTex, // ITEM_GORON_RUBY + gQuestIconZoraSapphireTex, // ITEM_ZORA_SAPPHIRE + gQuestIconStoneOfAgonyTex, // ITEM_STONE_OF_AGONY + gQuestIconGerudosCardTex, // ITEM_GERUDOS_CARD + gQuestIconGoldSkulltulaTex, // ITEM_SKULL_TOKEN + gQuestIconHeartContainerTex, // ITEM_HEART_CONTAINER + gQuestIconHeartPieceTex, // ITEM_HEART_PIECE + gQuestIconDungeonBossKeyTex, // ITEM_DUNGEON_BOSS_KEY + gQuestIconDungeonMapTex, // ITEM_DUNGEON_COMPASS (swapped with map (inconsequential)) + gQuestIconDungeonCompassTex, // ITEM_DUNGEON_MAP (swapped with compass (inconsequential)) + gQuestIconDungeonBossKeyTex, // ITEM_SMALL_KEY (but texture is boss key (inconsequential)) + gQuestIconMagicJarSmallTex, // ITEM_MAGIC_JAR_SMALL + gQuestIconMagicJarBigTex, // ITEM_MAGIC_JAR_BIG + // icon_item_static 48x48 ia8 + gHeartPieceIcon1Tex, // ITEM_HEART_PIECE_2 + gHeartPieceIcon2Tex, // ITEM_INVALID_1 + gHeartPieceIcon3Tex, // ITEM_INVALID_2 + // parameter_static 16x16 ia8 + gOcarinaBtnIconCUpTex, // ITEM_INVALID_3 + gOcarinaBtnIconCDownTex, // ITEM_INVALID_4 + gOcarinaBtnIconCLeftTex, // ITEM_INVALID_5 + gOcarinaBtnIconCRightTex, // ITEM_INVALID_6 + gOcarinaBtnIconATex, // ITEM_INVALID_7 }; // Used to map item IDs to inventory slots diff --git a/src/code/z_construct.c b/src/code/z_construct.c index 0868c13d43..a0a45224fb 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -4,6 +4,8 @@ void Interface_Destroy(PlayState* play) { Map_Destroy(play); } +#define ICON_ITEM_SEGMENT_SIZE (4 * ITEM_ICON_SIZE) + void Interface_Init(PlayState* play) { InterfaceContext* interfaceCtx = &play->interfaceCtx; u32 parameterSize; @@ -70,10 +72,10 @@ void Interface_Init(PlayState* play) { (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, DO_ACTION_TEX_SIZE, "../z_construct.c", 178); - interfaceCtx->iconItemSegment = GameState_Alloc(&play->state, 4 * ICON_ITEM_TEX_SIZE, "../z_construct.c", 190); + interfaceCtx->iconItemSegment = GameState_Alloc(&play->state, ICON_ITEM_SEGMENT_SIZE, "../z_construct.c", 190); // "Icon Item Texture Initialization = %x" - osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", 4 * ICON_ITEM_TEX_SIZE); + osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", ICON_ITEM_SEGMENT_SIZE); osSyncPrintf("parameter->icon_itemSegment=%x\n", interfaceCtx->iconItemSegment); ASSERT(interfaceCtx->iconItemSegment != NULL, "parameter->icon_itemSegment != NULL", "../z_construct.c", 193); @@ -83,36 +85,31 @@ void Interface_Init(PlayState* play) { gSaveContext.equips.buttonItems[3]); if (gSaveContext.equips.buttonItems[0] < 0xF0) { - 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); + DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.equips.buttonItems[0]), ITEM_ICON_SIZE, + "../z_construct.c", 198); } else if (gSaveContext.equips.buttonItems[0] != 0xFF) { - 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); + DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.equips.buttonItems[0]), ITEM_ICON_SIZE, + "../z_construct.c", 203); } if (gSaveContext.equips.buttonItems[1] < 0xF0) { - 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); + DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (1 * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.equips.buttonItems[1]), ITEM_ICON_SIZE, + "../z_construct.c", 209); } if (gSaveContext.equips.buttonItems[2] < 0xF0) { - 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); + DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (2 * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.equips.buttonItems[2]), ITEM_ICON_SIZE, + "../z_construct.c", 214); } if (gSaveContext.equips.buttonItems[3] < 0xF0) { - 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); + DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (3 * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.equips.buttonItems[3]), ITEM_ICON_SIZE, + "../z_construct.c", 219); } osSyncPrintf("EVENT=%d\n", ((void)0, gSaveContext.timerState)); @@ -173,6 +170,9 @@ void Interface_Init(PlayState* play) { R_A_BTN_COLOR(2) = 50; } +#define TEXTBOX_SEGMENT_SIZE \ + (MESSAGE_STATIC_TEX_SIZE + MAX(MAX(ITEM_ICON_SIZE, QUEST_ICON_SIZE), 2 * MESSAGE_TEXTURE_STATIC_TEX_SIZE)) + void Message_Init(PlayState* play) { MessageContext* msgCtx = &play->msgCtx; s32 pad; @@ -188,15 +188,11 @@ void Message_Init(PlayState* play) { View_Init(&msgCtx->view, play->state.gfxCtx); - 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); + msgCtx->textboxSegment = GameState_Alloc(&play->state, TEXTBOX_SEGMENT_SIZE, "../z_construct.c", 349); osSyncPrintf("message->fukidashiSegment=%x\n", msgCtx->textboxSegment); - osSyncPrintf("吹き出しgame_alloc=%x\n", 0x2200); // "Textbox game_alloc=%x" + osSyncPrintf("吹き出しgame_alloc=%x\n", TEXTBOX_SEGMENT_SIZE); // "Textbox game_alloc=%x" ASSERT(msgCtx->textboxSegment != NULL, "message->fukidashiSegment != NULL", "../z_construct.c", 352); Font_LoadOrderedFont(&play->msgCtx.font); @@ -257,7 +253,7 @@ void Regs_InitDataImpl(void) { R_TEXTBOX_ICON_YPOS = 10; YREG(73) = -8; YREG(74) = 8; - R_TEXTBOX_ICON_SIZE = 24; + R_TEXTBOX_ICON_DIMENSION = 24; YREG(76) = 32; YREG(77) = 0; R_MESSAGE_DEBUGGER_SELECT = 0; diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index 8ca1a884d1..30c0d958f6 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -755,17 +755,17 @@ u16 Message_DrawItemIcon(PlayState* play, u16 itemId, Gfx** p, u16 i) { gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, msgCtx->textColorAlpha); if (itemId >= ITEM_MEDALLION_FOREST) { - gDPLoadTextureBlock(gfx++, msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, G_IM_FMT_RGBA, G_IM_SIZ_32b, 24, - 24, 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); + gDPLoadTextureBlock(gfx++, msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, G_IM_FMT_RGBA, G_IM_SIZ_32b, + QUEST_ICON_WIDTH, QUEST_ICON_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); } else { - gDPLoadTextureBlock(gfx++, msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, G_IM_FMT_RGBA, G_IM_SIZ_32b, 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); + gDPLoadTextureBlock(gfx++, msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, G_IM_FMT_RGBA, G_IM_SIZ_32b, + ITEM_ICON_WIDTH, ITEM_ICON_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(gfx++, (msgCtx->textPosX + R_TEXTBOX_ICON_XPOS) << 2, R_TEXTBOX_ICON_YPOS << 2, - (msgCtx->textPosX + R_TEXTBOX_ICON_XPOS + R_TEXTBOX_ICON_SIZE) << 2, - (R_TEXTBOX_ICON_YPOS + R_TEXTBOX_ICON_SIZE) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + (msgCtx->textPosX + R_TEXTBOX_ICON_XPOS + R_TEXTBOX_ICON_DIMENSION) << 2, + (R_TEXTBOX_ICON_YPOS + R_TEXTBOX_ICON_DIMENSION) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); gDPPipeSync(gfx++); gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); @@ -1164,21 +1164,18 @@ void Message_LoadItemIcon(PlayState* play, u16 itemId, s16 y) { } if (itemId < ITEM_MEDALLION_FOREST) { R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem32XOffsets[gSaveContext.language]; - R_TEXTBOX_ICON_YPOS = y + 6; - R_TEXTBOX_ICON_SIZE = 32; - DmaMgr_RequestSyncDebug(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, - (uintptr_t)_icon_item_staticSegmentRomStart + (itemId * ICON_ITEM_TEX_SIZE), - ICON_ITEM_TEX_SIZE, "../z_message_PAL.c", 1473); + R_TEXTBOX_ICON_YPOS = y + ((44 - ITEM_ICON_HEIGHT) / 2); + R_TEXTBOX_ICON_DIMENSION = ITEM_ICON_WIDTH; // assumes the image is square + DmaMgr_RequestSyncDebug(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, GET_ITEM_ICON_VROM(itemId), + ITEM_ICON_SIZE, "../z_message_PAL.c", 1473); // "Item 32-0" osSyncPrintf("アイテム32-0\n"); } else { R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem24XOffsets[gSaveContext.language]; - R_TEXTBOX_ICON_YPOS = y + 10; - R_TEXTBOX_ICON_SIZE = 24; - DmaMgr_RequestSyncDebug(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, - (uintptr_t)_icon_item_24_staticSegmentRomStart + - (itemId - ITEM_MEDALLION_FOREST) * ICON_ITEM_24_TEX_SIZE, - ICON_ITEM_24_TEX_SIZE, "../z_message_PAL.c", 1482); + R_TEXTBOX_ICON_YPOS = y + ((44 - QUEST_ICON_HEIGHT) / 2); + R_TEXTBOX_ICON_DIMENSION = QUEST_ICON_WIDTH; // assumes the image is square + DmaMgr_RequestSyncDebug(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, GET_QUEST_ICON_VROM(itemId), + QUEST_ICON_SIZE, "../z_message_PAL.c", 1482); // "Item 24" osSyncPrintf("アイテム24=%d (%d) {%d}\n", itemId, itemId - ITEM_KOKIRI_EMERALD, 84); } @@ -1977,7 +1974,11 @@ void Message_DrawMain(PlayState* play, Gfx** p) { }; static s16 sOcarinaEffectActorParams[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000 }; static void* sOcarinaNoteTextures[] = { - gOcarinaATex, gOcarinaCDownTex, gOcarinaCRightTex, gOcarinaCLeftTex, gOcarinaCUpTex, + gOcarinaBtnIconATex, // OCARINA_BTN_A + gOcarinaBtnIconCDownTex, // OCARINA_BTN_C_DOWN + gOcarinaBtnIconCRightTex, // OCARINA_BTN_C_RIGHT + gOcarinaBtnIconCLeftTex, // OCARINA_BTN_C_LEFT + gOcarinaBtnIconCUpTex, // OCARINA_BTN_C_UP }; static s16 sOcarinaButtonAPrimColors[][3] = { { 80, 255, 150 }, diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 9809191d87..6b9ae2b526 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1298,10 +1298,9 @@ void Interface_LoadItemIcon1(PlayState* play, u16 button) { InterfaceContext* interfaceCtx = &play->interfaceCtx; osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1); - DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_160, interfaceCtx->iconItemSegment + button * ICON_ITEM_TEX_SIZE, - (uintptr_t)_icon_item_staticSegmentRomStart + - (gSaveContext.equips.buttonItems[button] * ICON_ITEM_TEX_SIZE), - ICON_ITEM_TEX_SIZE, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1171); + DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_160, interfaceCtx->iconItemSegment + (button * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.equips.buttonItems[button]), ITEM_ICON_SIZE, 0, + &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1171); osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); } @@ -1309,10 +1308,9 @@ void Interface_LoadItemIcon2(PlayState* play, u16 button) { InterfaceContext* interfaceCtx = &play->interfaceCtx; osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1); - DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_180, interfaceCtx->iconItemSegment + button * ICON_ITEM_TEX_SIZE, - (uintptr_t)_icon_item_staticSegmentRomStart + - (gSaveContext.equips.buttonItems[button] * ICON_ITEM_TEX_SIZE), - ICON_ITEM_TEX_SIZE, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1193); + DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_180, interfaceCtx->iconItemSegment + (button * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.equips.buttonItems[button]), ITEM_ICON_SIZE, 0, + &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1193); osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); } @@ -3375,8 +3373,8 @@ void Interface_Draw(PlayState* play) { gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[16], 4, 0); gDPLoadTextureBlock(OVERLAY_DISP++, gItemIcons[pauseCtx->equipTargetItem], G_IM_FMT_RGBA, G_IM_SIZ_32b, - 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); + ITEM_ICON_WIDTH, ITEM_ICON_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); } else { // Magic Arrow Equip Effect svar1 = pauseCtx->equipTargetItem - 0xBF; diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index a8a24c7d91..274164c669 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -1133,7 +1133,7 @@ s32 EnOssan_HasPlayerSelectedItem(PlayState* play, EnOssan* this, Input* input) case SI_MILK_BOTTLE: func_80078884(NA_SE_SY_DECIDE); this->drawCursor = 0; - this->stateFlag = OSSAN_STATE_SELECT_ITEM_MILK_BOTTLE; + this->stateFlag = OSSAN_STATE_SELECT_ITEM_BOTTLE_MILK_FULL; return true; case SI_WEIRD_EGG: func_80078884(NA_SE_SY_DECIDE); @@ -1840,7 +1840,8 @@ void EnOssan_UpdateItemSelectedProperty(EnOssan* this) { for (i = 0; i < 8; i++) { if (temp_a1[0] != NULL) { - if (this->stateFlag != OSSAN_STATE_SELECT_ITEM && this->stateFlag != OSSAN_STATE_SELECT_ITEM_MILK_BOTTLE && + if (this->stateFlag != OSSAN_STATE_SELECT_ITEM && + this->stateFlag != OSSAN_STATE_SELECT_ITEM_BOTTLE_MILK_FULL && this->stateFlag != OSSAN_STATE_SELECT_ITEM_WEIRD_EGG && this->stateFlag != OSSAN_STATE_SELECT_ITEM_UNIMPLEMENTED && this->stateFlag != OSSAN_STATE_SELECT_ITEM_BOMBS && this->stateFlag != OSSAN_STATE_SELECT_ITEM_MASK && diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h index f59a7943b0..03538fbb6e 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -108,7 +108,7 @@ typedef enum { /* 07 */ OSSAN_STATE_BROWSE_RIGHT_SHELF, /* 08 */ OSSAN_STATE_LOOK_SHOPKEEPER, // From looking at shelf /* 09 */ OSSAN_STATE_SELECT_ITEM, // Select most items - /* 10 */ OSSAN_STATE_SELECT_ITEM_MILK_BOTTLE, + /* 10 */ OSSAN_STATE_SELECT_ITEM_BOTTLE_MILK_FULL, /* 11 */ OSSAN_STATE_SELECT_ITEM_WEIRD_EGG, /* 12 */ OSSAN_STATE_SELECT_ITEM_UNIMPLEMENTED, // Handles two unfinished shop items /* 13 */ OSSAN_STATE_SELECT_ITEM_BOMBS, diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index c6cd56fbdc..bf16fe77af 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -30,7 +30,11 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; static void* D_8082A130[] = { - gOcarinaATex, gOcarinaCDownTex, gOcarinaCRightTex, gOcarinaCLeftTex, gOcarinaCUpTex, + gOcarinaBtnIconATex, // OCARINA_BTN_A + gOcarinaBtnIconCDownTex, // OCARINA_BTN_C_DOWN + gOcarinaBtnIconCRightTex, // OCARINA_BTN_C_RIGHT + gOcarinaBtnIconCLeftTex, // OCARINA_BTN_C_LEFT + gOcarinaBtnIconCUpTex, // OCARINA_BTN_C_UP }; static u16 D_8082A144[] = { 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, @@ -333,7 +337,8 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { gDPSetEnvColor(POLY_OPA_DISP++, D_8082A0D8[sp218], D_8082A0E4[sp218], D_8082A0F0[sp218], 0); gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0); - KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_MEDALLION_FOREST + sp218], 24, 24, 0); + KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_MEDALLION_FOREST + sp218], QUEST_ICON_WIDTH, + QUEST_ICON_HEIGHT, 0); } } @@ -381,7 +386,8 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { for (sp218 = 0; sp218 < 3; sp218++, sp21A += 4) { if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD + sp218)) { gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0); - KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_KOKIRI_EMERALD + sp218], 24, 24, 0); + KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_KOKIRI_EMERALD + sp218], QUEST_ICON_WIDTH, + QUEST_ICON_HEIGHT, 0); } } @@ -392,7 +398,8 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { if (CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY + sp218)) { gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); - KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_STONE_OF_AGONY + sp218], 24, 24, 0); + KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_STONE_OF_AGONY + sp218], QUEST_ICON_WIDTH, + QUEST_ICON_HEIGHT, 0); } } @@ -449,7 +456,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { POLY_OPA_DISP = KaleidoScope_QuadTextureIA8( POLY_OPA_DISP, - gItemIcons[0x79 + + gItemIcons[ITEM_HEART_PIECE_2 - 1 + (((gSaveContext.inventory.questItems & 0xF0000000) & 0xF0000000) >> QUEST_HEART_PIECE_COUNT)], 48, 48, 0); } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 0228106022..d700d25a24 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -555,29 +555,32 @@ void KaleidoScope_DrawEquipment(PlayState* play) { if (1) {} if ((point != 0) && (CUR_UPG_VALUE(sChildUpgrades[i]) != 0)) { KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, - gItemIcons[sChildUpgradeItemBases[i] + point - 1], 32, 32, 0); + gItemIcons[sChildUpgradeItemBases[i] + point - 1], ITEM_ICON_WIDTH, + ITEM_ICON_HEIGHT, 0); } } else { if ((i == 0) && (CUR_UPG_VALUE(sAdultUpgrades[i]) == 0)) { KaleidoScope_DrawQuadTextureRGBA32( play->state.gfxCtx, gItemIcons[sChildUpgradeItemBases[i] + CUR_UPG_VALUE(sChildUpgrades[i]) - 1], - 32, 32, 0); + ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 0); } else if (CUR_UPG_VALUE(sAdultUpgrades[i]) != 0) { KaleidoScope_DrawQuadTextureRGBA32( play->state.gfxCtx, gItemIcons[sAdultUpgradeItemBases[i] + CUR_UPG_VALUE(sAdultUpgrades[i]) - 1], - 32, 32, 0); + ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 0); } } for (k = 0, bit = rowStart, point = 4; k < 3; k++, point += 4, temp++, bit++) { if (((u32)i == 0) && (k == 2) && (gSaveContext.bgsFlag != 0)) { - KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gBiggoronSwordIconTex, 32, 32, point); + KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIconSwordBiggoronTex, ITEM_ICON_WIDTH, + ITEM_ICON_HEIGHT, point); } else if ((i == 0) && (k == 2) && (gBitFlags[bit + 1] & gSaveContext.inventory.equipment)) { - KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gBrokenGiantsKnifeIconTex, 32, 32, point); + KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIconBrokenGiantsKnifeTex, ITEM_ICON_WIDTH, + ITEM_ICON_HEIGHT, point); } else if (gBitFlags[bit] & gSaveContext.inventory.equipment) { - KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIcons[ITEM_SWORD_KOKIRI + temp], 32, 32, - point); + KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIcons[ITEM_SWORD_KOKIRI + temp], + ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, point); } } } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 652073218c..5f2c0dcd38 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -467,8 +467,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { } gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[j + 0], 4, 0); - KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIcons[gSaveContext.inventory.items[i]], 32, 32, - 0); + KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIcons[gSaveContext.inventory.items[i]], + ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 0); } } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c index 29d029c921..f32663ba02 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c @@ -9,9 +9,9 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { static void* dungeonItemTexs[] = { - gBossKeyIconTex, - gCompassIconTex, - gDungeonMapIconTex, + gQuestIconDungeonBossKeyTex, + gQuestIconDungeonCompassTex, + gQuestIconDungeonMapTex, }; static void* dungeonTitleTexs[] = { gPauseDekuTitleENGTex, gPauseDodongoTitleENGTex, gPauseJabuTitleENGTex, gPauseForestTitleENGTex, @@ -302,7 +302,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); if (GET_GS_FLAGS(gSaveContext.mapIndex) == gAreaGsFlags[gSaveContext.mapIndex]) { - KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gGoldSkulltulaIconTex, 24, 24, 8); + KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gQuestIconGoldSkulltulaTex, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 8); } if ((play->sceneId >= SCENE_DEKU_TREE) && (play->sceneId <= SCENE_TREASURE_BOX_SHOP)) { diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index fe59d0a494..3d10978b18 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -1184,7 +1184,8 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); - KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gGoldSkulltulaIconTex, 24, 24, 0); + KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gQuestIconGoldSkulltulaTex, QUEST_ICON_WIDTH, + QUEST_ICON_HEIGHT, 0); } } } else if ((pauseCtx->unk_1E4 < 3) || (pauseCtx->unk_1E4 == 7) || (pauseCtx->unk_1E4 == 8)) { @@ -2550,7 +2551,8 @@ void KaleidoScope_Update(PlayState* play) { for (i = 0; i < ARRAY_COUNTU(gItemAgeReqs); i++) { if ((gItemAgeReqs[i] != 9) && (gItemAgeReqs[i] != ((void)0, gSaveContext.linkAge))) { - KaleidoScope_GrayOutTextureRGBA32(SEGMENTED_TO_VIRTUAL(gItemIcons[i]), 0x400); + KaleidoScope_GrayOutTextureRGBA32(SEGMENTED_TO_VIRTUAL(gItemIcons[i]), + ITEM_ICON_WIDTH * ITEM_ICON_HEIGHT); } }