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

P#113712 2022-06-27 06:41

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.

P#113714 2022-06-27 07:27 ( Edited 2022-06-27 07:49)

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.

P#113719 2022-06-27 09:46

omg I had no idea u could multi-peek 🤯

P#113759 2022-06-28 10:29

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

P#113763 2022-06-28 11:02

@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!

P#113777 2022-06-28 21:20 ( Edited 2022-06-28 21:21)
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.

P#113965 2022-07-05 01:37

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-01-30 17:15:08 | 0.023s | Q:17