Closed pancelor closed 4 months ago
ah my bad, you need to poke-unpack-split, not poke-split. (the unpack-split part is necessary b/c 2048 is too many parameters to pass to poke on their own)
here are two snippets you can run inside PICO-8; either one will put a string into your clipboard that can be pasted into your pico8 cart -- p8x8 will properly convert it.
1 - Use this one - it works in pico8, and also in p8x8-converted carts:
local data='poke(unpack(split\"0x5600'
for addr=0x5600,0x5dff do
data..=","..@addr
end
printh(data..'"))',"@clip")
2 - This one looks fancy but doesn't have much of a real benefit:
local data=""
for addr=0x5600,0x5dff do
data..=sub(tostr(@addr,1),5,6) --byte to 2-digit hex
end
data='local custom_font = p64env.userdata("u8",0x800,"'..data..'")\npoke(0x5600,custom_font:get())'
printh(data,"@clip")
(kinda neat tho, and maybe there's a better version of this that doesn't involve the slow ish poke. not that it matters much - you poke once during init and then you're good to go. I tried memmap - memmap(0x5600,my_font_userdata)
but it didn't do anything; I assume it violated the "all memory under 0x10000 must be memmapped" rule somehow)
I expect the p8scii-based poke to become popular, with the various font tools out there switching to that! Will you consider support?
(?"\I-forget-the-code mem-address encoded-bytes"
)
Ah, this one? ?"⁶!5600⁸⁸\n\0\0\0\0\0\0\0\0\0..."
That's not supported currently. I'll consider it, but it's unlikely (I don't want to be in the business of editing code automatically, and that would be needed here. see my reply about special chars here for some more context/explanation)
However, I can make the warnings nicer. I've already made a snippet you can run in PICO-8 to automatically convert the font memory into a Picotron-safe poke -- I should make this more prominent in the warnings.
update: you can now use p8x8_datastring() to easily convert binary-data-strings. For instance, you would need to change ?"⁶!5600⁸⁸\n\0\0\0\0\0\0\0\0\0..."
in your cart to poke(0x5600,ord(p8x8_datastring"⁸⁸\n\0\0\0\0\0\0\0\0\0...",1,len))
However, note that picotron 010g has a bug where ord(str,i,num)
isn't working properly: https://www.lexaloffle.com/bbs/?pid=147830#p
custom fonts in picotron, from /system/lib/head.lua:
custom fonts in p8x8, from baked/main.lua:
however, this doesn't seem to work -- test case here. the fonst stuff doesn't work because of non-ascii chars, but I'm not sure what's wrong with the numeric version
the numeric version was created in p8 with
todo: compare data format for new font (/system/fonts/p8.font) with old output of fonter on the default font