Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 38 lines (30 sloc) 1.05 KB
#!/usr/bin/env python
# Author: Bryan Cain
# Date: January 22, 2011
# Description: Converts VC Genesis saves to the .srm format used by Gens/GS.
# The save format used by Genesis VC games was reverse engineered by Bryan Cain.
import struct
# src, dest: filesystem paths
def convert(src, dest):
infile = open(src, 'rb')
outfile = open(dest, 'wb')
# read VC header
assert == 'VCSD'
size1 = struct.unpack('<I',[0] # size of expanded file + size of SRAM block (0x8) # not sure what these 4 bytes do
assert == 'SRAM'
size = struct.unpack('<I',[0] # size of expanded file; equal to (size1 - 0x8)
assert size == size1 - 0x8
while outfile.tell() < size:
data =
intdata = struct.unpack('>512B', data)
outfile.write(struct.pack('>512H', *intdata))
if __name__ == '__main__':
import sys
if len(sys.argv) != 3:
sys.stderr.write('Usage: %s infile outfile\n' % sys.argv[0])
convert(sys.argv[1], sys.argv[2])
print 'Done'