diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/00_Core/Actor/Actor.cpp | 25 | ||||
| -rw-r--r-- | src/00_Core/Actor/Navi/ActorForceNavi.cpp | 2 | ||||
| -rw-r--r-- | src/08_GameStart/GameStart.cpp | 5 | ||||
| -rw-r--r-- | src/14_Land/Actor/ActorRupee.cpp | 30 | ||||
| -rw-r--r-- | src/14_Land/Actor/Character/ActorCharacterBase.cpp | 2 | ||||
| -rw-r--r-- | src/31_Shop/Actor/ActorBeedle.cpp | 10 | ||||
| -rw-r--r-- | src/31_Shop/Actor/ActorItemSeller.cpp | 2 | ||||
| -rw-r--r-- | src/31_Shop/Actor/ActorItemSellerBase.cpp | 471 | ||||
| -rw-r--r-- | src/31_Shop/Actor/ActorShopItem.cpp | 67 | ||||
| -rw-r--r-- | src/Main/Game/Game.cpp | 2 | ||||
| -rw-r--r-- | src/Main/Message/MessageManager.cpp | 19 | ||||
| -rw-r--r-- | src/Main/Unknown/UnkStruct_020397f8.cpp | 12 |
12 files changed, 508 insertions, 139 deletions
diff --git a/src/00_Core/Actor/Actor.cpp b/src/00_Core/Actor/Actor.cpp index 9e5b4202..342029c3 100644 --- a/src/00_Core/Actor/Actor.cpp +++ b/src/00_Core/Actor/Actor.cpp @@ -30,7 +30,7 @@ const UnkStruct3 sUnkTable[] = { {4, 2}, {4, 2}, {4, 2}, {8, 2}, {4, 2}, {0xff, 2}, {20, 2}, {6, 2}, {6, 2}, {2, 2}, }; -Actor_UnkStruct_020::Actor_UnkStruct_020() : +ARM Actor_UnkStruct_020::Actor_UnkStruct_020() : mUnk_0c(-1), mUnk_0d(0), mUnk_0e(1), @@ -152,28 +152,11 @@ ARM void Actor::vfunc_18(u32 param1) { func_ov00_0207a1c8(&mUnk_0a4, param1, &mPos); } -struct UnkStruct1 { - /* 00 */ unk32 mUnk_00; - /* 04 */ unk32 mUnk_04; - /* 08 */ unk8 mUnk_08; - /* 09 */ unk8 mUnk_09; - /* 0a */ unk8 mUnk_0a; - /* 0b */ unk8 mUnk_0b; - /* 0c */ unk32 mUnk_0c; - /* 10 */ unk32 mUnk_10; - /* 14 */ unk8 mUnk_14; - /* 15 */ unk8 mUnk_15; - /* 16 */ unk16 mUnk_16; - /* 18 */ unk32 mUnk_18; - /* 1c */ unk32 mUnk_1c; - /* 20 */ -}; extern void *data_027e0d3c; extern unk32 data_02063e4c; extern "C" bool func_ov00_02079470(void *param1, Vec3p *param2, unk32 param3, unk32 param4, unk32 *param5, unk32 *param6, unk32 param7, unk32 param8); -extern "C" void func_01ffbe34(UnkStruct1 *param1); -extern "C" void func_020313c8(unk32 *param1, unk32 param2, unk32 param3, u32 param4, UnkStruct1 *param5); +extern "C" void func_020313c8(unk32 *param1, unk32 param2, unk32 param3, u32 param4, UnkStruct_01ffbe34 *param5); ARM void Actor::vfunc_1c(u16 *param1) { u16 unk1 = mUnk_07a; if (mUnk_129) { @@ -186,7 +169,7 @@ ARM void Actor::vfunc_1c(u16 *param1) { unk32 unk2; unk32 unk3; if (func_ov00_02079470(data_027e0d3c, &mPos, 0, 0, &unk2, &unk3, 0, 0)) { - UnkStruct1 unk4; + UnkStruct_01ffbe34 unk4; func_01ffbe34(&unk4); unk4.mUnk_04 = 1; func_020313c8(&data_02063e4c, unk2, unk3, unk1, &unk4); @@ -229,7 +212,7 @@ ARM void Actor::SetUnk_11c(bool value) { mUnk_11c = value; } -ARM void Actor::vfunc_68() {} +ARM void Actor::vfunc_68(unk32 param1, UnkStruct_020397f8 *param2) {} ARM bool Actor::vfunc_6c() { return true; diff --git a/src/00_Core/Actor/Navi/ActorForceNavi.cpp b/src/00_Core/Actor/Navi/ActorForceNavi.cpp index 04b83c13..91210a72 100644 --- a/src/00_Core/Actor/Navi/ActorForceNavi.cpp +++ b/src/00_Core/Actor/Navi/ActorForceNavi.cpp @@ -5,7 +5,7 @@ ActorType ActorForceNavi::gType = ActorType(ActorTypeId_ForceNavi, (ActorCreateF #pragma section sbss end extern u32 **data_027e0fe0[]; -ActorForceNavi *ActorForceNavi::Create() { +ARM ActorForceNavi *ActorForceNavi::Create() { return new(*data_027e0fe0[0], 4) ActorForceNavi(); } diff --git a/src/08_GameStart/GameStart.cpp b/src/08_GameStart/GameStart.cpp index 98f63118..cf9e79a7 100644 --- a/src/08_GameStart/GameStart.cpp +++ b/src/08_GameStart/GameStart.cpp @@ -31,7 +31,7 @@ void func_02004730(unk32); unk32 *MountCompressedNarc(char *, char *, unk8 *, unk32, unk32); void func_02031e1c(u32 *, const char *); void func_02027ab4(unk32, u32 *, UNK_PTR, UNK_PTR, unk32, unk32, unk32, unk32); -void func_02016fcc(unk32 *); +unk32 func_02016fcc(unk32 *); void func_02004ba8(); void func_02004b94(); void func_02004c68(); @@ -39,7 +39,6 @@ void func_020425e0(); void func_ov000_0207a654(unk32 *); } -extern unk8 data_020691a0; extern unk32 data_ov000_020ec754; extern unk32 data_ov000_020d8795; extern u8 data_ov000_020d88b4[24]; @@ -75,7 +74,7 @@ ARM GameStart::GameStart(GameModeId modeId) : REG_DISPCNT_SUB &= ~0x1F00; REG_DISPCNT_SUB |= 0x0100; - uVar1 = MountCompressedNarc("NLG", "Menu/Bg/NintendoLogo.bin", &data_020691a0, 0xCC00, 1); + uVar1 = MountCompressedNarc("NLG", "Menu/Bg/NintendoLogo.bin", data_020691a0, 0xCC00, 1); func_02031e1c(&local_28, "NLG:nLogo"); func_02031e1c(&local_1c, "NLG:rightTxt"); func_02027ab4(0, &local_28, &local_24, &local_20, 0, 0, 0, 2); diff --git a/src/14_Land/Actor/ActorRupee.cpp b/src/14_Land/Actor/ActorRupee.cpp index 510261ba..e6240251 100644 --- a/src/14_Land/Actor/ActorRupee.cpp +++ b/src/14_Land/Actor/ActorRupee.cpp @@ -20,19 +20,19 @@ extern u32 **data_027e0fe0[]; ActorType ActorRupee::gType = ActorType(ActorTypeId_Rupee, (ActorCreateFunc) ActorRupee::Create, NULL); -ActorRupee *ActorRupee::Create() { +ARM ActorRupee *ActorRupee::Create() { ActorRupee *newRupee = new(*data_027e0fe0[0], 4) ActorRupee(); return newRupee; } static const ActorType_UnkClass data_ov014_021589f4 = ActorType_UnkClass(FLOAT_TO_Q21(0.4662), FLOAT_TO_Q19(0.4661)); -ActorRupee::ActorRupee() { +ARM ActorRupee::ActorRupee() { mRupeeId = 8; mUnk_15c = 0; } -bool ActorRupee::Init() { +ARM bool ActorRupee::Init() { RupeeId rupeeId = (RupeeId) mUnk_020.mUnk_00[0]; mRupeeId = rupeeId; s32 iVar1 = (func_ov14_0213b70c(rupeeId) ? data_ov014_021589f4.mUnk_4 : 0xaa8) >> 1; @@ -80,13 +80,13 @@ bool ActorRupee::Init() { return true; } -bool ActorRupee::vfunc_60() { +ARM bool ActorRupee::vfunc_60() { return func_ov14_0213b70c(mRupeeId); } -void ActorRupee::vfunc_64() {} +ARM void ActorRupee::vfunc_64() {} -void ActorRupee::Move() { +ARM void ActorRupee::Move() { s32 size; ApplyGravity(); @@ -107,7 +107,7 @@ void ActorRupee::Move() { } } -ItemId ActorRupee::GetRupeeCutsceneItemId() { +ARM ItemId ActorRupee::GetRupeeCutsceneItemId() { switch (mRupeeId) { case RupeeId_Green: return ItemId_None; @@ -140,7 +140,7 @@ ItemId ActorRupee::GetRupeeCutsceneItemId() { return ItemId_None; } -void ActorRupee::func_ov14_0213b204(unk32 param1) { +ARM void ActorRupee::func_ov14_0213b204(unk32 param1) { switch (param1) { case 0: mVisible = true; @@ -160,7 +160,7 @@ void ActorRupee::func_ov14_0213b204(unk32 param1) { mUnk_130 = param1; } -void ActorRupee::Update(bool param1) { +ARM void ActorRupee::Update(bool param1) { ItemId cutsceneItemId; s32 uVar3; Vec3p local_1c; @@ -264,14 +264,14 @@ void ActorRupee::Update(bool param1) { KillInBounds(); } -void ActorRupee::vfunc_14(u32 param1) { +ARM void ActorRupee::vfunc_14(u32 param1) { if (func_ov00_020c313c(param1)) { Update(false); } mUnk_0a4.func_ov000_0207a1c8(param1, &mPos); } -void ActorRupee::vfunc_18(u32 param1) { +ARM void ActorRupee::vfunc_18(u32 param1) { if (func_ov00_020c313c(param1)) { Update(true); } @@ -279,13 +279,13 @@ void ActorRupee::vfunc_18(u32 param1) { } #define VFUNC20_COND (param1 ? mUnk_0a4.mUnk_01 : mUnk_0a4.mUnk_00) -void ActorRupee::vfunc_20(bool param1) { +ARM void ActorRupee::vfunc_20(bool param1) { if (VFUNC20_COND && !(mUnk_130 == 2 && mActiveFrames % 8 < 4) && VFUNC20_COND) { func_ov14_0213b5f4(mRupeeId, param1, &mPos, true); } } -void ActorRupee::func_ov14_0213b5f4(RupeeId id, unk32 param2, Vec3p *param3, bool param4) { +ARM void ActorRupee::func_ov14_0213b5f4(RupeeId id, unk32 param2, Vec3p *param3, bool param4) { Actor_UnkStruct_012 unk_class; static const u32 data_ov014_02153e28[] = { // sRupeePalettes @@ -308,7 +308,7 @@ void ActorRupee::func_ov14_0213b5f4(RupeeId id, unk32 param2, Vec3p *param3, boo } } -void ActorRupee::func_ov14_0213b6a4(RupeeId id, Actor_UnkStruct_012 *param2) { +ARM void ActorRupee::func_ov14_0213b6a4(RupeeId id, Actor_UnkStruct_012 *param2) { param2->mUnk_04 = 3; if (func_ov14_0213b70c(id)) { @@ -324,7 +324,7 @@ void ActorRupee::func_ov14_0213b6a4(RupeeId id, Actor_UnkStruct_012 *param2) { } } -bool ActorRupee::func_ov14_0213b70c(RupeeId id) { +ARM bool ActorRupee::func_ov14_0213b70c(RupeeId id) { switch (id) { case RupeeId_BigGreen: case RupeeId_BigRed: diff --git a/src/14_Land/Actor/Character/ActorCharacterBase.cpp b/src/14_Land/Actor/Character/ActorCharacterBase.cpp index 58bbf299..7759ad62 100644 --- a/src/14_Land/Actor/Character/ActorCharacterBase.cpp +++ b/src/14_Land/Actor/Character/ActorCharacterBase.cpp @@ -191,7 +191,7 @@ ARM void ActorCharacterBase::vfunc_84() { ARM void ActorCharacterBase::vfunc_cc() {} ARM void ActorCharacterBase::vfunc_c8() {} ARM void ActorCharacterBase::vfunc_d0() {} -ARM void ActorCharacterBase::vfunc_68() {} +ARM void ActorCharacterBase::vfunc_68(unk32 param1, UnkStruct_020397f8 *param2) {} bool ActorCharacterBase::vfunc_bc() { return (mUnk_158.mUnk_18 & 0xffff0000) == 0x1000000; diff --git a/src/31_Shop/Actor/ActorBeedle.cpp b/src/31_Shop/Actor/ActorBeedle.cpp index 0daf9d03..9a31a491 100644 --- a/src/31_Shop/Actor/ActorBeedle.cpp +++ b/src/31_Shop/Actor/ActorBeedle.cpp @@ -4,7 +4,7 @@ ActorBeedle *ActorBeedle::Create() {} bool ActorBeedle::Init() {} void ActorBeedle::vfunc_c4() {} -void ActorBeedle::vfunc_114() {} +unk32 ActorBeedle::vfunc_114(unk32 param1) {} unk32 ActorBeedle::vfunc_d4() {} static unk32 func_ov031_02180e44(unk32 param1, unk32 param2) {} @@ -14,9 +14,9 @@ void ActorBeedle::vfunc_f8() {} void ActorBeedle::vfunc_fc() {} void ActorBeedle::vfunc_100() {} void ActorBeedle::vfunc_104() {} -unk32 ActorBeedle::vfunc_d8() {} -unk32 ActorBeedle::vfunc_dc() {} -unk32 ActorBeedle::vfunc_e0() {} +unk32 ActorBeedle::vfunc_d8(unk32 param1) {} +unk32 ActorBeedle::vfunc_dc(unk32 param1) {} +unk32 ActorBeedle::vfunc_e0(unk32 param1) {} bool ActorBeedle::vfunc_70() {} bool ActorBeedle::vfunc_6c() {} void ActorBeedle::vfunc_108() {} @@ -26,6 +26,6 @@ void ActorBeedle::vfunc_110() {} unk32 ActorBeedle::func_ov031_021812e4(unk32 param1) {} void ActorBeedle::func_ov031_0218132c(unk32 param1) {} -void ActorBeedle::vfunc_11c() {} +bool ActorBeedle::vfunc_11c() {} void ActorBeedle::vfunc_118() {} ActorBeedle::~ActorBeedle() {} diff --git a/src/31_Shop/Actor/ActorItemSeller.cpp b/src/31_Shop/Actor/ActorItemSeller.cpp index c6d746af..fd1f9a4d 100644 --- a/src/31_Shop/Actor/ActorItemSeller.cpp +++ b/src/31_Shop/Actor/ActorItemSeller.cpp @@ -5,7 +5,7 @@ ActorItemSeller *ActorItemSeller2::Create() {} ActorItemSeller *ActorItemSeller3::Create() {} bool ActorItemSeller::Init() {} -void ActorItemSeller::vfunc_114() {} +unk32 ActorItemSeller::vfunc_114(unk32 param1) {} void ActorItemSeller::vfunc_f4() {} void ActorItemSeller::vfunc_f8() {} void ActorItemSeller::vfunc_fc() {} diff --git a/src/31_Shop/Actor/ActorItemSellerBase.cpp b/src/31_Shop/Actor/ActorItemSellerBase.cpp index d051a075..9309f0d7 100644 --- a/src/31_Shop/Actor/ActorItemSellerBase.cpp +++ b/src/31_Shop/Actor/ActorItemSellerBase.cpp @@ -1,39 +1,436 @@ +#include "Actor/ActorShopItem.hpp" +#include "Actor/ActorSpawner.hpp" +#include "Actor/ActorTypeId.hpp" #include "Actor/Character/ActorItemSeller.hpp" +#include "DTCM/UnkStruct_027e0c54.hpp" +#include "DTCM/UnkStruct_027e0f64.hpp" +#include "Item/Item.hpp" +#include "Item/ItemManager.hpp" +#include "Message/MessageManager.hpp" +#include "Message/MsgProc.hpp" +#include "Player/PlayerLinkBase.hpp" +#include "Player/TouchControl.hpp" +#include "Unknown/UnkStruct_02037628.hpp" +#include "Unknown/UnkStruct_027e0dbc.hpp" +#include "nds/math.h" -ActorItemSellerBase::ActorItemSellerBase() {} -ActorItemSellerBase::~ActorItemSellerBase() {} - -bool ActorItemSellerBase::Init() {} -void ActorItemSellerBase::vfunc_20(bool param1) {} -bool ActorItemSellerBase::vfunc_c0() {} -void ActorItemSellerBase::vfunc_c4() {} - -void ActorItemSellerBase::func_ov031_0217d588() {} -void ActorItemSellerBase::func_ov031_0217d5c0() {} -void ActorItemSellerBase::func_ov031_0217d5c4() {} -void ActorItemSellerBase::func_ov031_0217d5e8() {} -void ActorItemSellerBase::func_ov031_0217d610() {} -void ActorItemSellerBase::func_ov031_0217d62c() {} -void ActorItemSellerBase::func_ov031_0217d638() {} -void ActorItemSellerBase::func_ov031_0217d6ac() {} -void ActorItemSellerBase::func_ov031_0217d6d0() {} -void ActorItemSellerBase::func_ov031_0217d760() {} -void ActorItemSellerBase::func_ov031_0217d784() {} -void ActorItemSellerBase::func_ov031_0217d7ac() {} -void ActorItemSellerBase::func_ov031_0217d830() {} -void ActorItemSellerBase::func_ov031_0217d858() {} -void ActorItemSellerBase::func_ov031_0217d890() {} -void ActorItemSellerBase::func_ov031_0217d8d0() {} -void ActorItemSellerBase::func_ov031_0217d8dc() {} -void ActorItemSellerBase::func_ov031_0217d93c() {} -void ActorItemSellerBase::func_ov031_0217d974() {} - -unk32 ActorItemSellerBase::vfunc_d4() {} -bool ActorItemSellerBase::vfunc_8c() {} - -void ActorItemSellerBase::func_ov031_0217da20(unk32 param1) {} - -void ActorItemSellerBase::vfunc_68() {} -bool ActorItemSellerBase::CollidesWithLink() {} -void ActorItemSellerBase::vfunc_11c() {} -bool ActorItemSellerBase::IsHitboxTouched(bool param1) {} +static ActorItemSellerBase *sCurrentSeller; + +ARM ActorItemSellerBase *ActorItemSellerBase::GetCurrentSeller() { + return sCurrentSeller; +} + +ARM ActorItemSellerBase::ActorItemSellerBase() { + mUnk_470 = 3; + sCurrentSeller = this; +} + +ARM ActorItemSellerBase::~ActorItemSellerBase() { + sCurrentSeller = NULL; +} + +static const ActorTypeId sShopItemActorTypes[ShopItem_BASE_COUNT] = { + [ShopItem_Test] = ActorTypeId_ShopItemDM, + [ShopItem_SoldOut] = ActorTypeId_ShopItemSoldOut, + [ShopItem_Bombs] = ActorTypeId_ShopItemBombs, + [ShopItem_Arrows] = ActorTypeId_ShopItemArrows, + [ShopItem_Bombchus] = ActorTypeId_ShopItemBombchus, + [ShopItem_HeartContainer] = ActorTypeId_ShopItemHeartContainer, + [ShopItem_BombBag] = ActorTypeId_ShopItemBombBag, + [ShopItem_Quiver] = ActorTypeId_ShopItemQuiver, + [ShopItem_BombchuBag] = ActorTypeId_ShopItemBombchuBag, + [ShopItem_ShipPart] = ActorTypeId_ShopItemShipPart, + [ShopItem_Treasure] = ActorTypeId_ShopItemTreasure, + [ShopItem_CourageGem] = ActorTypeId_ShopItemGem, + [ShopItem_PowerGem] = ActorTypeId_ShopItemGem, + [ShopItem_WisdomGem] = ActorTypeId_ShopItemGem, + [ShopItem_Shield] = ActorTypeId_ShopItemShield, + [ShopItem_RedPotion] = ActorTypeId_ShopItemPotion, + [ShopItem_PurplePotion] = ActorTypeId_ShopItemPotion, + [ShopItem_YellowPotion] = ActorTypeId_ShopItemPotion, +}; + +ARM bool ActorItemSellerBase::Init() { + UnkStruct_ov031_02183e80 *pUVar2; + unk32 numShipParts; + s32 numTreasure; + + ActorCharacter_1d8 *pUnk_1d8 = &mUnk_1d8; + pUnk_1d8->mUnk_020.mUnk_5c = 0x3800; + pUnk_1d8->mUnk_020.mUnk_64 = 0x4000; + pUnk_1d8->mUnk_020.mUnk_60 = 0x5000; + pUnk_1d8->mUnk_020.mUnk_66 = 0x5555; + mUnk_1d8.mUnk_020.mUnk_8d = 0; + mUnk_1d8.func_ov014_02145e48(0); + mUnk_1d8.mUnk_10->mUnk_0c.mUnk_04 = 0x1000; + this->func_ov031_0217d588(); + + ActorSpawnOptions options; + Vec3p pos = mPos; + pos.x -= FLOAT_TO_Q20(0.8); + pos.y += FLOAT_TO_Q20(0.65); + pos.z += FLOAT_TO_Q20(1.2); + numShipParts = 0; + numTreasure = 0; + for (s32 i = 0; i < 5; ++i) { + ShopItem shopItem = this->vfunc_114(i); + options.mUnk_24 = 0; + ActorTypeId actorType = sShopItemActorTypes[shopItem]; + switch (actorType) { + case ActorTypeId_ShopItemBombBag: + if (!gItemManager->HasItem(ItemFlag_BombBag)) { + actorType = ActorTypeId_ShopItemSoldOut; + } + break; + case ActorTypeId_ShopItemQuiver: + if (!gItemManager->HasItem(ItemFlag_Bow)) { + actorType = ActorTypeId_ShopItemSoldOut; + } + break; + case ActorTypeId_ShopItemBombchuBag: + if (!gItemManager->HasItem(ItemFlag_BombchuBag)) { + actorType = ActorTypeId_ShopItemSoldOut; + } + break; + case ActorTypeId_ShopItemShipPart: + options.mUnk_24 = numShipParts; + if (data_027e0dbc.func_ov003_020f3d5c(numShipParts + 8)) { + actorType = ActorTypeId_ShopItemSoldOut; + } + numShipParts++; + break; + case ActorTypeId_ShopItemTreasure: { + bool unk; + if (mUnk_470 == 2) { + options.mUnk_24 = numTreasure + 2; + unk = data_027e0dbc.func_ov003_020f3d5c(numTreasure + 7); + } else { + options.mUnk_24 = numTreasure; + unk = data_027e0dbc.func_ov003_020f3d5c(numTreasure + 5); + } + if (unk) { + actorType = ActorTypeId_ShopItemSoldOut; + } + numTreasure++; + break; + } + case ActorTypeId_ShopItemGem: + options.mUnk_24 = shopItem - ShopItem_CourageGem; + break; + case ActorTypeId_ShopItemPotion: + options.mUnk_24 = shopItem - ShopItem_RedPotion; + break; + } + gActorSpawner->Spawn(actorType, &pos, &options, &UnkStruct_ov031_02183e80::GetInstance()->mShopItemRefs[i]); + pos.x += FLOAT_TO_Q20(0.4); + if (i % 2 == 0) { + pos.z += FLOAT_TO_Q20(0.8); + } else { + pos.z -= FLOAT_TO_Q20(0.8); + } + } + options.mUnk_24 = 0; + pos.x = mPos.x - FLOAT_TO_Q20(1.0); + pos.y = mPos.y + FLOAT_TO_Q20(0.5); + pos.z = mPos.z + FLOAT_TO_Q20(2.5); + gActorSpawner->Spawn(ActorTypeId_ShopItemBK, &pos, &options, &UnkStruct_ov031_02183e80::GetInstance()->mShopItemRefBK); + pos.x = mPos.x + FLOAT_TO_Q20(1.0); + pos.y = mPos.y + FLOAT_TO_Q20(0.5); + pos.z = mPos.z + FLOAT_TO_Q20(2.5); + gActorSpawner->Spawn(ActorTypeId_ShopItemCC, &pos, &options, &UnkStruct_ov031_02183e80::GetInstance()->mShopItemRefCC); + pos.x = mPos.x + FLOAT_TO_Q20(1.0); + pos.y = mPos.y + FLOAT_TO_Q20(0.5); + pos.z = mPos.z + FLOAT_TO_Q20(2.5); + gActorSpawner->Spawn(ActorTypeId_ShopItemBY, &pos, &options, &UnkStruct_ov031_02183e80::GetInstance()->mShopItemRefBY); + mUnk_478 = 0; + mUnk_47c = data_027e0dbc.GetUnk_24()->mUnk_0b; + mUnk_480 = 0; + return ActorCharacter::Init(); +} + +ARM void ActorItemSellerBase::vfunc_20(bool param1) { + if (!data_027e0c54.func_020361d0()) { + ActorCharacter::vfunc_20(param1); + } +} + +ARM bool ActorItemSellerBase::vfunc_c0() { + if (ActorCharacterBase::vfunc_c0()) { + return true; + } + return mUnk_474 != 0; +} + +ARM void ActorItemSellerBase::vfunc_c4() { + Vec3p offsetPos; + if (mInactive) { + mAngle = mUnk_012; + mUnk_1d8.mUnk_020.mUnk_8d = 0; + return; + } + mPrevPos.x = mPos.x; + mPrevPos.y = mPos.y; + mPrevPos.z = mPos.z; + mUnk_1d8.mActor->GetOffsetPos(&offsetPos); + mUnk_1d8.mUnk_020.func_ov014_0214aa0c(&offsetPos, mUnk_1d8.mActor->mAngle); + switch (mUnk_474) { + case 0: + this->func_ov031_0217d5c0(); + break; + case 1: + this->func_ov031_0217d5e8(); + break; + case 2: + this->func_ov031_0217d638(); + break; + case 3: + case 4: + this->func_ov031_0217d6d0(); + break; + case 5: + this->func_ov031_0217d784(); + break; + case 6: + this->func_ov031_0217d830(); + break; + case 7: + this->func_ov031_0217d890(); + break; + case 8: + this->func_ov031_0217d8dc(); + break; + } + mUnk_1d8.func_ov014_02145cac(); + this->func_ov014_02145178(); +} + +ARM void ActorItemSellerBase::func_ov031_0217d588() { + mUnk_474 = 0; + mUnk_1d8.func_ov014_02145f0c(0); + mUnk_1d8.mUnk_10->mUnk_0c.mUnk_04 = 0x1000; + this->vfunc_b4(); +} + +ARM void ActorItemSellerBase::func_ov031_0217d5c0() {} + +ARM void ActorItemSellerBase::func_ov031_0217d5c4() { + mUnk_474 = 1; + this->func_ov014_0214591c(); + mUnk_1d8.mUnk_10->mUnk_0c.mUnk_04 = 0x1000; +} + +ARM void ActorItemSellerBase::func_ov031_0217d5e8() { + if (this->vfunc_bc()) { + this->func_ov031_0217d588(); + } +} + +ARM void ActorItemSellerBase::func_ov031_0217d610() { + mUnk_474 = 2; + this->vfunc_118(); +} + +ARM void ActorItemSellerBase::func_ov031_0217d62c() { + mUnk_474 = 2; +} + +ARM void ActorItemSellerBase::func_ov031_0217d638() { + if (UnkStruct_ov031_02183e80::GetInstance()->mUnk_000 != 5) { + return; + } + if (UnkStruct_ov031_02183e80::GetInstance()->mUnk_194 != -1) { + this->func_ov031_0217d858(); + return; + } + if (mUnk_470 == 0 && this->vfunc_11c()) { + this->func_ov031_0217d6ac(); + return; + } + this->func_ov031_0217d760(); +} + +ARM bool ActorItemSellerBase::func_ov031_0217d6ac() { + mUnk_474 = 3; + return data_027e0e28.func_ov018_02160a64(-1, 1); +} + +ARM void ActorItemSellerBase::func_ov031_0217d6d0() { + UnkStruct_02037628 auStack_20; + + switch (mUnk_474) { + case 3: + auStack_20.func_02037628(); + if (auStack_20.mUnk_15 == 0) { + mUnk_474 = 4; + this->vfunc_b4(); + this->SetUnk_11c(1); + } + break; + case 4: + default: + if (this->vfunc_bc()) { + this->func_ov031_0217d588(); + } + } +} + +ARM void ActorItemSellerBase::func_ov031_0217d760() { + mUnk_474 = 5; + data_027e0e28.func_ov018_02160a64(-1, 1); +} + +ARM void ActorItemSellerBase::func_ov031_0217d784() { + if (this->vfunc_bc()) { + this->func_ov031_0217d588(); + } +} + +ARM void ActorItemSellerBase::func_ov031_0217d7ac() { + mUnk_474 = 6; + data_027e0f64->mUnk_4->func_ov000_0208726c(0); + data_027e0f64->mUnk_8->func_ov000_0208726c(0); + this->vfunc_b4(); + this->SetUnk_11c(1); + for (s32 i = 0; i < 5; ++i) { + ActorShopItem *shopItem = UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217cdd8(i); + if (shopItem != NULL) { + shopItem->func_ov031_0217f0b4(); + } + } +} + +ARM void ActorItemSellerBase::func_ov031_0217d830() { + if (this->vfunc_bc()) { + this->func_ov031_0217d588(); + } +} + +extern "C" bool HasFreebieCard(); +ARM void ActorItemSellerBase::func_ov031_0217d858() { + + mUnk_474 = 7; + unk32 unk = UnkStruct_ov031_02183e80::GetInstance()->mUnk_194; + data_027e0e28.func_ov018_02160a64(unk, !HasFreebieCard()); +} + +ARM void ActorItemSellerBase::func_ov031_0217d890() { + PlayerLinkBase *pPlayerLink = gPlayerLink; + if (UnkStruct_ov031_02183e80::GetInstance()->mUnk_198 || pPlayerLink->GetStateId() == 6) { + this->func_ov031_0217d8d0(); + } +} + +ARM void ActorItemSellerBase::func_ov031_0217d8d0() { + mUnk_474 = 8; +} + +ARM void ActorItemSellerBase::func_ov031_0217d8dc() { + PlayerLinkBase *pPlayerLink = gPlayerLink; + if (UnkStruct_ov031_02183e80::GetInstance()->mUnk_198 || pPlayerLink->GetStateId() != 6) { + UnkStruct_ov031_02183e80::GetInstance()->mUnk_198 = false; + if (HasFreebieCard()) { + this->func_ov031_0217d7ac(); + } else { + this->func_ov031_0217d62c(); + } + } +} + +ARM void ActorItemSellerBase::func_ov031_0217d93c() { + UnkStruct_027e0f64_04 *unk = data_027e0f64->mUnk_4; + mUnk_1d8.mUnk_020.mUnk_78.x = unk->mUnk_260.x; + mUnk_1d8.mUnk_020.mUnk_78.y = unk->mUnk_260.y; + mUnk_1d8.mUnk_020.mUnk_78.z = unk->mUnk_260.z; + mUnk_1d8.mUnk_020.mUnk_8c = true; + mUnk_1d8.mUnk_020.mUnk_8f = true; +} + +ARM void ActorItemSellerBase::func_ov031_0217d974() { + mUnk_1d8.mUnk_020.mUnk_8c = false; + mUnk_1d8.mUnk_020.mUnk_8f = true; +} + +ARM unk32 ActorItemSellerBase::vfunc_d4() { + return ActorCharacterBase::vfunc_d4(); +} + +ARM bool ActorItemSellerBase::vfunc_8c() { + switch (mUnk_474) { + case 1: + if (UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217ce18()) { + return true; + } + if (mUnk_480) { + mUnk_480 = false; + return true; + } + this->func_ov031_0217d610(); + return false; + case 2: + case 7: + case 8: + return false; + } + return true; +} + +ARM void ActorItemSellerBase::func_ov031_0217da20(unk32 param1) { + UnkStruct_020397f8 *iVar1; + UnkStruct_02037628 auStack_28; + auStack_28.func_020376c0(&mPos); + auStack_28.mUnk_15 = 0; + auStack_28.mUnk_16 = 1; + iVar1 = gMessageManager.func_02036f68(param1, &auStack_28, &mUnk_158); + iVar1->mUnk_38 = &mUnk_478; + iVar1->mUnk_3c = 2; +} + +ARM void ActorItemSellerBase::vfunc_68(unk32 param1, UnkStruct_020397f8 *param2) { + param2->mUnk_38 = &mUnk_478; + param2->mUnk_3c = 2; + ActorCharacterBase::vfunc_68(param1, param2); + if (!mUnk_474) { + this->func_ov031_0217d5c4(); + } +} + +ARM bool ActorItemSellerBase::CollidesWithLink() { + Vec3p pos = mPos; + Vec3p playerPos = gPlayerPos; + if (playerPos.z < pos.z - FLOAT_TO_Q20(1.0)) { + return false; + } + if (playerPos.z > pos.z + FLOAT_TO_Q20(4.0)) { + return false; + } + if (playerPos.x < pos.x - FLOAT_TO_Q20(3.0)) { + return false; + } + if (playerPos.x > pos.x + FLOAT_TO_Q20(3.0)) { + return false; + } + return true; +} + +ARM bool ActorItemSellerBase::vfunc_11c() { + return false; +} + +ARM bool ActorItemSellerBase::IsHitboxTouched(bool param1) { + if (ActorCharacter::IsHitboxTouched(param1)) { + return true; + } + for (s32 i = 0; i < 5; ++i) { + ActorShopItem *shopItem = UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217cdd8(i); + if (param1) { + if (TouchControl::func_0202b864(&shopItem->mPos, 0x4cd, 8)) { + return true; + } + } else { + if (TouchControl::func_0202b894(&shopItem->mPos, 0x4cd, 8)) { + return true; + } + } + } + return false; +} diff --git a/src/31_Shop/Actor/ActorShopItem.cpp b/src/31_Shop/Actor/ActorShopItem.cpp index 9b10209b..903c9e8a 100644 --- a/src/31_Shop/Actor/ActorShopItem.cpp +++ b/src/31_Shop/Actor/ActorShopItem.cpp @@ -1,5 +1,6 @@ #include "Actor/ActorShopItem.hpp" #include "Actor/ActorTypeId.hpp" +#include "Actor/Character/ActorItemSeller.hpp" #include "DTCM/UnkStruct_027e0c54.hpp" #include "DTCM/UnkStruct_027e0f64.hpp" #include "Item/Item.hpp" @@ -566,8 +567,6 @@ ARM void ActorShopItemBase::vfunc_14(u32 param1) { mUnk_0a4.func_ov000_0207a1c8(param1, &mPos); } -extern "C" UnkStruct_ov031_02183e80 *func_ov031_0217bdb8(); - ARM void ActorShopItem::vfunc_14(u32 param1) { Vec3p subroutine_arg0; Vec3p sp24; @@ -575,7 +574,7 @@ ARM void ActorShopItem::vfunc_14(u32 param1) { Vec3p *temp_r0_2; UnkStruct_027e0f64_04 *temp_r3; - if ((this->func_ov00_020c313c(param1) != 0) && (func_ov031_0217bdb8()->mUnk_19a == 0)) { + if ((this->func_ov00_020c313c(param1) != 0) && (UnkStruct_ov031_02183e80::GetInstance()->mUnk_19a == 0)) { temp_r3 = data_027e0f64->mUnk_8; sp24 = temp_r3->mUnk_260; sp24.y = FLOAT_TO_Q20(2.3); @@ -603,7 +602,7 @@ ARM void ActorShopItem::vfunc_14(u32 param1) { } ARM void ActorShopItemShipPart::vfunc_14(u32 param1) { - if (func_ov031_0217bdb8()->mUnk_19a != 0 && mUnk_174 == true) { + if (UnkStruct_ov031_02183e80::GetInstance()->mUnk_19a != 0 && mUnk_174 == true) { mModel = mUnk_178; mPos.x = 0; mPos.y = FLOAT_TO_Q20(10.0); @@ -736,8 +735,6 @@ ARM void ActorShopItem::vfunc_20(bool param1) { data_ov000_020e9c88.func_ov000_0207b89c(param1, &mPos, &func_ov031_0217f114, this); } -extern "C" unk32 func_ov031_0217bda0(); -extern "C" unk32 func_ov031_0217bdac(); extern "C" void CopySingle288(void *src, void *dest); extern "C" void func_ov009_0211d090(Vec3p *, Vec3p *); extern "C" void func_ov009_0211d00c(Mat3p *, Vec3p *); @@ -746,17 +743,15 @@ ARM void ActorShopItemShipPart::vfunc_20(bool param1) { return; } if (mUnk_174 == true && mModel == mUnk_178) { - func_ov031_0217bdb8(); - unk32 size = func_ov031_0217bda0(); + unk32 size = UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217bda0(); UnkStruct_027e0f64_04 *unk1 = data_027e0f64->func_ov000_0208b180(); Mat4x3p MStack_44 = unk1->mUnk_01c; Mat3p tempMatrix; CopySingle288(&MStack_44, &tempMatrix); Mat3p rotation2; Mat3p_func_01ff83a0(&tempMatrix, &rotation2); - func_ov031_0217bdb8(); Vec3p translation; - translation.z = -func_ov031_0217bdac(); + translation.z = -UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217bdac(); translation.x = 0; translation.y = 0; Mat3p_MultiplyVec(&translation, &rotation2, &translation); @@ -767,7 +762,7 @@ ARM void ActorShopItemShipPart::vfunc_20(bool param1) { scale2.z = size; sShip2Model->SetTransform(&scale2, &rotation2, &translation); - Vec3p tempVec = func_ov031_0217bdb8()->mUnk_178; + Vec3p tempVec = UnkStruct_ov031_02183e80::GetInstance()->mUnk_178; translation = tempVec; Vec3p_Add(&mPos, &translation, &translation); Vec3p scale; @@ -837,14 +832,8 @@ ARM void ActorShopItemBY::vfunc_1c(u16 *param1) { } } -struct UnkStruct_ov031_02183e84 { - /* 000 */ PAD(0x000, 0x470); - /* 470 */ unk32 mUnk_470; - /* 474 */ -}; -extern UnkStruct_ov031_02183e84 *func_ov031_0217cf1c(); ARM unk32 ActorShopItem::GetSoldOutMessageId() { - if (func_ov031_0217cf1c()->mUnk_470 == 2) { + if (ActorItemSellerBase::GetCurrentSeller()->mUnk_470 == 2) { return BMG_ID(BMG_FILE_INDEX_FIELD, 0x57); } else { return BMG_ID(BMG_FILE_INDEX_SHIP, 0xff); @@ -860,7 +849,7 @@ ARM unk32 ActorShopItemSoldOut::GetMessageId() { } ARM unk32 ActorShopItemHeartContainer::GetMessageId() { - if (func_ov031_0217cf1c()->mUnk_470 == 2) { + if (ActorItemSellerBase::GetCurrentSeller()->mUnk_470 == 2) { return BMG_ID(BMG_FILE_INDEX_FIELD, 0x44); } else { return BMG_ID(BMG_FILE_INDEX_SHIP, 0x8e); @@ -881,7 +870,7 @@ ARM unk32 ActorShopItemBombs::GetMessageId() { extern "C" bool HasFreebieCard(); ARM unk32 ActorShopItemBombBag::GetMessageId() { - unk32 unk = func_ov031_0217cf1c()->mUnk_470; + unk32 unk = ActorItemSellerBase::GetCurrentSeller()->mUnk_470; if (unk == 2) { return BMG_ID(BMG_FILE_INDEX_FIELD, 0x48); } else if (HasFreebieCard()) { @@ -896,7 +885,7 @@ ARM unk32 ActorShopItemBombchus::GetMessageId() { } ARM unk32 ActorShopItemBombchuBag::GetMessageId() { - switch (func_ov031_0217cf1c()->mUnk_470) { + switch (ActorItemSellerBase::GetCurrentSeller()->mUnk_470) { case 2: return BMG_ID(BMG_FILE_INDEX_FIELD, 0x49); case 1: @@ -908,7 +897,7 @@ ARM unk32 ActorShopItemBombchuBag::GetMessageId() { } ARM unk32 ActorShopItemShipPart::GetMessageId() { - switch (func_ov031_0217cf1c()->mUnk_470) { + switch (ActorItemSellerBase::GetCurrentSeller()->mUnk_470) { case 2: return BMG_ID(BMG_FILE_INDEX_FIELD, 0x46); case 0: @@ -935,7 +924,7 @@ ARM unk32 ActorShopItemShipPart::GetMessageId() { } ARM unk32 ActorShopItemTreasure::GetMessageId() { - switch (func_ov031_0217cf1c()->mUnk_470) { + switch (ActorItemSellerBase::GetCurrentSeller()->mUnk_470) { case 2: return BMG_ID(BMG_FILE_INDEX_FIELD, 0x4a); case 0: @@ -962,7 +951,7 @@ ARM unk32 ActorShopItemTreasure::GetMessageId() { } ARM unk32 ActorShopItemGem::GetMessageId() { - switch (func_ov031_0217cf1c()->mUnk_470) { + switch (ActorItemSellerBase::GetCurrentSeller()->mUnk_470) { case 2: return BMG_ID(BMG_FILE_INDEX_FIELD, 0x4b); case 0: @@ -985,7 +974,7 @@ ARM unk32 ActorShopItemShield::GetMessageId() { ARM unk32 ActorShopItemPotion::GetMessageId() { int iVar1; - if (func_ov031_0217cf1c()->mUnk_470 == 2) { + if (ActorItemSellerBase::GetCurrentSeller()->mUnk_470 == 2) { switch (mShopItemId) { case ShopItem_RedPotion: return BMG_ID(BMG_FILE_INDEX_FIELD, 0x4d); @@ -1022,7 +1011,7 @@ ARM s32 ActorShopItem::GetPrice() { } ARM s32 ActorShopItemHeartContainer::GetPrice() { - if (func_ov031_0217cf1c()->mUnk_470 == 1) { + if (ActorItemSellerBase::GetCurrentSeller()->mUnk_470 == 1) { return 1500; } else { return 2000; @@ -1030,7 +1019,7 @@ ARM s32 ActorShopItemHeartContainer::GetPrice() { } ARM s32 ActorShopItemPotion::GetPrice() { - if (func_ov031_0217cf1c()->mUnk_470 != 2) { + if (ActorItemSellerBase::GetCurrentSeller()->mUnk_470 != 2) { if (mShopItemId == ShopItem_RedPotion) { return 80; } else { @@ -1055,14 +1044,12 @@ ARM s32 ActorShopItemShipPart::GetPrice() { ARM s32 ActorShopItemTreasure::GetPrice() { unk32 unk = mUnk_17c; - return func_ov031_0217bdb8()->mUnk_038[unk]; + return UnkStruct_ov031_02183e80::GetInstance()->mUnk_038[unk]; } -extern "C" unk32 func_ov031_0217ce6c(); ARM unk32 ActorShopItem::vfunc_c0() { s32 price = this->GetPrice(); - func_ov031_0217bdb8(); - unk32 unk = (price * (10 - func_ov031_0217ce6c()) / 10 + 5) / 10 * 10; + unk32 unk = (price * (10 - UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217ce6c()) / 10 + 5) / 10 * 10; if (unk < 10) { unk = 10; } @@ -1073,13 +1060,13 @@ ARM void ActorShopItem::vfunc_c4() { if (mItemId == ItemId_None) { return; } - if (func_ov031_0217bdb8()->func_ov031_0217bd80()) { + if (UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217bd80()) { mUnk_175 = true; } } ARM void ActorShopItemHeartContainer::vfunc_c4() { - switch (func_ov031_0217cf1c()->mUnk_470) { + switch (ActorItemSellerBase::GetCurrentSeller()->mUnk_470) { case 2: gAdventureFlags->Set(AdventureFlag_Unk_103, true); break; @@ -1130,7 +1117,7 @@ ARM void ActorShopItemShipPart::vfunc_c4() { ShipPart part = this->func_ov031_02180248(); ShipType type = this->func_ov031_02180260(); GiveShipPart(part, type); - if (func_ov031_0217bdb8()->func_ov031_0217bd80()) { + if (UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217bd80()) { data_027e0dbc.func_ov003_020f3d74(mUnk_180 + 8); } ActorShopItem::vfunc_c4(); @@ -1140,14 +1127,14 @@ extern "C" void func_ov009_0211cac0(u32); ARM void ActorShopItemTreasure::vfunc_c4() { unk32 unk = this->func_ov031_02180278(); func_ov009_0211cac0(unk); - if (func_ov031_0217bdb8()->func_ov031_0217bd80()) { + if (UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217bd80()) { data_027e0dbc.func_ov003_020f3d74(mUnk_17c + 5); } ActorShopItem::vfunc_c4(); } ARM void ActorShopItemGem::vfunc_c4() { - switch (func_ov031_0217cf1c()->mUnk_470) { + switch (ActorItemSellerBase::GetCurrentSeller()->mUnk_470) { case 2: gAdventureFlags->Set(AdventureFlag_Unk_105, true); break; @@ -1240,17 +1227,17 @@ ARM bool ActorShopItemBY::vfunc_b8() { ARM unk32 ActorShopItemShipPart::func_ov031_02180248() { s32 unk = mUnk_180; - return func_ov031_0217bdb8()->mUnk_01c[unk]; + return UnkStruct_ov031_02183e80::GetInstance()->mUnk_01c[unk]; } ARM unk32 ActorShopItemShipPart::func_ov031_02180260() { s32 unk = mUnk_180; - return func_ov031_0217bdb8()->mUnk_024[unk]; + return UnkStruct_ov031_02183e80::GetInstance()->mUnk_024[unk]; } ARM unk32 ActorShopItemTreasure::func_ov031_02180278() { s32 unk = mUnk_17c; - return func_ov031_0217bdb8()->mUnk_02c[unk]; + return UnkStruct_ov031_02183e80::GetInstance()->mUnk_02c[unk]; } ARM bool ActorShopItemDM::vfunc_d0() { @@ -1318,7 +1305,7 @@ ARM bool ActorShopItemPotion::vfunc_d0() { } void ActorShopItemUnk::func_ov031_02180418() { - if (func_ov031_0217bdb8()->func_ov031_0217cec0()) { + if (UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217cec0()) { return; } mUnk_164 = true; diff --git a/src/Main/Game/Game.cpp b/src/Main/Game/Game.cpp index 65410b8d..b02fa9f9 100644 --- a/src/Main/Game/Game.cpp +++ b/src/Main/Game/Game.cpp @@ -377,7 +377,7 @@ ARM void Game::Run() { func_020363c8(local_28, &data_027e0c54); this->mUnk_0f0 = local_28[0]; this->mMode->vfunc_10(&this->mUnk_0f0); - gMessageManager.func_02036ca4((unk32) & this->mUnk_0f0); + gMessageManager.func_02036ca4(&this->mUnk_0f0); if (this->mModeId == 2) { data_027e103c->func_ov005_02103e58(&this->mUnk_0f0); } diff --git a/src/Main/Message/MessageManager.cpp b/src/Main/Message/MessageManager.cpp index d1eabdd0..0c889f61 100644 --- a/src/Main/Message/MessageManager.cpp +++ b/src/Main/Message/MessageManager.cpp @@ -359,7 +359,7 @@ ARM void MessageManager::func_02036c50(u16 *param_2) { } } -ARM void MessageManager::func_02036ca4(unk32 param_2) { +ARM void MessageManager::func_02036ca4(u16 *param_2) { s32 i; for (i = 0; i < ARRAY_LEN(this->mUnk_28); i++) { @@ -467,19 +467,19 @@ ARM UnkStruct_02038aa0 *MessageManager::func_02036da8(u32 param_2, s16 *param_3) // non-matching ARM void MessageManager::func_02036edc(u32 param_2, u8 param_3) { UnkStruct_020397f8 *pSVar1; - u8 auStack_28[24]; + UnkStruct_02037628 auStack_28; u8 local_13; - func_02037628(auStack_28); + auStack_28.func_02037628(); local_13 = 0; if ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0 && (data_02056be4[data_027e077c.mUnk_0] & 2) == 0) { local_13 = 1; } - auStack_28[21] = local_13; - auStack_28[20] = param_3; - pSVar1 = this->func_02036f68(param_2, auStack_28); + auStack_28.mUnk_15 = local_13; + auStack_28.mUnk_14 = param_3; + pSVar1 = this->func_02036f68(param_2, &auStack_28, NULL); if (pSVar1 != NULL) { if (this->mUnk_04 == 0) { @@ -489,7 +489,8 @@ ARM void MessageManager::func_02036edc(u32 param_2, u8 param_3) { } // non-matching -ARM UnkStruct_020397f8 *MessageManager::func_02036f68(u32 param_2, u8 *param_3) { +ARM UnkStruct_020397f8 *MessageManager::func_02036f68(u32 param_2, UnkStruct_02037628 *param_3, + UnkStruct_ov000_020d18f4 *param_4) { EntryINF1 *pEVar1; UnkStruct_02038aa0 *pSVar2; EntryINF1 *pEVar3; @@ -502,7 +503,7 @@ ARM UnkStruct_020397f8 *MessageManager::func_02036f68(u32 param_2, u8 *param_3) return NULL; } - if (param_3[21] != 0) { + if (param_3->mUnk_15 != 0) { pSVar5 = (UnkStruct_020397f8 *) this->mUnk_28[2]; pSVar2 = this->mUnk_28[3]; } else { @@ -519,7 +520,7 @@ ARM UnkStruct_020397f8 *MessageManager::func_02036f68(u32 param_2, u8 *param_3) if (data_ov000_020eec9c.func_ov000_020d7f18(0x19) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x18) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x34) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x35) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x1A) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x1B) == 0 && - (param_3[12]) != 7) { + (param_3->mUnk_0c) != 7) { data_ov000_020eec9c.func_ov000_020d77e4(0x1C); } diff --git a/src/Main/Unknown/UnkStruct_020397f8.cpp b/src/Main/Unknown/UnkStruct_020397f8.cpp index 793ee441..3f538f09 100644 --- a/src/Main/Unknown/UnkStruct_020397f8.cpp +++ b/src/Main/Unknown/UnkStruct_020397f8.cpp @@ -748,12 +748,13 @@ ARM unk32 UnkStruct_020397f8::vfunc_1c(u16 *param1, UnkStruct_0203b264 *param2, switch (this->mUnk_57a) { case 0: return this->func_0203905c(param1, param2, param3, param4); - case 1: + case 1: { UnknownMsgChoiceStruct *pChoiceData; s32 i = this->func_0203a30c(); pChoiceData = &this->mUnk_428[this->mUnk_528[i]]; return this->mUnk_164->func_0203cb5c( *param1, (((pChoiceData->mUnk_00->mUnk_0[3] << 0x10) | ((u16 *) pChoiceData->mUnk_00->mUnk_0)[2]) + ~0xFFFE)); + } default: break; } @@ -767,7 +768,8 @@ ARM void UnkStruct_020397f8::vfunc_60(func_0203b410_param1 *param1, unk32 param2 unk16 uVar2; unk32 iVar3; unk32 iVar4; - unk32 uVar5; + unk32 *uVar5; + unk32 uVar5_1; u32 uVar6; uVar6 = 0; @@ -820,12 +822,12 @@ ARM void UnkStruct_020397f8::vfunc_60(func_0203b410_param1 *param1, unk32 param2 iVar3 = func_02016fcc(uVar5); } else { if (this->func_02032fa4() != 0) { - uVar5 = 0x33; + uVar5_1 = 0x33; } else { - uVar5 = 0x32; + uVar5_1 = 0x32; } - data_027e0cbc.func_0203d77c(uVar5, 1, 1); + data_027e0cbc.func_0203d77c(uVar5_1, 1, 1); iVar3 = data_027e0cbc.func_0203d77c(data_02056a00[uVar6 * 0x18] - 2, 1, 1); } |
