notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
psx_gpu: fix lines
[pcsx_rearmed.git]
/
plugins
/
gpu_neon
/
psx_gpu
/
psx_gpu_parse.c
diff --git
a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
index
2ef823d
..
be69f44
100644
(file)
--- a/
plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
+++ b/
plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
@@
-153,6
+153,13
@@
void set_triangle_color(psx_gpu_struct *psx_gpu, u32 triangle_color)
#define sign_extend_12bit(value) \
(((s32)((value) << 20)) >> 20) \
#define sign_extend_12bit(value) \
(((s32)((value) << 20)) >> 20) \
+#define sign_extend_11bit(value) \
+ (((s32)((value) << 21)) >> 21) \
+
+#define sign_extend_10bit(value) \
+ (((s32)((value) << 22)) >> 22) \
+
+
#define get_vertex_data_xy(vertex_number, offset16) \
vertexes[vertex_number].x = \
sign_extend_12bit(list_s16[offset16]) + psx_gpu->offset_x; \
#define get_vertex_data_xy(vertex_number, offset16) \
vertexes[vertex_number].x = \
sign_extend_12bit(list_s16[offset16]) + psx_gpu->offset_x; \
@@
-210,8
+217,8
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
break;
case 0x02:
break;
case 0x02:
- render_block_fill(psx_gpu, list[0] & 0xFFFFFF, list_s16[2]
, list_s16[3]
,
- list_s16[
4] & 0x3FF, list_s16[5] & 0x3
FF);
+ render_block_fill(psx_gpu, list[0] & 0xFFFFFF, list_s16[2]
& 0x3FF
,
+ list_s16[
3] & 0x1FF, list_s16[4] & 0x3FF, list_s16[5] & 0x1
FF);
break;
case 0x20 ... 0x23:
break;
case 0x20 ... 0x23:
@@
-221,7
+228,7
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
get_vertex_data_xy(0, 2);
get_vertex_data_xy(1, 4);
get_vertex_data_xy(2, 6);
get_vertex_data_xy(0, 2);
get_vertex_data_xy(1, 4);
get_vertex_data_xy(2, 6);
-
+
render_triangle(psx_gpu, vertexes, current_command);
break;
}
render_triangle(psx_gpu, vertexes, current_command);
break;
}
@@
-352,7
+359,8
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
while(1)
{
xy = *list_position;
while(1)
{
xy = *list_position;
- if(xy == 0x55555555)
+
+ if((xy & 0xF000F000) == 0x50005000)
break;
vertexes[0] = vertexes[1];
break;
vertexes[0] = vertexes[1];
@@
-363,6
+371,9
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
list_position++;
num_vertexes++;
list_position++;
num_vertexes++;
+ if(list_position > list_end)
+ break;
+
render_line(psx_gpu, vertexes, current_command, list[0]);
}
render_line(psx_gpu, vertexes, current_command, list[0]);
}
@@
-406,7
+417,7
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
while(1)
{
color = list_position[0];
while(1)
{
color = list_position[0];
- if(
color == 0x55555555
)
+ if(
(color & 0xF000F000) == 0x50005000
)
break;
xy = list_position[1];
break;
xy = list_position[1];
@@
-422,6
+433,9
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
list_position += 2;
num_vertexes++;
list_position += 2;
num_vertexes++;
+ if(list_position > list_end)
+ break;
+
render_line(psx_gpu, vertexes, current_command, 0);
}
render_line(psx_gpu, vertexes, current_command, 0);
}
@@
-433,8
+447,8
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
case 0x60 ... 0x63:
{
case 0x60 ... 0x63:
{
- u32 x =
list_s16[2] + psx_gpu->offset_x
;
- u32 y =
list_s16[3] + psx_gpu->offset_y
;
+ 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;
u32 width = list_s16[4] & 0x3FF;
u32 height = list_s16[5] & 0x1FF;
@@
-444,8
+458,8
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
case 0x64 ... 0x67:
{
case 0x64 ... 0x67:
{
- u32 x =
list_s16[2] + psx_gpu->offset_x
;
- u32 y =
list_s16[3] + psx_gpu->offset_y
;
+ 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;
u32 uv = list_s16[4];
u32 width = list_s16[6] & 0x3FF;
u32 height = list_s16[7] & 0x1FF;
@@
-462,8
+476,8
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
case 0x6A:
case 0x6B:
{
case 0x6A:
case 0x6B:
{
- s32 x =
list_s16[2] + psx_gpu->offset_x
;
- s32 y =
list_s16[3] + psx_gpu->offset_y
;
+ s32 x =
sign_extend_11bit(list_s16[2] + psx_gpu->offset_x)
;
+ s32 y =
sign_extend_11bit(list_s16[3] + psx_gpu->offset_y)
;
render_sprite(psx_gpu, x, y, 0, 0, 1, 1, current_command, list[0]);
break;
render_sprite(psx_gpu, x, y, 0, 0, 1, 1, current_command, list[0]);
break;
@@
-474,8
+488,8
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
case 0x72:
case 0x73:
{
case 0x72:
case 0x73:
{
- s32 x =
list_s16[2] + psx_gpu->offset_x
;
- s32 y =
list_s16[3] + psx_gpu->offset_y
;
+ s32 x =
sign_extend_11bit(list_s16[2] + psx_gpu->offset_x)
;
+ s32 y =
sign_extend_11bit(list_s16[3] + psx_gpu->offset_y)
;
render_sprite(psx_gpu, x, y, 0, 0, 8, 8, current_command, list[0]);
break;
render_sprite(psx_gpu, x, y, 0, 0, 8, 8, current_command, list[0]);
break;
@@
-486,8
+500,8
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
case 0x76:
case 0x77:
{
case 0x76:
case 0x77:
{
- s32 x =
list_s16[2] + psx_gpu->offset_x
;
- s32 y =
list_s16[3] + psx_gpu->offset_y
;
+ 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];
set_clut(psx_gpu, list_s16[5]);
u32 uv = list_s16[4];
set_clut(psx_gpu, list_s16[5]);
@@
-502,8
+516,8
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
case 0x7A:
case 0x7B:
{
case 0x7A:
case 0x7B:
{
- s32 x =
list_s16[2] + psx_gpu->offset_x
;
- s32 y =
list_s16[3] + psx_gpu->offset_y
;
+ s32 x =
sign_extend_11bit(list_s16[2] + psx_gpu->offset_x)
;
+ s32 y =
sign_extend_11bit(list_s16[3] + psx_gpu->offset_y)
;
render_sprite(psx_gpu, x, y, 0, 0, 16, 16, current_command, list[0]);
break;
render_sprite(psx_gpu, x, y, 0, 0, 16, 16, current_command, list[0]);
break;
@@
-514,8
+528,8
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
case 0x7E:
case 0x7F:
{
case 0x7E:
case 0x7F:
{
- s32 x =
list_s16[2] + psx_gpu->offset_x
;
- s32 y =
list_s16[3] + psx_gpu->offset_y
;
+ 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];
set_clut(psx_gpu, list_s16[5]);
u32 uv = list_s16[4];
set_clut(psx_gpu, list_s16[5]);
@@
-532,10
+546,10
@@
void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size)
case 0xA0: // sys -> vid
{
case 0xA0: // sys -> vid
{
- u32 load_x = list_s16[2];
- u32 load_y = list_s16[3];
- u32 load_width = list_s16[4];
- u32 load_height = list_s16[5];
+ u32 load_x = list_s16[2]
& 0x3FF
;
+ u32 load_y = list_s16[3]
& 0x1FF
;
+ u32 load_width = list_s16[4]
& 0x3FF
;
+ u32 load_height = list_s16[5]
& 0x1FF
;
u32 load_size = load_width * load_height;
command_length += load_size / 2;
u32 load_size = load_width * load_height;
command_length += load_size / 2;