aboutsummaryrefslogtreecommitdiff
path: root/plugins/gpu_neon
diff options
context:
space:
mode:
authornotaz2012-08-18 18:25:12 +0300
committernotaz2012-10-12 00:05:08 +0300
commit3b3dee71d84bbbb376548d794b7a11cd38833cf0 (patch)
treefbbe0807d1c8c29b534e93ae8569224e26776dcc /plugins/gpu_neon
parente929dec505f8d3692248fe0d42c84a37c994ad39 (diff)
downloadpcsx_rearmed-3b3dee71d84bbbb376548d794b7a11cd38833cf0.tar.gz
pcsx_rearmed-3b3dee71d84bbbb376548d794b7a11cd38833cf0.tar.bz2
pcsx_rearmed-3b3dee71d84bbbb376548d794b7a11cd38833cf0.zip
psx_gpu: do enhanced lines
Diffstat (limited to 'plugins/gpu_neon')
-rw-r--r--plugins/gpu_neon/psx_gpu/psx_gpu.c20
-rw-r--r--plugins/gpu_neon/psx_gpu/psx_gpu.h2
-rw-r--r--plugins/gpu_neon/psx_gpu/psx_gpu_parse.c26
3 files changed, 31 insertions, 17 deletions
diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.c b/plugins/gpu_neon/psx_gpu/psx_gpu.c
index 092125b..9b5a64d 100644
--- a/plugins/gpu_neon/psx_gpu/psx_gpu.c
+++ b/plugins/gpu_neon/psx_gpu/psx_gpu.c
@@ -4179,9 +4179,6 @@ do \
{ \
delta_y *= -1; \
\
- if(delta_y >= 512) \
- return; \
- \
if(delta_x > delta_y) \
{ \
draw_line_span_horizontal(decrement, shading, blending, dithering, \
@@ -4195,9 +4192,6 @@ do \
} \
else \
{ \
- if(delta_y >= 512) \
- return; \
- \
if(delta_x > delta_y) \
{ \
draw_line_span_horizontal(increment, shading, blending, dithering, \
@@ -4212,7 +4206,7 @@ do \
void render_line(psx_gpu_struct *psx_gpu, vertex_struct *vertexes, u32 flags,
- u32 color)
+ u32 color, int double_resolution)
{
s32 color_r, color_g, color_b;
u32 triangle_winding = 0;
@@ -4264,9 +4258,19 @@ void render_line(psx_gpu_struct *psx_gpu, vertex_struct *vertexes, u32 flags,
delta_x = x_b - x_a;
delta_y = y_b - y_a;
- if(delta_x >= 1024)
+ if(delta_x >= 1024 || delta_y >= 512 || delta_y <= -512)
return;
+ if(double_resolution)
+ {
+ x_a *= 2;
+ x_b *= 2;
+ y_a *= 2;
+ y_b *= 2;
+ delta_x *= 2;
+ delta_y *= 2;
+ }
+
flags &= ~RENDER_FLAGS_TEXTURE_MAP;
vram_ptr = psx_gpu->vram_out_ptr + (y_a * 1024) + x_a;
diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.h b/plugins/gpu_neon/psx_gpu/psx_gpu.h
index fc5b566..f8547f3 100644
--- a/plugins/gpu_neon/psx_gpu/psx_gpu.h
+++ b/plugins/gpu_neon/psx_gpu/psx_gpu.h
@@ -233,7 +233,7 @@ void render_triangle(psx_gpu_struct *psx_gpu, vertex_struct *vertexes,
void render_sprite(psx_gpu_struct *psx_gpu, s32 x, s32 y, u32 u, u32 v,
s32 width, s32 height, u32 flags, u32 color);
void render_line(psx_gpu_struct *gpu, vertex_struct *vertexes, u32 flags,
- u32 color);
+ u32 color, int double_resolution);
u32 texture_region_mask(s32 x1, s32 y1, s32 x2, s32 y2);
diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
index 54f5614..86a816e 100644
--- a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
+++ b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
@@ -408,7 +408,7 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_command)
vertexes[1].x = list_s16[4] + psx_gpu->offset_x;
vertexes[1].y = list_s16[5] + psx_gpu->offset_y;
- render_line(psx_gpu, vertexes, current_command, list[0]);
+ render_line(psx_gpu, vertexes, current_command, list[0], 0);
break;
}
@@ -429,7 +429,7 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_command)
vertexes[1].x = (xy & 0xFFFF) + psx_gpu->offset_x;
vertexes[1].y = (xy >> 16) + psx_gpu->offset_y;
- render_line(psx_gpu, vertexes, current_command, list[0]);
+ render_line(psx_gpu, vertexes, current_command, list[0], 0);
list_position++;
num_vertexes++;
@@ -460,7 +460,7 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_command)
vertexes[1].x = list_s16[6] + psx_gpu->offset_x;
vertexes[1].y = list_s16[7] + psx_gpu->offset_y;
- render_line(psx_gpu, vertexes, current_command, 0);
+ render_line(psx_gpu, vertexes, current_command, 0, 0);
break;
}
@@ -490,7 +490,7 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_command)
vertexes[1].x = (xy & 0xFFFF) + psx_gpu->offset_x;
vertexes[1].y = (xy >> 16) + psx_gpu->offset_y;
- render_line(psx_gpu, vertexes, current_command, 0);
+ render_line(psx_gpu, vertexes, current_command, 0, 0);
list_position += 2;
num_vertexes++;
@@ -1079,7 +1079,9 @@ u32 gpu_parse_enhanced(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_c
vertexes[1].x = list_s16[4] + psx_gpu->offset_x;
vertexes[1].y = list_s16[5] + psx_gpu->offset_y;
- render_line(psx_gpu, vertexes, current_command, list[0]);
+ render_line(psx_gpu, vertexes, current_command, list[0], 0);
+ enhancement_enable();
+ render_line(psx_gpu, vertexes, current_command, list[0], 1);
break;
}
@@ -1100,7 +1102,10 @@ u32 gpu_parse_enhanced(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_c
vertexes[1].x = (xy & 0xFFFF) + psx_gpu->offset_x;
vertexes[1].y = (xy >> 16) + psx_gpu->offset_y;
- render_line(psx_gpu, vertexes, current_command, list[0]);
+ enhancement_disable();
+ render_line(psx_gpu, vertexes, current_command, list[0], 0);
+ enhancement_enable();
+ render_line(psx_gpu, vertexes, current_command, list[0], 1);
list_position++;
num_vertexes++;
@@ -1131,7 +1136,9 @@ u32 gpu_parse_enhanced(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_c
vertexes[1].x = list_s16[6] + psx_gpu->offset_x;
vertexes[1].y = list_s16[7] + psx_gpu->offset_y;
- render_line(psx_gpu, vertexes, current_command, 0);
+ render_line(psx_gpu, vertexes, current_command, 0, 0);
+ enhancement_enable();
+ render_line(psx_gpu, vertexes, current_command, 0, 1);
break;
}
@@ -1161,7 +1168,10 @@ u32 gpu_parse_enhanced(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_c
vertexes[1].x = (xy & 0xFFFF) + psx_gpu->offset_x;
vertexes[1].y = (xy >> 16) + psx_gpu->offset_y;
- render_line(psx_gpu, vertexes, current_command, 0);
+ enhancement_disable();
+ render_line(psx_gpu, vertexes, current_command, 0, 0);
+ enhancement_enable();
+ render_line(psx_gpu, vertexes, current_command, 0, 1);
list_position += 2;
num_vertexes++;