diff options
author | Astatin <[email protected]> | 2025-05-20 15:16:43 +0200 |
---|---|---|
committer | Astatin <[email protected]> | 2025-05-20 15:16:43 +0200 |
commit | 34ee469cc32584d579bae925857fc25c0a8c6c1b (patch) | |
tree | b5f33d4419ce400a4ad06179f88f7d6e1d6e5ae1 /scripts | |
parent | 9843e1e65b6eb3e96a6b6a73ffaeab4481061ac6 (diff) |
Fix object not deleted when dialogue open on specific frame
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/edit-recording.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/edit-recording.py b/scripts/edit-recording.py new file mode 100644 index 0000000..5f98a7e --- /dev/null +++ b/scripts/edit-recording.py @@ -0,0 +1,30 @@ +import sys + +file = open(sys.argv[1], "rb") +output_file = open(sys.argv[2], "wb") + +last_cycle_update = 0 +offset = 0 +while True: + next_cycle_update_buf = file.read(16) + if len(next_cycle_update_buf) < 16: + break + inputs = file.read(2) + + next_cycle_update = int.from_bytes(next_cycle_update_buf, byteorder="little", signed=False) + print("CYCLES: %d, input1: %08x, input2: %08x" % (next_cycle_update, inputs[0], inputs[1])) + + + next_cycle_update -= offset + + if last_cycle_update != 0: + if next_cycle_update - last_cycle_update > 70224 * 256 * 8: + new_offset = (next_cycle_update - last_cycle_update) - ((next_cycle_update - last_cycle_update) % (70224 * 256)) - (70224 * 256) + print(new_offset) + next_cycle_update -= new_offset + offset += new_offset + + + last_cycle_update = next_cycle_update + output_file.write(next_cycle_update.to_bytes(16, byteorder="little", signed=False)) + output_file.write(inputs) |