Log In  

It'd be really cool and interesting if there was a spr() overload that read the sprite data from a memory address.

Personally I could see it working something like mspr(addr,len,x,y,w,h). Alternatively, len can be inferred from w*h and can be left out, so mspr(addr,x,y,w,h). Not to say that both of these should be in the API at the same time, it's a one-or-the-other deal.

So:

mspr(0x4300,64,x,y,8,8)
mspr(0x4300,x,y,8,8) --alt

Would read 64 bytes from the start of the user bank, and then draw it at an 8*8 rectangle at X and Y.
Of course, the bytes would have to be masked, but still, I think this would be extremely useful.

ed: BTW, I am aware how easy it would be to do this normally, but I think this would be really cool as a built in feature. I'm thinking Jelpi's corruption mode starting to draw the character from the SFX, etc.

P#15377 2015-10-14 15:16 ( Edited 2015-10-15 20:47)

I agree this would be cool and would allow for some neat stuff, although I'm not sure how I feel about making it really easy (basically endorsed by the platform) to circumvent the sprite-space limitations. I think the fact that you have limited space to work with sprites, and the fact that there's a tradeoff between sprite-space and map-space is one of the really cool features of Pico-8. Providing a built-in way to ignore that feels sort of weird to me.

P#15397 2015-10-15 12:45 ( Edited 2015-10-15 16:45)

That's a totally valid concern, but I don't think it'll be a huge issue, as the user has to put the (readable) sprite data into RAM anyways. The 0x4300 block is always clear, and the other area that makes a lot of sense is the shared bank. It seems to me like it'd be more useful to power users trying to get some more bang for their buck than breaking the limitations straight out of the gate.
Of course, somebody could do something silly like putting sprites into strings and then putting those into RAM, but that's already possible.

P#15400 2015-10-15 14:40 ( Edited 2015-10-15 18:40)

One thing I would like to see rather than a mspr style command is remappable frame buffer / sprite buffer pointers, so you could do things like copy from the screen to the sprite space (feed back effects!)

P#15405 2015-10-15 16:47 ( Edited 2015-10-15 20:47)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 23:08:39 | 0.006s | Q:12