aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rwxr-xr-xisoc-mount2
-rwxr-xr-xisoc.py5
3 files changed, 9 insertions, 2 deletions
diff --git a/README.md b/README.md
index 58a1371..1581a32 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,10 @@ Currently, you can use redseafs to create/modify/read RedSea ISO.C files on any
Specify `--rw` to commit writes to ISO.C file, otherwise discarded on unmount.
+Specify `--2k` to pad ISO.C file to multiple of 2048 bytes, for compatibility with VirtualBox virtual CD or physical disc ONLY
+
+(2k padded ISO.C files will not mount with TempleOS `MountFile()`, you will get `ERROR: Not RedSea`)
+
If the ISO.C file does not exist, a blank filesystem will be created (and written on unmount if `--rw` specified.)
`fusermount -u <mount_point>` to unmount
diff --git a/isoc-mount b/isoc-mount
index c732c32..4b1c0a5 100755
--- a/isoc-mount
+++ b/isoc-mount
@@ -20,6 +20,8 @@ if len(sys.argv) < 3:
print "Usage: " + sys.argv[0] + " [--rw] [--2k] <filename.ISO.C> <mount_point>"
print " --rw: commit writes to ISO.C file, otherwise discarded on unmount."
print " If the ISO.C file does not exist, a new one will be created."
+ print " --2k: Pad ISO.C to multiple of 2048 bytes "
+ print " (for VirtualBox or physical disk only) "
sys.exit()
os.system('"' + sys.argv[0][:sys.argv[0].rfind("/")+1] + 'isoc.py" "' + sys.argv[1] + '" "' + sys.argv[2] + '" "' + rw + '" "' + pad + '" &')
diff --git a/isoc.py b/isoc.py
index eee3693..9cba8b3 100755
--- a/isoc.py
+++ b/isoc.py
@@ -192,8 +192,9 @@ def write_iso_c(self, iso_c_file, pad):
file.seek(int(f['clus']*RS_BLK_SIZE))
file.write(self.data[(d+'/'+f['filename']).replace("//","/")])
- # Set counter to byte multiple 2048
- de_clus_ctr=roundup(de_clus_ctr)
+ # If --2k, Set counter to byte multiple 2048
+ if int(pad) == 1:
+ de_clus_ctr=roundup(de_clus_ctr)
# Write to EOF
file.seek(RS_DRV_OFFSET+int(de_clus_ctr*RS_BLK_SIZE)-1)