mirror of
https://github.com/a2-4am/wozardry.git
synced 2024-12-12 17:29:14 +00:00
support removing tracks from woz with FLUX chunk
This commit is contained in:
parent
d0ebf64b83
commit
b07e018310
@ -709,15 +709,17 @@ class WozDiskImage:
|
|||||||
return self.remove(self.track_num_to_half_phase(track_num))
|
return self.remove(self.track_num_to_half_phase(track_num))
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
"""removes tracks from self.tracks that are not referenced from self.tmap, and adjusts remaining self.tmap indices"""
|
"""removes tracks from self.tracks that are not referenced from self.tmap/flux, and adjusts remaining indices"""
|
||||||
if self.flux: return
|
|
||||||
i = 0
|
i = 0
|
||||||
while i < len(self.tracks):
|
while i < len(self.tracks):
|
||||||
if i not in self.tmap:
|
if (i not in self.tmap) and (i not in self.flux):
|
||||||
del self.tracks[i]
|
del self.tracks[i]
|
||||||
for adjust in range(len(self.tmap)):
|
for adjust in range(len(self.tmap)):
|
||||||
if (self.tmap[adjust] >= i) and (self.tmap[adjust] != 0xFF):
|
if (self.tmap[adjust] >= i) and (self.tmap[adjust] != 0xFF):
|
||||||
self.tmap[adjust] -= 1
|
self.tmap[adjust] -= 1
|
||||||
|
for adjust in range(len(self.flux)):
|
||||||
|
if (self.flux[adjust] >= i) and (self.flux[adjust] != 0xFF):
|
||||||
|
self.flux[adjust] -= 1
|
||||||
else:
|
else:
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user