A new instance of PICO-8, will have the custom font properties set to zero.
?peek(0x5600) -- =0 ?peek(0x5601) -- =0 ?peek(0x5602) -- =0 |
This sets width and height to a default of 0 pixels. This will never be a useful default state.
It can be confusing for newcomers- and frankly is easily forgotten / overlooked for experienced users- when working with custom fonts.
Request:
- Initialise custom font properties to a reasonable default of 8 x 8 px, which matches the one-off character default. i.e.
poke(0x5600,8,8,8)
I mean the customfont is in the 'RAM' space still so I think it checks out and for compatibility reasons
sorry, I disagree! when pico-8 starts, there is no custom font defined, so no data at all in this memory. if you want a custom font you fill in the data needed. and as was pointed out, before custom fonts this memory region was part of general-use RAM, and it may still be used for bespoke purposes, so best to keep it nulled.
Hi @merwok. Please can you give an example where initialising to a null value is beneficial for general use? (I think we can agree it's unlikely to cause any incompatibility).
Well I can't think of many cases (maybe you want to use that part of mem for storing screen data and drawing it?)
But if you set those values on reset and initalze them that hugely hurts using that area to store data between runs!
I want to store additional stuff in there and reset my game without having problems (though I guess you'd probably not but all the other memory is niled out so it seems awkward..)
Guys, I have to agree with @merwok.
If you turn off the Apple ][ computer and turn it back on, you certainly don't want your old program to be there. No, normally memory is filled with zeros and 255's and that's about it.
It's expected behavior. So too I do I think that presetting values in the custom font without an actual font to be detrimental to the flow of Pico-8.
Now if @zep wants to stuff in a completely custom font say a nice looking 8x8 as part of boot-up that can optionally be accessed by the programmer, then yeah, that would be fine.
By default the memory could be all zeroes. Then a command either in immediate mode or code, customfont(true)
A quick check is made to ensure it is all zeroes. If so then Zep's own custom font is stuffed into there and activated with the option to turn it off again, which would clear it all to zeroes.
customfont(false)
If there is neither all zeroes or his exact font, then it would only turn on and off the ability to see the custom font that is installed there.
Thanks @merwok, @SmellyFishstiks, @dw817 - for the different perspective.
I can see where you're coming from. For me, it was just a simple Quality Of Life hack... but I agree, it wouldn't be consistent. (Although I could highlight various places where data is initialised, e.g. Sprite 0 is set to X
).
Marking as 'Resolved'. Thanks again.
[Please log in to post a comment]