Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blit.c: Implement flip/rotate for x64 (Fix baby pacman) #401

Merged
merged 1 commit into from
Jan 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/windows/blit.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,23 +608,26 @@ int win_perform_blit(const struct win_blit_params * const blit, int update)
if (blit->dstyscale > 1) //!! due to hack above, make bottom black
memset(dst, 0, blit->dstpitch*(asmblit_srcheight / 2));
#else
UINT32 c;
const UINT8 * __restrict src = asmblit_srcdata;
UINT8 * __restrict dst = asmblit_dstdata;

for (c = 0; c < asmblit_srcheight; ++c)
INT32 valuefixups[32]; // asm rely on 32 bit register arithmetic, we reuse the same 'fixup' values but need them as signed values for x64
compute_source_fixups(blit, (UINT32*)valuefixups);

for (int c = 0; c < blit_srcheight; ++c) // y loop
{
int c2,c2d=0;
for (c2 = 0; c2 < blit->srcwidth; ++c2)
const UINT8* __restrict pushed_src = src;
for (c2 = 0; c2 < blit_srcwidth; ++c2) // x loop
{
const UINT16 col = blit->srclookup[((UINT16*)src)[c2]];
int s;
for (s = 0; s < blit->dstxscale; ++s,++c2d)
const UINT16 col = blit->srclookup[*(UINT16*)src];
for (int s = 0; s < blit->dstxscale; ++s,++c2d)
((UINT16*)dst)[c2d] = col;
src += valuefixups[FIXUPVAL_SRCBYTES1];
}
for (c2 = 1; c2 < blit->dstyscale; ++c2)
memcpy(dst + blit->dstpitch*c2, dst, blit->dstpitch);
src += blit->srcpitch;
src = pushed_src + valuefixups[FIXUPVAL_SRCADVANCE];
dst += blit->dstpitch * blit->dstyscale;
}
#endif
Expand Down
Loading