Ver código fonte

Acorn ADFS format specifiers

Keir Fraser 3 anos atrás
pai
commit
089ea42114

+ 59 - 8
scripts/greaseweazle/codec/formats.py

@@ -5,6 +5,8 @@
 # This is free and unencumbered software released into the public domain.
 # See the file COPYING for more details, or visit <http://unlicense.org>.
 
+from collections import OrderedDict
+
 from greaseweazle.tools import util
 
 class Format:
@@ -36,6 +38,50 @@ class Format_Acorn_DFS_DS(Format):
         self.fmt = m.Acorn_DFS
         self.default_revs = m.default_revs
         super().__init__()
+
+class Format_Acorn_ADFS_160(Format):
+    img_compatible = True
+    default_trackset = 'c=0-39:h=0'
+    max_trackset = 'c=0-81:h=0'
+    def __init__(self):
+        import greaseweazle.codec.ibm.mfm as m
+        self.fmt = m.Acorn_ADFS_640
+        self.default_revs = m.default_revs
+        super().__init__()
+    
+class Format_Acorn_ADFS_320(Format):
+    img_compatible = True
+    default_trackset = 'c=0-79:h=0'
+    max_trackset = 'c=0-81:h=0'
+    def __init__(self):
+        import greaseweazle.codec.ibm.mfm as m
+        self.fmt = m.Acorn_ADFS_640
+        self.default_revs = m.default_revs
+        super().__init__()
+
+class Format_Acorn_ADFS_640(Format):
+    img_compatible = True
+    def __init__(self):
+        import greaseweazle.codec.ibm.mfm as m
+        self.fmt = m.Acorn_ADFS_640
+        self.default_revs = m.default_revs
+        super().__init__()
+    
+class Format_Acorn_ADFS_800(Format):
+    img_compatible = True
+    def __init__(self):
+        import greaseweazle.codec.ibm.mfm as m
+        self.fmt = m.Acorn_ADFS_800
+        self.default_revs = m.default_revs
+        super().__init__()
+    
+class Format_Acorn_ADFS_1600(Format):
+    img_compatible = True
+    def __init__(self):
+        import greaseweazle.codec.ibm.mfm as m
+        self.fmt = m.Acorn_ADFS_1600
+        self.default_revs = m.default_revs
+        super().__init__()
     
 class Format_Amiga_AmigaDOS_DD(Format):
     adf_compatible = True
@@ -160,16 +206,16 @@ class Format_AtariST_880(Format):
         super().__init__()
     
     
-formats = {
+formats = OrderedDict({
     'acorn.dfs.ss': Format_Acorn_DFS_SS,
     'acorn.dfs.ds': Format_Acorn_DFS_DS,
+    'acorn.adfs.160': Format_Acorn_ADFS_160,
+    'acorn.adfs.320': Format_Acorn_ADFS_320,
+    'acorn.adfs.640': Format_Acorn_ADFS_640,
+    'acorn.adfs.800': Format_Acorn_ADFS_800,
+    'acorn.adfs.1600': Format_Acorn_ADFS_1600,
     'amiga.amigados': Format_Amiga_AmigaDOS_DD,
     'amiga.amigados_hd': Format_Amiga_AmigaDOS_HD,
-    'ibm.180': Format_IBM_180,
-    'ibm.360': Format_IBM_360,
-    'ibm.720': Format_IBM_720,
-    'ibm.1200': Format_IBM_1200,
-    'ibm.1440': Format_IBM_1440,
     'atarist.360': Format_AtariST_360,
     'atarist.400': Format_AtariST_400,
     'atarist.440': Format_AtariST_440,
@@ -177,11 +223,16 @@ formats = {
     'atarist.800': Format_AtariST_800,
     'atarist.880': Format_AtariST_880,
     'commodore.1581': Format_IBM_800,
-}
+    'ibm.180': Format_IBM_180,
+    'ibm.360': Format_IBM_360,
+    'ibm.720': Format_IBM_720,
+    'ibm.1200': Format_IBM_1200,
+    'ibm.1440': Format_IBM_1440,
+})
 
 def print_formats(f = None):
     s = ''
-    for k, v in sorted(formats.items()):
+    for k, v in formats.items():
         if not f or f(k, v):
             if s:
                 s += '\n'

+ 30 - 0
scripts/greaseweazle/codec/ibm/mfm.py

@@ -414,6 +414,36 @@ class AtariST_11SPT(IBM_MFM_720):
     gap_3 = 3
     nsec  = 11
 
+class Acorn_ADFS_640(IBM_MFM_Predefined):
+
+    time_per_rev = 0.2
+    clock = 2e-6
+
+    gap_3 = 57
+    nsec  = 16
+    id0   = 0
+    sz    = 1
+
+class Acorn_ADFS_800(IBM_MFM_Predefined):
+
+    time_per_rev = 0.2
+    clock = 2e-6
+
+    gap_3 = 116
+    nsec  = 5
+    id0   = 0
+    sz    = 3
+
+class Acorn_ADFS_1600(IBM_MFM_Predefined):
+
+    time_per_rev = 0.2
+    clock = 1e-6
+
+    gap_3 = 116
+    nsec  = 10
+    id0   = 0
+    sz    = 3
+
 
 def mfm_encode(dat):
     y = 0