It is currently Tue Oct 24, 2017 2:48 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Sat Oct 29, 2005 3:12 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
Quote:
To be the most accurate, the best option would be to make the player choise it's own initial colour


Hah, I love this. That way you can have it match the very color your NES displayed (assuming you had one back in the day).

Quote:
Most emulators have $00 as the default palette.


I've noticed that the Game Genie uses gray as the background color when starting the original code.

Quote:
I think that ANY walue is accurate, scince every NES has a different color.


This can't be true, otherwise you could claim that a particular NES is inaccurate because it has one particular instead of the others. Maybe an uncollapsed quantum wave function of a NES would satisfy this. :)

As for the palette values at power-up, we've established that they are not consistent on different NES units, that none of 3500+ games rely on the initial values, and that being dynamic RAM, the first entry might start out as 0x0f. Each emulator author can make his own decision as to what is "best", but it's silly to try to have everyone here agree on something subjective (that being what tradeoffs to make between accuracy and enhancement).


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 07, 2005 10:11 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
I just realized that you don't need to keep a flag for each palette entry, just a second "rendering" palette that you use for actual rendering but that the emulated code can never read from. At power-up, fill this palette with black ($0f) and fill the normal palette with whatever accurate power-up values you're using. Then when you have a palette write, write to both palettes. This way black is used until a particular palette entry is first written, then its normal color is used. The change is very minimal:

Code:
char palette [0x20];
char rendering_palette [0x20]; // added
char initial_palette [0x20] = { ... }; // initial palette values at power-up

void power_up()
{
    memset( rendering_palette, 0x0f, 0x20 ); // added
    memcpy( palette, initial_palette, 0x20 );
}

void write_palette( int addr, int data )
{
    palette [addr] = data;
    rendering_palette [addr] = data; // added
}

int read_palette( int addr )
{
    return palette [addr];
}

void render_graphics()
{
    ...
    int color = rendering_palette [index]; // changed
    ...
}


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

All times are UTC - 7 hours


Who is online

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