This commit is contained in:
twinaphex 2016-01-28 21:27:00 +01:00
parent 59f6eb87c3
commit af9ae593a1
3 changed files with 8 additions and 10 deletions

View File

@ -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];

View File

@ -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);
}
}

View File

@ -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++)