浏览代码

scp: Document the WRSP extension block in the Python code.

Keir Fraser 4 年之前
父节点
当前提交
405283e80a
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      scripts/greaseweazle/image/scp.py

+ 7 - 2
scripts/greaseweazle/image/scp.py

@@ -99,9 +99,9 @@ class SCP(Image):
             trk_offs = trk_offs[:off]
 
         # Parse the extension block introduced by github:markusC64/g64conv.
-        # b'EXTS', length, <length byte Extension Area>
+        # b'EXTS', length, <length bytes: Extension Area>
         # Extension Area contains consecutive chunks of the form:
-        # ID, length, <length bytes of ID-specific dat>
+        # ID, length, <length bytes: ID-specific data>
         ext_sig, ext_len = struct.unpack('<4sI', dat[0x2b0:0x2b8])
         min_tdh = min(filter(lambda x: x != 0, trk_offs), default=0)
         if ext_sig == b'EXTS' and 0x2b8 + ext_len <= min_tdh:
@@ -109,6 +109,11 @@ class SCP(Image):
             while end - pos >= 8:
                 chk_sig, chk_len = struct.unpack('<4sI', dat[pos:pos+8])
                 pos += 8
+                # WRSP: WRite SPlice information block.
+                # Data is comprised of >= 169 32-bit values:
+                #  0: Flags (currently unused; must be zero)
+                #  N: Write splice/overlap position for track N, in SCP ticks
+                #     (zero if the track is unused)
                 if chk_sig == b'WRSP' and chk_len >= 169*4:
                     # Write-splice positions for writing out SCP tracks
                     # correctly to disk.