Move trade data, some trade.c clean up documentation

This commit is contained in:
GriffinR 2019-10-03 01:16:22 -04:00
parent 48e54ae387
commit c3c8fb40cf
13 changed files with 1377 additions and 1340 deletions

View File

@ -27,6 +27,7 @@
#include "constants/secret_bases.h"
#include "constants/songs.h"
#include "constants/species.h"
#include "constants/trade.h"
#include "constants/trainer_hill.h"
#include "constants/trainers.h"
#include "constants/vars.h"

View File

@ -5,7 +5,7 @@ BattleFrontier_Lounge6_EventScript_264FED:: @ 8264FED
lock
faceplayer
goto_if_set FLAG_BATTLE_FRONTIER_TRADE_DONE, BattleFrontier_Lounge6_EventScript_265083
setvar VAR_0x8008, 3
setvar VAR_0x8008, INGAME_TRADE_MEOWTH
copyvar VAR_0x8004, VAR_0x8008
specialvar VAR_RESULT, GetInGameTradeSpeciesInfo
copyvar VAR_0x8009, VAR_RESULT

View File

@ -5,7 +5,7 @@ FortreeCity_House1_EventScript_2162BB:: @ 82162BB
lock
faceplayer
goto_if_set FLAG_FORTREE_NPC_TRADE_COMPLETED, FortreeCity_House1_EventScript_216355
setvar VAR_0x8008, 1
setvar VAR_0x8008, INGAME_TRADE_PLUSLE
copyvar VAR_0x8004, VAR_0x8008
specialvar VAR_RESULT, GetInGameTradeSpeciesInfo
copyvar VAR_0x8009, VAR_RESULT

View File

@ -5,7 +5,7 @@ PacifidlogTown_House3_EventScript_203C11:: @ 8203C11
lock
faceplayer
goto_if_set FLAG_PACIFIDLOG_NPC_TRADE_COMPLETED, PacifidlogTown_House3_EventScript_203CAB
setvar VAR_0x8008, 2
setvar VAR_0x8008, INGAME_TRADE_HORSEA
copyvar VAR_0x8004, VAR_0x8008
specialvar VAR_RESULT, GetInGameTradeSpeciesInfo
copyvar VAR_0x8009, VAR_RESULT

View File

@ -5,7 +5,7 @@ RustboroCity_House1_EventScript_21593F:: @ 821593F
lock
faceplayer
goto_if_set FLAG_RUSTBORO_NPC_TRADE_COMPLETED, RustboroCity_House1_EventScript_2159D5
setvar VAR_0x8008, 0
setvar VAR_0x8008, INGAME_TRADE_SEEDOT
copyvar VAR_0x8004, VAR_0x8008
specialvar VAR_RESULT, GetInGameTradeSpeciesInfo
copyvar VAR_0x8009, VAR_RESULT

13
include/constants/trade.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef GUARD_CONSTANTS_TRADE_H
#define GUARD_CONSTANTS_TRADE_H
#define TRADE_PLAYER 0
#define TRADE_PARTNER 1
#define TRADE_PARTICIPANT_COUNT 2
#define INGAME_TRADE_SEEDOT 0
#define INGAME_TRADE_PLUSLE 1
#define INGAME_TRADE_HORSEA 2
#define INGAME_TRADE_MEOWTH 3
#endif //GUARD_CONSTANTS_TRADE_H

View File

@ -4848,13 +4848,13 @@ extern const u32 gCableCarCord_Gfx[];
extern const u16 gCableCar_Pal[];
// Trade
extern const u16 gUnknown_08DDB3E4[];
extern const u8 gUnknown_08DDB464[];
extern const u16 gTradeMenu_Pal[];
extern const u8 gTradeMenu_Gfx[];
extern const u16 gUnknown_08DDCF04[];
extern const u16 gTradeGba2_Pal[];
extern const u8 gTradeGba_Gfx[];
extern const u16 gUnknown_08DDD704[];
extern const u8 gUnknown_08DDC6E4[];
extern const u8 gTradeButtons_Gfx[];
extern const u16 gUnknown_08DDB444[];
// Party menu

View File

@ -7,7 +7,7 @@
// Exported RAM declarations
extern struct MailStruct gUnknown_020321C0[PARTY_SIZE];
extern u8 gUnknown_02032298[2];
extern u8 gSelectedTradeMonPositions[2];
// Exported ROM declarations
extern const struct WindowTemplate gUnknown_0833900C;

View File

@ -1084,8 +1084,8 @@ static void sub_80B37FC(u8 taskId)
task->data[0]++;
break;
case 2:
gUnknown_02032298[0] = 0;
gUnknown_02032298[1] = 0;
gSelectedTradeMonPositions[0] = 0;
gSelectedTradeMonPositions[1] = 0;
m4aMPlayAllStop();
sub_800AC34();
task->data[0]++;
@ -1117,8 +1117,8 @@ static void sub_80B3894(u8 taskId)
data[0]++;
break;
case 2:
gUnknown_02032298[0] = 0;
gUnknown_02032298[1] = 0;
gSelectedTradeMonPositions[0] = 0;
gSelectedTradeMonPositions[1] = 0;
m4aMPlayAllStop();
sub_800ADF8();
data[0]++;

1186
src/data/trade.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1518,13 +1518,10 @@ asm(".space 0x20"); //blank palette??
// more trade stuff?
const u16 gUnknown_08DDB3E4[] = INCBIN_U16("graphics/trade/menu.gbapal");
const u16 gTradeMenu_Pal[] = INCBIN_U16("graphics/trade/menu.gbapal");
const u16 gUnknown_08DDB444[] = INCBIN_U16("graphics/unknown/unknown_DDB444.gbapal");
const u8 gUnknown_08DDB464[] = INCBIN_U8("graphics/trade/menu.4bpp");
const u8 gUnknown_08DDC6E4[] = INCBIN_U8("graphics/trade/buttons.4bpp");
const u8 gTradeMenu_Gfx[] = INCBIN_U8("graphics/trade/menu.4bpp");
const u8 gTradeButtons_Gfx[] = INCBIN_U8("graphics/trade/buttons.4bpp");
const u16 gUnused_DDCEE4[] = INCBIN_U16("graphics/unused/unused_DDCEE4.bin");

File diff suppressed because it is too large Load Diff

View File

@ -2347,8 +2347,8 @@ void sub_8013F90(u8 taskId)
{
memcpy(gUnknown_020321C0, gBlockRecvBuffer[GetMultiplayerId() ^ 1], sizeof(struct MailStruct) * PARTY_SIZE);
ResetBlockReceivedFlags();
gUnknown_02032298[0] = monId;
gUnknown_02032298[1] = 6;
gSelectedTradeMonPositions[0] = monId;
gSelectedTradeMonPositions[1] = PARTY_SIZE;
gMain.savedCallback = CB2_ReturnToField;
SetMainCallback2(sub_807AE50);
sub_801807C(&gUnknown_02022C40);