#!/usr/bin/perl # # Patch the UFD-DOS binary # # Patches cribbed from ufdpatch.ny by: # Bert Holgersson <560> 1988-02-03 20.26.03 (DUMP) # use bytes; @patches = ( # Hack to initalize the PRA:/PRB: devices in the printer # ROM [0x604b, 0xc3, 0x1b, 0x78], # Ctrl-C fix [0x6851, 0xcd, 0x9b, 0x6f], [0x6f9b, 0xcd, 0x3e, 0x03, 0xe9] ); $org = 0x6000; $len = 4096; ($in, $out) = @ARGV; open(IN, '<', $in) or die "$0: cannot open $in: $!\n"; if (read(IN, $rom, $len) != $len) { die "$0: input file $in has the wrong length\n"; } close(IN); foreach $patch (@patches) { @p = @$patch; $a = shift @p; foreach $b (@p) { substr($rom, $a-$org, 1) = chr($b); $a++; } } open(OUT, '>', $out) or die "$0: cannot open $out: $!\n"; print OUT $rom; close(OUT);