nesdev.parodius.com Forum Index nesdev.parodius.com
NES Development and Strangulation Records message boards
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Full 410-Color NES Palette Demo
Goto page 1, 2  Next
 
Post new topic   Reply to topic    nesdev.parodius.com Forum Index -> NESdev
View previous topic :: View next topic  
Author Message
blargg



Joined: 27 Sep 2004
Posts: 1955

PostPosted: Sat Mar 11, 2006 3:12 am    Post subject: Full 410-Color NES Palette Demo Reply with quote

I liked Loopy's PALTEST demo and extended the concept to show all ~410 colors on screen: (2 grays + 12 colors) * 4 brightness levels * 8 emphasis bit settings + 1 black about 39 duplicates. It came out pretty nice:



full_nes_palette.nes

I took a different approach of keeping PPU rendering off and manually refilling the palette at the proper time mid-scanline. I spread the spectrum horizontally and first tried vertically cycling through the four brightness levels for each emphasis combination. I noticed that I could get a smoother light-to-dark transition if I instead cycled through each emphasis combination for each brightness.

UPDATE: I wrote a color counting program using nes_ntsc and it only counted 410 unique colors (using 8 bit resolution for the red, green, and blue components). Adjusting brightness and contrast didn't affect this number by more than a couple of colors.
Back to top
View user's profile Send private message Visit poster's website
Celius



Joined: 05 Jun 2005
Posts: 1875
Location: Minneapolis, Minnesota, United States

PostPosted: Sat Mar 11, 2006 12:00 pm    Post subject: Reply with quote

Nice Demo! Too bad it only works on Nintendulator. FCEUXD wouldn't play it correctly. I loaded it in FCEUXD, and I was like "This can't be the demo, this is crap." Because it showed like 3 different blues on screen at once. Do you think this would work on real hardware? It seems very buggy. Maybe a little more precise scanline counting would be good, if you can do that.
Back to top
View user's profile Send private message Visit poster's website
NewRisingSun



Joined: 19 May 2005
Posts: 141

PostPosted: Sat Mar 11, 2006 12:41 pm    Post subject: Reply with quote

Quote:
FCEUXD wouldn't play it correctly. I loaded it in FCEUXD, and I was like "This can't be the demo, this is crap." Because it showed like 3 different blues on screen at once. Do you think this would work on real hardware?
In case you haven't noticed, Nintendulator is the more accurate emulator. It also works on Nestopia 1.27, by the way.
Quote:
Maybe a little more precise scanline counting would be good, if you can do that.
Why would he modify working code to work with a particular suboptimal emulator?

Last edited by NewRisingSun on Sat Mar 11, 2006 1:34 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Celius



Joined: 05 Jun 2005
Posts: 1875
Location: Minneapolis, Minnesota, United States

PostPosted: Sat Mar 11, 2006 1:21 pm    Post subject: Reply with quote

NewRisingSun wrote:

Quote:
Maybe a little more precise scanline counting would be good, if you can do that.
Why would he modify working code to work with a particular suboptimal emulator?


No, no, no. That's not what I meant. Because there is obvious off-time scanline counting, blargg should count scanlines more precicely. Well, when I think about it, he did a really nice job of counting, because if it was off time, the color blocks would be scrolling down off screen. I don't know. It just isn't very pretty, because scanline counting is hard. But all those colors on screen at once is really awesome. Just looks a little fuzzy in some places. And I have noticed that Nintendulator is far more accurate.
Back to top
View user's profile Send private message Visit poster's website
Quietust



Joined: 19 Sep 2004
Posts: 1028

PostPosted: Sat Mar 11, 2006 1:28 pm    Post subject: Reply with quote

The problem with FCEU is that it only supports three "colour emphasis" modes at once on the screen: "no bits", "all bits", and "some bits" (i.e. any other combination, but only the first one it encounters).
Back to top
View user's profile Send private message
Bregalad



Joined: 12 Nov 2004
Posts: 3640
Location: Jongny, VD, Switzerland

PostPosted: Sat Mar 11, 2006 1:30 pm    Post subject: Reply with quote

It doesn't work under Nestopia for me. Since Nintendulator don't run on my PC but only on the family's PC (because mine is way too slow), I cannot test it yet.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Quietust



Joined: 19 Sep 2004
Posts: 1028

PostPosted: Sat Mar 11, 2006 1:33 pm    Post subject: Reply with quote

Bregalad wrote:
It doesn't work under Nestopia for me. Since Nintendulator don't run on my PC but only on the family's PC (because mine is way too slow), I cannot test it yet.


You don't need a fast computer to see this demo - even 1fps is enough to see the result.
Back to top
View user's profile Send private message
Bregalad



