mirror of
https://github.com/UzixLS/pacemuzx.git
synced 2025-07-19 07:11:20 +03:00
pacemuzx v1.0
This commit is contained in:
26
remove_rom.pl
Executable file
26
remove_rom.pl
Executable file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
# First 4K of Pac-Man ROM
|
||||
$file = 'pacman.6e';
|
||||
open FILE, "<$file" and binmode FILE or die "$file: $!\n";
|
||||
read FILE, $rom='', -s $file;
|
||||
close FILE;
|
||||
|
||||
# Full TAP image for emulator, including ROM
|
||||
$file = 'pacemuzx.tap';
|
||||
open FILE, "<$file" and binmode FILE or die "$file: $!\n";
|
||||
read FILE, $data='', -s $file;
|
||||
close FILE;
|
||||
|
||||
$index = index($data, $rom);
|
||||
die "ROM image not found in TAP file!\n" if $index < 0;
|
||||
|
||||
$file = 'start.part';
|
||||
open FILE, ">$file" and binmode FILE or die "$file: $!\n";
|
||||
print FILE substr $data, 0, $index;
|
||||
close FILE;
|
||||
|
||||
$file = 'end.part';
|
||||
open FILE, ">$file" and binmode FILE or die "$file: $!\n";
|
||||
print FILE substr $data, $index+16384;
|
||||
close FILE;
|
Reference in New Issue
Block a user