It is currently Wed Oct 18, 2017 5:16 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 64 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
PostPosted: Fri Jun 09, 2017 3:03 am 
Offline
User avatar

Joined: Sat Sep 07, 2013 2:59 pm
Posts: 1401
On the NES, each palette entry of the 2 x 4 on-screen palettes takes one byte, i.e. each palette entry can have a value of 0-255.

So, is there a technical reason why the total number of colors on the NES is only 64 (52 + a few black entries) instead of 256?

I would understand it if the palettes occupied only 24 bytes (6 bits for each of the 2 x 4 x 4 entries). But they take the full 32 bytes (8 bits for each of the 2 x 4 x 4 entries).

_________________
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 3:26 am 
Offline

Joined: Tue Oct 06, 2015 10:16 am
Posts: 555
Money.


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 3:29 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7230
Location: Chexbres, VD, Switzerland
I'm sorry but those kinds of questions, such as "why are nametables 32x32 tiles", "why are tiles 8x8 pixels", "why is the screen resolution 256x240", or "why is there only 8 sprites per line", "why isn't the A15 adress line passed to the cartridge edge", "why the square channels contains an almost useless length counter feature", etc... have already been asked over and over and there's no answer. This is just how Nintendo designed the console. Only Nintendo knows. Asking here is irrelevant. Your quesiton is unanswerable for us.


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 3:41 am 
Offline
User avatar

