-#define select_enhancement_buf_ptr(psx_gpu, x) \\r
- ((psx_gpu)->enhancement_buf_ptr + \\r
- ((psx_gpu)->enhancement_buf_by_x16[(x) / 16] << 20))\r
-\r
#if !defined(NEON_BUILD) || defined(SIMD_BUILD)\r
\r
#ifndef zip_4x32b\r
static void setup_sprite_untextured_4x(psx_gpu_struct *psx_gpu, s32 x, s32 y,\r
s32 u, s32 v, s32 width, s32 height, u32 color)\r
{\r
- setup_sprite_untextured(psx_gpu, x, y, u, v, width * 2, height * 2, color);\r
+ width *= 2;\r
+ height *= 2;\r
+ if (width > 1024)\r
+ width = 1024;\r
+ setup_sprite_untextured(psx_gpu, x, y, u, v, width, height, color);\r
}\r
\r
#define setup_sprite_blocks_switch_textured_4x(texture_mode) \\r
render_sprite_blocks_switch_block_4x()\r
};\r
\r
-\r
void render_sprite_4x(psx_gpu_struct *psx_gpu, s32 x, s32 y, u32 u, u32 v,\r
s32 width, s32 height, u32 flags, u32 color)\r
{\r
s32 x_right = x + width - 1;\r
s32 y_bottom = y + height - 1;\r
+ s16 end_x;\r
\r
#ifdef PROFILE\r
sprites++;\r
height -= clip;\r
}\r
\r
- if(x_right > psx_gpu->viewport_end_x)\r
- width -= x_right - psx_gpu->viewport_end_x;\r
+ end_x = psx_gpu->viewport_end_x;\r
+ if (end_x - psx_gpu->viewport_start_x + 1 > 512)\r
+ end_x = psx_gpu->viewport_start_x + 511;\r
+\r
+ if(x_right > end_x)\r
+ width -= x_right - end_x;\r
\r
if(y_bottom > psx_gpu->viewport_end_y)\r
height -= y_bottom - psx_gpu->viewport_end_y;\r
if((width <= 0) || (height <= 0))\r
return;\r
\r
- psx_gpu->vram_out_ptr = select_enhancement_buf_ptr(psx_gpu, x);\r
+ if (!psx_gpu->enhancement_current_buf_ptr)\r
+ return;\r
+ psx_gpu->vram_out_ptr = psx_gpu->enhancement_current_buf_ptr;\r
\r
x *= 2;\r
y *= 2;\r