mirror of
https://github.com/pret/pmd-red.git
synced 2026-04-24 06:57:18 -05:00
address kecleon review
This commit is contained in:
parent
41437a7a2e
commit
996a1cbc34
|
|
@ -467,7 +467,7 @@ _08019288: .4byte gUnknown_203B210
|
|||
_0801928C: .4byte gUnknown_202DE30
|
||||
_08019290: .4byte gKecleonShopDialogue
|
||||
_08019294:
|
||||
bl CountKecleonShopItems
|
||||
bl CountKecleonItems
|
||||
cmp r0, 0
|
||||
bne _080192C0
|
||||
ldr r0, _080192AC
|
||||
|
|
|
|||
|
|
@ -105,20 +105,20 @@ void sub_8090F58(void*, u8 *, struct ItemSlot *, struct unkStruct_8090F58*);
|
|||
void ShiftItemsDownFrom(s32 start);
|
||||
void ClearItemSlotAt(u32 index);
|
||||
void MoveToStorage(struct ItemSlot* slot);
|
||||
s32 CountKecleonItemShopItems(void);
|
||||
void InitKecleonItemShopItem(u8 index);
|
||||
struct HeldItem *GetKecleonItemShopItem(u8 index);
|
||||
void FillKecleonItemShopGaps(void);
|
||||
void SortGreenKecleonShopInventory(void);
|
||||
s32 CountKecleonShopItems(void);
|
||||
void InitKecleonShopItem(u8 index);
|
||||
struct HeldItem *GetKecleonShopItem(u8 index);
|
||||
void FillKecleonShopGaps(void);
|
||||
void SortKecleonShopInventory(void);
|
||||
void ChooseKecleonShopInventory(u8 index);
|
||||
bool8 AddGreenKecleonShopItem(u8 itemIndex);
|
||||
u32 CountKecleonWareShopItems(void);
|
||||
void InitKecleonWareShopItem(u8 index);
|
||||
struct HeldItem* GetKecleonWareShopItem(u8 index);
|
||||
void FillKecleonWareShopGaps(void);
|
||||
void SortPurpleKecleonShopInventory(void);
|
||||
void ChoosePurpleKecleonShopInventory(u8 index);
|
||||
bool8 AddPurpleKecleonShopItem(u8 itemIndex);
|
||||
bool8 AddKecleonShopItem(u8 itemIndex);
|
||||
u32 CountKecleonWareItems(void);
|
||||
void InitKecleonWareItem(u8 index);
|
||||
struct HeldItem* GetKecleonWareItem(u8 index);
|
||||
void FillKecleonWareGaps(void);
|
||||
void SortKecleonWareInventory(void);
|
||||
void ChooseKecleonWareInventory(u8 index);
|
||||
bool8 AddKecleonWareItem(u8 itemIndex);
|
||||
void FillInventoryGaps();
|
||||
bool8 AddHeldItemToInventory(struct HeldItem* slot);
|
||||
bool8 IsNotMoneyOrUsedTMItem(u8 id);
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ struct TeamInventory
|
|||
{
|
||||
struct ItemSlot teamItems[INVENTORY_SIZE];
|
||||
u16 teamStorage[NUMBER_OF_ITEM_IDS];
|
||||
struct HeldItem kecleonItemShopItems[MAX_KECLEON_ITEM_SHOP_ITEMS];
|
||||
struct HeldItem kecleonWareShopItems[MAX_KECLEON_WARE_SHOP_ITEMS];
|
||||
struct HeldItem kecleonShopItems[MAX_KECLEON_ITEM_SHOP_ITEMS];
|
||||
struct HeldItem kecleonWareItems[MAX_KECLEON_WARE_SHOP_ITEMS];
|
||||
/* 0x260 */ s32 teamMoney;
|
||||
/* 0x264 */ u32 teamSavings;
|
||||
};
|
||||
|
|
|
|||
120
src/items.c
120
src/items.c
|
|
@ -46,8 +46,8 @@ extern void sub_80078A4(u32, u32, u32, u32, u32);
|
|||
extern void sub_80073E0(u32);
|
||||
extern void xxx_format_and_draw(u32, u32, const u8 *, u32, u32);
|
||||
extern s32 sub_8091E94(s32 a1, s32 a2, s32 a3);
|
||||
extern void SortGreenKecleonShopInventory();
|
||||
bool8 AddPurpleKecleonShopItem(u8);
|
||||
extern void SortKecleonShopInventory();
|
||||
bool8 AddKecleonWareItem(u8);
|
||||
|
||||
void LoadItemParameters(void)
|
||||
{
|
||||
|
|
@ -77,7 +77,7 @@ void InitializeMoneyItems(void)
|
|||
|
||||
for(i = 0; i < MAX_KECLEON_ITEM_SHOP_ITEMS; i++)
|
||||
{
|
||||
InitKecleonItemShopItem(i);
|
||||
InitKecleonShopItem(i);
|
||||
}
|
||||
gTeamInventory_203B460->teamMoney = 0;
|
||||
gTeamInventory_203B460->teamSavings = 0;
|
||||
|
|
@ -954,40 +954,40 @@ void MoveToStorage(struct ItemSlot* slot)
|
|||
}
|
||||
}
|
||||
|
||||
s32 CountKecleonItemShopItems(void)
|
||||
s32 CountKecleonShopItems(void)
|
||||
{
|
||||
s32 i;
|
||||
s32 counter = 0;
|
||||
for (i = 0; i < MAX_KECLEON_ITEM_SHOP_ITEMS; i++) {
|
||||
if (gTeamInventory_203B460->kecleonItemShopItems[i].itemIndex) {
|
||||
if (gTeamInventory_203B460->kecleonShopItems[i].itemIndex) {
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
return counter;
|
||||
}
|
||||
|
||||
void InitKecleonItemShopItem(u8 index)
|
||||
void InitKecleonShopItem(u8 index)
|
||||
{
|
||||
struct HeldItem* unk230;
|
||||
struct HeldItem* shopItem;
|
||||
|
||||
unk230 = &gTeamInventory_203B460->kecleonItemShopItems[index];
|
||||
unk230->itemIndex = ITEM_ID_NOTHING;
|
||||
unk230->numItems = 0;
|
||||
shopItem = &gTeamInventory_203B460->kecleonShopItems[index];
|
||||
shopItem->itemIndex = ITEM_ID_NOTHING;
|
||||
shopItem->numItems = 0;
|
||||
}
|
||||
|
||||
struct HeldItem* GetKecleonItemShopItem(u8 i)
|
||||
struct HeldItem* GetKecleonShopItem(u8 i)
|
||||
{
|
||||
return &gTeamInventory_203B460->kecleonItemShopItems[i];
|
||||
return &gTeamInventory_203B460->kecleonShopItems[i];
|
||||
}
|
||||
|
||||
void FillKecleonItemShopGaps(void)
|
||||
void FillKecleonShopGaps(void)
|
||||
{
|
||||
s32 slot_checking = 0;
|
||||
s32 last_filled = 0;
|
||||
|
||||
do {
|
||||
while (slot_checking < MAX_KECLEON_ITEM_SHOP_ITEMS) {
|
||||
if (gTeamInventory_203B460->kecleonItemShopItems[slot_checking].itemIndex) {
|
||||
if (gTeamInventory_203B460->kecleonShopItems[slot_checking].itemIndex) {
|
||||
break;
|
||||
}
|
||||
// find next empty slot
|
||||
|
|
@ -1000,7 +1000,7 @@ void FillKecleonItemShopGaps(void)
|
|||
|
||||
if (slot_checking > last_filled) {
|
||||
// shift it down
|
||||
gTeamInventory_203B460->kecleonItemShopItems[last_filled] = gTeamInventory_203B460->kecleonItemShopItems[slot_checking];
|
||||
gTeamInventory_203B460->kecleonShopItems[last_filled] = gTeamInventory_203B460->kecleonShopItems[slot_checking];
|
||||
}
|
||||
slot_checking++;
|
||||
last_filled++;
|
||||
|
|
@ -1008,22 +1008,22 @@ void FillKecleonItemShopGaps(void)
|
|||
|
||||
// clear out the rest of the slots
|
||||
for (; last_filled < MAX_KECLEON_ITEM_SHOP_ITEMS; last_filled++) {
|
||||
InitKecleonItemShopItem(last_filled);
|
||||
InitKecleonShopItem(last_filled);
|
||||
}
|
||||
}
|
||||
|
||||
void SortGreenKecleonShopInventory(void) {
|
||||
void SortKecleonShopInventory(void) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < MAX_KECLEON_ITEM_SHOP_ITEMS - 1; i++) {
|
||||
s32 j;
|
||||
for (j = i + 1; j < MAX_KECLEON_ITEM_SHOP_ITEMS; j++) {
|
||||
s32 order_i = GetItemOrder(gTeamInventory_203B460->kecleonItemShopItems[i].itemIndex);
|
||||
s32 order_j = GetItemOrder(gTeamInventory_203B460->kecleonItemShopItems[j].itemIndex);
|
||||
if (order_i > order_j || (order_i == order_j && gTeamInventory_203B460->kecleonItemShopItems[i].numItems < gTeamInventory_203B460->kecleonItemShopItems[j].numItems)) {
|
||||
struct HeldItem str_i = gTeamInventory_203B460->kecleonItemShopItems[i];
|
||||
gTeamInventory_203B460->kecleonItemShopItems[i] = gTeamInventory_203B460->kecleonItemShopItems[j];
|
||||
gTeamInventory_203B460->kecleonItemShopItems[j] = str_i;
|
||||
s32 order_i = GetItemOrder(gTeamInventory_203B460->kecleonShopItems[i].itemIndex);
|
||||
s32 order_j = GetItemOrder(gTeamInventory_203B460->kecleonShopItems[j].itemIndex);
|
||||
if (order_i > order_j || (order_i == order_j && gTeamInventory_203B460->kecleonShopItems[i].numItems < gTeamInventory_203B460->kecleonShopItems[j].numItems)) {
|
||||
struct HeldItem str_i = gTeamInventory_203B460->kecleonShopItems[i];
|
||||
gTeamInventory_203B460->kecleonShopItems[i] = gTeamInventory_203B460->kecleonShopItems[j];
|
||||
gTeamInventory_203B460->kecleonShopItems[j] = str_i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1035,59 +1035,59 @@ void ChooseKecleonShopInventory(u8 index) {
|
|||
|
||||
memcpy(data, gUnknown_81097E8, 4 * sizeof(u32));
|
||||
for (i = 0; i < MAX_KECLEON_ITEM_SHOP_ITEMS; i++) {
|
||||
InitKecleonItemShopItem(i);
|
||||
InitKecleonShopItem(i);
|
||||
}
|
||||
for (i = 0; i < MAX_KECLEON_ITEM_SHOP_ITEMS; i++) {
|
||||
s32 rand_1 = RandomCapped(9999);
|
||||
s32 rand_2 = RandomCapped(9999);
|
||||
AddGreenKecleonShopItem(sub_8091E94(data[index], rand_1, rand_2));
|
||||
AddKecleonShopItem(sub_8091E94(data[index], rand_1, rand_2));
|
||||
}
|
||||
SortGreenKecleonShopInventory();
|
||||
ChoosePurpleKecleonShopInventory(index);
|
||||
SortKecleonShopInventory();
|
||||
ChooseKecleonWareInventory(index);
|
||||
}
|
||||
|
||||
bool8 AddGreenKecleonShopItem(u8 itemIndex) {
|
||||
bool8 AddKecleonShopItem(u8 itemIndex) {
|
||||
struct HeldItem held;
|
||||
s32 i;
|
||||
|
||||
xxx_init_helditem_8090B08(&held, itemIndex); // initialize
|
||||
for (i = 0; i < MAX_KECLEON_ITEM_SHOP_ITEMS; i++) {
|
||||
if (!gTeamInventory_203B460->kecleonItemShopItems[i].itemIndex) {
|
||||
gTeamInventory_203B460->kecleonItemShopItems[i] = held;
|
||||
if (!gTeamInventory_203B460->kecleonShopItems[i].itemIndex) {
|
||||
gTeamInventory_203B460->kecleonShopItems[i] = held;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 CountKecleonWareShopItems(void) {
|
||||
u32 CountKecleonWareItems(void) {
|
||||
s32 i;
|
||||
u32 count = 0;
|
||||
for (i = 0; i < MAX_KECLEON_WARE_SHOP_ITEMS; i++) {
|
||||
if (gTeamInventory_203B460->kecleonWareShopItems[i].itemIndex) {
|
||||
if (gTeamInventory_203B460->kecleonWareItems[i].itemIndex) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void InitKecleonWareShopItem(u8 index) {
|
||||
struct HeldItem* unk250 = &gTeamInventory_203B460->kecleonWareShopItems[index];
|
||||
unk250->itemIndex = ITEM_ID_NOTHING;
|
||||
unk250->numItems = 0;
|
||||
void InitKecleonWareItem(u8 index) {
|
||||
struct HeldItem* wareItem = &gTeamInventory_203B460->kecleonWareItems[index];
|
||||
wareItem->itemIndex = ITEM_ID_NOTHING;
|
||||
wareItem->numItems = 0;
|
||||
}
|
||||
|
||||
struct HeldItem* GetKecleonWareShopItem(u8 index) {
|
||||
return &gTeamInventory_203B460->kecleonWareShopItems[index];
|
||||
struct HeldItem* GetKecleonWareItem(u8 index) {
|
||||
return &gTeamInventory_203B460->kecleonWareItems[index];
|
||||
}
|
||||
|
||||
void FillKecleonWareShopGaps(void) {
|
||||
void FillKecleonWareGaps(void) {
|
||||
s32 slot_checking = 0;
|
||||
s32 last_filled = 0;
|
||||
|
||||
do {
|
||||
while (slot_checking < MAX_KECLEON_WARE_SHOP_ITEMS) {
|
||||
if (gTeamInventory_203B460->kecleonWareShopItems[slot_checking].itemIndex != ITEM_ID_NOTHING) {
|
||||
if (gTeamInventory_203B460->kecleonWareItems[slot_checking].itemIndex != ITEM_ID_NOTHING) {
|
||||
break;
|
||||
}
|
||||
slot_checking++;
|
||||
|
|
@ -1099,7 +1099,7 @@ void FillKecleonWareShopGaps(void) {
|
|||
|
||||
if (slot_checking > last_filled) {
|
||||
// shift it down
|
||||
gTeamInventory_203B460->kecleonWareShopItems[last_filled] = gTeamInventory_203B460->kecleonWareShopItems[slot_checking];
|
||||
gTeamInventory_203B460->kecleonWareItems[last_filled] = gTeamInventory_203B460->kecleonWareItems[slot_checking];
|
||||
}
|
||||
slot_checking++;
|
||||
last_filled++;
|
||||
|
|
@ -1107,51 +1107,51 @@ void FillKecleonWareShopGaps(void) {
|
|||
|
||||
// clear out the rest of the slots
|
||||
for (; last_filled < MAX_KECLEON_WARE_SHOP_ITEMS; last_filled++) {
|
||||
InitKecleonWareShopItem(last_filled);
|
||||
InitKecleonWareItem(last_filled);
|
||||
}
|
||||
}
|
||||
|
||||
void SortPurpleKecleonShopInventory(void) {
|
||||
void SortKecleonWareInventory(void) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < MAX_KECLEON_WARE_SHOP_ITEMS - 1; i++) {
|
||||
s32 j;
|
||||
for (j = i + 1; j < MAX_KECLEON_WARE_SHOP_ITEMS; j++) {
|
||||
s32 order_i = GetItemOrder(gTeamInventory_203B460->kecleonWareShopItems[i].itemIndex);
|
||||
s32 order_j = GetItemOrder(gTeamInventory_203B460->kecleonWareShopItems[j].itemIndex);
|
||||
if (order_i > order_j || (order_i == order_j && gTeamInventory_203B460->kecleonWareShopItems[i].numItems < gTeamInventory_203B460->kecleonWareShopItems[j].numItems)) {
|
||||
struct HeldItem str_i = gTeamInventory_203B460->kecleonWareShopItems[i];
|
||||
gTeamInventory_203B460->kecleonWareShopItems[i] = gTeamInventory_203B460->kecleonWareShopItems[j];
|
||||
gTeamInventory_203B460->kecleonWareShopItems[j] = str_i;
|
||||
s32 order_i = GetItemOrder(gTeamInventory_203B460->kecleonWareItems[i].itemIndex);
|
||||
s32 order_j = GetItemOrder(gTeamInventory_203B460->kecleonWareItems[j].itemIndex);
|
||||
if (order_i > order_j || (order_i == order_j && gTeamInventory_203B460->kecleonWareItems[i].numItems < gTeamInventory_203B460->kecleonWareItems[j].numItems)) {
|
||||
struct HeldItem str_i = gTeamInventory_203B460->kecleonWareItems[i];
|
||||
gTeamInventory_203B460->kecleonWareItems[i] = gTeamInventory_203B460->kecleonWareItems[j];
|
||||
gTeamInventory_203B460->kecleonWareItems[j] = str_i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ChoosePurpleKecleonShopInventory(u8 index) {
|
||||
void ChooseKecleonWareInventory(u8 index) {
|
||||
u32 data[MAX_KECLEON_WARE_SHOP_ITEMS];
|
||||
s32 i;
|
||||
|
||||
memcpy(data, gUnknown_81097F8, 4 * sizeof(u32));
|
||||
for (i = 0; i < MAX_KECLEON_WARE_SHOP_ITEMS; i++) {
|
||||
InitKecleonWareShopItem(i);
|
||||
InitKecleonWareItem(i);
|
||||
}
|
||||
for (i = 0; i < MAX_KECLEON_WARE_SHOP_ITEMS; i++) {
|
||||
s32 rand_1 = RandomCapped(9999);
|
||||
s32 rand_2 = RandomCapped(9999);
|
||||
AddPurpleKecleonShopItem(sub_8091E94(data[index], rand_1, rand_2));
|
||||
AddKecleonWareItem(sub_8091E94(data[index], rand_1, rand_2));
|
||||
}
|
||||
SortPurpleKecleonShopInventory();
|
||||
SortKecleonWareInventory();
|
||||
}
|
||||
|
||||
bool8 AddPurpleKecleonShopItem(u8 itemIndex) {
|
||||
bool8 AddKecleonWareItem(u8 itemIndex) {
|
||||
struct HeldItem held;
|
||||
s32 i;
|
||||
|
||||
xxx_init_helditem_8090B08(&held, itemIndex); // initialize
|
||||
for (i = 0; i < MAX_KECLEON_WARE_SHOP_ITEMS; i++) {
|
||||
if (!gTeamInventory_203B460->kecleonWareShopItems[i].itemIndex) {
|
||||
gTeamInventory_203B460->kecleonWareShopItems[i] = held;
|
||||
if (!gTeamInventory_203B460->kecleonWareItems[i].itemIndex) {
|
||||
gTeamInventory_203B460->kecleonWareItems[i] = held;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1171,10 +1171,10 @@ s32 SaveTeamInventory(u8* unk0, u32 size)
|
|||
SaveIntegerBits(&unk, &gTeamInventory_203B460->teamStorage[i], 10);
|
||||
}
|
||||
for (i = 0; i < MAX_KECLEON_ITEM_SHOP_ITEMS; i++) {
|
||||
SaveHeldItem(&unk, &gTeamInventory_203B460->kecleonItemShopItems[i]);
|
||||
SaveHeldItem(&unk, &gTeamInventory_203B460->kecleonShopItems[i]);
|
||||
}
|
||||
for (i = 0; i < MAX_KECLEON_WARE_SHOP_ITEMS; i++) {
|
||||
SaveHeldItem(&unk, &gTeamInventory_203B460->kecleonWareShopItems[i]);
|
||||
SaveHeldItem(&unk, &gTeamInventory_203B460->kecleonWareItems[i]);
|
||||
}
|
||||
SaveIntegerBits(&unk, &gTeamInventory_203B460->teamMoney, 24);
|
||||
SaveIntegerBits(&unk, &gTeamInventory_203B460->teamSavings, 24);
|
||||
|
|
@ -1195,10 +1195,10 @@ s32 RestoreTeamInventory(u8 *unk0, u32 size)
|
|||
RestoreIntegerBits(&unk, &gTeamInventory_203B460->teamStorage[i], 10);
|
||||
}
|
||||
for (i = 0; i < MAX_KECLEON_ITEM_SHOP_ITEMS; i++) {
|
||||
RestoreHeldItem(&unk, &gTeamInventory_203B460->kecleonItemShopItems[i]);
|
||||
RestoreHeldItem(&unk, &gTeamInventory_203B460->kecleonShopItems[i]);
|
||||
}
|
||||
for (i = 0; i < MAX_KECLEON_WARE_SHOP_ITEMS; i++) {
|
||||
RestoreHeldItem(&unk, &gTeamInventory_203B460->kecleonWareShopItems[i]);
|
||||
RestoreHeldItem(&unk, &gTeamInventory_203B460->kecleonWareItems[i]);
|
||||
}
|
||||
RestoreIntegerBits(&unk, &gTeamInventory_203B460->teamMoney, 24);
|
||||
RestoreIntegerBits(&unk, &gTeamInventory_203B460->teamSavings, 24);
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ extern void sub_801A3DC(void);
|
|||
extern void sub_801AD34(u32);
|
||||
extern void PlaySound(u16 songIndex);
|
||||
|
||||
u32 CountKecleonShopItems(void);
|
||||
u32 CountKecleonItems(void);
|
||||
|
||||
void sub_8019700(void)
|
||||
{
|
||||
|
|
@ -148,7 +148,7 @@ void sub_8019730(void)
|
|||
gUnknown_203B210->unk28 = menuAction;
|
||||
switch(menuAction) {
|
||||
case 2:
|
||||
if (CountKecleonShopItems() == 0)
|
||||
if (CountKecleonItems() == 0)
|
||||
UpdateKecleonStoreState(5);
|
||||
else if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE)
|
||||
UpdateKecleonStoreState(0xA);
|
||||
|
|
@ -194,14 +194,14 @@ void sub_8019850(void)
|
|||
case 5:
|
||||
AddToTeamMoney(-gUnknown_203B210->itemSellPrice);
|
||||
if (gUnknown_203B210->isKecleonItemShop) {
|
||||
AddHeldItemToInventory(GetKecleonItemShopItem(gUnknown_203B210->itemShopItemIndex));
|
||||
InitKecleonItemShopItem(gUnknown_203B210->itemShopItemIndex);
|
||||
FillKecleonItemShopGaps();
|
||||
AddHeldItemToInventory(GetKecleonShopItem(gUnknown_203B210->itemShopItemIndex));
|
||||
InitKecleonShopItem(gUnknown_203B210->itemShopItemIndex);
|
||||
FillKecleonShopGaps();
|
||||
}
|
||||
else {
|
||||
AddHeldItemToInventory(GetKecleonWareShopItem(gUnknown_203B210->wareShopItemIndex));
|
||||
InitKecleonWareShopItem(gUnknown_203B210->wareShopItemIndex);
|
||||
FillKecleonWareShopGaps();
|
||||
AddHeldItemToInventory(GetKecleonWareItem(gUnknown_203B210->wareShopItemIndex));
|
||||
InitKecleonWareItem(gUnknown_203B210->wareShopItemIndex);
|
||||
FillKecleonWareGaps();
|
||||
}
|
||||
PlaySound(0x14c);
|
||||
UpdateKecleonStoreState(0x11);
|
||||
|
|
@ -282,11 +282,11 @@ void sub_80199CC(void)
|
|||
case 3:
|
||||
if (gUnknown_203B210->isKecleonItemShop) {
|
||||
gUnknown_203B210->itemShopItemIndex = sub_8019FB0();
|
||||
item = GetKecleonItemShopItem(gUnknown_203B210->itemShopItemIndex);
|
||||
item = GetKecleonShopItem(gUnknown_203B210->itemShopItemIndex);
|
||||
}
|
||||
else {
|
||||
gUnknown_203B210->wareShopItemIndex = sub_801A37C();
|
||||
item = GetKecleonWareShopItem(gUnknown_203B210->wareShopItemIndex);
|
||||
item = GetKecleonWareItem(gUnknown_203B210->wareShopItemIndex);
|
||||
}
|
||||
xxx_init_itemslot_8090A8C(&gUnknown_203B210->unk1C,item->itemIndex,0);
|
||||
gUnknown_203B210->unk1C.numItems =item->numItems;
|
||||
|
|
@ -296,11 +296,11 @@ void sub_80199CC(void)
|
|||
case 4:
|
||||
if (gUnknown_203B210->isKecleonItemShop) {
|
||||
gUnknown_203B210->itemShopItemIndex = sub_8019FB0();
|
||||
item = GetKecleonItemShopItem(gUnknown_203B210->itemShopItemIndex);
|
||||
item = GetKecleonShopItem(gUnknown_203B210->itemShopItemIndex);
|
||||
}
|
||||
else {
|
||||
gUnknown_203B210->wareShopItemIndex = sub_801A37C();
|
||||
item = GetKecleonWareShopItem(gUnknown_203B210->wareShopItemIndex);
|
||||
item = GetKecleonWareItem(gUnknown_203B210->wareShopItemIndex);
|
||||
}
|
||||
xxx_init_itemslot_8090A8C(&gUnknown_203B210->unk1C,item->itemIndex,0);
|
||||
gUnknown_203B210->unk1C.numItems = item->numItems;
|
||||
|
|
@ -452,12 +452,12 @@ void sub_8019D68(void)
|
|||
}
|
||||
}
|
||||
|
||||
u32 CountKecleonShopItems(void)
|
||||
u32 CountKecleonItems(void)
|
||||
{
|
||||
if(gUnknown_203B210->isKecleonItemShop)
|
||||
return CountKecleonItemShopItems();
|
||||
return CountKecleonShopItems();
|
||||
else
|
||||
return CountKecleonWareShopItems();
|
||||
return CountKecleonWareItems();
|
||||
}
|
||||
|
||||
void sub_8019DAC(void)
|
||||
|
|
@ -498,7 +498,7 @@ void sub_8019E04(s32 param_1)
|
|||
|
||||
u32 sub_8019E40(u32 r0)
|
||||
{
|
||||
if(CountKecleonItemShopItems() == 0)
|
||||
if(CountKecleonShopItems() == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -512,7 +512,7 @@ u32 sub_8019E40(u32 r0)
|
|||
gUnknown_203B214->unk38->unk14 = gUnknown_203B214->unk9C;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B214->unk3C, 1, 1);
|
||||
sub_8013818(gUnknown_203B214, CountKecleonItemShopItems(), 0xA, r0);
|
||||
sub_8013818(gUnknown_203B214, CountKecleonShopItems(), 0xA, r0);
|
||||
gUnknown_203B214->unk18 = gUnknown_203B218;
|
||||
sub_8013984((u8 *)gUnknown_203B214);
|
||||
sub_801A064();
|
||||
|
|
@ -541,7 +541,7 @@ u32 sub_8019EDC(u8 r0)
|
|||
PlayMenuSoundEffect(1);
|
||||
return 2;
|
||||
case 1:
|
||||
item = GetKecleonItemShopItem(sub_8019FB0());
|
||||
item = GetKecleonShopItem(sub_8019FB0());
|
||||
|
||||
// NOTE: needs seperate vars to match
|
||||
itemIndex = item->itemIndex << 16;
|
||||
|
|
@ -585,7 +585,7 @@ void sub_8019FCC(u8 r0)
|
|||
{
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B214->unk3C, 0, 0);
|
||||
gUnknown_203B214->shopItemCount = CountKecleonItemShopItems();
|
||||
gUnknown_203B214->shopItemCount = CountKecleonShopItems();
|
||||
sub_8013984((u8 *)gUnknown_203B214);
|
||||
sub_801A064();
|
||||
sub_801A0D8();
|
||||
|
|
@ -690,7 +690,7 @@ void sub_801A0D8(void)
|
|||
for(index = 0; index < gUnknown_203B214->unk1A; index++)
|
||||
{
|
||||
temp_calc = (gUnknown_203B214->unk1E * gUnknown_203B214->unk1C) + index;
|
||||
heldItem = GetKecleonItemShopItem(temp_calc);
|
||||
heldItem = GetKecleonShopItem(temp_calc);
|
||||
|
||||
index_shift = heldItem->itemIndex << 16;
|
||||
slot.temp.full_bits = (slot.temp.full_bits & 0xff00ffff) | index_shift;
|
||||
|
|
@ -721,7 +721,7 @@ void sub_801A0D8(void)
|
|||
|
||||
u32 sub_801A20C(u32 r0)
|
||||
{
|
||||
if(CountKecleonWareShopItems() == 0)
|
||||
if(CountKecleonWareItems() == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -735,7 +735,7 @@ u32 sub_801A20C(u32 r0)
|
|||
gUnknown_203B21C->unk38->unk14 = gUnknown_203B21C->unk9C;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B21C->unk3C, 1, 1);
|
||||
sub_8013818(gUnknown_203B21C, CountKecleonWareShopItems(), 0xA, r0);
|
||||
sub_8013818(gUnknown_203B21C, CountKecleonWareItems(), 0xA, r0);
|
||||
gUnknown_203B21C->unk18 = gUnknown_203B220;
|
||||
sub_8013984((u8 *)gUnknown_203B21C);
|
||||
sub_801A430();
|
||||
|
|
@ -764,7 +764,7 @@ u32 sub_801A2A8(u8 r0)
|
|||
PlayMenuSoundEffect(1);
|
||||
return 2;
|
||||
case 1:
|
||||
item = GetKecleonWareShopItem(sub_801A37C());
|
||||
item = GetKecleonWareItem(sub_801A37C());
|
||||
|
||||
// NOTE: needs seperate vars to match
|
||||
itemIndex = item->itemIndex << 16;
|
||||
|
|
@ -808,7 +808,7 @@ void sub_801A398(u8 r0)
|
|||
{
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B21C->unk3C, 0, 0);
|
||||
gUnknown_203B21C->shopItemCount = CountKecleonWareShopItems();
|
||||
gUnknown_203B21C->shopItemCount = CountKecleonWareItems();
|
||||
sub_8013984((u8 *)gUnknown_203B21C);
|
||||
sub_801A430();
|
||||
sub_801A4A4();
|
||||
|
|
@ -912,7 +912,7 @@ void sub_801A4A4(void)
|
|||
for(index = 0; index < gUnknown_203B21C->unk1A; index++)
|
||||
{
|
||||
temp_calc = (gUnknown_203B21C->unk1E * gUnknown_203B21C->unk1C) + index;
|
||||
heldItem = GetKecleonWareShopItem(temp_calc);
|
||||
heldItem = GetKecleonWareItem(temp_calc);
|
||||
|
||||
index_shift = heldItem->itemIndex << 16;
|
||||
slot.temp.full_bits = (slot.temp.full_bits & 0xff00ffff) | index_shift;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user