Joined: 12 Nov 2004
Posts: 3640
Location: Jongny, VD, Switzerland

PostPosted: Sat Mar 11, 2006 1:40 pm    Post subject: Reply with quote

You're right. It seems very shacky. Why not use a standard method for horizontal palette chaning an use tricky tricks only for vertical palette changing ? It sounds much more reasonable to me.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
tepples



Joined: 19 Sep 2004
Posts: 4889
Location: USA

PostPosted: Sat Mar 11, 2006 3:18 pm    Post subject: Reply with quote

Bregalad wrote:
Why not use a standard method for horizontal palette chaning an use tricky tricks only for vertical palette changing ?

Because you can only do vertical palette changing on a small number of colors at once before hblank time runs out.
Back to top
View user's profile Send private message Visit poster's website AIM Address
baisoku



Joined: 11 Nov 2004
Posts: 121
Location: San Francisco, CA

PostPosted: Sat Mar 11, 2006 3:33 pm    Post subject: Reply with quote

Disregard the noise, blargg. Nice work. Smile Ditto for the RGB mixing page.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Memblers
Site Admin


Joined: 20 Sep 2004
Posts: 1836
Location: Indianapolis

PostPosted: Sat Mar 11, 2006 6:04 pm    Post subject: Reply with quote

This is really cool. It made me think of all kinds of crazy stuff, like someone could theoretically draw a picture like this on a cart that has no CHR memory at all. Couldn't it select colors in a given pattern rather than cycling through them all? (Why someone would do that is a whole other thing, but anyways.. CopyNES TV display maybe? heheh).
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
blargg



Joined: 27 Sep 2004
Posts: 1955

PostPosted: Sat Mar 11, 2006 6:28 pm    Post subject: Reply with quote

Hahaha to all who try this on a puny emulator. I developed it on my NES and it is not at all buggy (but it is a hack in the good sense); where do you think the screenshot came from? Not my emulator, ha! It's using the CPU to do all pixel timing, not the PPU, so the edges of colors are ragged by three pixels. If timing weren't perfect the image would roll and be skewed horizontally. To those who suggest I use normal palettes and tiles, this would add glitches on a whole scanline between colors, as with Loopy's PALTEST.

Memblers wrote:
It made me think of all kinds of crazy stuff, like someone could theoretically draw a picture like this on a cart that has no CHR memory at all. Couldn't it select colors in a given pattern rather than cycling through them all?


I was thinking of exactly this. The main problem is getting the data out fast enough. This demo uses 6 CPU cycles (18 pixels) per horizontal strip. You could put the data on the stack and quickly pop it all off, widening the strips to 24 pixels, or put the data in zero page and widen the strips to 21 pixels. Both would still limit you to 256 pixels until the buffer needed to be refilled, giving about 22 scanlines of data. You could unroll everything into special-purpose code, giving you 14 strips across with full vertical resolution, using. Too bad I only have enough devcart memory to display about 100 lines like this. I should try making a picture convertor and demo for this. It could even change the emphasis each line, giving access to hundreds of colors.
Back to top
View user's profile Send private message Visit poster's website
NewRisingSun



Joined: 19 May 2005
Posts: 141

PostPosted: Sat Mar 11, 2006 6:57 pm    Post subject: Reply with quote

Inspired from reading those articles about Color Dream's "Hellraiser" cart, I have always wondered about such a thing: putting a custom CPU with the actual game code and PPU on the cartridge, and all the 6502 program does is feed the picture data from the custom CPU/PPU to the NES, and controller input from the NES to the custom CPU; the custom PPU would output a 7-bit color code (4xNES color + 3xEmphasis) for each and every pixel, which the NES program then writes into the NES PPU's palette register.

Of course, that wouldn't work because of the speed issue, as explained previously, unless the cartridge hardware could somehow change the PPU's palette register directly, without using the 6502 CPU.
Back to top
View user's profile Send private message Visit poster's website
blargg



Joined: 27 Sep 2004
Posts: 1955

PostPosted: Sat Mar 11, 2006 7:47 pm    Post subject: Reply with quote

Here's one with an earlier color arrangement that I like better, since it's clearer what's going on and each color rectangle is more distinct:



full_nes_palette2.nes

As before, run on a NES or an accurate emulator. Smile
Back to top
View user's profile Send private message Visit poster's website
Jagasian



Joined: 09 Feb 2005
Posts: 384

PostPosted: Mon Mar 13, 2006 12:15 pm    Post subject: Reply with quote

blargg wrote:
where do you think the screenshot came from? Not my emulator, ha!


Honestly, it is really becoming hard to tell, considering your recent work. Can you prove that screenshot is not taken from an emulator?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nesdev.parodius.com Forum Index -> NESdev All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group