So, I have been trying to get the background update loop in my NMI to work for like a month now. I have no problem loading a partial background of 256 tiles, but once it goes past that, I just can't get it to work. Either my program gets stuck in the loop or draws the background incorrectly. I know I need 16 bit math for this, but I just can't program a 16 bit stuff on 8 bit processor.
The way I'm updating my background is that the program sets the high and low bytes of the target background's location in pointers and sets a "flag" that the NMI checks if it's set. If it is, the NMI will update the background from the location that is stored to the pointers. Then the NMI clears the flag and ends the NMI. If the flag is not set the NMI will draw the updated background.
Here is my code if you need to take a look at it: http://pastebin.com/HbvTbPDM
The way I'm updating my background is that the program sets the high and low bytes of the target background's location in pointers and sets a "flag" that the NMI checks if it's set. If it is, the NMI will update the background from the location that is stored to the pointers. Then the NMI clears the flag and ends the NMI. If the flag is not set the NMI will draw the updated background.
Here is my code if you need to take a look at it: http://pastebin.com/HbvTbPDM