Scrolling and mapper 7 demo

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Scrolling and mapper 7 demo
by on (#103776)
This demo is sort of a combo of a scrolling demo and a demo that shows how to use mappers which swap a single bank of 32kb PRG with trampoline code that is as transparent as possible.

It also shows how to scroll horizontally without using vertical mirroring while minimizing the attribute clashes on the side borders. Most games usually shows off 8 or more pixels of garbage on the sides. Here it shows max. 3 pixels of garbage at the left OR max. 4 pixels of garbage to the right (never simultaneously). On PAL consoles, only max. 2 pixels of garbage are visible on the right.
Graphics ripped of SMB3 save states.

The scrolling code is particularly clean and robust (at least in my opinion), as the part that controls the camera, moves the camera, and updates the scrolling are completely independant. I was going to make it multi-directional scrolling but I gave up after doing horizontal scrolling.