NES graphic memory limit

A place for your artistic side. Discuss techniques and tools for pixel art on the NES, GBC, or similar platforms.

Moderator: Moderators

User avatar
Drew Sebastino
Formerly Espozo
Posts: 3496
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

NES graphic memory limit

Post by Drew Sebastino »

In [url=http://forums.nesdev.com/viewtopic.php?p=142340#p142340]this post[/url], lidnariq wrote:Once you have more than 8 KiB, you're either going to be using RAM for CHR, and so there's no need to have any specific size limitation; or else the smallest cheapest available ROM now is 128 KiB. So once you add any mapper at all, don't feel like you need to hold back.
What kind of memory limitations does the NES have for graphics? Because it has the CHR rom like the Neo Geo, could you actually have better animation on the NES than on the SNES with a special mapper?
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Newcomer to NES programming

Post by tepples »

With a suitable mapper, you could probably feed a nearly VHS quality video signal into the NES PPU.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Newcomer to NES programming

Post by lidnariq »

Yes. Well, sorta. It's still only a 2bpp plane, and that's a bigger thing in terms of visual richness than changing total content.

The late-stage advanced mappers often provided eight independent 1KiB banks to control this, allowing for (e.g.) a quarter of tiles to be animated while half were used for fixed background things and another quarter could change as the level progressed, as well as grouped animations on random subsets of sprites.

But between the 6502 being an 8-bit microcomputer, and memory and bandwidth on the NES being limited, there was very little pressure to go past 256 KiB of data.
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Newcomer to NES programming

Post by Sik »

Espozo wrote:
lidnariq wrote:Once you have more than 8 KiB, you're either going to be using RAM for CHR, and so there's no need to have any specific size limitation; or else the smallest cheapest available ROM now is 128 KiB. So once you add any mapper at all, don't feel like you need to hold back.
What kind of memory limitations does the NES have for graphics? Because it has the CHR rom like the Neo Geo, could you actually have better animation on the NES than on the SNES with a special mapper?
That's how After Burner can change the entire background so quickly (albeit that's swapping the nametable rather than the tiles).

For a more straight example, the beginning of stage 7-1 in Return of the Joker at 17:38. Admittedly that's just changing a few tiles that happen to be spread everywhere, but that part definitely looks a lot more animated than the vast majority of 2D games from later generations.

EDIT: also, this can be useful for making parallax =P
User avatar
Drew Sebastino
Formerly Espozo
Posts: 3496
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: Newcomer to NES programming

Post by Drew Sebastino »

You know, I was bored so I converted these graphics to work on the NES. I think you can guess what game it is from. :wink:
chr rom graphics.png
chr rom graphics.png (11.17 KiB) Viewed 6416 times
Working with the NES's limited color palette is extremely annoying. If there are 64 different slots for colors, why are there several ones left black? You know, I find it a little humorous that the Atari 2600's color palette is over twice as large as the NES.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Newcomer to NES programming

Post by tepples »

Espozo wrote:Working with the NES's limited color palette is extremely annoying. If there are 64 different slots for colors, why are there several ones left black?
Because there are only 12 possible hues, plus one column of grays. This leaves a bunch of unused (black) entries.
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Newcomer to NES programming

Post by Sik »

Two columns of gray and ten color hues. But yeah I really wonder why didn't they try to extend it so that all 16 columns were covered instead of just 14 (also the lack of yellow is annoying).
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Newcomer to NES programming

Post by tepples »

Sik wrote:But yeah I really wonder why didn't they try to extend it so that all 16 columns were covered instead of just 14
Cost. In 1983, each gate on an integrated circuit cost a lot more than it does in 2015.
(also the lack of yellow is annoying).
That's an NTSC problem if anything. Pure yellow is out of NTSC's gamut.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Newcomer to NES programming

Post by lidnariq »

Sik wrote:ten color hues.
<pedantic>Twelve.</pedantic>
why didn't they try to extend it so that all 16 columns were covered instead of just 14
Perhaps because the 2600's analog delay line was deemed insufficiently precise.

