From 265f8b5b259221dfa1a5fc5537059f262036eb52 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 30 Oct 2019 11:16:26 -0400 Subject: trade through sub_8053E1C; dynamic sys flags start idx --- include/constants/flags.h | 12 +++++++----- include/constants/region_map.h | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'include/constants') diff --git a/include/constants/flags.h b/include/constants/flags.h index 082e12f87..80eaca3e0 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1,7 +1,7 @@ #ifndef GUARD_CONSTANTS_FLAGS_H #define GUARD_CONSTANTS_FLAGS_H -// TODO: Get correct names and numbers +#include "constants/trainers.h" #define FLAG_TEMP_1 0x001 #define FLAG_TEMP_2 0x002 @@ -1309,10 +1309,12 @@ #define FLAG_TRAINER_FLAG_START 0x500 -#define TRAINERS_FLAG_NO 0x2E7 // 743 -#define TRAINER_FLAGS_WORDS 0x300 - -#define SYS_FLAGS (FLAG_TRAINER_FLAG_START + TRAINER_FLAGS_WORDS) // 0x800 +// Vanilla: SYS_FLAGS = 0x800 +#if (NUM_TRAINERS) & 31 +#define SYS_FLAGS (FLAG_TRAINER_FLAG_START + ((NUM_TRAINERS) + 31) / 32 * 32) +#else +#define SYS_FLAGS (FLAG_TRAINER_FLAG_START + (NUM_TRAINERS)) +#endif // SYSTEM FLAGS diff --git a/include/constants/region_map.h b/include/constants/region_map.h index 527acf2c9..0957a72ee 100644 --- a/include/constants/region_map.h +++ b/include/constants/region_map.h @@ -200,4 +200,6 @@ #define MAPSEC_SPECIAL_AREA 0xC4 #define MAPSEC_NONE 0xC5 +#define MAPSEC_IN_GAME_TRADE 0xFE + #endif //GUARD_CONSTANTS_REGION_MAP_H -- cgit v1.2.3 From 2c2c179eb9b92d0998922cc96a115d3d1671a64b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 30 Oct 2019 12:49:16 -0400 Subject: Finish trade code --- include/constants/flags.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/constants') diff --git a/include/constants/flags.h b/include/constants/flags.h index 80eaca3e0..bd356064c 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1310,11 +1310,7 @@ #define FLAG_TRAINER_FLAG_START 0x500 // Vanilla: SYS_FLAGS = 0x800 -#if (NUM_TRAINERS) & 31 #define SYS_FLAGS (FLAG_TRAINER_FLAG_START + ((NUM_TRAINERS) + 31) / 32 * 32) -#else -#define SYS_FLAGS (FLAG_TRAINER_FLAG_START + (NUM_TRAINERS)) -#endif // SYSTEM FLAGS -- cgit v1.2.3