Log In  


While pico8-lua itself can handle even 0x7fff arguments being passed to a function (easy to see via unpack, for example), peek and poke seem to only handle up to 0x2000.

E.g. peek(0x8000, 0x2001) returns 0x2000 values instead of 0x2001
And poke(0x8000, <0x2001 values>) only pokes addresses up to 0x9fff

3


2

One more bug: if you pass 0 to the 3rd ("count") argument of ord(), you get a "too many ord results" error (whereas no return values would've been expected)

This makes it awkward to convert any string to its characters via ord(str,1,#str) since it fails if str is empty.


strange as it was noted changed for v0.2.2b (see changelog or https://www.lexaloffle.com/bbs/?tid=41852 — but no details noted).

for your second thing (ord), it seems acceptable to check if string is empty before doing things with it.


omg I had no idea u could multi-peek 🤯


goodness from the last year! multi-peek, multi-poke, multi-ord and chr too!


@merwok Wow! I use multi-poke extensively in my last cart, but that was the only one I was aware of! I refer to the manual and wiki constantly, but I think I'm due for a full readthrough of the manual again, I see these are all documented now!


1

Yo @zep, I just ran into the ord(s, 1, #s) problem mentioned above myself, where it dies on s=="".

I agree it's broken and needs to be fixed.

It should just return nothing, a.k.a. an empty tuple.



[Please log in to post a comment]