It is currently Mon Jul 16, 2018 2:11 am

 All times are UTC - 7 hours

 Page 2 of 2 [ 17 posts ] Go to page Previous  1, 2
 Print view Previous topic | Next topic
Author Message
 Post subject: Re: SNES color palette in emulatorsPosted: Fri Jun 30, 2017 1:32 am

Joined: Tue Feb 07, 2017 2:03 am
Posts: 470
Having the lower 3 bits set from the upper 3 bits, adds a slight Gamma "curve". in that the 111XX values will have the lower 3 bits be 111 which is the brighter side, and then 000XX will have the lower 3 bits 000 which is the darker side.

Also ZSNES is 486 not fancy pants Pentium.

Top

 Post subject: Re: SNES color palette in emulatorsPosted: Fri Jun 30, 2017 2:25 am

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7443
Location: Chexbres, VD, Switzerland
Oziphantom wrote:
Having the lower 3 bits set from the upper 3 bits, adds a slight Gamma "curve".

No, the increase is linear, and it's just a different rounding algorithm. There's no such thing as a "curve" here, just straight lines.

Also, I think the "proper" algorithm would be multiply by 255/31 and round to the nearest number, which is even closer to multiply by 33/4 and roudning to the lowest number. The only 4 values where those both algorithms leads to different results are shown.

Code:
0       0       0
1       8       8
2       16      16
3       25      24   <-----
4       33      33
5       41      41
6       49      49
7       58      57    <-----
8       66      66
9       74      74
10      82      82
11      90      90
12      99      99
13      107     107
14      115     115
15      123     123
16      132     132
17      140     140
18      148     148
19      156     156
20      165     165
21      173     173
22      181     181
23      189     189
24      197     198    <-----
25      206     206
26      214     214
27      222     222
28      230     231     <------
29      239     239
30      247     247
31      255     255

For each of those cases, the value is close to the rounding boundary of n.5 :
3 -> 24.68 rounds to 25 but is also close to 24
7 -> 57.58 rounds to 58 but is also close to 57
24 -> 197.42 rounds to 197 but is also close to 198
28 -> 230.32 rounds to 230 but is not that far from 231

So I think copying the top bits to the unused bottom bits is actually a perfectly valid way to do it.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 2 of 2 [ 17 posts ] Go to page Previous  1, 2

 All times are UTC - 7 hours

#### Who is online

Users browsing this forum: koitsu and 4 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ NES / Famicom    NESdev    NESemdev    NES Graphics    NES Music    Homebrew Projects       2018 NESdev Competition       2017 NESdev Competition       2016 NESdev Competition       2014 NESdev Competition       2011 NESdev Competition    Newbie Help Center    NES Hardware and Flash Equipment       Reproduction    NESdev International       FCdev       NESdev China       NESdev Middle East Other    General Stuff    Membler Industries    Other Retro Dev       SNESdev       GBDev    Test Forum Site Issues    phpBB Issues    Web Issues    nesdevWiki