dansanderson / picotool

Tools and Python libraries for manipulating Pico-8 game files. http://www.lexaloffle.com/pico-8.php
MIT License
367 stars 46 forks source link

Preserving of P8SCII Control Codes #89

Open Liquidream opened 2 years ago

Liquidream commented 2 years ago

(I believe you've yet to look at P8SCII, so this is just an FYI for when you do)

Currently, when picotool/luamin processes source files wish such code as below:

print("\^w\^thello world")

...it results in the backslashes being escaped (breaking the P8SCII Control Codes):

print("\\^w\\^thello world")
Liquidream commented 2 years ago

Just ran into this one again while updating SCUMM-8. I guess this more a case of preserving single backslashes "\" Which I guess might be a challenge for your parser? (hope not)

hsandt commented 2 years ago

I also needed to write instructions such as "Press 🅾 (O glyph)" and the 🅾 (O glyph) became "ユか✽ゆヤま◆". After processing Lua content with Python, it was even flattened to "___" (this is an issue on my side, not sure why as I'm processing UTF-8; but first the issue must be fixed on picotool side, then I can see if I need more work to make the glyph work).

I saw some update of glyphs and updated picotool to latest, but the issue was still there.

simonwulf commented 1 year ago

I recently encountered the same issue as @hsandt and decided to look into it. I was able to remove the issue by disabling all unescaping of P8SCII escape sequences. I believe this should solve your issue as well, @Liquidream.

I made a PR for the suggested fix.