Skip to content
Closed
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
3 changes: 3 additions & 0 deletions config/ff8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,17 @@ binaries:
options:
target_path: original/menushop.ovl
src_path: src/menu/menushop
section_order: [.text, .rodata, .data, .bss]
segments:
- name: menushop
type: code
start: 0x0
vram: 0x801E5800
subsegments:
- [0x0, c, menushop]
- [0x29A4, c, menushop2]
- [0x429C, .rodata, menushop]
- [0x4308, .rodata, menushop2]
- [0x4364, rodata]
- [0x4570, data]
- [0x5228]
Expand Down
4 changes: 2 additions & 2 deletions include/gamestate.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ enum GfId {
*/
typedef struct {
/* 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. */
/* 0x10 */ u16 visited; /**< Shop has been visited flag. */
/* 0x12 */ u8 pad[2]; /**< Padding. */
} ShopData; /* 0x14 = 20 bytes */

#define SHOP_COUNT 20
Expand Down
97 changes: 70 additions & 27 deletions include/menushop.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,45 +23,88 @@ typedef struct {
} 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;
u8 type; /**< 0x0: item type. */
u8 flags; /**< 0x1: targeting and usability bitfield. */
u8 param1; /**< 0x2: type-dependent (heal amount, GF id, ability id, magazine start page). */
u8 param2; /**< 0x3: type-dependent (status mask, stat mask, compatibility amount, magazine end page). */
} MItemEntry; /* 0x4 = 4 bytes */

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;
u8 pad000[0xF];
u16 state; /**< 0x10: state machine current state (0-17) */
u8 pad12[0x8];
s16 unk1C;
u8 pad1D[0x3]; /**< 0x12 */
s32 field_20; /**< 0x20 */
s32 field_24; /**< 0x24 */
u32 gil; /**< 0x28: gil */
u8 *unk2C; /**< 0x2C: pointer to D_80077EBC */
union {
s32 unk30_s32;
s16 unk30_s16[2];
} union30; /* 0x30 */
s16 unk34; /* 0x34 */
u16 unk36; /* 0x36 */
u16 unk38; /* 0x38 */
s16 unk3A; /**< 0x3A: scroll offset. */
union {
s16 unk3C_s16[2];
s8 unk3C_s8[4];
} union3C; /* 0x3C */
u8 unk40; /**< 0x40: page start. */
u8 unk41; /**< 0x41: page end. */
s8 unk42; /* 0x42 */
u8 unk43; /* 0x43 */
u8 unk44; /* 0x44 */
u8 unk45; /* 0x45 */
u8 unk46; /**< 0x46: orientation (left if equals 0, right otherwise). */
s8 unk47; /* 0x47 */
u8 unk48; /* 0x48 */
u8 unk49; /**< 0x49: item count */
u8 unk4A; /* 0x4A */
u8 unk4B; /* 0x4B */
u16 unk4C; /* 0x4C */
u16 unk4E; /* 0x4E */
} ShopMenuState;

typedef struct {
u8 pad000[0x28];
s32 unk28; /**< 0x28: passed to drawColorByMenuPalette as 4th argument. */
} Struct_801E7508;
u16 unk0;
u8 unk2;
u8 unk3;
u8 unk4[8];
} Struct_func_801E7CFC; /* 12 bytes */

typedef struct {
u8 pad0[4];
u8 unk4;
u8 pad[7];
} Struct_func_801E7F4C; /* 12 bytes */

extern ShopData D_80077CC8[SHOP_COUNT]; /**< Shop data table. */
extern s32 D_80077E70;
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 Struct_func_801E7F4C D_8007C3B8[28];
extern u16 D_801E9B64[4]; /**< 8 bytes. */
extern u8 D_801E9B6C[52]; /**< 52 bytes. */
extern Struct_func_801E7CFC D_801E9BA0[33]; /**< 396 bytes. */
extern u8 D_801E9D2C[68]; /**< 68 bytes. */
extern ShopItemRarity D_801EA170[SHOP_COUNT][SHOP_ITEM_COUNT]; /**< Shop item rarity tables (shop.bin content). */
extern ShopItemPrice D_801EA3F0[ITEM_PRICE_COUNT]; /**< Item price table (price.bin content). */
extern MItemEntry D_801EA70C[199]; /**< Field-menu item table (mitem.bin content). */
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 u8 D_801EB150[8];
extern s32 D_801EB160;
extern s32 D_801EB260[];
extern s32 D_801EB2E4;
extern s32 D_801EB2E8;
extern u8 D_801F7F98[];
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 void func_801E5E90(ShopMenuState*);
extern s32 func_801E79D4(ShopMenuState*, s32, s32);
extern s32 func_801EFBB4(s32, s32, s32);
extern void* func_801E6FD8(void);
extern s32 func_801E6FD8(s32, s32, s32, s32, s32);

#endif /* MENUSHOP_H */
8 changes: 8 additions & 0 deletions include/menushop2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef MENUSHOP2_H
#define MENUSHOP2_H

#include "common.h"
#include "menu.h"
#include "menushop.h"

#endif /* MENUSHOP2_H */
Loading