diff --git a/include/debug_mode.h b/include/debug_mode.h index 5430f21..7cb55f1 100644 --- a/include/debug_mode.h +++ b/include/debug_mode.h @@ -1,17 +1,20 @@ #ifndef DEBUG_MODE_H #define DEBUG_MODE_H +#define VERSION "v1.0.3 D" + #define DEBUG_MODE false #define IGNORE_GAME_PAK true -#define IGNORE_LINK_CABLE true +#define IGNORE_LINK_CABLE false #define IGNORE_MG_E4_FLAGS true #define IGNORE_UNRECEIVED_PKMN true #define FORCE_TUTORIAL false #define DONT_REMOVE_PKMN false #define SHOW_INVALID_PKMN false #define IGNORE_DEX_COMPLETION false +#define WRITE_CABLE_DATA_TO_SAVE true -#define DEBUG_GAME RUBY_ID +#define DEBUG_GAME EMERALD_ID #define DEBUG_VERS VERS_1_0 #define DEBUG_LANG LANG_ENG diff --git a/include/pokemon_party.h b/include/pokemon_party.h index 8a8bb3d..8f68550 100644 --- a/include/pokemon_party.h +++ b/include/pokemon_party.h @@ -30,9 +30,9 @@ public: int get_game_gen(); int get_num_pkmn(); bool get_contains_invalid(); + byte box_data_array[0x462]; private: - byte box_data_array[0x462]; int last_error; bool has_new_pkmn = false; bool contains_mythical = false; diff --git a/source/main.cpp b/source/main.cpp index 544ec59..b7b6b3b 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -273,6 +273,9 @@ int credits() tte_write(std::to_string(tutorial).c_str()); tte_write("-"); tte_write((n2hexstr(def_lang)).c_str()); + + tte_write("\n\n"); + tte_write(VERSION); while (true) { if (key_hit(KEY_B)) diff --git a/source/mystery_gift_injector.cpp b/source/mystery_gift_injector.cpp index 1d962b8..ac4c84a 100644 --- a/source/mystery_gift_injector.cpp +++ b/source/mystery_gift_injector.cpp @@ -116,7 +116,17 @@ bool inject_mystery(Pokemon_Party &incoming_box_data) update_memory_buffer_checksum(false); erase_sector(0x1E000); - copy_ram_to_save(&global_memory_buffer[0], 0x1E000, 0x1000); + if (WRITE_CABLE_DATA_TO_SAVE) + { + for (int i = 0; i < 1122; i++) + { + global_memory_buffer[i] = incoming_box_data.box_data_array[i]; + } + for (int i = 0; i < 0x1000 - 1122; i++){ + global_memory_buffer[i + 1122] = 0xAA; + } + } + copy_ram_to_save(&global_memory_buffer[0], 0x0000, 0x1000); // Set flags int memory_section = 1 + ((curr_rom.offset_flags + (curr_rom.unused_flag_start / 8)) / 0xF80); // This sets the correct memory section, since flags stretch between section 1 and 2.