Or maybe because the NES is very clearly inspired by the Colecovision, and that used a 2×NTSC crystal, divided in two to make the Z80 system clock, and then multiplied by 3 to make the TMS9928A clock. The TMS9928A generates component natively, but has a very fixed palette (15 colors including white and black), and requires an external IC to convert to modulated video. An obvious simplification (and cost reduction) is to avoid the awkward analog frequency doubler and just use some multiple of 3×NTSC to get both the desired horizontal pixel count and colorburst frequency.

At that point, they could have used the 2600's analog delay line, but doing the same thing digitally is simpler and doesn't require any tuning or on-die capacitors.

On the other hand, I think that it should have been easy to extend the palette in the other direction (the two missing MSBs), though, with more options for saturation and/or brightness.
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Newcomer to NES programming

Post by Sik »

tepples wrote:Cost. In 1983, each gate on an integrated circuit cost a lot more than it does in 2015.
Isn't the value just fed to a 16 step counter though, which is then used to generate part of the analog signal? I'd imagine that the analog part would have been feasibly enough to tweak that the range would fall within something that covered all 16 columns.

Then again discussing a hardware decision that was decided over 30 years ago is stupid...
tepples wrote:That's an NTSC problem if anything. Pure yellow is out of NTSC's gamut.
There isn't even a color similar to yellow though, the closest to it is a light orange that doesn't pass for yellow no matter what (pure red isn't there either but at least there's a color close enough to pass for it).
lidnariq wrote:<pedantic>Twelve.</pedantic>
Wait... *headdesk* I can't do math (apparently I substracted two twice)
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Newcomer to NES programming

Post by tepples »

Sik wrote:
tepples wrote:Cost. In 1983, each gate on an integrated circuit cost a lot more than it does in 2015.
Isn't the value just fed to a 16 step counter though, which is then used to generate part of the analog signal?
It can be thought of as a 12-step counter, as the master clock rate is six times the color burst rate. The counter ticks on both rises and falls.
tepples wrote:That's an NTSC problem if anything. Pure yellow is out of NTSC's gamut.
There isn't even a color similar to yellow though, the closest to it is a light orange that doesn't pass for yellow no matter what
Which yellow is in Dr. Mario?
Image
Screenshot by mobygames
User avatar
Myask
Posts: 965
Joined: Sat Jul 12, 2014 3:04 pm

Re: Newcomer to NES programming

Post by Myask »

Mednafen debugger: PPU memory wrote:

Code: Select all

3F00: 0F 31 2C 0A  0F 32 28 0A  0F 28 15 21  0F 00 22 0A
3F10: 0F 37 30 18  0F 28 15 0F  0F 28 15 21  0F 28 21 0F
Looks like 28. The use of blue as the "highlight" on it seems to help.
For "fun", edit sprite and BG palette entry 2 to 0F 28 28 28.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Newcomer to NES programming

Post by Bregalad »

Espozo wrote:You know, I was bored so I converted these graphics to work on the NES. I think you can guess what game it is from. :wink:
Legend of Mana ?

By the way this picture is extremely good looking.
If there are 64 different slots for colors, why are there several ones left black?
None are "left black", there is just this transparent colour that repeats every first colour of every palette.
ccovell
Posts: 1045
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Re: Newcomer to NES programming

Post by ccovell »

Bregalad wrote:
If there are 64 different slots for colors, why are there several ones left black?
None are "left black", there is just this transparent colour that repeats every first colour of every palette.
He's not talking about the palette RAM entries, but rather the table of possible colours in the PPU.

Well, there is a great explanation (document?) by Kevin Horton about how the PPU generates its colour signals in the NTSC domain. Colour $X0 is the high voltage for each brightness level, and the corresponding $XD the low voltage, and the PPU makes the colours in between by oscillating between the two voltages with different phases. Quite smart and interesting. Maybe Nintendo (Ricoh) could have added a couple more hues in there, but then the hues wouldn't rotate cleanly at 30 degrees(?) for each hue setting.
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: NES graphic memory limit

Post by Sik »

Bleh, looking at the palette 28 looks ochre instead =/ Dammit context.
Post Reply