Log In  

Cart #membor-0 | 2023-06-22 | Code ▽ | Embed ▽ | No License
5
Trying to learn more about memory operations and manipulation. I feel like there should be a simpler, more efficient, way of handling this demo but I don't know that I understand the memory functions in Pico8 well enough to do that. Right now I'm doing a BAND on each 4-byte chunk of screen memory I save into RAM to highlight overlaps of these circles. But I feel like there must be a way to do this without the loop.

P#131232 2023-06-22 14:58 ( Edited 2023-06-22 14:59)

this is a valid test - and the loop is needed, there is no binary ops for a whole array.

a totally different approach is to use bitplanes to achieve a similar effect for much cheaper (ser manual/bbs for exemples).

note: for perf, suggest to look at replacing band, peek, … by their shorthand variants (faster)

minor bug: the loop overwrites memory at 8192 - this is outside of screen space (should be 8192-4 for poke4 operations)

P#131265 2023-06-23 06:36 ( Edited 2023-06-23 09:29)

@freds72 Thanks for the feedback. I saw bitplanes while I was exploring techniques for a concept I have and they might work but I wanted to have some dynamic way of achieving it. I actually discovered @krajzeg's work on Dank Tombs after I started playing with this. I don't know if I need the extensiveness of his implementation, but it's pretty close to what I was thinking. I think I'm going to just try to keep the artwork black and white so I don't overwhelm myself trying to understand the color shifting I've noticed in some further tests on the binary operation.

I will look at the manual further and familiarize with the shorthands. Also realized it's redundant to write the second time to RAM as it's equivalent to just operating on the screen space itself.

P#131275 2023-06-23 18:42 ( Edited 2023-06-23 18:44)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-12-02 12:05:43 | 0.019s | Q:16