mirror of
https://github.com/bobbimanners/emailler.git
synced 2025-02-03 18:34:34 +00:00
3d4ee4ecf2
git-svn-id: http://svn.code.sf.net/p/netboot65/code@63 93682198-c243-4bdb-bd91-e943c89aac3b
20 lines
594 B
Ruby
20 lines
594 B
Ruby
#
|
|
# Vice will treat a cartridge bin file that is of an even length as if the first 2 bytes in the file are a load address to be skipped over
|
|
# so we want to make sure the bin file is an odd length - specifically 8193 bytes
|
|
#
|
|
|
|
FILE_LENGTH=8193
|
|
PAD_BYTE=0xff.chr
|
|
filename=ARGV[0]
|
|
if filename.nil? then
|
|
puts "no filename specified"
|
|
exit
|
|
end
|
|
|
|
|
|
infile=File.open(filename,"rb").read
|
|
puts "fixing length of #{filename} from #{infile.length} to #{FILE_LENGTH} bytes"
|
|
outfile=File.open(filename,"wb")
|
|
outfile<<infile
|
|
outfile<<PAD_BYTE*(FILE_LENGTH-infile.length)
|
|
outfile.close |