Indirect addressing / page crossing?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Indirect addressing / page crossing?

Post by dougeff »

My money is on a 2001 write...actually 2 writes, 1 to disable rendering, then immediately one to enable it.

Writes to 2005 or 2006 or 2007 would cause scroll changes. I see no jitter, so NO.

Writes to 2000, could switch the nametable, so that could be possible, if the other nametable were blank (Black).
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Indirect addressing / page crossing?

Post by rainwarrior »

PLACE YOUR BETS NOW!

I'd reckon this is actually a big combination of a lot of things that have been suggested. A write to the PPU, caused by a flawed 16-bit calculation that produced an indirect pointer. :)
JoeGtake2
Posts: 333
Joined: Tue Jul 01, 2014 4:02 pm

Re: Indirect addressing / page crossing?

Post by JoeGtake2 »

Brian Parker for the win.

This one was hiding in plain sight. It took him 4 minutes to find with just the ROM, and took me three to fix once I knew *where* the problem was. Found it instantly. And it was certainly user error. I'll tell you how the problem manifested for anyone who is interested.

My static bank = full. I mean...buckling. Maybe five or six bytes left in it. I have had to continue to move chunks of data into overflow banks for the last year as the engine has grown in complexity. Sometimes I'm just in a rush when I do this, and I decide, "no...no, let's keep that part in static bank....what else can we move?".

It seems that I started to move some of the drawing code (specifically, the *figure out what sprite should I draw* code) to an overflow bank, and then must've changed my mind. I deleted the bank switch...but never the switch back.

I'm guessing, if I'm tracing it right, this gave me a wonky y value, and it was trying to change momentarily to bank #$20, which means it was trying to load chr bank 1. Brian saw that there was a chr bank swap, and that made me straighten...I am not doing anything with chr bank swapping (at least, not yet). When he found that, I found the problem almost immediately.



By the way - can I say once again how humbled I am to be part of this community, and how awesome and supportive all of you have been with all of this? No joke, this is like the last sane safehaven on the internet. I hope I get to meet all of you in person one day and buy you all drinks!
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Indirect addressing / page crossing?

Post by rainwarrior »

Noticing that nobody mentioned CHR banking, myself included. For some reason I'd presumed you were using CHR-RAM, but I don't know why I thought that. What mapper are you using, by the way?
JoeGtake2
Posts: 333
Joined: Tue Jul 01, 2014 4:02 pm

Re: Indirect addressing / page crossing?

Post by JoeGtake2 »

I am using CHR Ram, indeed, which was why this was funky, and as soon as he noticed the chr bank switching, i knew right where to look (since I'm not doing that! haha).

Using INL's *mapper 30*...essentially an UnRom with 512.
Post Reply