VRC6 scanlines and scrolling

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Post by rainwarrior »

I never realized Battletoads' Turbo Tunnel level was a raster effect. I'd always assumed it was like the other scrolling effects in the game (careful CHR-RAM tile cycling), since the differently-scrolling portion was tileable anyway. That game has a little bit of everything in it though. One thing I've always wondered... that differently-scrolled part of the background in this level flickers sometimes with punches/kicks. I sometimes consider maybe it's just a bug they left in?

I've done a partial analysis of Rad Racer; I'll create a thread for it once I've got a bit more information on it (I think it's pretty interesting), but it is indeed just carefully timed code for the most part (after a sprite 0 hit at the start of the road).

Edit: after looking at it, the top of the battletoads turbo tunnel screen before the first split appears to be timed code, and the second split to halfway down the screen a sprite 0 hit. A lot of other crazy stuff is going on, like the code that updates PPU data each frame appears to be written to $0700-$0800... dynamically generated code? Very interesting. I'm sure there would be a lot to learn from the Battletoads source code.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

rainwarrior wrote:One thing I've always wondered... that differently-scrolled part of the background in this level flickers sometimes with punches/kicks. I sometimes consider maybe it's just a bug they left in?
Punches and kicks in Battletoads freeze the game while they run because they're played through $4011.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

tepples wrote:Punches and kicks in Battletoads freeze the game while they run because they're played through $4011.
Graphical glitches for sound effects... that's a horrible trade-off if you ask me!
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

True, but remember they had no mapper IRQs to work with !

Also, it's fun how the status bar stays in place but the other raster effects are disabled during the sound effect. I guess they stop the sound completely between the start of the VBlank and the end of the end of the status bar every frame, which makes the sound effects sound weird/distorted (it doesn't matter that much since it's sound effects).

That also explains why the sound effects plays at a lower rate on the snake level and last level, the status bar is longer because they needed to update more tiles to VRAM every frame.
On a related not I'm really curious how Rad Racer works, since it seems to do scanline scrolling with an MMC1 somehow. One of these days I'm going to start tracing its rendering code...
I've analyzed a good part of the game.
Apparently it runs most of the game logic between VBlank and the start of the road part. Then it synchronizes with a sprite zero hit that happens at a variable pixel position but always just one scanline before the start of the road part.
Then there is several lines where the game writes an adress to $2006 every 2 scanlines for the 3d look of the road, in a addition with $2005 writes for the curve of the road. This section also vary in length, but added with the background section, is always a constant.
Then comes the part where there is only $2005 writes for the curve of the road, and finally comes the status bar which of course is fixed.
All those timings depend on the synchronization with the sprite zero hit.

Rad Racer 2 is similar the only difference is that there is no sprite zero hits, and the initial synchronization is done with an IRQ instead. However, the other split points are still synced with timed code from the first IRQ. I don't remember if there was a second IRQ for the status bar but it would be easy to check.
Useless, lumbering half-wits don't scare us.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Bregalad wrote:True, but remember they had no mapper IRQs to work with !
Sure, but when designing a game you have to think of all the possibilities, how different aspects of it (specially the ones that involve hardware "tricks") will work with each other. You can't realize that the sound effects screw up the raster effects and just say "fuck it" and ignore this bug. IMO, visual glitches are the worst kind, and should be avoided at all costs.
User avatar
MottZilla
Posts: 2835
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

tokumaru wrote:
tepples wrote:Punches and kicks in Battletoads freeze the game while they run because they're played through $4011.
Graphical glitches for sound effects... that's a horrible trade-off if you ask me!
The area in question is going to be played through in a matter of 30 seconds to 1 minute. The need some point in time for updating the samples. Alot of players probably won't even notice it. I did vaguely remember the background part would change when you hit them but I thought it was intentional. It was only after this was mentioned that I fired it up and observed that part of the background to realize that the mid section wasn't being properly scrolled for that brief moment.

I really don't think it was a big issue. A bigger issue is that Player 2 can't play Clinger Winger and must lose all their lives for Player 1 to get your team to the next level.
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Post by rainwarrior »

I always thought it was kinda cool that the background was reacting to the gameplay. Like it was a living brain or something that didn't like it when you were fighting.
Post Reply