I tried reading tables against reading an array and doesn't seem much difference.. except for ram.
I tried this where it reads the table which turned out to be word vals and it takes 512B for 16x16 sprite.
I don't see a speed difference so will use tables.
This set up once.
dimspritedata(256)asword;trying sprite data in array instead of a tableforptr=1to256readtablesprite1,ptr,spritedata(ptr);copy table to arraynext
you can test table or array with comment on/off
subsprite(insprite_x, insprite_y);fills box with sprite dataSetAddressWindow_ILI9341(sprite_x,sprite_y,sprite_x+15,sprite_y+15)ptr=1repeat256; pixel=spritedata(ptr) ;reads arrayReadTablesprite1,ptr,pixel;reads tableSendWord_ILI9341pixelptr++endrepeat
using gcstudio.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It was just a visual comparison. The difference in animation speed wasn't noticeable so I won't pursue the idea.
You'd think you'd notice the difference... 512 bytes read 8 times every loop but I didn't notice a visible animation speed increase.
Maybe it's using a mega328p. Maybe certain pics reading ram would be much faster than reading program memory. I dunno.
Interesting experiment though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried reading tables against reading an array and doesn't seem much difference.. except for ram.
I tried this where it reads the table which turned out to be word vals and it takes 512B for 16x16 sprite.
I don't see a speed difference so will use tables.
This set up once.
you can test table or array with comment on/off
using gcstudio.
Interesting results. How accurate was your timing?
It was just a visual comparison. The difference in animation speed wasn't noticeable so I won't pursue the idea.
You'd think you'd notice the difference... 512 bytes read 8 times every loop but I didn't notice a visible animation speed increase.
Maybe it's using a mega328p. Maybe certain pics reading ram would be much faster than reading program memory. I dunno.
Interesting experiment though.