diff --git a/include/debug_mode.h b/include/debug_mode.h index da1355e..e84b77f 100644 --- a/include/debug_mode.h +++ b/include/debug_mode.h @@ -6,7 +6,7 @@ #define IGNORE_LINK_CABLE true #define IGNORE_MG_E4_FLAGS 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/mystery_gift_builder.h b/include/mystery_gift_builder.h index 8804f6b..727d53e 100644 --- a/include/mystery_gift_builder.h +++ b/include/mystery_gift_builder.h @@ -9,13 +9,17 @@ #include "debug_mode.h" #include "save_data_manager.h" #include "script_var.h" +#include "pokemon_data.h" #define VIR_ADDRESS 0x08000000 #define MG_SCRIPT_SIZE 0x3E8 #define NPC_LOCATION_OFFSET 0x4 #define READ_AS_THUMB 0x1 -#define FLAG_ID_START 0x21 // This one stays consistant, at least for FRLG/E. Must also be 8x or 8x+1 to store in one byte +#define FLAG_ID_START 0x21 + + + #define VAR_ID_START 0x8000 // This one should also stay consistant #define VIRTUAL_ADDRESS 0x08000000 // This will also stay constant @@ -73,13 +77,12 @@ public: u8 get_script_value_at(int index); u32 calc_checksum32(); u16 calc_crc16(); - bool validity_array[30]; + bool validity_array[MAX_PKMN_IN_BOX]; + int dex_array[MAX_PKMN_IN_BOX]; private: void add_command(int len); u16 rev_endian(u16 num); - void insert_textboxes(); - void fill_textbox_pointers(); void add_asm(u16 command); void init_npc_location(u8 bank, u8 map, u8 npc); void add_word(u32 word); @@ -92,8 +95,7 @@ private: void faceplayer(); void checkflag(u8 flag_id); void virtualgotoif(u8 condition, u32 location); - void virtualmsgbox(u8 textbox_id); - void virtualmsgbox2(u32 location); + void virtualmsgbox(u32 location); void waitmsg(); void waitkeypress(); void setvar(u16 var_id, u16 value); diff --git a/include/pokemon_data.h b/include/pokemon_data.h index 0817943..a95ebd1 100644 --- a/include/pokemon_data.h +++ b/include/pokemon_data.h @@ -28,6 +28,8 @@ #define SILVER_ID 5 #define CRYSTAL_ID 6 +#define MAX_PKMN_IN_BOX 6 + extern const u8 EXP_MAX[252]; extern const u32 EXP_TYPES[6]; diff --git a/include/pokemon_party.h b/include/pokemon_party.h index 2ec18a3..722c73c 100644 --- a/include/pokemon_party.h +++ b/include/pokemon_party.h @@ -16,14 +16,11 @@ public: bool get_has_new_pkmn(); void set_game(int nGame); void set_lang(int nLang); - int get_num_pkmn(); - int get_dex_num(int index); private: byte box_data_array[0x462]; int last_error; - int num_pokemon; bool has_new_pkmn; int game; char lang; diff --git a/include/rom_data.h b/include/rom_data.h index 30e6e51..46773a8 100644 --- a/include/rom_data.h +++ b/include/rom_data.h @@ -38,6 +38,8 @@ public: int loc_gSaveBlock1; // Only used in R/S int loc_gSaveBlock1PTR; // Only used in FR/LG/E int loc_setPokedexFlag; + int loc_gSaveDataBuffer; // The location of the saveDataBuffer + int loc_readFlashSector; int offset_ramscript; // Ramscript offset as found within the SaveBlock1 struct in global.h int offset_flags; // Flag offset as found within the SaveBlock1 struct in global.h int offset_wondercard; diff --git a/source/mystery_gift_builder.cpp b/source/mystery_gift_builder.cpp index 74c6490..b264b8f 100644 --- a/source/mystery_gift_builder.cpp +++ b/source/mystery_gift_builder.cpp @@ -20,13 +20,13 @@ int var_dex_num = (VAR_ID_START + 0x08); int var_index = (VAR_ID_START + 0x09); int var_pkmn_offset = (VAR_ID_START + 0x0A); -int flag_pkmn_1 = (FLAG_ID_START + 0x0); -int flag_pkmn_2 = (FLAG_ID_START + 0x1); -int flag_pkmn_3 = (FLAG_ID_START + 0x2); -int flag_pkmn_4 = (FLAG_ID_START + 0x3); -int flag_pkmn_5 = (FLAG_ID_START + 0x4); -int flag_pkmn_6 = (FLAG_ID_START + 0x5); -int flag_all_collected = (FLAG_ID_START + 0x6); +//int flag_pkmn_1 = (FLAG_ID_START + 0x0); +//int flag_pkmn_2 = (FLAG_ID_START + 0x1); +//int flag_pkmn_3 = (FLAG_ID_START + 0x2); +//int flag_pkmn_4 = (FLAG_ID_START + 0x3); +//int flag_pkmn_5 = (FLAG_ID_START + 0x4); +//int flag_pkmn_6 = (FLAG_ID_START + 0x5); +int flag_all_collected = (FLAG_ID_START + 6); // These will all be set based on the ROM pointers /* @@ -93,10 +93,14 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) asm_var setPokedexFlag_ptr(curr_rom.loc_setPokedexFlag + READ_AS_THUMB, asm_variable_list, &curr_index); asm_var dexSeenCaught_ptr(ptr_dex_seen_caught, asm_variable_list, &curr_index); asm_var currPkmnIndex_ptr(ptr_index, asm_variable_list, &curr_index); - asm_var pkmnStruct(asm_variable_list, &curr_index); - asm_var dexStruct(asm_variable_list, &curr_index); + asm_var pkmnStruct(curr_rom.loc_gSaveDataBuffer, asm_variable_list, &curr_index); + asm_var dexStruct(curr_rom.loc_gSaveDataBuffer + (MAX_PKMN_IN_BOX * POKEMON_SIZE), asm_variable_list, &curr_index); + asm_var flashBuffer_ptr(curr_rom.loc_gSaveDataBuffer, asm_variable_list, &curr_index); + asm_var readFlashSector_ptr(curr_rom.loc_readFlashSector + READ_AS_THUMB, asm_variable_list, &curr_index); xse_var mainAsmStart(asm_variable_list, &curr_index); xse_var dexAsmStart(asm_variable_list, &curr_index); + xse_var readFlashStart(asm_variable_list, &curr_index); + xse_var jumpLoop(asm_variable_list, &curr_index); xse_var jumpBoxFull(asm_variable_list, &curr_index); xse_var jumpPkmnCollected(asm_variable_list, &curr_index); @@ -128,7 +132,7 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) faceplayer(); // Have the NPC face the player checkflag(flag_all_collected); // Check if the "all collected" flag has been set virtualgotoif(COND_FLAGTRUE, jumpAllCollected.add_reference(2)); // If "all collected" is true, then jump to the "thank you" text - virtualmsgbox2(textGreet.add_reference(1)); // Otherwise, greet the player + virtualmsgbox(textGreet.add_reference(1)); // Otherwise, greet the player waitmsg(); // Wait for the message to finish waitkeypress(); // Wait for the player to press A/B setvar(var_index, 0); // set the index to 0 @@ -147,7 +151,7 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) copybyte(ptr_script_ptr_high + 1, ptr_block_ptr_high + 1); // Copy the fourth byte of the saveblock1ptr to a variable } // addvar(var_script_ptr_low, curr_rom.offset_ramscript + 8 + READ_AS_THUMB); // add the offset for ramscript, plus 8. 8 is for the 8 bytes of Checksum, padding and NPC info - addvar(var_script_ptr_low, mainAsmStart.add_reference(3)); // Add the offset for the start of ASM + addvar(var_script_ptr_low, readFlashStart.add_reference(3)); // Add the offset for the start of ASM setvar(var_call_return_1, rev_endian(0x0300)); // Set the vairable to 0x03. 0x03 = RETURN setvar(var_call_check_flag, rev_endian(0x2B00)); // Set the variable to 0x2B. 0x2B = CHECK FLAG addvar(var_call_check_flag, rev_endian(FLAG_ID_START)); // Add the starting flag ID to the check flag ASM variable @@ -155,51 +159,68 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) jumpLoop.set_start(); // Set the jump destination for the JUMP_LOOP call(ptr_call_check_flag); // Call the check flag ASM virtualgotoif(COND_FLAGFALSE, jumpPkmnCollected.add_reference(2)); // If the "pokemon collected" flag is false, jump to the end of the loop - call(ptr_callASM); // Call SendMonToPC ASM - compare(var_box_return, 2); // Compare the resulting return to #2 - virtualgotoif(COND_EQUALS, jumpBoxFull.add_reference(2)); // If the return value was #2, jump to the box full message - addvar(var_script_ptr_low, dexAsmStart.add_reference(3, &mainAsmStart)); // add to the CallASM offset so that it points to PTR_DEX_START instead - setvar(var_dex_seen_caught, 2); // set the seen caught variable to 2, so that the Pokemon is set to "seen" - call(ptr_callASM); // call "PTR_DEX_START" - addvar(var_dex_seen_caught, 1); // add 1 to the seen caught variable so that the Pokemon will be "Caught" - call(ptr_callASM); // Call "PTR_DEX_START" again - subvar(var_script_ptr_low, dexAsmStart.add_reference(3, &mainAsmStart)); // subtract from the CallASM offset so that it points to CALL_ASM again - jumpPkmnCollected.set_start(); // Set the jump destination for if the Pokemon has already been collected - addvar(var_pkmn_offset, POKEMON_SIZE); // Add the size of one Pokmeon to the Pokemon offset - addvar(var_index, 1); // Add one to the index - addvar(var_call_check_flag, rev_endian(1)); // Add one to the flag index - compare(var_index, 6); // Compare the index to 6 - virtualgotoif(COND_LESSTHAN, jumpLoop.add_reference(2)); // if index is less than six, jump to the start of the loop - setflag(flag_all_collected); // Set the "all collected" flag - fanfare(0xA4); // Play the received fanfare - virtualmsgbox2(textReceived.add_reference(1)); // Display the recieved text - waitfanfare(); // Wait for the fanfare - waitmsg(); // Wait for the text to finish - waitkeypress(); // Wait for the player to press A/B - jumpAllCollected.set_start(); // Set the destination for if all the Pokemon have already been collected - virtualmsgbox2(textThank.add_reference(1)); // Display the thank test - waitmsg(); // Wait for the message - waitkeypress(); // Wait for the player to press A/B - release(); // Release the player - killscript(); // Erase RAMscript - jumpBoxFull.set_start(); // Set the destination for if the box is full - virtualmsgbox2(textPCFull.add_reference(1)); // Display the full box message - waitmsg(); // Wait for the message - waitkeypress(); // Wait for the player to presse A/B - release(); // Release the player - end(); // End the script + call(ptr_callASM); // Call readFlash ASM + addvar(var_script_ptr_low, mainAsmStart.add_reference(3, &readFlashStart)); + + call(ptr_callASM); // Call SendMonToPC ASM + compare(var_box_return, 2); // Compare the resulting return to #2 + virtualgotoif(COND_EQUALS, jumpBoxFull.add_reference(2)); // If the return value was #2, jump to the box full message + addvar(var_script_ptr_low, dexAsmStart.add_reference(3, &mainAsmStart)); // add to the CallASM offset so that it points to PTR_DEX_START instead + setvar(var_dex_seen_caught, 2); // set the seen caught variable to 2, so that the Pokemon is set to "seen" + call(ptr_callASM); // call "PTR_DEX_START" + addvar(var_dex_seen_caught, 1); // add 1 to the seen caught variable so that the Pokemon will be "Caught" + call(ptr_callASM); // Call "PTR_DEX_START" again + subvar(var_script_ptr_low, dexAsmStart.add_reference(3, &mainAsmStart)); // subtract from the CallASM offset so that it points to CALL_ASM again + subvar(var_script_ptr_low, mainAsmStart.add_reference(3, &readFlashStart)); + jumpPkmnCollected.set_start(); // Set the jump destination for if the Pokemon has already been collected + addvar(var_pkmn_offset, POKEMON_SIZE); // Add the size of one Pokmeon to the Pokemon offset + addvar(var_index, 1); // Add one to the index + addvar(var_call_check_flag, rev_endian(1)); // Add one to the flag index + compare(var_index, MAX_PKMN_IN_BOX); // Compare the index to 30 + virtualgotoif(COND_LESSTHAN, jumpLoop.add_reference(2)); // if index is less than six, jump to the start of the loop + setflag(flag_all_collected); // Set the "all collected" flag + fanfare(0xA4); // Play the received fanfare + virtualmsgbox(textReceived.add_reference(1)); // Display the recieved text + waitfanfare(); // Wait for the fanfare + waitmsg(); // Wait for the text to finish + waitkeypress(); // Wait for the player to press A/B + jumpAllCollected.set_start(); // Set the destination for if all the Pokemon have already been collected + virtualmsgbox(textThank.add_reference(1)); // Display the thank test + waitmsg(); // Wait for the message + waitkeypress(); // Wait for the player to press A/B + release(); // Release the player + killscript(); // Erase RAMscript + jumpBoxFull.set_start(); // Set the destination for if the box is full + virtualmsgbox(textPCFull.add_reference(1)); // Display the full box message + waitmsg(); // Wait for the message + waitkeypress(); // Wait for the player to presse A/B + release(); // Release the player + end(); // End the script textGreet.insert_text(mg_script); textThank.insert_text(mg_script); textPCFull.insert_text(mg_script); textReceived.insert_text(mg_script); - four_align(); // Align the code so that it is byte aligned - // - mainAsmStart.set_start(); // Set the memory pointer location for ASM start - push(rlist_lr); // save the load register to the stack - ldr3(r3, curr_pkmn_index_ptr.add_reference()); // set r3 to the pointer to the pokemon offset variable - ldr1(r3, r3, 0); // set r3 to the value in memory r3 points to - add5(r0, pkmnStruct.add_reference()); // set r0 to a pointer 28 bytes ahead, which is the start of the Pokemon struct. + four_align(); // Align the code so that it is byte aligned + + readFlashStart.set_start(); + push(rlist_lr); // save the load register to the stack + mov1(r0, 30); // set r0 to 30 (the sector ID for eReader data) + ldr3(r1, flashBuffer_ptr.add_reference()); + ldr3(r2, readFlashSector_ptr.add_reference()); // set r2 to the location of "readFlashSector" plus one, since it is thumb code + mov3(r3, r15); // move r15 (the program counter) to r3 + add2(r3, 5); // add 5 to r3 to compensate for the four following bytes, plus to tell the system to read as thumb code + mov3(r14, r3); // move r3 into r14 (the load register) + bx(r2); // jump to the pointer stored in r2 (readFlashSector) + pop(rlist_r0); // remove r0 from the stack and put it into r0 + bx(r0); + // + mainAsmStart.set_start(); // Set the memory pointer location for ASM start + push(rlist_lr); // save the load register to the stack + ldr3(r3, curr_pkmn_index_ptr.add_reference()); // set r3 to the pointer to the pokemon index variable + ldr1(r3, r3, 0); // set r3 to the value in memory r3 points to + add5(r0, pkmnStruct.add_reference()); // set r0 to a pointer to the start of the Pokemon struct. + ldr1(r0, r0, 0); add3(r0, r0, r3); // add r3 to r0, giving it the correct offset for the current index ldr3(r1, sendMonToPC_ptr.add_reference()); // set r1 to the location of "SendMonToPC" plus one, since it is thumb code mov3(r2, r15); // move r15 (the program counter) to r2 @@ -217,57 +238,45 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) ldr1(r0, r0, 0); // load the value at r0's pointer mov1(r3, 0xFF); // load 0xFF into r3 and1(r0, r3); // AND r0 and r3, which will give us just the least significant byte - add5(r1, dexStruct.add_reference()); // set r1 to the value stored X bytes ahead - add3(r0, r0, r1); // add r0 and r1, which is the current index and dex_struct respectivly - ldr1(r0, r0, 0); // load the value at the memory location stored in r0 - and1(r0, r3); // truncate to just the least significant byte, which is the current dex number - ldr3(r1, dexSeenCaught_ptr.add_reference()); // load the dex_seen_caught variable's pointer into r1 - ldr1(r1, r1, 0); // load the value of memory pointed at by r1 - and1(r1, r3); // AND r1 and r3, which will keep only the least significant byte - ldr3(r2, setPokedexFlag_ptr.add_reference()); // load the GetSetPokedexFlag function location into r2 - mov3(r3, r15); // move r15 (the program counter) to r3 - add2(r3, 5); // add 5 to r3 to compensate for the four following bytes, as well as to tell it to read as THUMB code - mov3(r14, r3); // move r3 into r14 (the load register) - // - bx(r2); // jump to the pointer stored in r2 (GetSetPokedexFlag) - pop(rlist_r0); // remove r0 from the stack and put it into r0 - bx(r0); // jump to r0 (return to where the function was called) - // - add_padding(); // add padding so that we are byte aligned again - add_word(sendMonToPC_ptr.place_word()); // the location of "SendMonToPC", plus one (so it is interpreted as thumb code) - add_word(returned_box_success_ptr.place_word()); // the location of variable "0x8006" (the return value) - add_word(curr_pkmn_index_ptr.place_word()); // the location of variable "0x8008" (the pokemon offset) - add_word(setPokedexFlag_ptr.place_word()); // the location of GetSetPokedexFlag, plus one (so it is interpreted as thumb code) - add_word(dexSeenCaught_ptr.place_word()); // the location of the DEX_SEEN_CAUGHT variable - add_word(currPkmnIndex_ptr.place_word()); // the location of the INDEX variable - dexStruct.set_start(); // set the DEX_STRUCT offset - for (int i = 0; i < incoming_box_data.get_num_pkmn(); i++) // Add in the dex numbers - { - mg_script[curr_index] = incoming_box_data.get_dex_num(i); - curr_index++; - } + add5(r1, dexStruct.add_reference()); // set r1 to the value stored X bytes ahead + ldr1(r1, r1, 0); + add3(r0, r0, r1); // add r0 and r1, which is the current index and dex_struct respectivly + ldr1(r0, r0, 0); // load the value at the memory location stored in r0 + and1(r0, r3); // truncate to just the least significant byte, which is the current dex number + ldr3(r1, dexSeenCaught_ptr.add_reference()); // load the dex_seen_caught variable's pointer into r1 + ldr1(r1, r1, 0); // load the value of memory pointed at by r1 + and1(r1, r3); // AND r1 and r3, which will keep only the least significant byte + ldr3(r2, setPokedexFlag_ptr.add_reference()); // load the GetSetPokedexFlag function location into r2 + mov3(r3, r15); // move r15 (the program counter) to r3 + add2(r3, 5); // add 5 to r3 to compensate for the four following bytes, as well as to tell it to read as THUMB code + mov3(r14, r3); // move r3 into r14 (the load register) + bx(r2); // jump to the pointer stored in r2 (GetSetPokedexFlag) + pop(rlist_r0); // remove r0 from the stack and put it into r0 + bx(r0); // jump to r0 (return to where the function was called) + + // + // + add_padding(); // add padding so that we are byte aligned again + add_word(sendMonToPC_ptr.place_word()); // the location of "SendMonToPC", plus one (so it is interpreted as thumb code) + add_word(returned_box_success_ptr.place_word()); // the location of variable "0x8006" (the return value) + add_word(curr_pkmn_index_ptr.place_word()); // the location of variable "0x8008" (the pokemon offset) + add_word(setPokedexFlag_ptr.place_word()); // the location of GetSetPokedexFlag, plus one (so it is interpreted as thumb code) + add_word(dexSeenCaught_ptr.place_word()); // the location of the DEX_SEEN_CAUGHT variable + add_word(currPkmnIndex_ptr.place_word()); // the location of the INDEX variable + add_word(flashBuffer_ptr.place_word()); + add_word(readFlashSector_ptr.place_word()); + add_word(pkmnStruct.place_word()); + add_word(dexStruct.place_word()); + four_align(); // make the offset a multiple of 4 - pkmnStruct.set_start(); // set the PKMN_STRUCT ptr offset - - for (int i = 0; i < incoming_box_data.get_num_pkmn(); i++) // Add in the Pokemon data - { - Pokemon curr_pkmn = incoming_box_data.get_converted_pkmn(i); - for (int curr_byte = 0; curr_byte < POKEMON_SIZE; curr_byte++) - { - mg_script[curr_index] = curr_pkmn.get_gen_3_data(curr_byte); - curr_index++; - } - validity_array[i] = curr_pkmn.get_validity(); - } - - for (unsigned int i = 0; i < asm_variable_list.size(); i++) + for (unsigned int i = 0; i < asm_variable_list.size(); i++) // Fill all the refrences for script variables { asm_variable_list[i]->fill_refrences(mg_script); } - if (curr_index > MG_SCRIPT_SIZE) + if (curr_index > MG_SCRIPT_SIZE) // Throw an error if the script is too large { tte_erase_screen(); int val = (curr_index - MG_SCRIPT_SIZE) - four_align_value; @@ -381,7 +390,7 @@ void mystery_gift_script::virtualgotoif(u8 condition, u32 location) add_command(6); } -void mystery_gift_script::virtualmsgbox2(u32 location) +void mystery_gift_script::virtualmsgbox(u32 location) { value_buffer[0] = 0xBD; value_buffer[1] = (VIRTUAL_ADDRESS >> 0) & 0xFF; diff --git a/source/mystery_gift_injector.cpp b/source/mystery_gift_injector.cpp index e646fb5..31a59f8 100644 --- a/source/mystery_gift_injector.cpp +++ b/source/mystery_gift_injector.cpp @@ -4,6 +4,7 @@ #include "mystery_gift_builder.h" #include "rom_data.h" #include "save.h" +#include "pokemon_data.h" // This will need to be modified for the JP releases static u8 bill_wonder_card[0x14E] = { @@ -57,10 +58,11 @@ bool inject_mystery(Pokemon_Party &incoming_box_data) erase_sector(memory_section_array[4]); copy_ram_to_save(&global_memory_buffer[0], memory_section_array[4], 0x1000); - // Add in Pokemon data - copy_save_to_ram(0x1C000, &global_memory_buffer[0], 0x1000); + // Add in Pokemon and Dex data + copy_save_to_ram(0x1E000, &global_memory_buffer[0], 0x1000); int curr_index = 0; - for (int i = 0; i < incoming_box_data.get_num_pkmn(); i++) // Add in the Pokemon data + + for (int i = 0; i < MAX_PKMN_IN_BOX; i++) // Add in the Pokemon data { Pokemon curr_pkmn = incoming_box_data.get_converted_pkmn(i); for (int curr_byte = 0; curr_byte < POKEMON_SIZE; curr_byte++) @@ -69,13 +71,23 @@ bool inject_mystery(Pokemon_Party &incoming_box_data) curr_index++; } script.validity_array[i] = curr_pkmn.get_validity(); + script.dex_array[i] = curr_pkmn.get_dex_number(); } - copy_ram_to_save(&global_memory_buffer[0], 0x1C000, 0x1000); + + for (int i = 0; i < MAX_PKMN_IN_BOX; i++) // Add in the dex numbers + { + global_memory_buffer[curr_index] = script.dex_array[i]; + curr_index++; + } + + update_memory_buffer_checksum(false); + erase_sector(0x1E000); + copy_ram_to_save(&global_memory_buffer[0], 0x1E000, 0x1000); // Set flags copy_save_to_ram(memory_section_array[1 + ((curr_rom.offset_flags + (FLAG_ID_START / 8)) / 0xF80)], &global_memory_buffer[0], 0x1000); global_memory_buffer[(curr_rom.offset_flags + (FLAG_ID_START / 8)) % 0xF80] &= (~0b01111111 << (FLAG_ID_START % 8)); // Set "collected all" flag to 0 and reset the "to obtain" flags - for (int i = 0; i < incoming_box_data.get_num_pkmn(); i++) +for (int i = 0; i < MAX_PKMN_IN_BOX; i++) { if (script.validity_array[i]) { diff --git a/source/pokemon_party.cpp b/source/pokemon_party.cpp index 2b72b56..6b5b781 100644 --- a/source/pokemon_party.cpp +++ b/source/pokemon_party.cpp @@ -92,7 +92,6 @@ void Pokemon_Party::start_link() setup(); last_error = loop(&box_data_array[0]); } - num_pokemon = 6; } int Pokemon_Party::get_last_error() @@ -123,11 +122,3 @@ void Pokemon_Party::set_lang(int nLang) { lang = nLang; } - -int Pokemon_Party::get_num_pkmn(){ - return num_pokemon; -} - -int Pokemon_Party::get_dex_num(int index){ - return 63; // Abra, for testing -} \ No newline at end of file diff --git a/source/rom_data.cpp b/source/rom_data.cpp index e6125d2..205f49d 100644 --- a/source/rom_data.cpp +++ b/source/rom_data.cpp @@ -134,6 +134,9 @@ bool rom_data::load_rom() loc_gSpecialVar_0x8000 = 0x020375D8; loc_gSaveBlock1PTR = 0x03005D8C; loc_setPokedexFlag = 0x080C0664; + loc_gSaveDataBuffer = 0x0203ABBC; + loc_readFlashSector = 0x0815314C; + offset_ramscript = 0x3728; offset_flags = 0x1270; return true;