diff --git a/examples/modifySergioTeam.pl b/examples/modifySergioTeam.pl new file mode 100644 index 0000000..c6b8516 --- /dev/null +++ b/examples/modifySergioTeam.pl @@ -0,0 +1,407 @@ +#!/usr/bin/env perl +use v5.34.1; + +use strict; +use warnings; + +use feature 'signatures'; + +use Rsaves + qw/read_save check_correct_size get_saves find_current_save_index check_correct_size find_pokemon_substruct change_gender read_pc_storage save_pc_changes enable_eon_ticket save_changes pokemon_set_shiny read_pkm_file_box enable_mirage_island_for_pokemon parse_version_name pokemon_fill_pp to_3rd_encoding translate_3rd_encoding/; +use Rsaves::Constants::Global + qw/$MOVE_SPIKES $MOVE_DRILL_PECK $MOVE_HIDDEN_POWER $MOVE_TAUNT $MOVE_THUNDERBOLT $MOVE_ROAR $MOVE_THUNDER_WAVE $ITEM_LEFTOVERS $MOVE_DRAGON_DANCE $MOVE_ROCK_SLIDE $MOVE_EARTHQUAKE $MOVE_TAUNT $MOVE_FLAMETHROWER $MOVE_WILL_O_WISP $MOVE_HYDRO_PUMP $MOVE_ICE_BEAM $MOVE_FOCUS_PUNCH $MOVE_PSYCHIC $MOVE_FIRE_PUNCH $MOVE_WISH $MOVE_PROTECT $MOVE_TOXIC/; + +use Rsaves::Constants::Ruby::Global qw/$MALE $FEMALE/; + +my $input = $ARGV[0] or die "No input save"; +my $output = $ARGV[1] or die "No output save"; +my $version = parse_version_name( $ARGV[2] ) // parse_version_name('ruby'); + +sub start { + my ( @saves_raw, $extra ); + ( @saves_raw[ 0, 1 ], $extra ) = read_save($input); + my @saves = get_saves( @saves_raw, $version ); + my $current_save_index = find_current_save_index(@saves); + my $save = $saves[$current_save_index]; + + my $pc = read_pc_storage($save); + my $jirachi = $pc->{boxes}[13][2]; + my $skarmory = $pc->{boxes}[13][0]; + modifyJirachi($jirachi); + modifySkarmory($skarmory); +# modifyJolteon($jolteon); +# modifyLarvitar($larvitar); +# modifyMoltres($moltres); +# modifyMudkip($mudkip); +# modifyStarmie($starmie); +# + pokemon_fill_pp($jirachi); + pokemon_fill_pp($skarmory); +# pokemon_fill_pp($larvitar); +# pokemon_fill_pp($moltres); +# pokemon_fill_pp($mudkip); +# pokemon_fill_pp($starmie); + + save_pc_changes( $save, $pc ); + save_changes( @saves, $extra, $output ); +} + +sub modifySkarmory ($pokemon) { + say $pokemon->{otid}; + say _hihalf_u32($pokemon->{otid}); + say _lowhalf_u32($pokemon->{otid}); + + $pokemon->{personality} = 0xC6C32B9F; + my $ivs_egg_status_and_ability = + $pokemon->{substructures}[3]{ivs_egg_status_and_ability}; + + my $ability = $ivs_egg_status_and_ability >> 31 & 1; + my $egg = $ivs_egg_status_and_ability >> 30 & 1; + my $iv_special_defense = $ivs_egg_status_and_ability >> 25 & 0x1F; + my $iv_special_attack = $ivs_egg_status_and_ability >> 20 & 0x1F; + my $iv_speed = $ivs_egg_status_and_ability >> 15 & 0x1F; + my $iv_defense = $ivs_egg_status_and_ability >> 10 & 0x1F; + my $iv_attack = $ivs_egg_status_and_ability >> 5 & 0x1F; + my $iv_hp = $ivs_egg_status_and_ability >> 0 & 0x1F; + + ( + $iv_hp, $iv_attack, $iv_defense, $iv_special_attack, + $iv_special_defense, $iv_speed, $ability + ) = ( 30, 31, 30, 10, 30, 30, 0 ); + + $ivs_egg_status_and_ability = 0; + $ivs_egg_status_and_ability |= ( ( $ability & 1 ) << 31 ); + $ivs_egg_status_and_ability |= ( ( $egg & 1 ) << 30 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_defense & 0x1F ) << 25 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_attack & 0x1F ) << 20 ); + $ivs_egg_status_and_ability |= ( ( $iv_speed & 0x1F ) << 15 ); + $ivs_egg_status_and_ability |= ( ( $iv_defense & 0x1F ) << 10 ); + $ivs_egg_status_and_ability |= ( ( $iv_attack & 0x1F ) << 5 ); + $ivs_egg_status_and_ability |= ( ( $iv_hp & 0x1F ) ); + $pokemon->{substructures}[3]{ivs_egg_status_and_ability} = + $ivs_egg_status_and_ability; + + $pokemon->{substructures}[2]{hp_ev} = 240; + $pokemon->{substructures}[2]{attack_ev} = 0; + $pokemon->{substructures}[2]{defense_ev} = 0; + $pokemon->{substructures}[2]{special_attack_ev} = 0; + $pokemon->{substructures}[2]{special_defense_ev} = 244; + $pokemon->{substructures}[2]{speed_ev} = 24; + + $pokemon->{substructures}[1]{movements}[0] = $MOVE_DRILL_PECK; + $pokemon->{substructures}[1]{movements}[1] = $MOVE_TAUNT; + $pokemon->{substructures}[1]{movements}[2] = $MOVE_ROAR; + $pokemon->{substructures}[1]{movements}[3] = $MOVE_SPIKES; + $pokemon->{substructures}[0]{held_item} = $ITEM_LEFTOVERS; + $pokemon->{substructures}[0]{experience} = 1_250_000; +} + +sub modifyJirachi ($pokemon) { + say $pokemon->{otid}; + say _hihalf_u32($pokemon->{otid}); + say _lowhalf_u32($pokemon->{otid}); + + $pokemon->{personality} = 0xC6C32B9F; + my $ivs_egg_status_and_ability = + $pokemon->{substructures}[3]{ivs_egg_status_and_ability}; + + my $ability = $ivs_egg_status_and_ability >> 31 & 1; + my $egg = $ivs_egg_status_and_ability >> 30 & 1; + my $iv_special_defense = $ivs_egg_status_and_ability >> 25 & 0x1F; + my $iv_special_attack = $ivs_egg_status_and_ability >> 20 & 0x1F; + my $iv_speed = $ivs_egg_status_and_ability >> 15 & 0x1F; + my $iv_defense = $ivs_egg_status_and_ability >> 10 & 0x1F; + my $iv_attack = $ivs_egg_status_and_ability >> 5 & 0x1F; + my $iv_hp = $ivs_egg_status_and_ability >> 0 & 0x1F; + + ( + $iv_hp, $iv_attack, $iv_defense, $iv_special_attack, + $iv_special_defense, $iv_speed, $ability + ) = ( 30, 28, 31, 31, 30, 27, 0 ); + + $ivs_egg_status_and_ability = 0; + $ivs_egg_status_and_ability |= ( ( $ability & 1 ) << 31 ); + $ivs_egg_status_and_ability |= ( ( $egg & 1 ) << 30 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_defense & 0x1F ) << 25 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_attack & 0x1F ) << 20 ); + $ivs_egg_status_and_ability |= ( ( $iv_speed & 0x1F ) << 15 ); + $ivs_egg_status_and_ability |= ( ( $iv_defense & 0x1F ) << 10 ); + $ivs_egg_status_and_ability |= ( ( $iv_attack & 0x1F ) << 5 ); + $ivs_egg_status_and_ability |= ( ( $iv_hp & 0x1F ) ); + $pokemon->{substructures}[3]{ivs_egg_status_and_ability} = + $ivs_egg_status_and_ability; + + $pokemon->{substructures}[2]{hp_ev} = 248; + $pokemon->{substructures}[2]{attack_ev} = 0; + $pokemon->{substructures}[2]{defense_ev} = 184; + $pokemon->{substructures}[2]{special_attack_ev} = 24; + $pokemon->{substructures}[2]{special_defense_ev} = 32; + $pokemon->{substructures}[2]{speed_ev} = 20; + + $pokemon->{substructures}[1]{movements}[0] = $MOVE_WISH; + $pokemon->{substructures}[1]{movements}[1] = $MOVE_PROTECT; + $pokemon->{substructures}[1]{movements}[2] = $MOVE_TOXIC; + $pokemon->{substructures}[1]{movements}[3] = $MOVE_FIRE_PUNCH; + $pokemon->{substructures}[0]{held_item} = $ITEM_LEFTOVERS; + $pokemon->{substructures}[0]{experience} = 1_250_000; +} + +sub modifyStarmie ($pokemon) { + $pokemon->{personality} = 0x6BB2770A; + $pokemon->{nickname} = to_3rd_encoding('Doctor'); + my $ivs_egg_status_and_ability = + $pokemon->{substructures}[3]{ivs_egg_status_and_ability}; + + my $ability = $ivs_egg_status_and_ability >> 31 & 1; + my $egg = $ivs_egg_status_and_ability >> 30 & 1; + my $iv_special_defense = $ivs_egg_status_and_ability >> 25 & 0x1F; + my $iv_special_attack = $ivs_egg_status_and_ability >> 20 & 0x1F; + my $iv_speed = $ivs_egg_status_and_ability >> 15 & 0x1F; + my $iv_defense = $ivs_egg_status_and_ability >> 10 & 0x1F; + my $iv_attack = $ivs_egg_status_and_ability >> 5 & 0x1F; + my $iv_hp = $ivs_egg_status_and_ability >> 0 & 0x1F; + + ( + $iv_hp, $iv_attack, $iv_defense, $iv_special_attack, + $iv_special_defense, $iv_speed, $ability + ) = ( 30, 11, 31, 30, 31, 31, 1 ); + + $ivs_egg_status_and_ability = 0; + $ivs_egg_status_and_ability |= ( ( $ability & 1 ) << 31 ); + $ivs_egg_status_and_ability |= ( ( $egg & 1 ) << 30 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_defense & 0x1F ) << 25 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_attack & 0x1F ) << 20 ); + $ivs_egg_status_and_ability |= ( ( $iv_speed & 0x1F ) << 15 ); + $ivs_egg_status_and_ability |= ( ( $iv_defense & 0x1F ) << 10 ); + $ivs_egg_status_and_ability |= ( ( $iv_attack & 0x1F ) << 5 ); + $ivs_egg_status_and_ability |= ( ( $iv_hp & 0x1F ) ); + $pokemon->{substructures}[3]{ivs_egg_status_and_ability} = + $ivs_egg_status_and_ability; + +# /*0x02*/ u16 metLevel:7; +# /*0x02*/ u16 metGame:4; +# /*0x03*/ u16 pokeball:4; +# /*0x03*/ u16 otGender:1; + my $meet_data = $pokemon->{substructures}[3]{met_data}; + + my $ot_gender = $meet_data >> 15 & 1; + my $pokeball = $meet_data >> 11 & 0xF; + my $meet_game = $meet_data >> 7 & 0xF; + my $meet_level = $meet_data & 0x7F; + + $meet_level = 22; + + $meet_data = 0; + + $meet_data |= ($ot_gender & 1) << 15; + $meet_data |= ($pokeball & 0xF) << 11; + $meet_data |= ($meet_game & 0xF) << 7; + $meet_data |= ($meet_level & 0x7F); + + $pokemon->{substructures}[3]{met_data} = $meet_data; + + $pokemon->{substructures}[2]{hp_ev} = 0; + $pokemon->{substructures}[2]{attack_ev} = 0; + $pokemon->{substructures}[2]{defense_ev} = 0; + $pokemon->{substructures}[2]{speed_ev} = 0; + $pokemon->{substructures}[2]{special_attack_ev} = 0; + $pokemon->{substructures}[2]{special_defense_ev} = 0; + + $pokemon->{substructures}[1]{movements}[0] = $MOVE_HYDRO_PUMP; + $pokemon->{substructures}[1]{movements}[1] = $MOVE_ICE_BEAM; + $pokemon->{substructures}[1]{movements}[2] = $MOVE_THUNDERBOLT; + $pokemon->{substructures}[1]{movements}[3] = $MOVE_PSYCHIC; + $pokemon->{substructures}[0]{held_item} = $ITEM_LEFTOVERS; +} + +sub modifyMudkip ($pokemon) { + $pokemon->{personality} = 0x6BB2770A; + $pokemon->{nickname} = to_3rd_encoding('Kumena'); + my $ivs_egg_status_and_ability = + $pokemon->{substructures}[3]{ivs_egg_status_and_ability}; + + my $ability = $ivs_egg_status_and_ability >> 31 & 1; + my $egg = $ivs_egg_status_and_ability >> 30 & 1; + my $iv_special_defense = $ivs_egg_status_and_ability >> 25 & 0x1F; + my $iv_special_attack = $ivs_egg_status_and_ability >> 20 & 0x1F; + my $iv_speed = $ivs_egg_status_and_ability >> 15 & 0x1F; + my $iv_defense = $ivs_egg_status_and_ability >> 10 & 0x1F; + my $iv_attack = $ivs_egg_status_and_ability >> 5 & 0x1F; + my $iv_hp = $ivs_egg_status_and_ability >> 0 & 0x1F; + + ( + $iv_hp, $iv_attack, $iv_defense, $iv_special_attack, + $iv_special_defense, $iv_speed, $ability + ) = ( 31, 29, 30, 30, 31, 31, 0 ); + + $ivs_egg_status_and_ability = 0; + $ivs_egg_status_and_ability |= ( ( $ability & 1 ) << 31 ); + $ivs_egg_status_and_ability |= ( ( $egg & 1 ) << 30 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_defense & 0x1F ) << 25 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_attack & 0x1F ) << 20 ); + $ivs_egg_status_and_ability |= ( ( $iv_speed & 0x1F ) << 15 ); + $ivs_egg_status_and_ability |= ( ( $iv_defense & 0x1F ) << 10 ); + $ivs_egg_status_and_ability |= ( ( $iv_attack & 0x1F ) << 5 ); + $ivs_egg_status_and_ability |= ( ( $iv_hp & 0x1F ) ); + $pokemon->{substructures}[3]{ivs_egg_status_and_ability} = + $ivs_egg_status_and_ability; + + $pokemon->{substructures}[2]{hp_ev} = 0; + $pokemon->{substructures}[2]{attack_ev} = 0; + $pokemon->{substructures}[2]{defense_ev} = 0; + $pokemon->{substructures}[2]{speed_ev} = 0; + $pokemon->{substructures}[2]{special_attack_ev} = 0; + $pokemon->{substructures}[2]{special_defense_ev} = 0; + + $pokemon->{substructures}[1]{movements}[0] = $MOVE_HYDRO_PUMP; + $pokemon->{substructures}[1]{movements}[1] = $MOVE_EARTHQUAKE; + $pokemon->{substructures}[1]{movements}[2] = $MOVE_ICE_BEAM; + $pokemon->{substructures}[1]{movements}[3] = $MOVE_FOCUS_PUNCH; + $pokemon->{substructures}[0]{held_item} = $ITEM_LEFTOVERS; +} + +sub modifyMoltres ($pokemon) { + $pokemon->{personality} = 0x336E4D34; + my $ivs_egg_status_and_ability = + $pokemon->{substructures}[3]{ivs_egg_status_and_ability}; + + my $ability = $ivs_egg_status_and_ability >> 31 & 1; + my $egg = $ivs_egg_status_and_ability >> 30 & 1; + my $iv_special_defense = $ivs_egg_status_and_ability >> 25 & 0x1F; + my $iv_special_attack = $ivs_egg_status_and_ability >> 20 & 0x1F; + my $iv_speed = $ivs_egg_status_and_ability >> 15 & 0x1F; + my $iv_defense = $ivs_egg_status_and_ability >> 10 & 0x1F; + my $iv_attack = $ivs_egg_status_and_ability >> 5 & 0x1F; + my $iv_hp = $ivs_egg_status_and_ability >> 0 & 0x1F; + + ( + $iv_hp, $iv_attack, $iv_defense, $iv_special_attack, + $iv_special_defense, $iv_speed, $ability + ) = ( 30, 18, 31, 30, 31, 31, 0 ); + + $ivs_egg_status_and_ability = 0; + $ivs_egg_status_and_ability |= ( ( $ability & 1 ) << 31 ); + $ivs_egg_status_and_ability |= ( ( $egg & 1 ) << 30 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_defense & 0x1F ) << 25 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_attack & 0x1F ) << 20 ); + $ivs_egg_status_and_ability |= ( ( $iv_speed & 0x1F ) << 15 ); + $ivs_egg_status_and_ability |= ( ( $iv_defense & 0x1F ) << 10 ); + $ivs_egg_status_and_ability |= ( ( $iv_attack & 0x1F ) << 5 ); + $ivs_egg_status_and_ability |= ( ( $iv_hp & 0x1F ) ); + $pokemon->{substructures}[3]{ivs_egg_status_and_ability} = + $ivs_egg_status_and_ability; + + $pokemon->{substructures}[2]{hp_ev} = 0; + $pokemon->{substructures}[2]{attack_ev} = 0; + $pokemon->{substructures}[2]{defense_ev} = 0; + $pokemon->{substructures}[2]{speed_ev} = 0; + $pokemon->{substructures}[2]{special_attack_ev} = 0; + $pokemon->{substructures}[2]{special_defense_ev} = 0; + + $pokemon->{substructures}[1]{movements}[0] = $MOVE_FLAMETHROWER; + $pokemon->{substructures}[1]{movements}[1] = $MOVE_HIDDEN_POWER; + $pokemon->{substructures}[1]{movements}[2] = $MOVE_WILL_O_WISP; + $pokemon->{substructures}[1]{movements}[3] = $MOVE_ROAR; + $pokemon->{substructures}[0]{held_item} = $ITEM_LEFTOVERS; +} + +sub _hihalf_u32 { + my $n = shift; + return ( ( $n & 0xFFFF0000 ) >> 16 ); +} + +sub _lowhalf_u32 { + my $n = shift; + return ( $n & 0xFFFF ); +} + +sub modifyLarvitar ($pokemon) { + $pokemon->{personality} = 0x9CF2063B; + my $ivs_egg_status_and_ability = + $pokemon->{substructures}[3]{ivs_egg_status_and_ability}; + + my $ability = $ivs_egg_status_and_ability >> 31 & 1; + my $egg = $ivs_egg_status_and_ability >> 30 & 1; + my $iv_special_defense = $ivs_egg_status_and_ability >> 25 & 0x1F; + my $iv_special_attack = $ivs_egg_status_and_ability >> 20 & 0x1F; + my $iv_speed = $ivs_egg_status_and_ability >> 15 & 0x1F; + my $iv_defense = $ivs_egg_status_and_ability >> 10 & 0x1F; + my $iv_attack = $ivs_egg_status_and_ability >> 5 & 0x1F; + my $iv_hp = $ivs_egg_status_and_ability >> 0 & 0x1F; + + ( + $iv_hp, $iv_attack, $iv_defense, $iv_special_attack, + $iv_special_defense, $iv_speed, $ability + ) = ( 31, 30, 30, 23, 30, 31, 0 ); + + $ivs_egg_status_and_ability = 0; + $ivs_egg_status_and_ability |= ( ( $ability & 1 ) << 31 ); + $ivs_egg_status_and_ability |= ( ( $egg & 1 ) << 30 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_defense & 0x1F ) << 25 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_attack & 0x1F ) << 20 ); + $ivs_egg_status_and_ability |= ( ( $iv_speed & 0x1F ) << 15 ); + $ivs_egg_status_and_ability |= ( ( $iv_defense & 0x1F ) << 10 ); + $ivs_egg_status_and_ability |= ( ( $iv_attack & 0x1F ) << 5 ); + $ivs_egg_status_and_ability |= ( ( $iv_hp & 0x1F ) ); + $pokemon->{substructures}[3]{ivs_egg_status_and_ability} = + $ivs_egg_status_and_ability; + + $pokemon->{substructures}[2]{hp_ev} = 0; + $pokemon->{substructures}[2]{attack_ev} = 0; + $pokemon->{substructures}[2]{defense_ev} = 0; + $pokemon->{substructures}[2]{speed_ev} = 0; + $pokemon->{substructures}[2]{special_attack_ev} = 0; + $pokemon->{substructures}[2]{special_defense_ev} = 0; + + $pokemon->{substructures}[1]{movements}[0] = $MOVE_DRAGON_DANCE; + $pokemon->{substructures}[1]{movements}[1] = $MOVE_ROCK_SLIDE; + $pokemon->{substructures}[1]{movements}[2] = $MOVE_EARTHQUAKE; + $pokemon->{substructures}[1]{movements}[3] = $MOVE_TAUNT; + $pokemon->{substructures}[0]{held_item} = $ITEM_LEFTOVERS; +} + +sub modifyJolteon ($pokemon) { + $pokemon->{personality} = 0x46F43BCA; + my $ivs_egg_status_and_ability = + $pokemon->{substructures}[3]{ivs_egg_status_and_ability}; + + my $ability = $ivs_egg_status_and_ability >> 31 & 1; + my $egg = $ivs_egg_status_and_ability >> 30 & 1; + my $iv_special_defense = $ivs_egg_status_and_ability >> 25 & 0x1F; + my $iv_special_attack = $ivs_egg_status_and_ability >> 20 & 0x1F; + my $iv_speed = $ivs_egg_status_and_ability >> 15 & 0x1F; + my $iv_defense = $ivs_egg_status_and_ability >> 10 & 0x1F; + my $iv_attack = $ivs_egg_status_and_ability >> 5 & 0x1F; + my $iv_hp = $ivs_egg_status_and_ability >> 0 & 0x1F; + + ( + $iv_hp, $iv_attack, $iv_defense, $iv_special_attack, + $iv_special_defense, $iv_speed, $ability + ) = ( 31, 22, 30, 31, 31, 31, 0 ); + + $ivs_egg_status_and_ability = 0; + $ivs_egg_status_and_ability |= ( ( $ability & 1 ) << 31 ); + $ivs_egg_status_and_ability |= ( ( $egg & 1 ) << 30 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_defense & 0x1F ) << 25 ); + $ivs_egg_status_and_ability |= ( ( $iv_special_attack & 0x1F ) << 20 ); + $ivs_egg_status_and_ability |= ( ( $iv_speed & 0x1F ) << 15 ); + $ivs_egg_status_and_ability |= ( ( $iv_defense & 0x1F ) << 10 ); + $ivs_egg_status_and_ability |= ( ( $iv_attack & 0x1F ) << 5 ); + $ivs_egg_status_and_ability |= ( ( $iv_hp & 0x1F ) ); + $pokemon->{substructures}[3]{ivs_egg_status_and_ability} = + $ivs_egg_status_and_ability; + + $pokemon->{substructures}[2]{hp_ev} = 0; + $pokemon->{substructures}[2]{attack_ev} = 0; + $pokemon->{substructures}[2]{defense_ev} = 0; + $pokemon->{substructures}[2]{speed_ev} = 0; + $pokemon->{substructures}[2]{special_attack_ev} = 0; + $pokemon->{substructures}[2]{special_defense_ev} = 0; + + $pokemon->{substructures}[1]{movements}[0] = $MOVE_THUNDERBOLT; + $pokemon->{substructures}[1]{movements}[1] = $MOVE_HIDDEN_POWER; + $pokemon->{substructures}[1]{movements}[2] = $MOVE_THUNDER_WAVE; + $pokemon->{substructures}[1]{movements}[3] = $MOVE_ROAR; + $pokemon->{substructures}[0]{held_item} = $ITEM_LEFTOVERS; +} +start; diff --git a/jirachi.gba b/jirachi.gba new file mode 100644 index 0000000..670488b Binary files /dev/null and b/jirachi.gba differ diff --git a/jirachi.sav b/jirachi.sav new file mode 100644 index 0000000..41daaf3 Binary files /dev/null and b/jirachi.sav differ diff --git a/lib/Rsaves.pm b/lib/Rsaves.pm index 72b732f..dc4fe9c 100644 --- a/lib/Rsaves.pm +++ b/lib/Rsaves.pm @@ -762,7 +762,6 @@ sub save_changes { ( @saves[ 0, 1 ], $extra, $filename ) = @_; my $content = ''; for my $save (@saves) { - my $counter_j = 0; for my $section (@$save) { die "Too much memory allocated" if length $content > 1000000; _recalculate_checksum($section); @@ -770,7 +769,6 @@ sub save_changes { } } $content .= $extra; - die "Save length is incorrect." if length $content != 128 * 1024; open my $fh, '>', $filename; print $fh $content; close $fh; diff --git a/skarmorySergio.gba b/skarmorySergio.gba new file mode 100644 index 0000000..670488b Binary files /dev/null and b/skarmorySergio.gba differ diff --git a/skarmorySergio.sav b/skarmorySergio.sav new file mode 100644 index 0000000..f3c9f5b Binary files /dev/null and b/skarmorySergio.sav differ diff --git a/start_sergio.gba b/start_sergio.gba new file mode 100644 index 0000000..670488b Binary files /dev/null and b/start_sergio.gba differ diff --git a/start_sergio.sav b/start_sergio.sav new file mode 100644 index 0000000..cc2e118 Binary files /dev/null and b/start_sergio.sav differ