It is currently Mon Dec 11, 2017 4:50 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Incorrect RGB conversion
PostPosted: Mon May 19, 2014 4:50 pm 
Offline
Snes9x White Belt

Joined: Mon May 19, 2014 4:46 pm
Posts: 16
Hi,

for the Windows port the RGB565 to RGB32 is implemented as:
Code:
#define CONVERT_16_TO_32(pixel)
    (((((pixel) >> 11)        ) << /*RedShift+3*/  19) |
     ((((pixel) >> 6)   & 0x1f) << /*GreenShift+3*/11) |
     (((pixel)         & 0x1f) << /*BlueShift+3*/ 3))


The green pixel needlessly is stripped off its least significant bit, i.e. instad of 6 it is treated as a 5-bit color. Here's the fix:

Code:
     ((((pixel) >> 5)   & 0x3f) << /*GreenShift+2*/10) |


Regards, Zenju

_________________
http://www.freefilesync.org/
http://sourceforge.net/projects/xbrz/


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 03, 2014 10:47 pm 
Offline
Hero of Hyrule | Official Port Recruiter

Joined: Mon May 24, 2004 5:06 pm
Posts: 2588
Location: 255.255.255.255
Moved to Public Dev. :)

_________________
Image

Unofficial Test Monkey For:
* Snes9X GX (Wii)
* Snes9X EX (Android)
* Snes9X 64-bits (PC/Mac)

ZSNES|Ben Heck|NSRT|Bob Smiley


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 04, 2014 6:13 pm 
Offline
Official Win32 Porter/Dev
User avatar

Joined: Thu Aug 30, 2007 10:15 pm
Posts: 594
I've already applied it. Now I just need to find some time for xbrz...


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 11, 2014 6:12 am 
Offline
Snes9x White Belt
User avatar

Joined: Wed Oct 31, 2012 1:18 am
Posts: 46
how this can be 16 bit to 32 bit RGB conversion ? if the SNES work with 15 bit BGR.

http://wiki.superfamicom.org/snes/show/Palettes


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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