mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
support extended palette for 256-color sprites.
This commit is contained in:
14
GPU2D.cpp
14
GPU2D.cpp
@ -824,8 +824,18 @@ void GPU2D::DrawSprite_Normal(u16* attrib, u32 width, s32 xpos, u32 ypos, u32* d
|
|||||||
pixels += (tilenum & 0x3FFF);
|
pixels += (tilenum & 0x3FFF);
|
||||||
pixels += ((ypos & 0x7) << 3);
|
pixels += ((ypos & 0x7) << 3);
|
||||||
|
|
||||||
u16* pal = (u16*)&GPU::Palette[Num ? 0x600 : 0x200];
|
u32 extpal = (DispCnt & 0x80000000);
|
||||||
//pal += (attrib[2] & 0xF000) >> 8;
|
|
||||||
|
u16* pal;
|
||||||
|
if (extpal)
|
||||||
|
{
|
||||||
|
pal = (u16*)(Num ? GPU::VRAM_BOBJExtPal : GPU::VRAM_AOBJExtPal);
|
||||||
|
pal += (attrib[2] & 0xF000) >> 4;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pal = (u16*)&GPU::Palette[Num ? 0x600 : 0x200];
|
||||||
|
|
||||||
|
if (!pal) pal = (u16*)&GPU::Palette[Num ? 0x600 : 0x200]; // derp
|
||||||
|
|
||||||
if (attrib[1] & 0x1000) // xflip. TODO: do better? oh well for now this works
|
if (attrib[1] & 0x1000) // xflip. TODO: do better? oh well for now this works
|
||||||
{
|
{
|
||||||
|
@ -137,7 +137,7 @@
|
|||||||
1485980863 c:\documents\sources\melonds\ndscart.h
|
1485980863 c:\documents\sources\melonds\ndscart.h
|
||||||
"types.h"
|
"types.h"
|
||||||
|
|
||||||
1486312231 source:c:\documents\sources\melonds\ndscart.cpp
|
1486313011 source:c:\documents\sources\melonds\ndscart.cpp
|
||||||
<stdio.h>
|
<stdio.h>
|
||||||
<string.h>
|
<string.h>
|
||||||
"NDS.h"
|
"NDS.h"
|
||||||
|
Reference in New Issue
Block a user