fix screen edge partial sprite tile drawing in bigend
This commit is contained in:
parent
6928b667ae
commit
62ce62777d
1 changed files with 3 additions and 2 deletions
5
video.cc
5
video.cc
|
@ -245,6 +245,7 @@ static inline void rend_part_tile_Nbpp(u32 bg_comb, u32 px_comb,
|
|||
u16 pxflg = px_comb | tilepal;
|
||||
const u16 *subpal = &paltbl[tilepal];
|
||||
// Read packed pixel data, skip start pixels
|
||||
// TODO: account for big-endian byte reversal here
|
||||
u32 tilepix = eswap32(*(u32*)tile_ptr);
|
||||
if (hflip) tilepix <<= (start * 4);
|
||||
else tilepix >>= (start * 4);
|
||||
|
@ -1035,7 +1036,7 @@ static inline void render_obj_part_tile_Nbpp(
|
|||
for (u32 i = start; i < end; i++, dest_ptr++) {
|
||||
// Honor hflip by selecting bytes in the correct order
|
||||
u32 sel = hflip ? (7-i) : i;
|
||||
u8 pval = tile_ptr[sel];
|
||||
u8 pval = tile_ptr[swizzle_b(sel)];
|
||||
// Alhpa mode stacks previous value
|
||||
if (pval) {
|
||||
if (rdtype == FULLCOLOR)
|
||||
|
@ -1059,7 +1060,7 @@ static inline void render_obj_part_tile_Nbpp(
|
|||
for (u32 i = start; i < end; i++, dest_ptr++) {
|
||||
u32 selb = hflip ? (3-i/2) : i/2;
|
||||
u32 seln = hflip ? ((i & 1) ^ 1) : (i & 1);
|
||||
u8 pval = (tile_ptr[selb] >> (seln * 4)) & 0xF;
|
||||
u8 pval = (tile_ptr[swizzle_b(selb)] >> (seln * 4)) & 0xF;
|
||||
const u16 *subpal = &pal[palette];
|
||||
if (pval) {
|
||||
if (rdtype == FULLCOLOR)
|
||||
|
|
Loading…
Add table
Reference in a new issue