Did you try making a tracelog with FCEUXD and see what the code is doing?
Quote:
Well #1 ive come to find out i really dont need them just one INX will do.
Well what I was getting at... was it is really doing what you thought? The only time you're using X is in your tile lookup "LDA TILE,X" -- and even then you're never setting X to any initial value, and you're not preventing it from being greater than 8 -- so most of the time you're probably reading garbage.
Quote:
#2 i have to put the branch there becasue my nmni wont work if its not there.
That's not what I meant. And in fact.. .the NMI probably IS working without it... you're just not doing something else right. Instead of plugging in random lines of code and seeing the result... you should really try to understand what each line does. You'll never solve a problem by
guessing which lines you
might have to insert -- the only way to solve the problem is to understand it.
'BNE' will branch if the Z flag is clear.... right? So what line of code above that BNE changes the Z flag? Does it set or clear the Z flag? When does it set it and when does it clear it?
Quote:
#3 i know what number to display next casue im just changing tile numbers and i can see the numbers changing only really really fast.
Well I gather that's sort of what X is tracking -- but if you'll notice, you never set X to anything when you enter NMI. So the tile you draw is never specified.
What I was hinting at before was that you should be keeping a variable which is tracking the tile you want to draw. You should never keep long-term variables like that just in a register.. registers are just for work and quick temporary stuff. For something you want remembered between frames, you definately want to have a variable for it.
Quote:
#4 i figured it would write to sprite DMA after each increment to update the tile number.
But how often is that? Does it make any sense to update sprite RAM more than once per frame? How many times per frame are you actually doing it?
You really should pick up a copy of FCEUXD... run your ROM in it and make a trace log so you can see what your ROM is
actually doing. If it isn't
exactly following what you expect it to, then you can ask yourself "why is it doing it this way", and you can examine the log to find the answer, and fix the problem in your code.
To be a little more direct with the main problem you're having (but without giving away the solution):
Your TOGGLE section is an infinite loop, the only time your program is escaping it is when ANOTHER NMI triggers (adding onto the previous NMI, and eventually overflowing your stack). Basically, it's just a really nasty infinite loop your program gets caught up in on the very first NMI.