It is currently Sat Nov 18, 2017 4:35 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sun Mar 05, 2017 7:29 am 
Offline
User avatar

Joined: Sun Jan 25, 2015 6:51 pm
Posts: 69
Location: Tokyo
I started thinking about what would constitute an accurate palette from PAL / SECAM gamut space.
This test is directly from the hardware capable PAL gamut, at 12 equal steps along the possible range.

Row 10 ~ 1F is PAL gamut:
xR-0.64
yR-0.33
xG-0.29
yG-0.60
xB-0.15
yB-0.06
White point D65 (X0.3127, Y0.329)

Then row 0, 2 & 3 are luminance steps based on row 1.

This palette also includes a hack for getting a better 00 ~ 30, 0D~3D range. Reckless!! Use at own risk :mrgreen:

Image
Image

Attached is the PAL gamut palette in .aco, .act & .pal formats.
I think I have the .pal file laid out correctly, but not really sure how to convert for FCEUX to test out. If anyone can help?


Attachments:
NES-SECAMPALHK.zip [6.25 KiB]
Downloaded 52 times

_________________
twitter: http://twitter.com/hawkun
Pirate Pop Plus - gameboy styled game for 3DS, WiiU & Steam
Top
 Profile  
 
PostPosted: Sun Mar 05, 2017 10:35 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5822
Location: Canada
hawken wrote:
This palette also includes a hack for getting a better 00 ~ 30, 0D~3D range. Reckless!! Use at own risk :mrgreen:

Why would you do this? If it's intended for use in an emulator it'll just make games that use $20 as white look dull. If it's intended for use in making NES graphics, those colours aren't going to work on the real thing.

hawken wrote:
I think I have the .pal file laid out correctly, but not really sure how to convert for FCEUX to test out. If anyone can help?

The .pal file should have 64 x 3-byte RGB entries (or 512 if including emphasis), so either 192 or 1536 bytes. I don't know how you arrived at 631 bytes.


Top
 Profile  
 
PostPosted: Sun Mar 05, 2017 11:59 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6442
Location: UK (temporarily)
There is possibly, maybe some utility to having a "standardized" copy of the UM6559 SECAM generator palette, given how much it differs from the standard palette...


Top
 Profile  
 
PostPosted: Sun Mar 05, 2017 9:58 pm 
Offline
User avatar

Joined: Sun Jan 25, 2015 6:51 pm
Posts: 69
Location: Tokyo
rainwarrior wrote:
hawken wrote:
This palette also includes a hack for getting a better 00 ~ 30, 0D~3D range. Reckless!! Use at own risk :mrgreen:

Why would you do this? If it's intended for use in an emulator it'll just make games that use $20 as white look dull. If it's intended for use in making NES graphics, those colours aren't going to work on the real thing.


(theoretically it's just a luminance ramp, $20 was "meant" to be light grey. Would be interesting to know how it came out on actual PAL / SECAM sets with their differing chrominance. As shown above, $20 is a light grey on SECAM - although that might be the machine - I imagine artists went for $30 as white?)

Can take these out of the final .pal, this is just a test.

rainwarrior wrote:
hawken wrote:
I think I have the .pal file laid out correctly, but not really sure how to convert for FCEUX to test out. If anyone can help?

The .pal file should have 64 x 3-byte RGB entries (or 512 if including emphasis), so either 192 or 1536 bytes. I don't know how you arrived at 631 bytes.


The .pal file is output from ASEprite (64 lines plus header), I may be out of my depth here but why does FCEUX need .pal in 8bit colour space?

_________________
twitter: http://twitter.com/hawkun
Pirate Pop Plus - gameboy styled game for 3DS, WiiU & Steam


Last edited by hawken on Sun Mar 05, 2017 10:26 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sun Mar 05, 2017 10:23 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5822
Location: Canada
hawken wrote:
The .pal file is output from ASEprite (64 lines plus header), is there a utility that can convert to the way FCEUX needs it?

Opening it with a hex editor I discovered it's a "JASC-PAL" format. Never heard of this one before, but it looks like a simple text file containing a list of decimal triples.

Apparently there's also a Microsoft .pal format that's different.

Anyhow, no I don't know of any converter tool, but you could write a converter in python or some other convenient language in probably like 20 lines.


Top
 Profile  
 
PostPosted: Sun Mar 05, 2017 10:25 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6442
Location: UK (temporarily)
hawken wrote:
As shown above, $20 is a light grey on SECAM - although that might be the machine - I imagine artists went for $30 as white?)
I'm pretty certain the UM6559 palette (that link) should just be considered Wrong™.

