implement xflip for bitmap sprites (fixes #32)

This commit is contained in:
StapleButter 2017-04-29 16:18:33 +02:00
parent da31af9202
commit ee0effd22f
1 changed files with 33 additions and 10 deletions

View File

@ -1859,21 +1859,44 @@ void GPU2D::DrawSprite_Normal(u16* attrib, u32 width, s32 xpos, u32 ypos, u32* d
} }
u32 pixelsaddr = (Num ? 0x06600000 : 0x06400000) + tilenum; u32 pixelsaddr = (Num ? 0x06600000 : 0x06400000) + tilenum;
pixelsaddr += (xoff << 1);
for (; xoff < xend;) if (attrib[1] & 0x1000)
{ {
u16 color = GPU::ReadVRAM_OBJ<u16>(pixelsaddr); pixelsaddr += ((width-1 - xoff) << 1);
pixelsaddr += 2;
if (color & 0x8000) for (; xoff < xend;)
{ {
if (window) ((u8*)dst)[xpos] = 1; u16 color = GPU::ReadVRAM_OBJ<u16>(pixelsaddr);
else dst[xpos] = color | prio; pixelsaddr -= 2;
}
xoff++; if (color & 0x8000)
xpos++; {
if (window) ((u8*)dst)[xpos] = 1;
else dst[xpos] = color | prio;
}
xoff++;
xpos++;
}
}
else
{
pixelsaddr += (xoff << 1);
for (; xoff < xend;)
{
u16 color = GPU::ReadVRAM_OBJ<u16>(pixelsaddr);
pixelsaddr += 2;
if (color & 0x8000)
{
if (window) ((u8*)dst)[xpos] = 1;
else dst[xpos] = color | prio;
}
xoff++;
xpos++;
}
} }
} }
else else