mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-06 15:38:11 +01:00
Merge pull request #1257 from Kurausukun/menu_nonmatching
[LEAK INFORMED] match sub_819A080
This commit is contained in:
commit
571c5988ec
39
src/menu.c
39
src/menu.c
@ -2016,7 +2016,7 @@ void sub_819A080(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 src
|
||||
{
|
||||
int loopSrcY, loopDstY, loopSrcX, loopDstX, xEnd, yEnd, multiplierSrcY, multiplierDstY;
|
||||
const u8 *pixelsSrc;
|
||||
u16 *pixelsDst;
|
||||
u8 *pixelsDst;
|
||||
u16 toOrr;
|
||||
|
||||
if (dst->width - dstX < width)
|
||||
@ -2041,49 +2041,48 @@ void sub_819A080(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 src
|
||||
|
||||
if ((uintptr_t)pixelsDst & 0x1)
|
||||
{
|
||||
pixelsDst = (void*)(pixelsDst) - 1;
|
||||
pixelsDst--;
|
||||
if (loopDstX & 0x1)
|
||||
{
|
||||
toOrr = *pixelsDst & 0x0fff;
|
||||
toOrr = *(vu16*)pixelsDst;
|
||||
toOrr &= 0x0fff;
|
||||
if (loopSrcX & 0x1)
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0xf0) << 8);
|
||||
toOrr |= ((*pixelsSrc & 0xf0) << 8);
|
||||
else
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0x0f) << 12);
|
||||
toOrr |= ((*pixelsSrc & 0x0f) << 12);
|
||||
}
|
||||
else
|
||||
{
|
||||
toOrr = *pixelsDst & 0xf0ff;
|
||||
toOrr = *(vu16*)pixelsDst;
|
||||
toOrr &= 0xf0ff;
|
||||
if (loopSrcX & 0x1)
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0xf0) << 4);
|
||||
toOrr |= ((*pixelsSrc & 0xf0) << 4);
|
||||
else
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0x0f) << 8);
|
||||
toOrr |= ((*pixelsSrc & 0x0f) << 8);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (loopDstX & 1)
|
||||
{
|
||||
toOrr = *pixelsDst & 0xff0f;
|
||||
toOrr = *(vu16*)pixelsDst;
|
||||
toOrr &= 0xff0f;
|
||||
if (loopSrcX & 1)
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0xf0) << 0);
|
||||
toOrr |= ((*pixelsSrc & 0xf0) << 0);
|
||||
else
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0x0f) << 4);
|
||||
toOrr |= ((*pixelsSrc & 0x0f) << 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
toOrr = *pixelsDst & 0xfff0;
|
||||
toOrr = *(vu16*)pixelsDst;
|
||||
toOrr &= 0xfff0;
|
||||
if (loopSrcX & 1)
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0xf0) >> 4);
|
||||
toOrr |= ((*pixelsSrc & 0xf0) >> 4);
|
||||
else
|
||||
*pixelsDst = toOrr | ((*pixelsSrc & 0x0f) >> 0);
|
||||
toOrr |= ((*pixelsSrc & 0x0f) >> 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Needed to match, urgh.
|
||||
#ifndef NONMATCHING
|
||||
asm("":::"r4");
|
||||
pixelsDst++;pixelsDst--;
|
||||
#endif // NONMATCHING
|
||||
*(vu16*)pixelsDst = toOrr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user