1
0
mirror of synced 2024-11-28 06:50:49 +01:00

Add a sample "unknownHeader" to use in TJA conversions

This contains all of the dummy/padding text found through investigation, but none of the actual song-specific header metadata, so this will need to be updated further.

But, it's better than all 0s, and I want to test to see how TDMX responds to this.
This commit is contained in:
Viv 2023-06-02 16:33:46 -04:00
parent ce99164583
commit aadbb3f8ba
2 changed files with 23 additions and 2 deletions

View File

@ -69,3 +69,24 @@ byte_strings = {
} }
simpleHeaders = [b * 36 for b in [byte_strings['431'], byte_strings['V1'], byte_strings['V2']]] simpleHeaders = [b * 36 for b in [byte_strings['431'], byte_strings['V1'], byte_strings['V2']]]
# This sample header for the "unknown header bytes" is built from the investigations in utils/validateHeaderMetadata
# However, it's missing song-specific metadata from bytes 12, 16, 20, and (perhaps optionally), 76, 77 and 78.
unknownHeaderSample = [0] * 80
unknownHeaderSample[4] = 16
unknownHeaderSample[5] = 39
unknownHeaderSample[21] = 255
unknownHeaderSample[22] = 255
unknownHeaderSample[23] = 255
unknownHeaderSample[26] = 1
unknownHeaderSample[30] = 1
unknownHeaderSample[34] = 1
unknownHeaderSample[36] = 20
unknownHeaderSample[40] = 10
unknownHeaderSample[48] = 1
unknownHeaderSample[52] = 20
unknownHeaderSample[56] = 10
unknownHeaderSample[60] = 1
unknownHeaderSample[64] = 30
unknownHeaderSample[68] = 30
unknownHeaderSample[72] = 20

View File

@ -1,6 +1,6 @@
from copy import deepcopy from copy import deepcopy
from constants import TJA_NOTE_TYPES from constants import TJA_NOTE_TYPES, unknownHeaderSample
# Filler metadata that the `writeFumen` function expects # Filler metadata that the `writeFumen` function expects
default_note = {'type': '', 'pos': 0.0, 'item': 0, 'padding': 0.0, default_note = {'type': '', 'pos': 0.0, 'item': 0, 'padding': 0.0,
@ -162,7 +162,7 @@ def convertTJAToFumen(fumen, tja):
# Append the measure to the tja's list of measures # Append the measure to the tja's list of measures
tjaConverted['measures'].append(measureFumen) tjaConverted['measures'].append(measureFumen)
tjaConverted['headerUnknown'] = b'x\00' * 80 tjaConverted['headerUnknown'] = b"".join(i.to_bytes(1, 'little') for i in unknownHeaderSample)
tjaConverted['order'] = '<' tjaConverted['order'] = '<'
tjaConverted['length'] = len(tjaConverted['measures']) tjaConverted['length'] = len(tjaConverted['measures'])
tjaConverted['unknownMetadata'] = 0 tjaConverted['unknownMetadata'] = 0