Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/gamestate.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ enum GfId {
* 20 entries at g_gameState + 0x950 (0x80077CC8).
*/
typedef struct {
/* 0x00 */ u8 items[16]; /**< Item IDs available for sale. */
/* 0x00 */ u8 items[16]; /**< Flags indicating whether each item is visible in the shop. */
/* 0x10 */ u8 visited; /**< Shop has been visited flag. */
/* 0x11 */ u8 pad[3]; /**< Padding. */
} ShopData; /* 0x14 = 20 bytes */
Expand Down
13 changes: 11 additions & 2 deletions include/menumain.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
DR_AREA *func_801EF800(P_TAG *, DR_AREA *, u8 *); /**< Link a custom-rect DR_AREA prim. */
DR_AREA *func_801EF8D8(P_TAG *, DR_AREA *); /**< Link a clip-restore DR_AREA prim. */
s32 func_801EF9AC(s32, s32, s32, s32); /**< Panel/window render helper. */
void func_801EFBB4(s32, s32, s32); /**< Panel/window render helper. */
s32 func_801EFBB4(s32, s32, s32); /**< Panel/window render helper. */
s32 func_801F179C(s32, s32); /**< Allocate a menu state task (tickCb, drawCb). */
s32 func_801F6AD0(s32); /**< Party/character query helper. */
void func_801F7B60(void); /**< Menu teardown/exit helper. */
Expand All @@ -56,7 +56,16 @@ typedef struct MenuTask {
s32 (*drawCb)(struct MenuTask *, s32, s32); /* 0x0C: (task, ctx, dl) -> dl (func_801F16AC). */
u16 state; /* 0x10: per-task state word, zeroed on alloc. */
s8 inUse; /* 0x12: pool slot occupied. */
u8 pad13[0x65];
u8 pad13[0x15];
u32 unk28;
u8 *unk2C;
u32 unk30;
u16 pad34;
u16 unk36;
u16 unk38;
u8 pad3A[0xB];
u8 unk45;
u8 pad46[0x32];
} MenuTask; /* 0x78 bytes */

/**
Expand Down
67 changes: 67 additions & 0 deletions include/menushop.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#ifndef MENUSHOP_H
#define MENUSHOP_H

#include "gamestate.h"

#define SHOP_ITEM_COUNT 16
#define ITEM_PRICE_COUNT 200
#define ITEM_SLOT_COUNT 198

typedef struct {
u8 itemId; /**< 0x0: item ID. */
u8 rarity; /**< 0x1: item rarity (0x00 = Rare, 0xFF = Common). */
} ShopItemRarity; /* 0x2 = 2 bytes */

typedef struct {
u8 itemId; /**< 0x0: item ID. */
u8 visible; /**< 0x1: item visibility flag. */
} ShopItemVisibility; /* 0x2 = 2 bytes */

typedef struct {
u16 basePrice; /**< 0x0: base price. */
u8 sellRate; /**< 0x2: sell rate. */
} ShopItemPrice; /* 0x3 = 3 bytes */

typedef struct {
u8 pad000[0x20];
s32 *unk20; /**< 0x20: pointer to data. */
u8 pad024[0x12];
u16 unk36; /**< 0x36: scroll offset. */
} Struct_801E8B60;

typedef struct {
u8 pad000[0x3A];
s16 unk3A; /**< 0x3A: scroll offset. */
u8 pad03D[0x4];
u8 unk40; /**< 0x40: page start. */
u8 unk41; /**< 0x41: page end. */
u8 pad041[0x4];
u8 unk46; /**< 0x46: orientation (left if equals 0, right otherwise). */
} Struct_801E7374;

typedef struct {
u8 pad000[0x28];
s32 unk28; /**< 0x28: passed to drawColorByMenuPalette as 4th argument. */
} Struct_801E7508;

extern ShopData D_80077CC8[SHOP_COUNT]; /**< Shop data table. */
extern u8 D_80077EBC[ITEM_SLOT_COUNT]; /**< Item slot inventory. */
extern ShopItemPrice D_801EA3F0[ITEM_PRICE_COUNT]; /**< Item price table. */
extern u8 D_801EA70C[];
extern u8 D_801F7F98[];
extern u8 D_801E9B64[];
extern u8 D_801E9B6C[];
extern ShopItemRarity D_801EA170[SHOP_COUNT][SHOP_ITEM_COUNT]; /**< Shop item rarity tables. */
extern ShopItemVisibility D_801EAA28[SHOP_ITEM_COUNT]; /**< Shop item visibility table. */
extern s32 D_801EAA48[ITEM_PRICE_COUNT]; /**< Item sell prices. */
extern s32 D_801EAD68[ITEM_PRICE_COUNT]; /**< Item buy prices. */
extern u8 D_801EB088[ITEM_PRICE_COUNT]; /**< Item quantities. */
extern s32 g_menuColor;
extern s32 D_80077E70;
extern s32 func_801E8AB0;
extern void func_801E5E90(void*);
extern s32 func_801E79D4(void*, s32, s32);
extern s32 func_801EFBB4(s32, s32, s32);
extern void* func_801E6FD8(void);

#endif /* MENUSHOP_H */
2 changes: 1 addition & 1 deletion src/menu/menumain/menumain.c
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ s32 func_801F5E0C(s32 ctx, s32 dl, s32 x, s32 y, s32 color, s32 val, s32 flag) {
}

/** @brief Render number right-aligned (last param = 1). */
void func_801F5EFC(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5) {
s32 func_801F5EFC(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5) {
func_801F5E0C(a0, a1, a2, a3, a4, a5, 1);
}

Expand Down
Loading