Joined: Sat Sep 07, 2013 2:59 pm
Posts: 1401
Those questions are not analoguous since I'm not asking for arbitrary design decisions.
(For example, I didn't ask why the last few colors are filled with black instead of real values.)

My question was basically:

Is the color spectrum of the NES a collection of 256 colors where 204 colors are simply chosen to be black.
I.e. they could have added more colors without changing anything else since the slots already exist, they just chose not to fill them with meaningful values.

Or is there a technical reason that there are only 64 colors?
I.e. the PPU value might be one byte, but when it gets converted to the actual color, the NES reads from a six-bits-per-entry table, so adding new colors would have changed the overall logic.

_________________
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 3:56 am 
Offline

Joined: Mon Nov 10, 2008 3:09 pm
Posts: 429
DRW wrote:
On the NES, each palette entry of the 2 x 4 on-screen palettes takes one byte, i.e. each palette entry can have a value of 0-255.


No, they can't. The PPU's internal palette RAM is only six bits wide. When you write to it, the upper bits are simply discarded--you can verify this by reading it back via $2007.

As for why the palette isn't packed 4 entries in 3 bytes like you suggest, that would have had more drawbacks than benefits. Software would have to write very slightly less data in vblank to update the full palette, but updating individual colors, or doing arithmetic on palette entries for fade-outs, etc., would have become significantly more difficult with bit-packed entries.

And as for why the NES didn't support more than 4 levels of luma, I guess that would have made the DAC take up more PPU die space than the engineers could spare. The Atari TIAs (video chips in the 2600, 5200, 7800, and the 8-bit computers) had 3 or 4 bits of luma, but they needed external DACs--the video signals coming out of the chip were digital.


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 4:13 am 
Offline

Joined: Thu Aug 20, 2015 3:09 am
Posts: 284
The PPU only stores 6 bits per entry because that's all it can use. They don't simply index a table like you assume, because such a table would be far too big for the technology of the time. Instead it has a convoluted and actually rather clever chain of logic to generate the entire image using a single square wave. The square wave sequencer has 12 steps, allowing it to be offset in 12 phases, and there are four sets of levels for the low and high parts of the wave. But that doesn't include black and white, so there is logic to switch the square wave off and generate a constant signal, either the high level or the low level.

That gives you 14×4 = 56 different possible combinations, though since the level table has to pull double duty not all of them are very different.


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 5:13 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7230
Location: Chexbres, VD, Switzerland
DRW wrote:
Those questions are not analoguous since I'm not asking for arbitrary design decisions.

Yes, you are indeed asking for arbitrary design desicion. The 56 palette is part of the console's design.

Quote:
Is the color spectrum of the NES a collection of 256 colors where 204 colors are simply chosen to be black.

No.

Quote:
I.e. they could have added more colors without changing anything else since the slots already exist, they just chose not to fill them with meaningful values.

Yes they could have added more colours, but for some reason they didn't.

Quote:
Or is there a technical reason that there are only 64 colors?

Yes, only 6 bits of memory are used. They could still have used more colours with 6 bits, for example having 15 hues instead of only 12, but for some reason they didn't.


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 6:41 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3943
After reading about how the NES generates those colors, you never think about the NES palette the same way again.

It's a square wave between a bright gray level and a darker gray level, and it can be shifted to 12 different phases, left as light gray, or left as dark gray.
They picked up to 4 levels of brightness for the palette. But yes, they could have used more.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 8:04 am 
Offline
User avatar

Joined: Thu Sep 15, 2016 6:29 am
Posts: 249
Location: Denmark (PAL)
Bregalad wrote:
there's no answer. This is just how Nintendo designed the console. Only Nintendo knows. Asking here is irrelevant. Your quesiton is unanswerable for us.


That in itself would be an answer, if it were true. I would imagine there's a technical (/financial) limitation behind the descision. I'm certain that the NES would have had a 256 color palette if it doesn't make the PPU more expensive produce.


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 8:09 am 
Offline
User avatar

Joined: Sat Jul 04, 2015 9:58 am
Posts: 531
Location: -29.794229 -55.795374
Bregalad wrote:
"why isn't the A15 adress line passed to the cartridge edge"


Well, I found a clone that has it on the cartridge edge: :lol:
Attachment:
Phantom connector.jpg
Phantom connector.jpg [ 206.5 KiB | Viewed 1138 times ]


I just don't know for what it would be useful :roll: , unless you want to make something that works only with this clone and not with the real thing... :D


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 9:58 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19097
Location: NE Indiana, USA (NTSC)
It was die size cost. Name a way it could have been extended to 256 colors, and someone might explain how that would have been more expensive. In addition, a 3:3:2-bit (rrrgggbb) format wouldn't have produced pure grays.


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 10:17 am 
Offline
User avatar

Joined: Thu Mar 31, 2016 11:15 am
Posts: 197
When I finish my NES time machine I'm going to go back to the 80s and tell Mr. Nintendo to fire the guy implementing color emphasis bits. Then I'm going to tell him to hire a palette engineer that knows all 256 colors, including the exotic yellow one.


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 10:42 am 
Offline
User avatar

Joined: Sun Dec 12, 2010 10:27 pm
Posts: 282
Location: Hong Kong
Or, better, fire the one who decided 4 sub-palettes were already enough for the Mega Drive, backgrounds and sprites combined.
Though as explained in the Famicom's case here, there were many reasonable... er... reasons to this, Sega seemed to be quite bad in this area. The Game Gear is another odd ball, as it has a HUGE master palette despite having only 2 sub-palettes (though some games did change colours mid-screen), and this is more or less the only improvement over the original SMS (and the reduced resolution, if you call this an improvement).

What I really want to do with time traveling though, is to let the PC Engine have a larger master palette (4096 colours is enough). This can certainly make its arcade and PC conversions much more accurate. And AFAIK this is relatively "easy" to pull off too. You only need to change the VCE and keep the original VDC, which was already done by some arcade games using the same VDC and probably the PC-FX, which I'm not very familiar with its specs, but I think its VDC was just a minor upgrade from the PCE one.


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 12:41 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6277
Location: Seattle
The DAC inside the 2C02 has 10 taps; one could certainly specify palettes in a much more expanded manner where you directly specified which tap for the high and low phases instead of 2 bits specifying some pair. This would afford you 12·10·10=1200 different nominal colors, although a huge number of them would be duplicates (tons of greys and every color would be present twice), and lots of them would be completely out of gamut, too. (After all, these taps include the sync voltages)

The amount of die area needed to hold the palette would double, and addressing it (since it's now more than 8 bits) would be more complicated.

Furthermore, the location of the individual bits within the 2C02's palette RAM initially appears a little oddly interleaved, so even though there is enough area to hold the extra bits of RAM to hold a bigger RAM, there isn't enough width:
Code:
3f00&1 3f04&1 3f08&1 3f0c&1 3f00&2 3f04&2 3f08&2 3f0c&2 3f00&4 ... 3f0c&20
3f12&1 ...
3f02&1
3f11&1
3f01&1
3f13&1
3f03&1  remainder omitted for clarity


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 1:10 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19097
Location: NE Indiana, USA (NTSC)
A more practical refinement of that idea: For one additional bit per color, the PPU could have had a set of desaturated colors.

Of the 7 taps actually used for picture, $0D and $1D are very close, $2D and $00 are kind of close, and $3D and $10 are very close. So this leaves us four easy-to-distinguish taps: $1D, $00, $10, and $20.

[code]
bbaa xppp
|||| +++- Phase (0 to 5) in twelfths of a color subcarrier
|||| Corresponds to a pair of opposing hues
||++------ In-phase tap (7.5, 40, 70, or 100 IRE)
++-------- Out-of-phase tap

All the grays $0x, $5x, $Ax, and $Fx would be duplicates.

This would produce 12 sequences of two distinct taps times 6 hue pairs plus four grays = 76 colors without adding much complexity to the signal generator.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 64 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group