]> git.sesse.net Git - s573compress/commitdiff
More shuffling of extra stage bits.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 15 Dec 2019 12:52:32 +0000 (13:52 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 15 Dec 2019 13:05:34 +0000 (14:05 +0100)
create_mdb.py
dump_mdb.py
mdb_bin.ksy

index 0131cfba40540814a25be8dd2944b8e019004cdc..bbd5e4094e91ee3bf50e528184608c2b17c6d9a2 100755 (executable)
@@ -87,8 +87,8 @@ with open(output_filename, 'wb') as tabfile:
                e += struct.pack('B', entry['rating']['double_expert'] | (entry['rating']['double_challenge'] << 4))
                e += struct.pack('<H', 0)   # Always zero.
                e += struct.pack('B', (
-                       (entry['extra_stage_bit1'] << 7) |
-                       (MdbBin.ExtraStageInfo[entry['extra_stage']].value << 5) |
+                       (MdbBin.ExtraStageInfo[entry['extra_stage']].value << 6) |
+                       (entry['extra_stage_bit3'] << 5) |
                        (entry['extra_stage_bit4'] << 4) |
                        entry['song_type']
                ))
index 52af40b2bbeaa410bd65cca1d6806661abbe0698..2a4ba0dbd9f28e902fc3cd2c6ea699fd056af8cb 100755 (executable)
@@ -54,8 +54,8 @@ def create_json(entry):
                        'double_challenge': entry.double_rating_challenge,
                        'double_expert': entry.double_rating_expert,
                },
-               'extra_stage_bit1': entry.extra_stage_bit1,
                'extra_stage': entry.extra_stage.name,
+               'extra_stage_bit3': entry.extra_stage_bit3,
                'extra_stage_bit4': entry.extra_stage_bit4,
                'song_type': entry.song_type,
                'in_default_view': entry.in_default_view,
index 6a1dd4312e2eef52c5584eedc86fce203d847a5c..573bef89e50cef8011c7b7ac06b1eb5b383f68fb 100644 (file)
@@ -73,11 +73,11 @@ types:
       - id: always_zero_4
         contents: [0x0, 0x0]
       # Byte 0 of flags bitmask.
-      - id: extra_stage_bit1        # Only true for LoM. (For MAX2, true for KAKUMEI instead.)
-        type: b1
       - id: extra_stage
         type: b2
         enum: extra_stage_info
+      - id: extra_stage_bit3        # Only true for LoM.
+        type: b1
       - id: extra_stage_bit4        # Seems to never be set, must be 0. (MAX2 sets these to true for all regular songs, and false for other music.)
         type: b1
       - id: song_type               # Seems to be 0xc for regular songs, 0x6 for random. Probably a bitmask.
@@ -223,8 +223,8 @@ enums:
 
   extra_stage_info:
     0x0: none
-    0x1: extra_stage
-    0x2: one_more_extra_stage
+    0x1: one_more_extra_stage        # 1 and 2 are swapped on MAX2.
+    0x2: extra_stage
     0x3: unknown
 
   # Kaitai Struct doesn't have constants/configuration, so this is a way to simulate them.