I've managed to get horizontal scrolling with vertical nametables very nearly working - I'm updating columns to the nametable during vblank, and it is displaying them fine, but it seems like the nametable jitters up by a single pixel every time I update a column.
Is there any obvious reason for this? Am I setting the PPU up incorrectly or something? I set the vertical scroll to 0 before updating the nametable every frame.
Here's the relevant code (in C), this all happens just after the NMI flag is switched to 1:
Let me know if I'm making some kind of rookie mistake.
Is there any obvious reason for this? Am I setting the PPU up incorrectly or something? I set the vertical scroll to 0 before updating the nametable every frame.
Here's the relevant code (in C), this all happens just after the NMI flag is switched to 1:
Code:
OAM_ADDRESS = 0;
OAM_DMA = 2;
PPU_CTRL = 0x94;
PPU_MASK = 0x1e;
SCROLL = Horiz_scroll;
SCROLL = 0;
if(PPU_BufferCounter > 0) {
PPU_BufferCounter = 0;
PPU_ADDRESS = 0x20;
PPU_ADDRESS = 0x00 + (X_CurrentColumnCounter * 4) + X_CurrentSubColumnCounter;
for(index = 0;index < 30; ++index){
PPU_DATA = PPU_Buffer[index];
}
}
OAM_DMA = 2;
PPU_CTRL = 0x94;
PPU_MASK = 0x1e;
SCROLL = Horiz_scroll;
SCROLL = 0;
if(PPU_BufferCounter > 0) {
PPU_BufferCounter = 0;
PPU_ADDRESS = 0x20;
PPU_ADDRESS = 0x00 + (X_CurrentColumnCounter * 4) + X_CurrentSubColumnCounter;
for(index = 0;index < 30; ++index){
PPU_DATA = PPU_Buffer[index];
}
}
Let me know if I'm making some kind of rookie mistake.