Parallax scrolling

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

Moderator: Moderators

User avatar
MottZilla
Posts: 2832
Joined: Wed Dec 06, 2006 8:18 pm

Re: Parallax scrolling

Post by MottZilla » Sat Aug 08, 2015 7:04 pm

lidnariq wrote:Yes, ROM was (and still is) cheaper.
But if you need two separate ROMs made, would that have cost more than having just one ROM and CHR-RAM? With the volume of units that could use the 8KB SRAM chips maybe the cost wasn't more?

User avatar
tokumaru
Posts: 11863
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Parallax scrolling

Post by tokumaru » Sat Aug 08, 2015 7:26 pm

To me it sounds logical that a mask ROM, which is a custom part, would cost more than an off the shelf part, but I can't back this up.

There's also the fact that by using CHR-RAM you can save some money on the mapper, because CHR-RAM is versatile by nature, while CHR-ROM needs fine bankswitching (which is only present in more advanced mappers) to be versatile.

Even if using CHR-RAM instead of CHR-ROM didn't make Battletoads carts cheaper, using AOROM instead of an MMC3 probably did, and yet the game still features large colorful well animated characters, split parallax, overlapping parallax, background animations, things that a lot of games with more complex mappers didn't have, because CHR-RAM is that versatile, in the hands of competent programmers.

Most computers and consoles didn't offer the possibility of using CHR-ROM, so it's not like CHR-RAM was something mysterious or difficult to use, it was actually the norm, so it's not so surprising that some programmers would consider it common place.

lidnariq
Posts: 9689
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Parallax scrolling

Post by lidnariq » Sat Aug 08, 2015 8:48 pm

MottZilla wrote:But if you need two separate ROMs made, would that have cost more than having just one ROM and CHR-RAM? With the volume of units that could use the 8KB SRAM chips maybe the cost wasn't more?
As near as I can tell, not only is a PROM cheaper than a RAM, but the up-front cost for a Mask ROM conversion is small enough that you don't need too much volume to make it cheaper to switch:
this webpage says that it's an up-front cost of $85k for a Mask ROM conversion, and this book claims that the per-unit cost of a EPLD is 3x the cost of a Mask PLD (which, yes, isn't the same as a ROM, but it's not too dissimilar)

Of course, now, with e.g. the SST39SF010A being 58¢/@10k, the calculus is less clear. A substantial portion of this cost is packaging, now. Even the SST39SF040 is 93¢/@10k, and the M29F160 is ≈$2.40/@10k, so for modern prices you're necessarily talking about volumes of hundreds of thousands to make up this investment.

To make matters worse, I can't find any information about costs in the last 1980s/early 1990s, although I have this hunch that the Mask ROM conversion cost hasn't changed appreciably.

User avatar
DRW
Posts: 1982
Joined: Sat Sep 07, 2013 2:59 pm

Re: Parallax scrolling

Post by DRW » Mon Aug 10, 2015 2:37 pm

Alright, I'll try the version with the nine sprites. My game will have only one scrolling split anyway (plus the status bar).

Does the sprite overflow work even with empty sprites (i.e. a tile that has only the transparent color) or is it the same as with the sprite 0 hit where the flag is only set if an actually visible pixel hits the scanline?
My game "City Trouble": www.denny-r-walter.de/city.htm

snarfblam
Posts: 143
Joined: Fri May 13, 2011 7:36 pm

Re: Parallax scrolling

Post by snarfblam » Mon Aug 10, 2015 2:48 pm

Sprite overflow will work with transparent sprites. In theory, it's supposed to tell you if there are too many sprites on a scanline. Even if they're transparent, they still take up a slot in the PPU's working RAM for OAM.

User avatar
DRW
Posts: 1982
Joined: Sat Sep 07, 2013 2:59 pm

Re: Parallax scrolling

Post by DRW » Mon Aug 10, 2015 2:53 pm

Why wasn't this done with the sprite 0 as well? Why does the sprite 0 flag only hit when a visible pixel of that sprite touches a visible pixel of the background?
My game "City Trouble": www.denny-r-walter.de/city.htm

tepples
Posts: 22054
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Parallax scrolling

Post by tepples » Mon Aug 10, 2015 3:17 pm

DRW wrote:Why wasn't this done with the sprite 0 as well? Why does the sprite 0 flag only hit when a visible pixel of that sprite touches a visible pixel of the background?
As far as anybody outside Nintendo's sphere of non-disclosure can tell, it's probably a workaround for some patent. (Remember that the Famicom was conceived when the concept of a video game itself was still patented by Ralph Baer.) This way, Nintendo could plausibly pretend that it was for collision detection.