In the 2C02/2C07, colors $00 $10 $20 $30 are "1 2 3 3" and colors $0d $1d $2d $3d are "-1 0 1 2" (and colors $0e $1e $2e $3e $0f $1f $2f $3f all "0"), but in the UM6559 all four columns/rows are "0 1 2 3"

rainwarrior wrote:
Opening it with a hex editor I discovered it's a "JASC-PAL" format. Never heard of this one before, but it looks like a simple text file containing a list of decimal triples.
Then it's also very similar to GIMP's and Fractint's palette formats too, and trivially converted to a PPM (type "P3") image.


Top
 Profile  
 
PostPosted: Sun Mar 05, 2017 10:28 pm 
Offline
User avatar

Joined: Sun Jan 25, 2015 6:51 pm
Posts: 69
Location: Tokyo
rainwarrior wrote:
hawken wrote:
The .pal file is output from ASEprite (64 lines plus header), is there a utility that can convert to the way FCEUX needs it?

Opening it with a hex editor I discovered it's a "JASC-PAL" format. Never heard of this one before, but it looks like a simple text file containing a list of decimal triples.

Apparently there's also a Microsoft .pal format that's different.


Those are the two most common .pal formats, FCEUX is custom ;)

Thanks I'll look in to converting to 8bit colour space 3-byte. The FCEUX .pal files are a little confusing (at least to me) in a text editor as there's 12 rows of 8 entries (96 entries) [edit: ah I get it]. Also does anyone know why do they need to be in 8bit colour space?

_________________
twitter: http://twitter.com/hawkun
Pirate Pop Plus - gameboy styled game for 3DS, WiiU & Steam


Last edited by hawken on Sun Mar 05, 2017 10:50 pm, edited 4 times in total.

Top
 Profile  
 
PostPosted: Sun Mar 05, 2017 10:31 pm 
Offline
User avatar

Joined: Sun Dec 12, 2010 10:27 pm
Posts: 289
Location: Hong Kong
Jasc palette files seem to originate from JASC PSP, and not a Sony PSP!


Top
 Profile  
 
PostPosted: Sun Mar 05, 2017 10:40 pm 
Offline
User avatar

Joined: Sun Jan 25, 2015 6:51 pm
Posts: 69
Location: Tokyo
lidnariq wrote:

In the 2C02/2C07, colors $00 $10 $20 $30 are "1 2 3 3" and colors $0d $1d $2d $3d are "-1 0 1 2" (and colors $0e $1e $2e $3e $0f $1f $2f $3f all "0"), but in the UM6559 all four columns/rows are "0 1 2 3"


Could this be considered a "fix"?

I'll edit the .pal so that it conforms to 2C02/2C07 luminance shifting, could this be considered a "bug"?

Would be interesting to know what the true intention of these $00 ~ $30, $0D ~ $3D were meant to be... I'm totally up for making a palette that conveyed the true intentions of the original hardware.

_________________
twitter: http://twitter.com/hawkun
Pirate Pop Plus - gameboy styled game for 3DS, WiiU & Steam


Last edited by hawken on Sun Mar 05, 2017 10:52 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sun Mar 05, 2017 10:41 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5822
Location: Canada
hawken wrote:
Those are the two most common .pal formats, FCEUX is custom ;)

It's a very simple and natural format used by other NES emulators, though. It's not intended for anything but NES palettes, e.g. there's no header to say how many entries there are supposed to be, because there's only one way to do it, really. I don't think it originated with FCEUX, either.

hawken wrote:
As shown above, $20 is a light grey on SECAM - although that might be the machine

Oh, so the idea is based on some particular piece of Dendy clone hardware?

hawken wrote:
I imagine artists went for $30 as white?)

