It is currently Thu Nov 23, 2017 1:01 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sat Mar 11, 2006 3:12 am 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
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:

Image

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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 12:00 pm 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2136
Location: Minneapolis, Minnesota, United States
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 12:41 pm 
Offline

Joined: Thu May 19, 2005 11:30 am
Posts: 313
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.

Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 1:21 pm 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2136
Location: Minneapolis, Minnesota, United States
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 1:28 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1393
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).

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 1:30 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7273
Location: Chexbres, VD, Switzerland
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.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 1:33 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1393
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.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 1:40 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7273
Location: Chexbres, VD, Switzerland
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.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 3:18 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19252
Location: NE Indiana, USA (NTSC)
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 3:33 pm 
Offline
User avatar

Joined: Thu Nov 11, 2004 5:30 am
Posts: 121
Location: San Francisco, CA
Disregard the noise, blargg. Nice work. :) Ditto for the RGB mixing page.

_________________
...patience...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 6:04 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3484
Location: Indianapolis
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).


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 6:28 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 6:57 pm 
Offline

Joined: Thu May 19, 2005 11:30 am
Posts: 313
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 11, 2006 7:47 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
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:

Image

full_nes_palette2.nes

As before, run on a NES or an accurate emulator. :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 13, 2006 12:15 pm 
Offline

Joined: Wed Feb 09, 2005 9:31 am
Posts: 418
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?


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google Adsense [Bot] and 12 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