Closed swazrgb closed 6 months ago
I asked on the Desynced discord and Bernhard from Stage said they would hopefully publish an implementation of how to serialize these strings as well
Hmm, the data seems mostly correct, but the data stream ends before the reader is done. The decompressed data from the game is 6 bytes longer
Here is another one which gives a different error message: ERROR: Unable to parse table key of type 'table'
ASM:
foo:
.name "foo"
.pname p1, v
set_reg 1, p1
set_reg 2, p1
set_reg 3, p1
set_reg 4, p1
set_reg 5, p1
set_reg 6, p1
set_reg 7, p1
set_reg 8, p1
set_reg 9, p1
set_reg 10, p1
set_reg 11, p1
set_reg 12, p1
set_reg 13, p1
set_reg 14, p1
set_reg 15, p1
set_reg 16, p1
set_reg 17, p1
set_reg 18, p1
set_reg 19, p1
set_reg 20, p1
set_reg 21, p1
set_reg 22, p1
set_reg 23, p1
set_reg 24, p1
set_reg 25, p1
set_reg 26, p1
set_reg 27, p1
set_reg 28, p1
set_reg 29, p1
set_reg 30, p1
set_reg 31, p1
set_reg 32, p1
set_reg 33, p1
set_reg 34, p1
set_reg 35, p1
set_reg 36, p1
set_reg 37, p1
set_reg 38, p1
set_reg 39, p1
set_reg 40, p1
set_reg 41, p1
set_reg 42, p1
set_reg 43, p1
set_reg 44, p1
set_reg 45, p1
set_reg 46, p1
set_reg 47, p1
set_reg 48, p1
set_reg 49, p1
set_reg 50, p1
set_reg 51, p1
set_reg 52, p1
set_reg 53, p1
set_reg 54, p1
set_reg 55, p1
set_reg 56, p1
set_reg 57, p1
set_reg 58, p1
set_reg 59, p1
set_reg 60, p1
set_reg 61, p1
set_reg 62, p1
set_reg 63, p1
set_reg 64, p1
set_reg 65, p1
set_reg 66, p1
set_reg 67, p1
set_reg 68, p1
set_reg 69, p1
set_reg 70, p1
set_reg 71, p1
set_reg 72, p1
set_reg 73, p1
set_reg 74, p1
set_reg 75, p1
set_reg 76, p1
set_reg 77, p1
set_reg 78, p1
set_reg 79, p1
set_reg 80, p1
set_reg 81, p1
set_reg 82, p1
set_reg 83, p1
set_reg 84, p1
set_reg 85, p1
set_reg 86, p1
set_reg 87, p1
set_reg 88, p1
set_reg 89, p1
set_reg 90, p1
set_reg 91, p1
set_reg 92, p1
set_reg 93, p1
set_reg 94, p1
set_reg 95, p1
set_reg 96, p1
set_reg 97, p1
set_reg 98, p1
set_reg 99, p1
set_reg 100, p1
set_reg 101, p1
set_reg 102, p1
set_reg 103, p1
set_reg 104, p1
set_reg 105, p1
set_reg 106, p1
set_reg 107, p1
set_reg 108, p1
set_reg 109, p1
set_reg 110, p1
set_reg 111, p1
set_reg 112, p1
set_reg 113, p1
set_reg 114, p1
set_reg 115, p1
set_reg 116, p1
set_reg 117, p1
set_reg 118, p1
set_reg 119, p1
set_reg 120, p1
set_reg 121, p1
set_reg 122, p1
set_reg 123, p1
set_reg 124, p1
set_reg 125, p1
set_reg 126, p1
set_reg 127, p1
set_reg 128, p1
.ret
Behavior string:
DSC3Gk3nYCqG1m9GpZ3VrTyS4NHoZf4NHpNe1vmpf40yETvV0P3GJu0UwJhA3RU5zE1K2fOk2B3eZj48UYWx0fSpsk4P99701bmD9u4Y0oOb3HaHdg1w3xjZ0MrtWc0g3FtD0g8N5Q1Xb0c61UYd0s1M4e1s1M92oG1M1tXg3Yb6d005qB5M0EvKyr03ZOJJ1qkE572gOfjt2gO7W71VjuPn2UATVw1HfHhq1GWdFB1InQPx4BciCH1YcJ4l3tQ4Hr3tQLKs0xkcNv2Z7zU21TETSU1Tnfha1T5fuU0QTMTa17RMQg2I6daa03aSNM1udMuO2iTNbU2iOxpB2iXlOj18ikgb0xyB9A0oqxcg171J0s0dUzko1uwZbD1qhQWf1qjcur1qgsQf1mcLpr2PWuIe2U4UFO1HummY0v4RDt1InDuA0BXAQC2XYknq1RAB8M1311o93FFnYl0ThSiH0qpXI212J9yT0qPMIa0OjuTM1hf398261ETD262KXj4RLAK74gRobI0bWrz81YnJCd4Ovfp61hwlCb3buyhi3YOvmb4OLOQZ0NgAxe2yvaSt0lOsI54aJkJ43XnZ
So when there are 128 set_reg's the error is ERROR: Unable to parse table key of type 'table'
, 129 work, 130 gives ERROR: cannot parse unknown type undefined
I was testing longer behaviors, and occasionally get a behavior string that isn't recognized by the game and attempting to parse it with DesyncedJavascriptUtil gives:
ERROR: cannot parse unknown type undefined
For example the following asm:
Produces this corrupt behavior string:
Removing the last line (
set_reg 130, p1
) results in a functional behavior string which I can load in the game. If I add the final set_reg node in the game and export the behavior string from the game I get:Which does parse correctly.