mikejmoffitt wrote:
I don't have time to have a look at your whole program and understand it at the moment, but I'm not liking how busy your NMI routine is. One better approach would be to use NMI to set a flag, and in your Forever loop, have it repeatedly check for this flag. If that flag is set, clear it, run a frame of logic, and then go back to waiting for the NMI flag.
[...]
This is just a suggestion for structure, not a singular way to do it.
There is absolutely no requitement NOT having a busy NMI (if you know what you're doing) and your example is poor because you don't have to use php/plp in interrupts, the 6502 does it automatically. It could also do a "inc vbl_flag" so you wouldn't need to have a lda/sta pair here, nor a pha/pla pair.
The 3 approach exists - everything in NMI (as early Nintendo and Konami liked to do it), everything in main (what you're advocating and what Squaresoft liked to do it) and work split between main and NMI threads (what most NES games does, for example Capcom games does that but also later Nintendo games). I do not think any approach is inherently supperior to eachother. So this guy have a problem and you're telling him "you should go with everything in main". However you're not pointing to his problem at all - and invent an entierely new "problem" which isn't even one.
As for the original question, it looks like you are uploading a column of tiles at the wrong place. Be sure to log your VRAM updates.