Adding shiny fronts.
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use v5.16.3;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Path::Tiny;
|
||||
|
||||
my $pokemons_dir = path 'pokeemerald/graphics/pokemon/';
|
||||
my $tempdir = Path::Tiny->tempdir;
|
||||
my $shiny_dir = path 'resources/shiny';
|
||||
$shiny_dir->mkpath;
|
||||
for my $pokemon_dir ( $pokemons_dir->children ) {
|
||||
my $bpp = $tempdir->child( $pokemon_dir->basename . '.4bpp' );
|
||||
say $pokemon_dir->basename;
|
||||
system './pokeemerald/tools/gbagfx/gbagfx',
|
||||
$pokemon_dir->child('front.png'), $bpp;
|
||||
system './pokeemerald/tools/gbagfx/gbagfx',
|
||||
$bpp, $shiny_dir->child( $pokemon_dir->basename . '.png' ),
|
||||
'-palette', $pokemon_dir->child('shiny.pal'), '-mwidth', 8, '-object';
|
||||
}
|
|
@ -20,9 +20,18 @@ sub species {
|
|||
return $substruct_0->{species};
|
||||
}
|
||||
|
||||
sub get_image {
|
||||
sub get_icon {
|
||||
my $self = shift;
|
||||
my $pokemon_name = $Rsaves::Constants::Emerald::Species::SPECIES[$self->species];
|
||||
return "pokeemerald/graphics/pokemon/@{[lc($pokemon_name)]}/icon.png";
|
||||
}
|
||||
|
||||
sub get_front {
|
||||
my $self = shift;
|
||||
my $pokemon_name = $Rsaves::Constants::Emerald::Species::SPECIES[$self->species];
|
||||
if (Rsaves::pokemon_is_shiny($self->_pokemon)) {
|
||||
return "resources/shiny/@{[lc($pokemon_name)]}.png";
|
||||
}
|
||||
return "pokeemerald/graphics/pokemon/@{[lc($pokemon_name)]}/front.png";
|
||||
}
|
||||
1;
|
||||
|
|
|
@ -322,8 +322,6 @@ sub activate_about {
|
|||
$about->present;
|
||||
}
|
||||
|
||||
my $root = path(__FILE__)->parent->parent->parent->parent;
|
||||
|
||||
sub activate_view_pc {
|
||||
my $self = shift;
|
||||
GEmeTool::View::PokemonPCWindow->new( _save => $self->_save )->start;
|
||||
|
|
|
@ -63,17 +63,18 @@ sub start {
|
|||
my $width = shift;
|
||||
my $height = shift;
|
||||
|
||||
my $selected_pokemon = $self->get_selected_pokemon;
|
||||
$self->draw_pc($cairo, $scale_factor_pc);
|
||||
{
|
||||
my $output_box = Cairo::ImageSurface->create( 'argb32', $BOX_WIDTH, $BOX_HEIGHT );
|
||||
my $box_context = Cairo::Context->create($output_box);
|
||||
$self->draw_box($box_context);
|
||||
my $selected_pokemon = $self->get_selected_pokemon;
|
||||
$self->draw_pokemon( $box_context, $selected_pokemon );
|
||||
$self->draw_box_name($box_context);
|
||||
$cairo->set_source_surface( $output_box, $BOX_X, $BOX_Y );
|
||||
$cairo->paint;
|
||||
}
|
||||
$self->draw_pokemon_details($cairo, $selected_pokemon);
|
||||
$self->draw_cursor($cairo);
|
||||
}
|
||||
);
|
||||
|
@ -88,6 +89,21 @@ sub start {
|
|||
);
|
||||
}
|
||||
|
||||
sub draw_pokemon_details {
|
||||
my $self = shift;
|
||||
my $cairo = shift;
|
||||
my $selected_pokemon = shift;
|
||||
return if !defined $selected_pokemon;
|
||||
my $surface = Cairo::ImageSurface->create_from_png($root->child($selected_pokemon->get_front));
|
||||
my $scale_factor = 2;
|
||||
$cairo->scale( ($scale_factor) x 2 );
|
||||
$cairo->set_source_surface( $surface, 20, 30 );
|
||||
$cairo->get_source()->set_filter('nearest');
|
||||
$cairo->paint;
|
||||
$cairo->scale( (1/$scale_factor) x 2 );
|
||||
|
||||
}
|
||||
|
||||
sub draw_pc {
|
||||
my $self = shift;
|
||||
my $cairo = shift;
|
||||
|
@ -160,7 +176,7 @@ sub draw_pokemon {
|
|||
my $pokemon = $box->get_pokemon( $i * 6 + $j );
|
||||
my $is_selected =
|
||||
defined $selected_pokemon && $pokemon eq $selected_pokemon;
|
||||
my $pokemon_image = $root->child( $pokemon->get_image );
|
||||
my $pokemon_image = $root->child( $pokemon->get_icon );
|
||||
my $p = 25;
|
||||
my $x = $j * ( $p + 1 );
|
||||
my $y = 20 + ( ( $p - 3 ) * $i );
|
||||
|
@ -228,6 +244,16 @@ sub draw_box {
|
|||
$cairo->get_source()->set_filter('nearest');
|
||||
|
||||
$cairo->paint;
|
||||
$surface = Cairo::ImageSurface->create_from_png(
|
||||
$root->child('resources/right_arrow_pc.png') );
|
||||
$cairo->set_source_surface( $surface, $BOX_WIDTH / 2 - 14, 3);
|
||||
$cairo->get_source()->set_filter('nearest');
|
||||
$cairo->paint;
|
||||
$cairo->scale(-1, 1);
|
||||
$cairo->set_source_surface( $surface, - 14, 3);
|
||||
$cairo->get_source()->set_filter('nearest');
|
||||
$cairo->paint;
|
||||
$cairo->scale(-1, 1);
|
||||
$cairo->scale( 1 / 2, 1 / 2 );
|
||||
|
||||
}
|
||||
|
|
159
lib/Rsaves.pm
|
@ -11,12 +11,14 @@ use Data::Dumper;
|
|||
|
||||
use Rsaves::Constants::Ruby::Flags
|
||||
qw/$FLAG_SYS_HAS_EON_TICKET $FLAG_LEGENDARY_BATTLE_COMPLETED $FLAG_HIDE_LEGEND_MON_CAVE_OF_ORIGIN/;
|
||||
use Rsaves::Constants::Ruby::Vars qw/ $VAR_MIRAGE_RND_H $VAR_CAVE_OF_ORIGIN_B4F_STATE $VARS_START/;
|
||||
use Rsaves::Constants::Ruby::Vars
|
||||
qw/ $VAR_MIRAGE_RND_H $VAR_CAVE_OF_ORIGIN_B4F_STATE $VARS_START/;
|
||||
use Rsaves::Constants::Global
|
||||
qw/$SAPPHIRE_VERSION $RUBY_VERSION $EMERALD_VERSION $FIRERED_VERSION $LEAFGREEN_VERSION $COLOSSEUM_VERSION/;
|
||||
|
||||
use Rsaves::Constants::Firered::Flags qw/$FLAG_RECEIVED_AURORA_TICKET $FLAG_ENABLE_SHIP_BIRTH_ISLAND $FLAG_FOUGHT_DEOXYS $FLAG_DEOXYS_FLEW_AWAY/;
|
||||
use Rsaves::Constants::Firered::Vars qw/$VAR_MAP_SCENE_CERULEAN_CITY_RIVAL/;
|
||||
use Rsaves::Constants::Firered::Flags
|
||||
qw/$FLAG_RECEIVED_AURORA_TICKET $FLAG_ENABLE_SHIP_BIRTH_ISLAND $FLAG_FOUGHT_DEOXYS $FLAG_DEOXYS_FLEW_AWAY/;
|
||||
use Rsaves::Constants::Firered::Vars qw/$VAR_MAP_SCENE_CERULEAN_CITY_RIVAL/;
|
||||
use Rsaves::Constants::MoveAttributes qw/get_move_attributes/;
|
||||
use Exporter;
|
||||
|
||||
|
@ -57,22 +59,22 @@ my $PC_BUFFER_G = 11;
|
|||
my $PC_BUFFER_H = 12;
|
||||
my $PC_BUFFER_I = 13;
|
||||
my ( $FEMALE, $MALE ) = ( 1, 0 );
|
||||
my $FLAGS_OFFSET_RUBY = hex '1220';
|
||||
my $FLAGS_OFFSET_FIRERED = 0x0ee0;
|
||||
my $FLAGS_OFFSET_EMERALD = 0x1270;
|
||||
my $TRAINER_FLAG_START = hex '500';
|
||||
my $NUMBER_OF_TRAINERS = 693;
|
||||
my $KEY_ITEMS_OFFSET_RUBY = 0x5b0;
|
||||
my $KEY_ITEMS_OFFSET_FIRERED = 0x03b8;
|
||||
my $MAX_KEY_ITEMS_RUBY = 20;
|
||||
my $MAX_KEY_ITEMS_FIRERED = 30;
|
||||
my $ITEM_EON_TICKET = 275;
|
||||
my $ITEM_AURORA_TICKET = 371;
|
||||
my $POKEMON_NAME_LENGTH = 10;
|
||||
my $OT_NAME_LENGTH = 7;
|
||||
my $BOX_NAME_LENGTH = 9;
|
||||
my $RUBY_VARS_START = 0x1340;
|
||||
my $FIRERED_VARS_START = 0x1000;
|
||||
my $FLAGS_OFFSET_RUBY = hex '1220';
|
||||
my $FLAGS_OFFSET_FIRERED = 0x0ee0;
|
||||
my $FLAGS_OFFSET_EMERALD = 0x1270;
|
||||
my $TRAINER_FLAG_START = hex '500';
|
||||
my $NUMBER_OF_TRAINERS = 693;
|
||||
my $KEY_ITEMS_OFFSET_RUBY = 0x5b0;
|
||||
my $KEY_ITEMS_OFFSET_FIRERED = 0x03b8;
|
||||
my $MAX_KEY_ITEMS_RUBY = 20;
|
||||
my $MAX_KEY_ITEMS_FIRERED = 30;
|
||||
my $ITEM_EON_TICKET = 275;
|
||||
my $ITEM_AURORA_TICKET = 371;
|
||||
my $POKEMON_NAME_LENGTH = 10;
|
||||
my $OT_NAME_LENGTH = 7;
|
||||
my $BOX_NAME_LENGTH = 9;
|
||||
my $RUBY_VARS_START = 0x1340;
|
||||
my $FIRERED_VARS_START = 0x1000;
|
||||
|
||||
my %CHECKSUM_BYTES = (
|
||||
$TRAINER_INFO => hex 'F80',
|
||||
|
@ -114,9 +116,11 @@ sub parse_version_name {
|
|||
}
|
||||
|
||||
sub pokemon_fill_pp($pokemon) {
|
||||
|
||||
# Not taking pp bonuses in account, work for other day.
|
||||
for my $number_movement (0..3) {
|
||||
my $movement_id = $pokemon->{substructures}[1]{movements}[$number_movement];
|
||||
for my $number_movement ( 0 .. 3 ) {
|
||||
my $movement_id =
|
||||
$pokemon->{substructures}[1]{movements}[$number_movement];
|
||||
my $pp = get_move_attributes($movement_id)->{'pp'};
|
||||
$pokemon->{substructures}[1]{pp}[$number_movement] = $pp;
|
||||
}
|
||||
|
@ -137,6 +141,13 @@ sub calculate_shiny_personality {
|
|||
return ( $wanted_high_personality << 16 ) | _lowhalf_u32($personality);
|
||||
}
|
||||
|
||||
sub pokemon_is_shiny {
|
||||
my $pokemon = shift;
|
||||
my ($otid, $personality) = @{$pokemon}{ 'otid', 'personality' };
|
||||
return ( _lowhalf_u32($personality) ^ _hihalf_u32($personality)
|
||||
^ _lowhalf_u32($otid) ^ _hihalf_u32($otid) ) < 8;
|
||||
}
|
||||
|
||||
sub get_first_super_data {
|
||||
my $save = shift;
|
||||
my @sections = _find_sections_save( $save, 1 .. 4 );
|
||||
|
@ -273,11 +284,11 @@ sub _write_pokemon_fh {
|
|||
print $fh pack 'V', $pokemon->{personality};
|
||||
print $fh pack 'V', $pokemon->{otid};
|
||||
my $nickname = $pokemon->{nickname};
|
||||
if (length $nickname < 10) {
|
||||
if ( length $nickname < 10 ) {
|
||||
$nickname .= chr(0xff);
|
||||
my $to_add = 10 - length $nickname;
|
||||
for (my $i = 0; $i < $to_add; $i++) {
|
||||
$nickname .= chr(int(rand(256)));
|
||||
for ( my $i = 0 ; $i < $to_add ; $i++ ) {
|
||||
$nickname .= chr( int( rand(256) ) );
|
||||
}
|
||||
}
|
||||
print $fh $nickname;
|
||||
|
@ -430,7 +441,7 @@ sub _pokemon_checksum_substructures_fh {
|
|||
for ( 0 .. 3 ) {
|
||||
for ( 0 .. 5 ) {
|
||||
read $fh, my $read, 2 or die "Unable to read";
|
||||
$checksum = 0xffff & (( unpack 'v', $read ) + $checksum );
|
||||
$checksum = 0xffff & ( ( unpack 'v', $read ) + $checksum );
|
||||
}
|
||||
}
|
||||
return $checksum;
|
||||
|
@ -465,7 +476,7 @@ sub _write_pokemon_substruct_fh {
|
|||
$counter++;
|
||||
}
|
||||
$counter = 0xa1;
|
||||
for my $char ( '0'..'9') {
|
||||
for my $char ( '0' .. '9' ) {
|
||||
$translate_encoding_table{ chr($counter) } = $char;
|
||||
$translate_real_table{$char} = chr($counter);
|
||||
$counter++;
|
||||
|
@ -801,12 +812,12 @@ sub enable_eon_ticket {
|
|||
sub match_again_rival_firered_cerulean {
|
||||
my $save = shift;
|
||||
my $section0 = _find_section_save( $save, 0 );
|
||||
my $version = $section0->{version};
|
||||
my $version = $section0->{version};
|
||||
die "This is not Pokemon Leafgreen or Firered"
|
||||
if !_is_leafgreen_or_firered($version);
|
||||
if !_is_leafgreen_or_firered($version);
|
||||
my $superdata = get_first_super_data($save);
|
||||
set_var( $save, $superdata, $VAR_MAP_SCENE_CERULEAN_CITY_RIVAL, 0 );
|
||||
set_first_super_data($save, $superdata);
|
||||
set_var( $save, $superdata, $VAR_MAP_SCENE_CERULEAN_CITY_RIVAL, 0 );
|
||||
set_first_super_data( $save, $superdata );
|
||||
}
|
||||
|
||||
sub enable_deoxys_firered {
|
||||
|
@ -815,10 +826,10 @@ sub enable_deoxys_firered {
|
|||
die "This is not Pokemon Leafgreen or Firered"
|
||||
if !_is_leafgreen_or_firered( $section0->{version} );
|
||||
my $superdata = get_first_super_data($save);
|
||||
set_flag_id( $save, $superdata, $FLAG_RECEIVED_AURORA_TICKET, 1 );
|
||||
set_flag_id( $save, $superdata, $FLAG_RECEIVED_AURORA_TICKET, 1 );
|
||||
set_flag_id( $save, $superdata, $FLAG_ENABLE_SHIP_BIRTH_ISLAND, 1 );
|
||||
set_flag_id( $save, $superdata, $FLAG_FOUGHT_DEOXYS, 0 );
|
||||
set_flag_id( $save, $superdata, $FLAG_DEOXYS_FLEW_AWAY, 0 );
|
||||
set_flag_id( $save, $superdata, $FLAG_FOUGHT_DEOXYS, 0 );
|
||||
set_flag_id( $save, $superdata, $FLAG_DEOXYS_FLEW_AWAY, 0 );
|
||||
add_key_item( $save, $superdata, $ITEM_AURORA_TICKET );
|
||||
set_first_super_data( $save, $superdata );
|
||||
}
|
||||
|
@ -867,14 +878,15 @@ sub enable_rematch_main_legendary {
|
|||
sub get_security_key {
|
||||
my $save = shift;
|
||||
my $section0 = _find_section_save( $save, 0 );
|
||||
my $version = $section0->{version};
|
||||
my $data = $section0->{data};
|
||||
my $version = $section0->{version};
|
||||
my $data = $section0->{data};
|
||||
open my $fh, '<', \$data;
|
||||
if (_is_leafgreen_or_firered($version)) {
|
||||
if ( _is_leafgreen_or_firered($version) ) {
|
||||
read $fh, my $read, 0xf20;
|
||||
read $fh, $read, 4;
|
||||
read $fh, $read, 4;
|
||||
return unpack 'V', $read;
|
||||
} elsif (_is_ruby_or_sapphire($version)) {
|
||||
}
|
||||
elsif ( _is_ruby_or_sapphire($version) ) {
|
||||
return 0;
|
||||
}
|
||||
close $fh;
|
||||
|
@ -886,13 +898,14 @@ sub add_key_item {
|
|||
my $superdata = shift;
|
||||
my $item_id = shift;
|
||||
my $result = '';
|
||||
my $section0 = _find_section_save( $save, 0 );
|
||||
my $section0 = _find_section_save( $save, 0 );
|
||||
my $version = $section0->{version};
|
||||
open my $fh, '<', $superdata;
|
||||
my $offset = $KEY_ITEMS_OFFSET_RUBY;
|
||||
my $offset = $KEY_ITEMS_OFFSET_RUBY;
|
||||
my $max_key_items = $MAX_KEY_ITEMS_RUBY;
|
||||
if (_is_leafgreen_or_firered($version)) {
|
||||
$offset = $KEY_ITEMS_OFFSET_FIRERED;
|
||||
|
||||
if ( _is_leafgreen_or_firered($version) ) {
|
||||
$offset = $KEY_ITEMS_OFFSET_FIRERED;
|
||||
$max_key_items = $MAX_KEY_ITEMS_FIRERED;
|
||||
}
|
||||
read $fh, my ($read), $offset;
|
||||
|
@ -909,7 +922,7 @@ sub add_key_item {
|
|||
}
|
||||
$result .= $read;
|
||||
read $fh, $read, 2;
|
||||
my $quantity = get_security_key($save) ^ (unpack 'v', $read);
|
||||
my $quantity = get_security_key($save) ^ ( unpack 'v', $read );
|
||||
$result .= $read;
|
||||
if ( $found_item == $item_id ) {
|
||||
warn "$item_id already present with $quantity.";
|
||||
|
@ -924,16 +937,20 @@ sub add_key_item {
|
|||
}
|
||||
|
||||
sub get_var {
|
||||
my $save = shift;
|
||||
my $superdata = shift;
|
||||
my $var = shift;
|
||||
my $section0 = _find_section_save( $save, 0 );
|
||||
my $save = shift;
|
||||
my $superdata = shift;
|
||||
my $var = shift;
|
||||
my $section0 = _find_section_save( $save, 0 );
|
||||
my $version = $section0->{version};
|
||||
my $read_until = ( ( $var - $Rsaves::Constants::Ruby::Vars::VARS_START ) * 2 ) + $RUBY_VARS_START;
|
||||
if (_is_leafgreen_or_firered($version)) {
|
||||
$read_until = ( ( $var - $Rsaves::Constants::Firered::Vars::VARS_START ) * 2 ) + $FIRERED_VARS_START;
|
||||
my $read_until =
|
||||
( ( $var - $Rsaves::Constants::Ruby::Vars::VARS_START ) * 2 ) +
|
||||
$RUBY_VARS_START;
|
||||
if ( _is_leafgreen_or_firered($version) ) {
|
||||
$read_until =
|
||||
( ( $var - $Rsaves::Constants::Firered::Vars::VARS_START ) * 2 ) +
|
||||
$FIRERED_VARS_START;
|
||||
}
|
||||
if (_is_emerald($version)) {
|
||||
if ( _is_emerald($version) ) {
|
||||
die "Not implemented.";
|
||||
}
|
||||
open my $fh, '<', $superdata;
|
||||
|
@ -949,17 +966,22 @@ sub set_var {
|
|||
my $superdata = shift;
|
||||
my $var = shift;
|
||||
my $value = shift;
|
||||
my $section0 = _find_section_save( $save, 0 );
|
||||
my $section0 = _find_section_save( $save, 0 );
|
||||
my $version = $section0->{version};
|
||||
die "$value bigger than 0xffff" if $value > 0xffff;
|
||||
my $read_until = ( ( $var - $Rsaves::Constants::Ruby::Vars::VARS_START ) * 2 ) + $RUBY_VARS_START;
|
||||
if (_is_leafgreen_or_firered($version)) {
|
||||
$read_until = ( ( $var - $Rsaves::Constants::Firered::Vars::VARS_START ) * 2 ) + $FIRERED_VARS_START;
|
||||
my $read_until =
|
||||
( ( $var - $Rsaves::Constants::Ruby::Vars::VARS_START ) * 2 ) +
|
||||
$RUBY_VARS_START;
|
||||
|
||||
if ( _is_leafgreen_or_firered($version) ) {
|
||||
$read_until =
|
||||
( ( $var - $Rsaves::Constants::Firered::Vars::VARS_START ) * 2 ) +
|
||||
$FIRERED_VARS_START;
|
||||
}
|
||||
if (_is_emerald($version)) {
|
||||
if ( _is_emerald($version) ) {
|
||||
die "Not implemented.";
|
||||
}
|
||||
my $result = shift;
|
||||
my $result = shift;
|
||||
open my $fh, '<', $superdata;
|
||||
read $fh, ( my $read ), $read_until or die "Unable to read";
|
||||
$result .= $read;
|
||||
|
@ -979,7 +1001,7 @@ sub set_rematch {
|
|||
my $version = $section0->{version};
|
||||
my $offset = 0x9ca;
|
||||
|
||||
if (!_is_emerald($version)) {
|
||||
if ( !_is_emerald($version) ) {
|
||||
die 'Must be version emerald to do this.';
|
||||
}
|
||||
my $result = '';
|
||||
|
@ -1009,10 +1031,10 @@ sub set_flag_id {
|
|||
my $version = $section0->{version};
|
||||
my $offset = int( $id / 8 ) + $FLAGS_OFFSET_RUBY;
|
||||
if ( _is_leafgreen_or_firered($version) ) {
|
||||
$offset = (int $id / 8 ) + $FLAGS_OFFSET_FIRERED;
|
||||
$offset = ( int $id / 8 ) + $FLAGS_OFFSET_FIRERED;
|
||||
}
|
||||
if ( _is_emerald($version) ) {
|
||||
$offset = (int $id / 8 ) + $FLAGS_OFFSET_EMERALD;
|
||||
$offset = ( int $id / 8 ) + $FLAGS_OFFSET_EMERALD;
|
||||
}
|
||||
my $result = '';
|
||||
open my $fh, '<', $superdata;
|
||||
|
@ -1039,12 +1061,12 @@ sub check_flag_id {
|
|||
my $section0 = _find_section_save( $save, 0 );
|
||||
my $version = $section0->{version};
|
||||
|
||||
my $offset = int( $id / 8 ) + $FLAGS_OFFSET_RUBY;
|
||||
my $offset = int( $id / 8 ) + $FLAGS_OFFSET_RUBY;
|
||||
if ( _is_leafgreen_or_firered($version) ) {
|
||||
$offset = int ($id / 8 ) + $FLAGS_OFFSET_FIRERED;
|
||||
$offset = int( $id / 8 ) + $FLAGS_OFFSET_FIRERED;
|
||||
}
|
||||
if (_is_emerald($version)) {
|
||||
$offset = (int $id / 8 ) + $FLAGS_OFFSET_EMERALD;
|
||||
if ( _is_emerald($version) ) {
|
||||
$offset = ( int $id / 8 ) + $FLAGS_OFFSET_EMERALD;
|
||||
}
|
||||
|
||||
my $flags_offset = unpack "x@{[$offset]} C", ${$superdata};
|
||||
|
@ -1058,11 +1080,11 @@ sub check_rematch {
|
|||
my $section0 = _find_section_save( $save, 0 );
|
||||
my $version = $section0->{version};
|
||||
|
||||
if (!_is_emerald($version)) {
|
||||
if ( !_is_emerald($version) ) {
|
||||
die 'Must be version emerald to do this.';
|
||||
}
|
||||
|
||||
my $offset = $id + 0x9ca - 1;
|
||||
my $offset = $id + 0x9ca - 1;
|
||||
|
||||
my $rematch_offset = unpack "x@{[$offset]} C", ${$superdata};
|
||||
return $rematch_offset;
|
||||
|
@ -1094,9 +1116,10 @@ sub _recalculate_checksum {
|
|||
my $readed = '';
|
||||
read $fh, $readed, 4;
|
||||
my $to_add = unpack 'V', $readed;
|
||||
$checksum = 0xffffffff & ($checksum + $to_add);
|
||||
$checksum = 0xffffffff & ( $checksum + $to_add );
|
||||
}
|
||||
my $final_checksum = (_hihalf_u32($checksum) + _lowhalf_u32($checksum)) & 0xffffffff;
|
||||
my $final_checksum =
|
||||
( _hihalf_u32($checksum) + _lowhalf_u32($checksum) ) & 0xffffffff;
|
||||
$section->{checksum} = $final_checksum;
|
||||
}
|
||||
|
||||
|
|
After Width: | Height: | Size: 585 B |
After Width: | Height: | Size: 890 B |
After Width: | Height: | Size: 923 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 639 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 825 B |
After Width: | Height: | Size: 721 B |
After Width: | Height: | Size: 691 B |
After Width: | Height: | Size: 880 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 850 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 384 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 631 B |
After Width: | Height: | Size: 589 B |
After Width: | Height: | Size: 512 B |
After Width: | Height: | Size: 416 B |
After Width: | Height: | Size: 546 B |
After Width: | Height: | Size: 565 B |
After Width: | Height: | Size: 815 B |
After Width: | Height: | Size: 699 B |
After Width: | Height: | Size: 891 B |
After Width: | Height: | Size: 465 B |
After Width: | Height: | Size: 520 B |
After Width: | Height: | Size: 528 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1010 B |
After Width: | Height: | Size: 827 B |
After Width: | Height: | Size: 849 B |
After Width: | Height: | Size: 525 B |
After Width: | Height: | Size: 739 B |
After Width: | Height: | Size: 662 B |
After Width: | Height: | Size: 917 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 692 B |
After Width: | Height: | Size: 493 B |
After Width: | Height: | Size: 484 B |
After Width: | Height: | Size: 514 B |
After Width: | Height: | Size: 674 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 561 B |
After Width: | Height: | Size: 775 B |
After Width: | Height: | Size: 507 B |
After Width: | Height: | Size: 458 B |
After Width: | Height: | Size: 607 B |
After Width: | Height: | Size: 611 B |
After Width: | Height: | Size: 771 B |
After Width: | Height: | Size: 650 B |
After Width: | Height: | Size: 519 B |
After Width: | Height: | Size: 381 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 838 B |
After Width: | Height: | Size: 704 B |
After Width: | Height: | Size: 601 B |
After Width: | Height: | Size: 887 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 780 B |
After Width: | Height: | Size: 730 B |
After Width: | Height: | Size: 604 B |
After Width: | Height: | Size: 546 B |
After Width: | Height: | Size: 765 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 838 B |
After Width: | Height: | Size: 747 B |
After Width: | Height: | Size: 422 B |
After Width: | Height: | Size: 377 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 705 B |
After Width: | Height: | Size: 923 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 549 B |
After Width: | Height: | Size: 703 B |
After Width: | Height: | Size: 635 B |
After Width: | Height: | Size: 645 B |
After Width: | Height: | Size: 741 B |
After Width: | Height: | Size: 616 B |
After Width: | Height: | Size: 724 B |
After Width: | Height: | Size: 557 B |
After Width: | Height: | Size: 621 B |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 511 B |
After Width: | Height: | Size: 490 B |
After Width: | Height: | Size: 646 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 659 B |
After Width: | Height: | Size: 808 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 980 B |
After Width: | Height: | Size: 539 B |
After Width: | Height: | Size: 1.1 KiB |