Fixed a possible bug with 256-color backgrounds not using extended palettes.
This commit is contained in:
parent
f035b9d331
commit
26c2dd2ec9
|
@ -1094,7 +1094,6 @@ INLINE void renderline_textBG(GPU * gpu, u8 num, u8 * dst, u32 Y, u16 XBG, u16 Y
|
|||
u16 yoff;
|
||||
u16 x = 0;
|
||||
u16 xfin;
|
||||
u16 palette_size_shift;
|
||||
u16 mosaic = T1ReadWord((u8 *)&gpu->dispx_st->dispx_MISC.MOSAIC, 0);
|
||||
|
||||
s8 line_dir = 1;
|
||||
|
@ -1257,10 +1256,8 @@ INLINE void renderline_textBG(GPU * gpu, u8 num, u8 * dst, u32 Y, u16 XBG, u16 Y
|
|||
return;
|
||||
}
|
||||
|
||||
palette_size_shift=0; // color: no extended palette
|
||||
if(dispCnt->ExBGxPalette_Enable) // color: extended palette
|
||||
{
|
||||
palette_size_shift=8;
|
||||
pal = ARM9Mem.ExtPal[gpu->core][gpu->BGExtPalSlot[num]];
|
||||
if(!pal) return;
|
||||
}
|
||||
|
@ -1287,7 +1284,11 @@ INLINE void renderline_textBG(GPU * gpu, u8 num, u8 * dst, u32 Y, u16 XBG, u16 Y
|
|||
}
|
||||
for(; x < xfin; )
|
||||
{
|
||||
color = T1ReadWord(pal, ((*line) + (tileentry.bits.Palette<<palette_size_shift)) << 1);
|
||||
if(dispCnt->ExBGxPalette_Enable)
|
||||
color = T1ReadWord(pal, ((*line) + (tileentry.bits.Palette<<8)) << 1);
|
||||
else
|
||||
color = T1ReadWord(pal, (*line) << 1);
|
||||
|
||||
if (*line)
|
||||
gpu->setFinalColorBck(gpu,0,num,dst,color,x);
|
||||
|
||||
|
|
Loading…
Reference in New Issue