From 5fd2dd5b95ebe34bee2c459fbdf40afe286b9682 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 15 Feb 2021 18:06:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9dumpRecording=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E7=9A=84=E6=B3=A8=E9=87=8A=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/gametoolfunc.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index 8dc4db91..cf73d829 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -831,19 +831,17 @@ end Byte data format: (1 byte each period) dt, event, dt, event, ... - event range from 1 to 20, negative when release key - dt from 0 to infinity, 0~254 when 0~254, read next byte as dt(if there is an 255, add next byte to dt as well) + all data range from 0 to 127 + large value will be encoded as 1xxxxxxx(high)-1xxxxxxx-...-0xxxxxxx(low) - Example: - 6,1, 20,-1, 0,2, 255,0,-2, 255,255,255,62,4 ... - Translate: - (6,1)(20,-1)(0,2)(255,0,-2)(255,255,255,62,4) ... + Example (decoded): + 6,1, 20,-1, 0,2, 26,-2, 872,4, ... This means: Press key1 at 6f Release key1 at 26f (6+20) Press key2 at the same time (26+0) - Release key 2 after 255+0 frame (26+0+255+0) - Press key 4 after 255+255+255+62 frame (26+0+255+0+255+255+255+62) + Release key 2 after 26 frame (26+26) + Press key 4 after 872 frame (52+872) ... ]] function dumpRecording(list,ptr)