EVE memory allocation
Posted: Mon Aug 29, 2022 8:19 pm
Hello,
I am new to EVE as of last week and already thoroughly appreciating its capabilities. I have a newbie question about RAM_G allocation.
I have been using Rudolph's excellent library. I had no trouble getting the EVE_Test example working with a Teensy 4.1.
Also, no trouble building a widget based UI for a project. Sliders and toggles and buttons, oh my.
Then it was time to make a custom logo graphic. My source image happened to be a small PNG.
I used EAB to convert to L8, then to a c array. Pasted this array into pic[] in tft_data, adjusted the size and added a couple padding bytes.
It worked, but the displayed bitmap was corrupted by a few lines of garbage.
Then I found a note in the programming guide, that the top 42k of RAM_G (from address 0xF5800 - 0xFFFFF) may be overwritten by a PNG decode process.
Okay, so I moved the cmd_loadimage destination pointer down to 0xF0000 (again, I'm hacking a copy of Rudolph's EVE_Test example; so this was the MEM_PIC1 define, originally 0xFA000). Now everything looks great, exactly as expected. But I chose 0xf0000 as a stab in the dark, and can only imagine I was lucky not to clobber something.
So...my question is, are there general guidelines for allocating space in RAM_G for bitmaps? Or documentation that explains more about how coprocessor commands, etc., use RAM_G space? I've played around with cmd_getptr, cmd_getprops and apilevel, and will continue experimenting.
Any pointers welcome (no pun intended)!
Thanks!
Alex
I am new to EVE as of last week and already thoroughly appreciating its capabilities. I have a newbie question about RAM_G allocation.
I have been using Rudolph's excellent library. I had no trouble getting the EVE_Test example working with a Teensy 4.1.
Also, no trouble building a widget based UI for a project. Sliders and toggles and buttons, oh my.
Then it was time to make a custom logo graphic. My source image happened to be a small PNG.
I used EAB to convert to L8, then to a c array. Pasted this array into pic[] in tft_data, adjusted the size and added a couple padding bytes.
It worked, but the displayed bitmap was corrupted by a few lines of garbage.
Then I found a note in the programming guide, that the top 42k of RAM_G (from address 0xF5800 - 0xFFFFF) may be overwritten by a PNG decode process.
Okay, so I moved the cmd_loadimage destination pointer down to 0xF0000 (again, I'm hacking a copy of Rudolph's EVE_Test example; so this was the MEM_PIC1 define, originally 0xFA000). Now everything looks great, exactly as expected. But I chose 0xf0000 as a stab in the dark, and can only imagine I was lucky not to clobber something.
So...my question is, are there general guidelines for allocating space in RAM_G for bitmaps? Or documentation that explains more about how coprocessor commands, etc., use RAM_G space? I've played around with cmd_getptr, cmd_getprops and apilevel, and will continue experimenting.
Any pointers welcome (no pun intended)!
Thanks!
Alex