Skip to content

Commit

Permalink
Document Sunyshore Market data
Browse files Browse the repository at this point in the history
  • Loading branch information
Nomura-RH committed Sep 26, 2023
1 parent 8e5447b commit 81cff13
Show file tree
Hide file tree
Showing 3 changed files with 218 additions and 115 deletions.
102 changes: 102 additions & 0 deletions include/constants/seals.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#ifndef POKEPLATINUM_CONSTANTS_SEALS_H
#define POKEPLATINUM_CONSTANTS_SEALS_H

enum {
SEAL_DUMMY,

HEART_SEAL_A,
HEART_SEAL_B,
HEART_SEAL_C,
HEART_SEAL_D,
HEART_SEAL_E,
HEART_SEAL_F,

STAR_SEAL_A,
STAR_SEAL_B,
STAR_SEAL_C,
STAR_SEAL_D,
STAR_SEAL_E,
STAR_SEAL_F,

LINE_SEAL_A,
LINE_SEAL_B,
LINE_SEAL_C,
LINE_SEAL_D,

SMOKE_SEAL_A,
SMOKE_SEAL_B,
SMOKE_SEAL_C,
SMOKE_SEAL_D,

ELE_SEAL_A,
ELE_SEAL_B,
ELE_SEAL_C,
ELE_SEAL_D,

FOAMY_SEAL_A,
FOAMY_SEAL_B,
FOAMY_SEAL_C,
FOAMY_SEAL_D,

FIRE_SEAL_A,
FIRE_SEAL_B,
FIRE_SEAL_C,
FIRE_SEAL_D,

PARTY_SEAL_A,
PARTY_SEAL_B,
PARTY_SEAL_C,
PARTY_SEAL_D,

FLORA_SEAL_A,
FLORA_SEAL_B,
FLORA_SEAL_C,
FLORA_SEAL_D,
FLORA_SEAL_E,
FLORA_SEAL_F,

SONG_SEAL_A,
SONG_SEAL_B,
SONG_SEAL_C,
SONG_SEAL_D,
SONG_SEAL_E,
SONG_SEAL_F,
SONG_SEAL_G,

// Alphabet
A_SEAL,
B_SEAL,
C_SEAL,
D_SEAL,
E_SEAL,
F_SEAL,
G_SEAL,
H_SEAL,
I_SEAL,
J_SEAL,
K_SEAL,
L_SEAL,
M_SEAL,
N_SEAL,
O_SEAL,
P_SEAL,
Q_SEAL,
R_SEAL,
S_SEAL,
T_SEAL,
U_SEAL,
V_SEAL,
W_SEAL,
X_SEAL,
Y_SEAL,
Z_SEAL,
SHOCK_SEAL,
MYSTERY_SEAL,

// Unused
LIQUID_SEAL,
BURST_SEAL,
TWINKLE_SEAL
};

#endif // POKEPLATINUM_CONSTANTS_SEALS_H
114 changes: 113 additions & 1 deletion include/data/mart_items.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include "constants/items.h"
#include "constants/seals.h"

typedef struct {
u16 itemID;
u16 unk_02;
u16 requiredBadges;
} PokeMartCommonItem;

