From 0c95ff11f3e2e73bd351b8fb2e6576b6c9c2fbca Mon Sep 17 00:00:00 2001 From: Viv Date: Fri, 2 Jun 2023 16:33:42 -0400 Subject: [PATCH] `tja2fumen.py`: Account for additional unknown metadata I'm not sure what these 4 bytes represent yet. --- tja2fumen/tja2fumen.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tja2fumen/tja2fumen.py b/tja2fumen/tja2fumen.py index d7ac0dd..4cc2e70 100644 --- a/tja2fumen/tja2fumen.py +++ b/tja2fumen/tja2fumen.py @@ -106,6 +106,7 @@ def readFumen(fumenFile, byteOrder=None, debug=False): else: order = "<" totalMeasures = measuresLittle + unknownMetadata = readStruct(file, order, format_string="I", seek=0x204)[0] # Initialize the dict that will contain the chart information song = {} @@ -113,6 +114,7 @@ def readFumen(fumenFile, byteOrder=None, debug=False): song['headerUnknown'] = fumenHeaderUnknown song['order'] = order song["length"] = totalMeasures + song["unknownMetadata"] = unknownMetadata # Determine whether the song has branches from byte 0x1b0 (decimal 432) hasBranches = getBool(readStruct(file, order, format_string="B", seek=0x1b0)[0]) @@ -324,6 +326,7 @@ def writeFumen(file, song): # Write metadata writeStruct(file, order, format_string="B", value_list=[putBool(song['branches'])], seek=0x1b0) writeStruct(file, order, format_string="I", value_list=[song['length']], seek=0x200) + writeStruct(file, order, format_string="I", value_list=[song['unknownMetadata']], seek=0x204) # Write measure data file.seek(0x208)