Last active
October 1, 2020 19:44
-
-
Save shattered/94e0b352c241885a3a457f5a12757a41 to your computer and use it in GitHub Desktop.
victor 9000 image converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
use vars qw(@spt $RAW $IMG $buf); | |
@spt = | |
( | |
19, 19, 19, 19, | |
18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, | |
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, | |
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, | |
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, | |
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, | |
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | |
12, 12, 12, 12, 12, 12, 12, 12, 12 | |
); | |
open($RAW, "<", $ARGV[0]) || die; | |
open($IMG, ">", $ARGV[1]) || die; | |
binmode ($RAW); | |
binmode ($IMG); | |
for (my $i = 0; $i < 80; $i++) | |
{ | |
seek($RAW, $i * 19 * 512, 0); | |
read($RAW, $buf, $spt[$i] * 512); | |
print $IMG $buf; | |
} |
I've only tested this with kryoflux images from internet and they look like this when parsed by samdisk (track numbering starts at 0):
<...>
250Kbps Victor, 15 sectors, 512 bytes/sector:
38.0 3 4 5 6 7 8 9 10 11 12 13 14 0 1 2
39.0 11 12 13 14 0 1 2 3 4 5 6 7 8 9 10
40.0 3 4 5 6 7 8 9 10 11 12 13 14 0 1 2
41.0 11 12 13 14 0 1 2 3 4 5 6 7 8 9 10
42.0 3 4 5 6 7 8 9 10 11 12 13 14 0 1 2
43.0 11 12 13 14 0 1 2 3 4 5 6 7 8 9 10
44.0 3 4 5 6 7 8 9 10 11 12 13 14 0 1 2
45.0 11 12 13 14 0 1 2 3 4 5 6 7 8 9 10
46.0 3 4 5 6 7 8 9 10 11 12 13 14 0 1 2
47.0 11 12 13 14 0 1 2 3 4 5 6 7 8 9 10
250Kbps Victor, 14 sectors, 512 bytes/sector:
48.0 8 9 10 11 12 13 0 1 2 3 4 5 6 7
49.0 1 2 3 4 5 6 7 8 9 10 11 12 13 0
<...>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think there is a bug in the handling of zones (lines 14 & 15). When I look at the v9k technical manual, zone 4 (index starting at 0) should have 11 tracks, while only 10 tracks are declared. This means that track 48 gets 14 sectors instead of 15.