Closed mhughson closed 2 years ago
Digging into this a bit more, I see some oddities in the output:
cd("hex\tpage\tpos\ttype")
I found the issue. luamin does not handle nested block comments. For example adding the following:
--[[
will
--[[
this
--]]
break
--[[
everything
--]]
????
--]]
Will output:
break
? ? ? ?
It appears to not be counting the blocks, and just ending the comment block the moment it hits a --]]
This appears to be an inconsistency between PICO-8 and Lua. Lua will terminate the block comment at the first --]]
, similar to C's /* ... /* ... */
.
Naturally picotool should match PICO-8, just noting this for myself as I had hoped I could keep the PICO-8 and vanilla Lua features separate in the code. :/
Looks like I noticed this way back in #18 so I'll resolve this as a dupe. I'll try to get to it soon.
I am using the luamin command to try and compress my cart. It does a great job of shrinking the compressed size, but it actually grows my token count by a few hundred (putting it over the limit):
Pre luamin: 8010 tokens Post-luamin: 8304 tokens
However, the picotool reports no change in token count (and the counts themselves are wrong):
I have upload the p8 cart file here if you wish to reproduce the issue: mario_new.p8
Is this a known issue? Is there any known work around?