diff --git a/include/save_data_manager.h b/include/save_data_manager.h index b5d6a4a..8c22d28 100644 --- a/include/save_data_manager.h +++ b/include/save_data_manager.h @@ -4,9 +4,23 @@ #include #define HALL_OF_FAME 0x01C000 -#define MYSTERY_GIFT 0x01E000 #define HOF_SECTION 2032 +// Data map: +//There are 1936 (0x790) unused bytes starting at 0x1D7F0 + + //| Offset | Size | Contents + //-------------------------- +#define TUTORIAL_FLAG 1 //| 0x1 | 1 | Has made it through the tutorial +#define CAUGHT_DATA 2 //| 0x2 | 31 | Flags for each Pokemon species +#define TRANSFERED_FLAGS 33 //| 0x21 | 6 | Flags for if a Pokemon has been transfered in by the player +#define PKMN1_DATA 39 //| 0x27 | 100 | Data for Pokemon #1 +#define PKMN2_DATA 139 //| 0x8B | 100 | Data for Pokemon #2 +#define PKMN3_DATA 239 //| 0x8F | 100 | Data for Pokemon #3 +#define PKMN4_DATA 339 //| 0x153 | 100 | Data for Pokemon #4 +#define PKMN5_DATA 439 //| 0x1B7 | 100 | Data for Pokemon #5 +#define PKMN6_DATA 539 //| 0x21B | 100 | Data for Pokemon #6 + void load_save_data(); void write_save_data(); bool is_caught(int dex_num); diff --git a/source/main.cpp b/source/main.cpp index 6dec5a5..c1b1aca 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -210,6 +210,9 @@ int main(void) // Set up blend to fade to white/black inject_mystery(); + set_caught(3); + set_caught(15); + set_caught(5); // MAIN LOOP while (1) diff --git a/source/save_data_manager.cpp b/source/save_data_manager.cpp index c4443ff..f393ff7 100644 --- a/source/save_data_manager.cpp +++ b/source/save_data_manager.cpp @@ -12,20 +12,12 @@ void write_save_data(){ } bool is_caught(int dex_num){ - return (((global_memory_buffer[HOF_SECTION + (dex_num / 8)]) >> dex_num % 8) & 1); + return (((global_memory_buffer[HOF_SECTION + CAUGHT_DATA + (dex_num / 8)]) >> dex_num % 8) & 1); } void set_caught(int dex_num){ load_save_data(); - global_memory_buffer[HOF_SECTION + (dex_num / 8)] = global_memory_buffer[HOF_SECTION + (dex_num / 8)] | (1 << (dex_num % 8)); + global_memory_buffer[HOF_SECTION + CAUGHT_DATA + (dex_num / 8)] = global_memory_buffer[HOF_SECTION + CAUGHT_DATA + (dex_num / 8)] | (1 << (dex_num % 8)); write_save_data(); } -/* Data map: - -Byte 0: Has made it through the tutorial -0 - 31: Caught data - - - -*/ \ No newline at end of file