Cool so I'm going back to software for now. Not a big deal as they share most of the same feature and my "game" is very static and unintensive.
EDIT: I think I found an answer to this big long question below so yeah, NVM. Detailed the answer at the very bottom
Can anyone diagnose what is wrong with my main loop in my game? I image.lua sample included with R2 as a base but clearly I'm doing something wrong because I've always gotten flickering with CPU rendered stuff. Same thing happened with the CPU rendered text in my GPU build (only images were GPU rendered and those didn't flicker) which telling me I have a poor understanding of how to construct a main loop for CPU rendered stuff. GPU stuff was fine though so I think I understood that.
The flickering: EDIT Click on the gif to see it animated
View attachment 24165
Sample of my main. The main is at the bottom of the quote and handlestr() is the function that is supposed to draw everything when needed. There's a bunch more functions in the full lua (see attached zip) but this is just a sample of the 2 most relevant parts.
Basically what I'm trying to get is a totally static image on screen and update only when the user presses 'A'.
Maybe I just don't understand how screenbuffers work but I want to keep display the screenbuffer and when the user presses 'A', the game executes one of 3 commands
'bgload' screenbuffer is cleared. image (Background image) is loaded and applied to the blank screenbuffer
'setimg' image (character portrait) is loaded and applied to screenbuffer
'text' the array of strings is updated, bottom screenbuffer is cleared, the string are applied to bottom screenbuffer
User error I'm sure and hopefully an easy fix. I feel like all of the pieces are there but there just in the wrong order.
Also attached my index.lua and all revelevant assets. Confirmed working on Citra and 3DS hardware. Just extract it to the root of SD card or /sdmc/
ANSWER: So the solution for what I was trying to do is apparently to write the image twice. I've heard the word "double-buffered" before when it comes to stuff like this. IDK, at least it work. Without the "double writing" of the image sometimes I would see one of the images disappear from the screen when the other was loaded. With "doublewrite" it seems to be locked in and behaving like I want it to.
My code
GIF of Latest version in action (click to animate)
View attachment 24215