{
u32 x = sign_extend_11bit(list_s16[2] + psx_gpu->offset_x);
u32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
- u32 width = list_s16[4] & 0x3FF;
- u32 height = list_s16[5] & 0x1FF;
+ s32 width = list_s16[4] & 0x3FF;
+ s32 height = list_s16[5] & 0x1FF;
- render_sprite(psx_gpu, x, y, 0, 0, width, height, current_command, list[0]);
+ render_sprite(psx_gpu, x, y, 0, 0, &width, &height,
+ current_command, list[0]);
cpu_cycles += gput_sprite(width, height);
break;
}
u32 x = sign_extend_11bit(list_s16[2] + psx_gpu->offset_x);
u32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
u32 uv = list_s16[4];
- u32 width = list_s16[6] & 0x3FF;
- u32 height = list_s16[7] & 0x1FF;
+ s32 width = list_s16[6] & 0x3FF;
+ s32 height = list_s16[7] & 0x1FF;
set_clut(psx_gpu, list_s16[5]);
- render_sprite(psx_gpu, x, y, uv & 0xFF, (uv >> 8) & 0xFF, width, height,
- current_command, list[0]);
+ render_sprite(psx_gpu, x, y, uv & 0xFF, (uv >> 8) & 0xFF,
+ &width, &height, current_command, list[0]);
cpu_cycles += gput_sprite(width, height);
break;
}
{
s32 x = sign_extend_11bit(list_s16[2] + psx_gpu->offset_x);
s32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
+ s32 width = 1, height = 1;
- render_sprite(psx_gpu, x, y, 0, 0, 1, 1, current_command, list[0]);
+ render_sprite(psx_gpu, x, y, 0, 0, &width, &height,
+ current_command, list[0]);
cpu_cycles += gput_sprite(1, 1);
break;
}
{
s32 x = sign_extend_11bit(list_s16[2] + psx_gpu->offset_x);
s32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
+ s32 width = 8, height = 8;
- render_sprite(psx_gpu, x, y, 0, 0, 8, 8, current_command, list[0]);
- cpu_cycles += gput_sprite(8, 8);
+ render_sprite(psx_gpu, x, y, 0, 0, &width, &height,
+ current_command, list[0]);
+ cpu_cycles += gput_sprite(width, height);
break;
}
s32 x = sign_extend_11bit(list_s16[2] + psx_gpu->offset_x);
s32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
u32 uv = list_s16[4];
+ s32 width = 8, height = 8;
set_clut(psx_gpu, list_s16[5]);
- render_sprite(psx_gpu, x, y, uv & 0xFF, (uv >> 8) & 0xFF, 8, 8,
- current_command, list[0]);
- cpu_cycles += gput_sprite(8, 8);
+ render_sprite(psx_gpu, x, y, uv & 0xFF, (uv >> 8) & 0xFF,
+ &width, &height, current_command, list[0]);
+ cpu_cycles += gput_sprite(width, height);
break;
}
{
s32 x = sign_extend_11bit(list_s16[2] + psx_gpu->offset_x);
s32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
+ s32 width = 16, height = 16;
- render_sprite(psx_gpu, x, y, 0, 0, 16, 16, current_command, list[0]);
- cpu_cycles += gput_sprite(16, 16);
+ render_sprite(psx_gpu, x, y, 0, 0, &width, &height,
+ current_command, list[0]);
+ cpu_cycles += gput_sprite(width, height);
break;
}
s32 x = sign_extend_11bit(list_s16[2] + psx_gpu->offset_x);
s32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
u32 uv = list_s16[4];
+ s32 width = 16, height = 16;
set_clut(psx_gpu, list_s16[5]);
- render_sprite(psx_gpu, x, y, uv & 0xFF, (uv >> 8) & 0xFF, 16, 16,
- current_command, list[0]);
- cpu_cycles += gput_sprite(16, 16);
+ render_sprite(psx_gpu, x, y, uv & 0xFF, (uv >> 8) & 0xFF,
+ &width, &height, current_command, list[0]);
+ cpu_cycles += gput_sprite(width, height);
break;
}
#ifdef PCSX
+ case 0x1F: // irq?
case 0x80 ... 0x9F: // vid -> vid
case 0xA0 ... 0xBF: // sys -> vid
case 0xC0 ... 0xDF: // vid -> sys
{
u32 x = sign_extend_11bit(list_s16[2] + psx_gpu->offset_x);
u32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
- u32 width = list_s16[4] & 0x3FF;
- u32 height = list_s16[5] & 0x1FF;
+ s32 width = list_s16[4] & 0x3FF;
+ s32 height = list_s16[5] & 0x1FF;
- render_sprite(psx_gpu, x, y, 0, 0, width, height, current_command, list[0]);
+ render_sprite(psx_gpu, x, y, 0, 0, &width, &height,
+ current_command, list[0]);
if (check_enhanced_range(psx_gpu, x, x + width))
do_sprite_enhanced(psx_gpu, x, y, 0, 0, width, height, list[0]);
u32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
u8 u = list_s16[4];
u8 v = list_s16[4] >> 8;
- u32 width = list_s16[6] & 0x3FF;
- u32 height = list_s16[7] & 0x1FF;
+ s32 width = list_s16[6] & 0x3FF;
+ s32 height = list_s16[7] & 0x1FF;
set_clut(psx_gpu, list_s16[5]);
- render_sprite(psx_gpu, x, y, u, v, width, height,
- current_command, list[0]);
+ render_sprite(psx_gpu, x, y, u, v,
+ &width, &height, current_command, list[0]);
if (check_enhanced_range(psx_gpu, x, x + width))
do_sprite_enhanced(psx_gpu, x, y, u, v, width, height, list[0]);
{
s32 x = sign_extend_11bit(list_s16[2] + psx_gpu->offset_x);
s32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
+ s32 width = 1, height = 1;
- render_sprite(psx_gpu, x, y, 0, 0, 1, 1, current_command, list[0]);
+ render_sprite(psx_gpu, x, y, 0, 0, &width, &height,
+ current_command, list[0]);
if (check_enhanced_range(psx_gpu, x, x + 1))
- do_sprite_enhanced(psx_gpu, x, y, 0, 0, 1, 1, list[0]);
+ do_sprite_enhanced(psx_gpu, x, y, 0, 0, width, height, list[0]);
cpu_cycles += gput_sprite(1, 1);
break;
}
{
s32 x = sign_extend_11bit(list_s16[2] + psx_gpu->offset_x);
s32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
+ s32 width = 8, height = 8;
- render_sprite(psx_gpu, x, y, 0, 0, 8, 8, current_command, list[0]);
+ render_sprite(psx_gpu, x, y, 0, 0, &width, &height,
+ current_command, list[0]);
if (check_enhanced_range(psx_gpu, x, x + 8))
- do_sprite_enhanced(psx_gpu, x, y, 0, 0, 8, 8, list[0]);
- cpu_cycles += gput_sprite(8, 8);
+ do_sprite_enhanced(psx_gpu, x, y, 0, 0, width, height, list[0]);
+ cpu_cycles += gput_sprite(width, height);
break;
}
s32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
u8 u = list_s16[4];
u8 v = list_s16[4] >> 8;
+ s32 width = 8, height = 8;
set_clut(psx_gpu, list_s16[5]);
- render_sprite(psx_gpu, x, y, u, v, 8, 8,
- current_command, list[0]);
+ render_sprite(psx_gpu, x, y, u, v,
+ &width, &height, current_command, list[0]);
if (check_enhanced_range(psx_gpu, x, x + 8))
- do_sprite_enhanced(psx_gpu, x, y, u, v, 8, 8, list[0]);
- cpu_cycles += gput_sprite(8, 8);
+ do_sprite_enhanced(psx_gpu, x, y, u, v, width, height, list[0]);
+ cpu_cycles += gput_sprite(width, height);
break;
}
{
s32 x = sign_extend_11bit(list_s16[2] + psx_gpu->offset_x);
s32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
+ s32 width = 16, height = 16;
- render_sprite(psx_gpu, x, y, 0, 0, 16, 16, current_command, list[0]);
+ render_sprite(psx_gpu, x, y, 0, 0, &width, &height,
+ current_command, list[0]);
if (check_enhanced_range(psx_gpu, x, x + 16))
- do_sprite_enhanced(psx_gpu, x, y, 0, 0, 16, 16, list[0]);
- cpu_cycles += gput_sprite(16, 16);
+ do_sprite_enhanced(psx_gpu, x, y, 0, 0, width, height, list[0]);
+ cpu_cycles += gput_sprite(width, height);
break;
}
s32 y = sign_extend_11bit(list_s16[3] + psx_gpu->offset_y);
u8 u = list_s16[4];
u8 v = list_s16[4] >> 8;
+ s32 width = 16, height = 16;
set_clut(psx_gpu, list_s16[5]);
- render_sprite(psx_gpu, x, y, u, v, 16, 16, current_command, list[0]);
+ render_sprite(psx_gpu, x, y, u, v,
+ &width, &height, current_command, list[0]);
if (check_enhanced_range(psx_gpu, x, x + 16))
- do_sprite_enhanced(psx_gpu, x, y, u, v, 16, 16, list[0]);
- cpu_cycles += gput_sprite(16, 16);
+ do_sprite_enhanced(psx_gpu, x, y, u, v, width, height, list[0]);
+ cpu_cycles += gput_sprite(width, height);
break;
}
case 0x62:
case 0x63: { // Monochrome rectangle (variable size)
PT driver = gpuTileSpanDrivers[(Blending_Mode | gpu_unai.Masking | Blending | (gpu_unai.PixelMSB>>3)) >> 1];
- gpuDrawT(packet, driver);
- cpu_cycles += gput_sprite(le16_to_u16(packet.U2[4]) & 0x3ff,
- le16_to_u16(packet.U2[5]) & 0x1ff);
+ s32 w = 0, h = 0;
+ gpuDrawT(packet, driver, &w, &h);
+ cpu_cycles += gput_sprite(w, h);
} break;
case 0x64:
case 0x67: { // Textured rectangle (variable size)
gpuSetCLUT (le32_to_u32(gpu_unai.PacketBuffer.U4[2]) >> 16);
u32 driver_idx = Blending_Mode | gpu_unai.TEXT_MODE | gpu_unai.Masking | Blending | (gpu_unai.PixelMSB>>1);
+ s32 w = 0, h = 0;
//senquack - Only color 808080h-878787h allows skipping lighting calculation:
// This fixes Silent Hill running animation on loading screens:
if ((le32_raw(gpu_unai.PacketBuffer.U4[0]) & HTOLE32(0xF8F8F8)) != HTOLE32(0x808080))
driver_idx |= Lighting;
PS driver = gpuSpriteSpanDrivers[driver_idx];
- gpuDrawS(packet, driver);
- cpu_cycles += gput_sprite(le16_to_u16(packet.U2[6]) & 0x3ff,
- le16_to_u16(packet.U2[7]) & 0x1ff);
+ gpuDrawS(packet, driver, &w, &h);
+ cpu_cycles += gput_sprite(w, h);
} break;
case 0x68:
case 0x6B: { // Monochrome rectangle (1x1 dot)
gpu_unai.PacketBuffer.U4[2] = u32_to_le32(0x00010001);
PT driver = gpuTileSpanDrivers[(Blending_Mode | gpu_unai.Masking | Blending | (gpu_unai.PixelMSB>>3)) >> 1];
- gpuDrawT(packet, driver);
+ s32 w = 0, h = 0;
+ gpuDrawT(packet, driver, &w, &h);
cpu_cycles += gput_sprite(1, 1);
} break;
case 0x73: { // Monochrome rectangle (8x8)
gpu_unai.PacketBuffer.U4[2] = u32_to_le32(0x00080008);
PT driver = gpuTileSpanDrivers[(Blending_Mode | gpu_unai.Masking | Blending | (gpu_unai.PixelMSB>>3)) >> 1];
- gpuDrawT(packet, driver);
- cpu_cycles += gput_sprite(8, 8);
+ s32 w = 0, h = 0;
+ gpuDrawT(packet, driver, &w, &h);
+ cpu_cycles += gput_sprite(w, h);
} break;
case 0x74:
gpu_unai.PacketBuffer.U4[3] = u32_to_le32(0x00080008);
gpuSetCLUT (le32_to_u32(gpu_unai.PacketBuffer.U4[2]) >> 16);
u32 driver_idx = Blending_Mode | gpu_unai.TEXT_MODE | gpu_unai.Masking | Blending | (gpu_unai.PixelMSB>>1);
+ s32 w = 0, h = 0;
//senquack - Only color 808080h-878787h allows skipping lighting calculation:
//if ((gpu_unai.PacketBuffer.U1[0]>0x5F) && (gpu_unai.PacketBuffer.U1[1]>0x5F) && (gpu_unai.PacketBuffer.U1[2]>0x5F))
if ((le32_raw(gpu_unai.PacketBuffer.U4[0]) & HTOLE32(0xF8F8F8)) != HTOLE32(0x808080))
driver_idx |= Lighting;
PS driver = gpuSpriteSpanDrivers[driver_idx];
- gpuDrawS(packet, driver);
- cpu_cycles += gput_sprite(8, 8);
+ gpuDrawS(packet, driver, &w, &h);
+ cpu_cycles += gput_sprite(w, h);
} break;
case 0x78:
case 0x7B: { // Monochrome rectangle (16x16)
gpu_unai.PacketBuffer.U4[2] = u32_to_le32(0x00100010);
PT driver = gpuTileSpanDrivers[(Blending_Mode | gpu_unai.Masking | Blending | (gpu_unai.PixelMSB>>3)) >> 1];
- gpuDrawT(packet, driver);
- cpu_cycles += gput_sprite(16, 16);
+ s32 w = 0, h = 0;
+ gpuDrawT(packet, driver, &w, &h);
+ cpu_cycles += gput_sprite(w, h);
} break;
case 0x7C:
#ifdef __arm__
if ((gpu_unai.GPU_GP1 & 0x180) == 0 && (gpu_unai.Masking | gpu_unai.PixelMSB) == 0)
{
- gpuSetCLUT (le32_to_u32(gpu_unai.PacketBuffer.U4[2]) >> 16);
- gpuDrawS16(packet);
- cpu_cycles += gput_sprite(16, 16);
+ s32 w = 0, h = 0;
+ gpuSetCLUT(le32_to_u32(gpu_unai.PacketBuffer.U4[2]) >> 16);
+ gpuDrawS16(packet, &w, &h);
+ cpu_cycles += gput_sprite(w, h);
break;
}
// fallthrough
gpu_unai.PacketBuffer.U4[3] = u32_to_le32(0x00100010);
gpuSetCLUT (le32_to_u32(gpu_unai.PacketBuffer.U4[2]) >> 16);
u32 driver_idx = Blending_Mode | gpu_unai.TEXT_MODE | gpu_unai.Masking | Blending | (gpu_unai.PixelMSB>>1);
+ s32 w = 0, h = 0;
//senquack - Only color 808080h-878787h allows skipping lighting calculation:
//if ((gpu_unai.PacketBuffer.U1[0]>0x5F) && (gpu_unai.PacketBuffer.U1[1]>0x5F) && (gpu_unai.PacketBuffer.U1[2]>0x5F))
// Strip lower 3 bits of each color and determine if lighting should be used:
if ((le32_raw(gpu_unai.PacketBuffer.U4[0]) & HTOLE32(0xF8F8F8)) != HTOLE32(0x808080))
driver_idx |= Lighting;
PS driver = gpuSpriteSpanDrivers[driver_idx];
- gpuDrawS(packet, driver);
- cpu_cycles += gput_sprite(16, 16);
+ gpuDrawS(packet, driver, &w, &h);
+ cpu_cycles += gput_sprite(w, h);
} break;
#ifdef TEST
case 0xC0:
break;
#else
+ case 0x1F: // irq?
case 0x80 ... 0x9F: // vid -> vid
case 0xA0 ... 0xBF: // sys -> vid
case 0xC0 ... 0xDF: // vid -> sys