| View previous topic :: View next topic |
| Author |
Message |
blargg

Joined: 27 Sep 2004 Posts: 2537
|
Posted: Sat Mar 11, 2006 3:12 am Post subject: Full 410-Color NES Palette Demo |
|
|
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 |
|
 |
Celius

Joined: 05 Jun 2005 Posts: 1939 Location: Minneapolis, Minnesota, United States
|
Posted: Sat Mar 11, 2006 12:00 pm Post subject: |
|
|
| 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 |
|
 |
NewRisingSun
Joined: 19 May 2005 Posts: 141
|
Posted: Sat Mar 11, 2006 12:41 pm Post subject: |
|
|
| 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 |
|
 |
Celius

Joined: 05 Jun 2005 Posts: 1939 Location: Minneapolis, Minnesota, United States
|
Posted: Sat Mar 11, 2006 1:21 pm Post subject: |
|
|
| 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 |
|
 |
Quietust

Joined: 19 Sep 2004 Posts: 1028
|
Posted: Sat Mar 11, 2006 1:28 pm Post subject: |
|
|
| 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 |
|
 |
Bregalad

Joined: 12 Nov 2004 Posts: 4134 Location: Jongny, VD, Switzerland
|
Posted: Sat Mar 11, 2006 1:30 pm Post subject: |
|
|
| 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 |
|
 |
Quietust

Joined: 19 Sep 2004 Posts: 1028
|
Posted: Sat Mar 11, 2006 1:33 pm Post subject: |
|
|
| 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 |
|
 |
Bregalad

Joined: 12 Nov 2004 Posts: 4134 Location: Jongny, VD, Switzerland
|
Posted: Sat Mar 11, 2006 1:40 pm Post subject: |
|
|
| 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 |
|
 |
tepples

Joined: 19 Sep 2004 Posts: 6085 Location: NE Indiana, USA (NTSC)
|
Posted: Sat Mar 11, 2006 3:18 pm Post subject: |
|
|
| 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 |
|
 |
baisoku

Joined: 11 Nov 2004 Posts: 121 Location: San Francisco, CA
|
Posted: Sat Mar 11, 2006 3:33 pm Post subject: |
|
|
Disregard the noise, blargg. Nice work. Ditto for the RGB mixing page. |
|
| Back to top |
|
 |
Memblers Site Admin

Joined: 20 Sep 2004 Posts: 2171 Location: Indianapolis
|
Posted: Sat Mar 11, 2006 6:04 pm Post subject: |
|
|
| 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 |
|
 |
blargg

Joined: 27 Sep 2004 Posts: 2537
|
Posted: Sat Mar 11, 2006 6:28 pm Post subject: |
|
|
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 |
|
 |
NewRisingSun
Joined: 19 May 2005 Posts: 141
|
Posted: Sat Mar 11, 2006 6:57 pm Post subject: |
|
|
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 |
|
 |
blargg

Joined: 27 Sep 2004 Posts: 2537
|
Posted: Sat Mar 11, 2006 7:47 pm Post subject: |
|
|
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.  |
|
| Back to top |
|
 |
Jagasian
Joined: 09 Feb 2005 Posts: 385
|
Posted: Mon Mar 13, 2006 12:15 pm Post subject: |
|
|
| 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 |
|
 |
|