This is how the wiki explains scrolling:
I made it work by using the carry flag but I can't use EOR on the PPUCTRL reg to flip the first bit because you can't read from PPUCTRL, so I have to keep track of PPUCTRL in a separate variable and its just a mess. I'm not sure if I'm doing it right.
If someone could give me an example in assembly, that would be greatly appreciated.
I understand putting the X and Y in the PPUSCROLL register but what I don't understand is what it means by the 9th bit. Is that the carry flag?'Ordinarily, a program writes to two PPU registers to set the scroll position in its NMI handler:
Find the 9-bit X and Y coordinates of the upper left corner of the visible area (the part seen by the "camera")
Write the lower 8 bits of the X coordinate to PPUSCROLL ($2005)
Write the lower 8 bits of the Y coordinate to PPUSCROLL
Write the 9th bit of X and Y to bits 0 and 1, respectively, of PPUCTRL ($2000)
This is the nametable that's visible in the top-left corner
I made it work by using the carry flag but I can't use EOR on the PPUCTRL reg to flip the first bit because you can't read from PPUCTRL, so I have to keep track of PPUCTRL in a separate variable and its just a mess. I'm not sure if I'm doing it right.
If someone could give me an example in assembly, that would be greatly appreciated.
Statistics: Posted by MadCornDog — Sun Apr 14, 2024 3:35 pm — Replies 5 — Views 260