Repeating pattern parallax scrolling with CHR RAM
Posted: Sun Aug 27, 2017 9:33 pm
Sword Master and MetalStorm fake parallax scrolling by filling the background with a repeating pattern and then scrolling the pixels in the tiles that make up that pattern to cancel out a fraction of the background movement. But this technique usually requires a lot of CHR ROM, one bank for each horizontal position, and on MMC3, this can limit flexibility of what sprites can appear together.
So I decided to see if I could get pixel scrolling working with CHR RAM, using the Popslide engine for uploading the scrolled tiles to video memory. This doesn't scroll the background (yet), but it does scroll a 32x32 pixel pattern.
Because copying graphics to CHR RAM without self-modifying code takes 8 cycles per byte, there's not enough time to upload both 16 tiles to CHR RAM and a display list to OAM in an NTSC vblank. So I split them over two frames, which can cause tearing artifacts. To avoid this, you can either extend blanking or use a 32x16 pixel pattern, possibly using a brick wall tessellation. I don't know if 1bpp tiles would save appreciable vblank time, as there'd be more seeks when uploading the tiles.
So I decided to see if I could get pixel scrolling working with CHR RAM, using the Popslide engine for uploading the scrolled tiles to video memory. This doesn't scroll the background (yet), but it does scroll a 32x32 pixel pattern.
Because copying graphics to CHR RAM without self-modifying code takes 8 cycles per byte, there's not enough time to upload both 16 tiles to CHR RAM and a display list to OAM in an NTSC vblank. So I split them over two frames, which can cause tearing artifacts. To avoid this, you can either extend blanking or use a 32x16 pixel pattern, possibly using a brick wall tessellation. I don't know if 1bpp tiles would save appreciable vblank time, as there'd be more seeks when uploading the tiles.