Run length of 00 means 256 apparently
Closed this issue · 2 comments
cknave commented
See "RLE Lock" in https://museumofzzt.com/article/323/page/2/a-guide-to-zzt-lock-picking
SaxxonPike commented
ZZT's RLE loop decrements before checking to see if the counter is zero, which will cause a value of zero to wrap around to 255 as it's a byte internally. All other values in this case perform exactly as expected.
Implementation in Roton (UnpackTiles):
https://github.com/SaxxonPike/roton/blob/master/Source/Roton/Emulation/Core/Impl/GameSerializer.cs#L228
cknave commented
Thanks @SaxxonPike. A fix for this has been sitting in master for a while, I just need to release it: aeb7649