In NES games, no, not really. $20 and $30 are supposed to be the same white, and there are practical reasons why you might want to use $20 instead of $30. The main one I can think of is that it makes fading out look more natural when white doesn't persist for an extra step of the fadeout.

Some games prefer $30, some prefer $20. (Some appear to use both, e.g. Jaws.)


Last edited by rainwarrior on Sun Mar 05, 2017 10:44 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sun Mar 05, 2017 10:43 pm 
Offline
User avatar

Joined: Sun Jan 25, 2015 6:51 pm
Posts: 69
Location: Tokyo
rainwarrior wrote:
In NES games, no, not really. $20 and $30 are supposed to be the same white, and there are practical reasons why you might want to use $20 instead of $30. The main one I can think of is that it makes fading out look more natural when white doesn't persist for an extra step of the fadeout.


Ah good point

_________________
twitter: http://twitter.com/hawkun
Pirate Pop Plus - gameboy styled game for 3DS, WiiU & Steam


Top
 Profile  
 
PostPosted: Tue Mar 07, 2017 5:33 am 
Offline

Joined: Mon May 27, 2013 9:40 am
Posts: 356
It also allows for a slight dim of all palete but whites in, for example, a "P A U S E" sign. If you use $20 in the game and $30 to paint the sign you can dim the whole palette retaining pure white.

_________________
http://www.mojontwins.com


Top
 Profile  
 
PostPosted: Thu Mar 09, 2017 6:53 pm 
Offline
User avatar

Joined: Sun Jan 25, 2015 6:51 pm
Posts: 69
Location: Tokyo
I was reading a bit about what "official" games were allowed to use and Jaws is a pretty rare case, apparently developers were asked not to use $30 because it caused problems with some CRT sets as it was "whiter than white" - indeed games would be rejected by Nintendo if they used #30. The same went for $0d as it was "blacker than black" (not sure what damage that could do though). $e & $f range were not allowed either.

Having trouble converting this for FCEUX (as it requires 8bit colour depth), which this is not. The quest ends here ;)

_________________
twitter: http://twitter.com/hawkun
Pirate Pop Plus - gameboy styled game for 3DS, WiiU & Steam


Last edited by hawken on Thu Mar 09, 2017 8:04 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Mar 09, 2017 6:59 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10112
Location: Rio de Janeiro - Brazil
hawken wrote:
apparently developers were asked not to use $30 because it caused problems with some CRT sets as it was "whiter than white" - indeed games would be rejected by Nintendo if they used #30.

Where did you get this information? I don't think I've ever heard this before...

Quote:
The same went for $0d as it was "blacker than black" (not sure what damage that could do though).

Blacker than black is a well known issue... It doesn't cause any actual damage, but some TV mistake this color for sync signals, distorting the picture or causing it to "roll".

Quote:
$e & $f range were not allowed either.

Again, never heard of this. $0f is widely used for black in homebrew games.


Top
 Profile  
 
PostPosted: Thu Mar 09, 2017 7:10 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5822
Location: Canada
hawken wrote:
I was reading a bit about what "official" games were allowed to use and Jaws is a pretty rare case, apparently developers were asked not to use $30 because it caused problems with some CRT sets as it was "whiter than white" - indeed games would be rejected by Nintendo if they used #30. The same went for $0d as it was "blacker than black" (not sure what damage that could do though). $e & $f range were not allowed either.

Having trouble converting this for FCEUX as it requires 8bit colour depth, which this is not. The quest ends here ;)

I don't know what your sources are for this but they're completely bogus. (If you'd care to share the source, I'm sure there's people here who wouldn't mind correcting them.)

Again, $30 is the same as $20 by design, so this "whiter than white" idea makes no sense.

Super Mario Bros. uses $0F for black, and $30 for white. (So do a lot of games.) I'm certain that $0E is acceptable too, but I don't have a common example offhand.

I mentioned Jaws only as a weird case that I happened to notice uses both $20 and $30 on the same screen.

Nintendo didn't really have a way to test for and reject $0D either. For example, the common TMNT uses $0D and it made it through all licencing tests and was one of the highest selling games for the system. It doesn't use large amounts of it on the screen, just for sprite outlines, so I don't think it tends to cause the common desync problems, but my point is I don't believe they did any sort of categorical test for the use of $0D.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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