SourMesen / Mesen

Mesen is a cross-platform (Windows & Linux) NES/Famicom emulator built in C++ and C#
https://www.mesen.ca
GNU General Public License v3.0
1.26k stars 320 forks source link

$2d color #352

Closed maximc2010 closed 6 years ago

maximc2010 commented 6 years ago

Is it intentionally that when I set some bg color to $ 2d (from program), it is loaded as $ 10?

SourMesen commented 6 years ago

No, if this is happening, there is most likely a logic error in your code, or you are misunderstanding how the palette RAM behaves. The palette RAM has a lot of mirroring, and some values are never used during rendering. There is only a single background color - $3F00. The values at $3F04/$3F08/$3F0C can be set, but will never be used for rendering. The values at $3F10/$3F14/$3F18/$3F1C are mirrors of $3F00/$3F04/$3F08/$3F0C.

maximc2010 commented 6 years ago

Ok, it looks like bug in my code(or in Shiru's neslib which I use). When I set color 0x2d directly it's ok.