Put various data related to episode completion in a single hash
container.
sprite => ['8C',
line => 'B8',
],
sprite => ['8C',
line => 'B8',
],
- endtype => 's',
- endstr => 'Ca255',
- enddata => 'Ca255x256',
+ finish => [1,
+ type => 's',
+ message => 'Ca255',
+ code => 'Ca255x256',
+ ],
hiname => 'a3',
levels => ['*', # levelcount->total actually
id => 'Ca22',
hiname => 'a3',
levels => ['*', # levelcount->total actually
id => 'Ca22',
$version = 94;
}
elsif (ord substr($input, 147, 1) == 0) {
$version = 94;
}
elsif (ord substr($input, 147, 1) == 0) {
- # nul of end type is 2 bytes later (unlike first char of endstr)
+ # nul of finish type is 2 bytes later (unlike first char of message)
$version = 96;
}
warn "Ambiguous file version 95; guessing subversion $version\n";
$version = 96;
}
warn "Ambiguous file version 95; guessing subversion $version\n";
given ($fileversion) {
when (153) { } # current @FORMAT
$FORMAT[7] = 'Ca64'; # no reserved space after description
given ($fileversion) {
when (153) { } # current @FORMAT
$FORMAT[7] = 'Ca64'; # no reserved space after description
- $FORMAT[19] = 'Ca255'; # enddata
+ $FORMAT[15]->[-1] = 'Ca255'; # enddata
$FORMAT[-1]->[-1]->[0] = '32C'; # less objects
when ($version == 96) {
ref $_ and $_->[-1] = 'C' for @{ $FORMAT[11] }; # 9 moderefs
$FORMAT[-1]->[-1]->[0] = '32C'; # less objects
when ($version == 96) {
ref $_ and $_->[-1] = 'C' for @{ $FORMAT[11] }; # 9 moderefs
splice @FORMAT, 6, 2 if $version <= 94; # earlier version without description
when (95) { }
splice @{ $FORMAT[7] }, 4, 2; # no race
splice @FORMAT, 6, 2 if $version <= 94; # earlier version without description
when (95) { }
splice @{ $FORMAT[7] }, 4, 2; # no race
- splice @FORMAT, 16, 2; # no enddata
+ splice @{ $FORMAT[13] }, 4, 2; # no enddata
splice @{ $FORMAT[-1] }, 1, 2; # no name
when (94) { }
splice @{ $FORMAT[-1] }, 1, 2; # no name
when (94) { }
- splice @FORMAT, 16, 2; # no hiname
+ splice @FORMAT, 14, 2; # no hiname
$FORMAT[-1]->[0] = 64; # constant amount of levels
when (93) { }
default {
$FORMAT[-1]->[0] = 64; # constant amount of levels
when (93) { }
default {
#levels-multi
#hinames
);
#levels-multi
#hinames
);
$data->{moderef}->{end}->{tron}, # idem for tron
);
$data->{hinames} = [ unpack '(x2a3)*', substr($data->{leveldata}, -5 * $slots) ];
$data->{moderef}->{end}->{tron}, # idem for tron
);
$data->{hinames} = [ unpack '(x2a3)*', substr($data->{leveldata}, -5 * $slots) ];
- $data->{enddata} = substr delete($data->{leveldata}), $offset, -5 * $slots; #XXX
+ $data->{finish}->{code} = substr delete($data->{leveldata}), $offset, -5 * $slots; #XXX
$data->{format} = '86s';
return $data;
}
$data->{format} = '86s';
return $data;
}
print "\n";
printf("-- %-21s%4s: %s (%s)\n",
'(ending)',
print "\n";
printf("-- %-21s%4s: %s (%s)\n",
'(ending)',
- defined $data->{enddata} ? length $data->{enddata} : '?',
- defined $data->{endtype} ? $ENDTYPE[$data->{endtype}] || 'unknown' : 'code',
- $data->{endstr} // '?',
+ defined $data->{finish}->{code}
+ ? length $data->{finish}->{code} : '?',
+ defined $data->{finish}->{type}
+ ? $ENDTYPE[$data->{finish}->{type}] || 'unknown' : 'code',
+ $data->{finish}->{message} // '?',
) if $variant eq 'single';
}
}
) if $variant eq 'single';
}
}