const PokeMartCommonItem PokeMartCommonItems[] = {
Expand Down Expand Up @@ -233,4 +234,115 @@ const u16 *PokeMartSpecialties[] = {
SunyshoreMartSpecialties,
PokemonLeagueMartSpecialties,
VeilstoneDeptStoreStock_B1F_DOWN_LEFT
};

const u16 VeilstoneDeptStoreStock_4F_UP[] = {
0x7,
0x16,
0x19,
0x1A,
0x1B,
0xffff
};

const u16 VeilstoneDeptStoreStock_4F_DOWN[] = {
0x73,
0x74,
0x75,
0x77,
0x78,
0x79,
0xffff
};

const u16 *VeilstoneDeptStoreDecorationStocks[] = {
VeilstoneDeptStoreStock_4F_UP,
VeilstoneDeptStoreStock_4F_DOWN
};

const u16 SunyshoreMarketStockMonday[] = {
HEART_SEAL_A,
STAR_SEAL_B,
FIRE_SEAL_A,
SONG_SEAL_A,
LINE_SEAL_C,
ELE_SEAL_B,
PARTY_SEAL_D,
0xffff
};

const u16 SunyshoreMarketStockTuesday[] = {
HEART_SEAL_B,
STAR_SEAL_C,
FIRE_SEAL_B,
FLORA_SEAL_A,
SONG_SEAL_B,
LINE_SEAL_D,
ELE_SEAL_C,
0xffff
};

const u16 SunyshoreMarketStockWednesday[] = {
HEART_SEAL_C,
STAR_SEAL_D,
FIRE_SEAL_C,
FLORA_SEAL_B,
SONG_SEAL_C,
SMOKE_SEAL_A,
ELE_SEAL_D,
0xffff
};

const u16 SunyshoreMarketStockThursday[] = {
HEART_SEAL_D,
FOAMY_SEAL_A,
FIRE_SEAL_D,
FLORA_SEAL_C,
SONG_SEAL_D,
STAR_SEAL_E,
SMOKE_SEAL_B,
0xffff
};

const u16 SunyshoreMarketStockFriday[] = {
FOAMY_SEAL_B,
PARTY_SEAL_A,
FLORA_SEAL_D,
SONG_SEAL_E,
HEART_SEAL_E,
STAR_SEAL_F,
SMOKE_SEAL_C,
0xffff
};

const u16 SunyshoreMarketStockSaturday[] = {
FOAMY_SEAL_C,
PARTY_SEAL_B,
FLORA_SEAL_E,
SONG_SEAL_F,
HEART_SEAL_F,
LINE_SEAL_A,
SMOKE_SEAL_D,
0xffff
};

const u16 SunyshoreMarketStockSunday[] = {
STAR_SEAL_A,
SONG_SEAL_G,
FOAMY_SEAL_D,
FLORA_SEAL_F,
LINE_SEAL_B,
ELE_SEAL_A,
PARTY_SEAL_C,
0xffff
};

const u16 *SunyshoreMarketDailyStocks[] = {
SunyshoreMarketStockMonday,
SunyshoreMarketStockTuesday,
SunyshoreMarketStockWednesday,
SunyshoreMarketStockThursday,
SunyshoreMarketStockFriday,
SunyshoreMarketStockSaturday,
SunyshoreMarketStockSunday
};
117 changes: 3 additions & 114 deletions src/unk_02046AD4.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,117 +15,6 @@

#include "data/mart_items.h"

const u16 Unk_020EB9F0[] = {
0x7,
0x16,
0x19,
0x1A,
0x1B,
0xffff
};

const u16 Unk_020EBA0A[] = {
0x73,
0x74,
0x75,
0x77,
0x78,
0x79,
0xffff
};

const u16 *Unk_02100AF8[] = {
Unk_020EB9F0,
Unk_020EBA0A
};

const u16 Unk_020EBA76[] = {
0x1,
0x8,
0x1D,
0x2B,
0xF,
0x16,
0x24,
0xffff
};

const u16 Unk_020EBA26[] = {
0x2,
0x9,
0x1E,
0x25,
0x2C,
0x10,
0x17,
0xffff
};

const u16 Unk_020EBA36[] = {
0x3,
0xA,
0x1F,
0x26,
0x2D,
0x11,
0x18,
0xffff
};

const u16 Unk_020EBA56[] = {
0x4,
0x19,
0x20,
0x27,
0x2E,
0xB,
0x12,
0xffff
};

const u16 Unk_020EBA86[] = {
0x1A,
0x21,
0x28,
0x2F,
0x5,
0xC,
0x13,
0xffff
};

const u16 Unk_020EBA46[] = {
0x1B,
0x22,
0x29,
0x30,
0x6,
0xD,
0x14,
0xffff
};

const u16 Unk_020EBA96[] = {
0x7,
0x31,
0x1C,
0x2A,
0xE,
0x15,
0x23,
0xffff
};

const u16 *Unk_02100B00[] = {
Unk_020EBA76,
Unk_020EBA26,
Unk_020EBA36,
Unk_020EBA56,
Unk_020EBA86,
Unk_020EBA46,
Unk_020EBA96
};

BOOL sub_02046AD4 (UnkStruct_0203E724 * param0)
{
u16 v0[64];
Expand Down Expand Up @@ -170,7 +59,7 @@ BOOL sub_02046AD4 (UnkStruct_0203E724 * param0)
}

for (v4 = 0; v4 < (NELEMS(PokeMartCommonItems)); v4++) {
if (v1 >= PokeMartCommonItems[v4].unk_02) {
if (v1 >= PokeMartCommonItems[v4].requiredBadges) {
v0[v3] = PokeMartCommonItems[v4].itemID;
v3++;
}
Expand Down Expand Up @@ -208,15 +97,15 @@ BOOL sub_02046BF4 (UnkStruct_0203E724 * param0)
v1 = 0;
}

ov7_0224CDA4(param0->unk_28, param0->unk_34, (u16 *)Unk_02100AF8[v0], 1, v1);
ov7_0224CDA4(param0->unk_28, param0->unk_34, (u16 *)VeilstoneDeptStoreDecorationStocks[v0], 1, v1);
return 1;
}

BOOL sub_02046C34 (UnkStruct_0203E724 * param0)
{
u16 v0 = inline_02049538(param0);

ov7_0224CDA4(param0->unk_28, param0->unk_34, (u16 *)Unk_02100B00[v0], 2, 0);
ov7_0224CDA4(param0->unk_28, param0->unk_34, (u16 *)SunyshoreMarketDailyStocks[v0], 2, 0);
return 1;
}

Expand Down

0 comments on commit 81cff13

Please sign in to comment.