aboutsummaryrefslogtreecommitdiff
path: root/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
diff options
context:
space:
mode:
authorExophase2012-01-01 23:07:31 +0200
committernotaz2012-01-01 23:07:31 +0200
commit87c45ad1e2a265cedb7970cc1b7777591d0050b7 (patch)
treeb5085ecf9cf33cf4c022392ed321d9759d116f0f /plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
parent1c72b1c2337be47ef7be2254209cc61a6407fdbb (diff)
downloadpcsx_rearmed-87c45ad1e2a265cedb7970cc1b7777591d0050b7.tar.gz
pcsx_rearmed-87c45ad1e2a265cedb7970cc1b7777591d0050b7.tar.bz2
pcsx_rearmed-87c45ad1e2a265cedb7970cc1b7777591d0050b7.zip
psx_gpu: improve fills
Diffstat (limited to 'plugins/gpu_neon/psx_gpu/psx_gpu_parse.c')
-rw-r--r--plugins/gpu_neon/psx_gpu/psx_gpu_parse.c52
1 files changed, 49 insertions, 3 deletions
diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
index 7fee2eb..4f3dd12 100644
--- a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
+++ b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
@@ -210,16 +210,61 @@ void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
s16 *list_s16 = (void *)list;
current_command = *list >> 24;
command_length = command_lengths[current_command];
-
+
switch(current_command)
{
case 0x00:
break;
case 0x02:
- render_block_fill(psx_gpu, list[0] & 0xFFFFFF, list_s16[2] & 0x3FF,
- list_s16[3] & 0x1FF, list_s16[4] & 0x3FF, list_s16[5] & 0x1FF);
+ {
+ u32 x = list_s16[2] & 0x3FF;
+ u32 y = list_s16[3] & 0x1FF;
+ u32 width = list_s16[4] & 0x3FF;
+ u32 height = list_s16[5] & 0x1FF;
+ u32 color = list[0] & 0xFFFFFF;
+
+ x &= ~0xF;
+ width = ((width + 0xF) & ~0xF);
+
+ if((x + width) > 1024)
+ {
+ u32 width_a = 1024 - x;
+ u32 width_b = width - width_a;
+
+ if((y + height) > 512)
+ {
+ u32 height_a = 512 - y;
+ u32 height_b = height - height_a;
+
+ render_block_fill(psx_gpu, color, x, y, width_a, height_a);
+ render_block_fill(psx_gpu, color, 0, y, width_b, height_a);
+ render_block_fill(psx_gpu, color, x, 0, width_a, height_b);
+ render_block_fill(psx_gpu, color, 0, 0, width_b, height_b);
+ }
+ else
+ {
+ render_block_fill(psx_gpu, color, x, y, width_a, height);
+ render_block_fill(psx_gpu, color, 0, y, width_b, height);
+ }
+ }
+ else
+ {
+ if((y + height) > 512)
+ {
+ u32 height_a = 512 - y;
+ u32 height_b = height - height_a;
+
+ render_block_fill(psx_gpu, color, x, y, width, height_a);
+ render_block_fill(psx_gpu, color, x, 0, width, height_b);
+ }
+ else
+ {
+ render_block_fill(psx_gpu, color, x, y, width, height);
+ }
+ }
break;
+ }
case 0x20 ... 0x23:
{
@@ -567,6 +612,7 @@ void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
case 0xE1:
set_texture(psx_gpu, list[0] & 0x1FF);
+
if(list[0] & (1 << 9))
psx_gpu->render_state_base |= RENDER_STATE_DITHER;
else