X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fgpu_unai%2Fgpu_raster_sprite.h;h=a700db32f38c9aa2ea5217a44279c20a8746013e;hp=041fcbdc71e411391f2e8c296c9cc4747f61f16d;hb=ecd502e11f1d17998924f2de5909380b75c67d49;hpb=86aad47b0418b1715a4d223adf8f59aa92619d15 diff --git a/plugins/gpu_unai/gpu_raster_sprite.h b/plugins/gpu_unai/gpu_raster_sprite.h index 041fcbdc..a700db32 100644 --- a/plugins/gpu_unai/gpu_raster_sprite.h +++ b/plugins/gpu_unai/gpu_raster_sprite.h @@ -29,8 +29,8 @@ void gpuDrawS(const PS gpuSpriteSpanDriver) s32 u0; s32 v0; - x1 = x0 = GPU_EXPANDSIGN_SPRT(PacketBuffer.S2[2]) + DrawingOffset[0]; - y1 = y0 = GPU_EXPANDSIGN_SPRT(PacketBuffer.S2[3]) + DrawingOffset[1]; + x1 = x0 = GPU_EXPANDSIGN(PacketBuffer.S2[2]) + DrawingOffset[0]; + y1 = y0 = GPU_EXPANDSIGN(PacketBuffer.S2[3]) + DrawingOffset[1]; x1+= PacketBuffer.S2[6]; y1+= PacketBuffer.S2[7]; @@ -84,14 +84,55 @@ void gpuDrawS(const PS gpuSpriteSpanDriver) } } +#ifdef __arm__ +#include "gpu_arm.h" + +void gpuDrawS16(void) +{ + s32 x0, y0; + s32 u0, v0; + s32 xmin, xmax; + s32 ymin, ymax; + u32 h = 16; + + x0 = GPU_EXPANDSIGN(PacketBuffer.S2[2]) + DrawingOffset[0]; + y0 = GPU_EXPANDSIGN(PacketBuffer.S2[3]) + DrawingOffset[1]; + + xmin = DrawingArea[0]; xmax = DrawingArea[2]; + ymin = DrawingArea[1]; ymax = DrawingArea[3]; + u0 = PacketBuffer.U1[8]; + v0 = PacketBuffer.U1[9]; + + if (x0 > xmax - 16 || x0 < xmin || + ((u0 | v0) & 15) || !(TextureWindow[2] & TextureWindow[3] & 8)) { + // send corner cases to general handler + PacketBuffer.U4[3] = 0x00100010; + gpuDrawS(gpuSpriteSpanFn<0x20>); + return; + } + + if (y0 >= ymax || y0 <= ymin - 16) + return; + if (y0 < ymin) { + h -= ymin - y0; + v0 += ymin - y0; + y0 = ymin; + } + else if (ymax - y0 < 16) + h = ymax - y0; + + draw_spr16_full(&GPU_FrameBuffer[FRAME_OFFSET(x0, y0)], &TBA[FRAME_OFFSET(u0/4, v0)], CBA, h); +} +#endif // __arm__ + /////////////////////////////////////////////////////////////////////////////// void gpuDrawT(const PT gpuTileSpanDriver) { s32 x0, y0; s32 x1, y1; - x1 = x0 = GPU_EXPANDSIGN_SPRT(PacketBuffer.S2[2]) + DrawingOffset[0]; - y1 = y0 = GPU_EXPANDSIGN_SPRT(PacketBuffer.S2[3]) + DrawingOffset[1]; + x1 = x0 = GPU_EXPANDSIGN(PacketBuffer.S2[2]) + DrawingOffset[0]; + y1 = y0 = GPU_EXPANDSIGN(PacketBuffer.S2[3]) + DrawingOffset[1]; x1+= PacketBuffer.S2[4]; y1+= PacketBuffer.S2[5];