mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2025-01-23 16:31:44 +00:00
Changed binary test data so the file contents repeat on 8 character boundaries making differences easier to spot in Omnivore's char view
* added ranges for file specification
This commit is contained in:
parent
c36aebd593
commit
690cc0aaca
@ -9,14 +9,14 @@ import subprocess
|
|||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
def create_binary(filename, num, outfile, options):
|
def create_binary(filename, num, outfile, options):
|
||||||
"""Create patterned binary data with the filename interleaved with a byte
|
"""Create patterned binary data with the first 7 characters of the filename
|
||||||
ramp, e.g. A128\x00A128\x01A128\x02 etc.
|
interleaved with a byte ramp, e.g. A128 \x00A128 \x01A128 \x02 etc.
|
||||||
"""
|
"""
|
||||||
root, _ = outfile.split(".")
|
root, _ = outfile.split(".")
|
||||||
a = np.fromstring(root + " ", dtype=np.uint8)
|
prefix = ("%s " % root)[0:8]
|
||||||
|
a = np.fromstring(prefix, dtype=np.uint8)
|
||||||
b = np.tile(a, (num / np.alen(a)) + 1)[0:num]
|
b = np.tile(a, (num / np.alen(a)) + 1)[0:num]
|
||||||
e = np.where(b == 32)[0]
|
b[7::8] = np.arange(np.alen(b) / 8, dtype=np.uint8)
|
||||||
b[e] = np.arange(np.alen(e), dtype=np.uint8)
|
|
||||||
with open(filename, "wb") as fh:
|
with open(filename, "wb") as fh:
|
||||||
fh.write(b.tostring())
|
fh.write(b.tostring())
|
||||||
|
|
||||||
@ -78,12 +78,23 @@ if __name__ == "__main__":
|
|||||||
repeat, num = entry.split("*", 1)
|
repeat, num = entry.split("*", 1)
|
||||||
num = int(num)
|
num = int(num)
|
||||||
repeat = int(repeat)
|
repeat = int(repeat)
|
||||||
|
entries = [num] * repeat
|
||||||
|
elif "-" in entry:
|
||||||
|
first, last = entry.split("-", 1)
|
||||||
|
first = int(first)
|
||||||
|
if "," in last:
|
||||||
|
last, step = last.split(",", 1)
|
||||||
|
step = int(step)
|
||||||
|
else:
|
||||||
|
step = 1
|
||||||
|
last = int(last)
|
||||||
|
entries = range(first, last + 1, step)
|
||||||
else:
|
else:
|
||||||
num = int(entry)
|
num = int(entry)
|
||||||
repeat = 1
|
entries = [num]
|
||||||
for i in range(repeat):
|
for i in entries:
|
||||||
outfile = get_filename(num, used)
|
outfile = get_filename(i, used)
|
||||||
create_binary(binfile, num, outfile, options)
|
create_binary(binfile, i, outfile, options)
|
||||||
franny(out, "-A", "-i", binfile, "-o", outfile)
|
franny(out, "-A", "-i", binfile, "-o", outfile)
|
||||||
files.append(outfile)
|
files.append(outfile)
|
||||||
os.unlink(binfile)
|
os.unlink(binfile)
|
||||||
|
@ -6,7 +6,8 @@ function create() {
|
|||||||
./create_binary.py $ARGS -o ${ROOT}test1.atr 128 256 512 1024 4096
|
./create_binary.py $ARGS -o ${ROOT}test1.atr 128 256 512 1024 4096
|
||||||
./create_binary.py $ARGS -o ${ROOT}test2.atr 50*256 2*512 256 1024 256 d1 d2 d3 4096
|
./create_binary.py $ARGS -o ${ROOT}test2.atr 50*256 2*512 256 1024 256 d1 d2 d3 4096
|
||||||
./create_binary.py $ARGS -o ${ROOT}test3.atr 10*256 d1 d7 4096 d3 d5 d9 8000
|
./create_binary.py $ARGS -o ${ROOT}test3.atr 10*256 d1 d7 4096 d3 d5 d9 8000
|
||||||
./create_binary.py $ARGS -o ${ROOT}test4.atr 10*4096 d1 d3 d5 d7 d9
|
./create_binary.py $ARGS -o ${ROOT}test4.atr 10*4096 d1 d3 d5 d7 d9 15000
|
||||||
|
./create_binary.py $ARGS -o ${ROOT}test5.atr 100-500,7
|
||||||
}
|
}
|
||||||
|
|
||||||
create "dos_sd_" "-f a -t s"
|
create "dos_sd_" "-f a -t s"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user