mirror of
https://github.com/libretro/beetle-psx-libretro.git
synced 2024-11-24 01:09:51 +00:00
Backport 7320dd2640
This commit is contained in:
parent
59f6eb87c3
commit
af9ae593a1
@ -1140,7 +1140,7 @@ INLINE void PS_GPU::ReorderRGB_Var(uint32_t out_Rshift, uint32_t out_Gshift, uin
|
||||
uint32_t srcpix = src[fb_x >> 1];
|
||||
dest[x] = MAKECOLOR((((srcpix >> 0) & 0x1F) << 3), (((srcpix >> 5) & 0x1F) << 3), (((srcpix >> 10) & 0x1F) << 3), 0);
|
||||
|
||||
fb_x = (fb_x + 2) & 0x7FF;
|
||||
fb_x = (fb_x + 2) & ((0x7FF << UPSCALE_SHIFT) + UPSCALE - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1429,8 +1429,6 @@ int32_t PS_GPU::Update(const int32_t sys_timestamp)
|
||||
int32 udx_end = dx_end << UPSCALE_SHIFT;
|
||||
int32 ufb_x = fb_x << UPSCALE_SHIFT;
|
||||
|
||||
//printf("dx_end: %d, dmw: %d\n", udx_end, udmw);
|
||||
|
||||
for (uint32_t i = 0; i < UPSCALE; i++)
|
||||
{
|
||||
const uint16_t *src = GPU_RAM[y + i];
|
||||
|
@ -135,7 +135,7 @@ INLINE void PS_GPU::DrawSpan(int y, uint32_t clut_offset, const int32_t x_start,
|
||||
int32 clipx0 = ClipX0 << UPSCALE_SHIFT;
|
||||
int32 clipx1 = ClipX1 << UPSCALE_SHIFT;
|
||||
|
||||
if(LineSkipTest(this, y))
|
||||
if(LineSkipTest(this, y >> UPSCALE_SHIFT))
|
||||
return;
|
||||
|
||||
if(xs < xb) // (xs != xb)
|
||||
@ -146,7 +146,7 @@ INLINE void PS_GPU::DrawSpan(int y, uint32_t clut_offset, const int32_t x_start,
|
||||
if(xb > (clipx1 + 1))
|
||||
xb = clipx1 + 1;
|
||||
|
||||
if(xs < xb)
|
||||
if(xs < xb && ((y & (UPSCALE - 1)) == 0))
|
||||
{
|
||||
DrawTimeAvail -= (xb - xs) >> UPSCALE_SHIFT;
|
||||
|
||||
@ -156,7 +156,7 @@ INLINE void PS_GPU::DrawSpan(int y, uint32_t clut_offset, const int32_t x_start,
|
||||
}
|
||||
else if((BlendMode >= 0) || MaskEval_TA)
|
||||
{
|
||||
DrawTimeAvail -= ((((xb + 1) & ~1) - (xs & ~1)) >> 1) >> UPSCALE_SHIFT;
|
||||
DrawTimeAvail -= (((((xb >> UPSCALE_SHIFT) + 1) & ~1) - ((xs >> UPSCALE_SHIFT) & ~1)) >> 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,15 +87,15 @@ void PS_GPU::DrawSprite(int32_t x_arg, int32_t y_arg, int32_t w, int32_t h, uint
|
||||
|
||||
if(!LineSkipTest(this, y >> UPSCALE_SHIFT))
|
||||
{
|
||||
if(y_bound > y_start && x_bound > x_start)
|
||||
if(y_bound > y_start && x_bound > x_start && ((y & (UPSCALE - 1)) == 0))
|
||||
{
|
||||
// Note(TODO): From tests on a PS1, even a 0-width sprite takes up time to "draw" proportional to its height.
|
||||
int32_t suck_time = /* 8 + */ (x_bound - x_start);
|
||||
int32_t suck_time = /* 8 + */ (x_bound - x_start) >> UPSCALE_SHIFT;
|
||||
|
||||
if((BlendMode >= 0) || MaskEval_TA)
|
||||
suck_time += (((x_bound + 1) & ~1) - (x_start & ~1)) >> 1;
|
||||
suck_time += ((((x_bound >> UPSCALE_SHIFT) + 1) & ~1) - ((x_start >> UPSCALE_SHIFT) & ~1)) >> 1;
|
||||
|
||||
DrawTimeAvail -= suck_time >> UPSCALE_SHIFT;
|
||||
DrawTimeAvail -= suck_time;
|
||||
}
|
||||
|
||||
for(int32_t x = x_start; MDFN_LIKELY(x < x_bound); x++)
|
||||
|
Loading…
Reference in New Issue
Block a user