User avatar
dougeff
Posts: 2741
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Parallax scrolling

Post by dougeff » Mon Aug 10, 2015 3:56 pm

You can set the sprite zero attributes to be behind the background, essentially making it invisible.
nesdoug.com -- blog/tutorial on programming for the NES

User avatar
DRW
Posts: 1982
Joined: Sat Sep 07, 2013 2:59 pm

Re: Parallax scrolling

Post by DRW » Mon Aug 10, 2015 10:40 pm

Yeah, but you need to have a background element in the first place. If you want to draw your status bar on the blank background, you need to have some element that is only there to hide the zero sprite.
My game "City Trouble": www.denny-r-walter.de/city.htm

User avatar
Dwedit
Posts: 4354
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Parallax scrolling

Post by Dwedit » Tue Aug 11, 2015 6:24 am

Note that you can also do a top status bar with timed code, but that might be tricky.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

User avatar
DRW
Posts: 1982
Joined: Sat Sep 07, 2013 2:59 pm

Re: Parallax scrolling

Post by DRW » Tue Aug 11, 2015 6:42 am

Yeah, I tend to use the simple stuff for these things. I guess I'll have enough to do implementing the game itself. So, these whole techical details: For my first game, I'll try not to use some complicated hacks.
The nine sprite thing is something that I'll probably use anyway because I really want to do parallax scrolling. But timed code: Meh. Maybe next time when I program the next "Castlevania". 8-)
My game "City Trouble": www.denny-r-walter.de/city.htm

User avatar
tokumaru
Posts: 11863
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Parallax scrolling

Post by tokumaru » Tue Aug 11, 2015 7:38 am

Dwedit wrote:Note that you can also do a top status bar with timed code, but that might be tricky.
Am I invisible?

It's tricky if you try to time the code from the start of VBblank, but when you detect the end of VBlank by waiting for the sprite 0 hit or sprite overflow flag to be cleared and time it from there, it's quite simple.

johannesmutlu
Posts: 26
Joined: Fri Mar 11, 2011 2:22 pm

Re: Parallax scrolling

Post by johannesmutlu » Wed May 04, 2016 9:12 am

tokumaru wrote:To me it sounds logical that a mask ROM, which is a custom part, would cost more than an off the shelf part, but I can't back this up.

There's also the fact that by using CHR-RAM you can save some money on the mapper, because CHR-RAM is versatile by nature, while CHR-ROM needs fine bankswitching (which is only present in more advanced mappers) to be versatile.

Even if using CHR-RAM instead of CHR-ROM didn't make Battletoads carts cheaper, using AOROM instead of an MMC3 probably did, and yet the game still features large colorful well animated characters, split parallax, overlapping parallax, background animations, things that a lot of games with more complex mappers didn't have, because CHR-RAM is that versatile, in the hands of competent programmers.

Most computers and consoles didn't offer the possibility of using CHR-ROM, so it's not like CHR-RAM was something mysterious or difficult to use, it was actually the norm, so it's not so surprising that some programmers would consider it common place.
Yeah battletoads was/is an interresting game wich greatly simulate 16bit graphics on the nes,man if i saw this back in the 90's,whoaah,that would,ve blowed my face being me deheaded hahaha,also 1bit pcm can be done on the nes while still running a game smoothly can be done too,but that takes tons and tons of space, who could,ve ever tout that this was possible on nes,even supermariobros3 looks like nothing,even ninja gaiden 3 on the nes has some paralax scrolling wich even the lynx & snes version do averagely lack.
Sega said,genesis does what nintendon't,well think again an 8bit is all you need.

User avatar
DRW
Posts: 1982
Joined: Sat Sep 07, 2013 2:59 pm

Re: Parallax scrolling

Post by DRW » Wed May 04, 2016 12:57 pm

Not to sound like a dick, but did you just dig up a nine months old thread about the technical implementation of parallax scrolling just for some general ramblings about how much you like "Battletoads"?
My game "City Trouble": www.denny-r-walter.de/city.htm

User avatar
darryl.revok
Posts: 520
Joined: Sat Jul 25, 2015 1:22 pm

Re: Parallax scrolling

Post by darryl.revok » Wed May 04, 2016 1:52 pm

Presumably, he's got so much appreciation for Battletoads that he wanted to share it with the world.
johannesmutlu wrote:well think again an 8bit is all you need.
I loved this.

Post Reply