From c1817bd9249ee616cf9545a57136d6dd3669ce34 Mon Sep 17 00:00:00 2001 From: notaz Date: Mon, 13 Aug 2012 00:03:43 +0300 Subject: psx_gpu: add enhanced triangle rendering --- plugins/gpu_neon/psx_gpu/psx_gpu.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'plugins/gpu_neon/psx_gpu/psx_gpu.h') diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.h b/plugins/gpu_neon/psx_gpu/psx_gpu.h index 53a8717..7ed5622 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu.h +++ b/plugins/gpu_neon/psx_gpu/psx_gpu.h @@ -122,7 +122,7 @@ typedef struct vec_4x32u g_block_span; vec_4x32u b_block_span; - // 72 bytes + // 76 bytes u32 b; u32 b_dy; @@ -143,6 +143,7 @@ typedef struct void *texture_page_base; u16 *clut_ptr; u16 *vram_ptr; + u16 *vram_out_ptr; // 26 bytes u16 render_state_base; @@ -180,9 +181,16 @@ typedef struct u8 primitive_type; u8 interlace_mode; + // enhancement stuff + u16 *enhancement_buf_ptr; + s16 saved_viewport_start_x; + s16 saved_viewport_start_y; + s16 saved_viewport_end_x; + s16 saved_viewport_end_y; + // Align up to 64 byte boundary to keep the upcoming buffers cache line - // aligned - //u8 reserved_a[0]; + // aligned, also make reachable with single immediate addition + u8 reserved_a[240]; // 8KB block_struct blocks[MAX_BLOCKS_PER_ROW]; -- cgit v1.2.3 From f1359c5758c2e745b1cbec63e21445fa65f7cafe Mon Sep 17 00:00:00 2001 From: notaz Date: Mon, 13 Aug 2012 02:53:21 +0300 Subject: psx_gpu: switch enhancement to 2048 width otherwise games that position framebuffers horizontally corrupt the display. --- plugins/gpu_neon/psx_gpu/psx_gpu.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins/gpu_neon/psx_gpu/psx_gpu.h') diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.h b/plugins/gpu_neon/psx_gpu/psx_gpu.h index 7ed5622..71b99cd 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu.h +++ b/plugins/gpu_neon/psx_gpu/psx_gpu.h @@ -56,8 +56,9 @@ typedef enum typedef enum { RENDER_INTERLACE_ENABLED = 0x1, - RENDER_INTERLACE_ODD = 0x2 -} render_interlace_enum; + RENDER_INTERLACE_ODD = 0x2, + RENDER_DOUBLE_MODE = 0x4, +} render_mode_enum; typedef struct { @@ -179,7 +180,7 @@ typedef struct u8 texture_window_y; u8 primitive_type; - u8 interlace_mode; + u8 render_mode; // enhancement stuff u16 *enhancement_buf_ptr; -- cgit v1.2.3 From c6063f8985c69362a89a12111f393229ab65d05f Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 15 Aug 2012 23:52:38 +0300 Subject: psx_gpu: use different uvrgb phase for enhancement --- plugins/gpu_neon/psx_gpu/psx_gpu.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'plugins/gpu_neon/psx_gpu/psx_gpu.h') diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.h b/plugins/gpu_neon/psx_gpu/psx_gpu.h index 71b99cd..7252dc2 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu.h +++ b/plugins/gpu_neon/psx_gpu/psx_gpu.h @@ -123,7 +123,6 @@ typedef struct vec_4x32u g_block_span; vec_4x32u b_block_span; - // 76 bytes u32 b; u32 b_dy; @@ -139,6 +138,8 @@ typedef struct u32 triangle_color; u32 dither_table[4]; + u32 uvrgb_phase; + struct render_block_handler_struct *render_block_handler; void *texture_page_ptr; void *texture_page_base; @@ -146,19 +147,12 @@ typedef struct u16 *vram_ptr; u16 *vram_out_ptr; - // 26 bytes u16 render_state_base; u16 render_state; u16 num_spans; u16 num_blocks; - s16 offset_x; - s16 offset_y; - - u16 clut_settings; - u16 texture_settings; - s16 viewport_start_x; s16 viewport_start_y; s16 viewport_end_x; @@ -166,7 +160,6 @@ typedef struct u16 mask_msb; - // 8 bytes u8 triangle_winding; u8 display_area_draw_enable; @@ -182,6 +175,12 @@ typedef struct u8 primitive_type; u8 render_mode; + s16 offset_x; + s16 offset_y; + + u16 clut_settings; + u16 texture_settings; + // enhancement stuff u16 *enhancement_buf_ptr; s16 saved_viewport_start_x; @@ -191,7 +190,7 @@ typedef struct // Align up to 64 byte boundary to keep the upcoming buffers cache line // aligned, also make reachable with single immediate addition - u8 reserved_a[240]; + u8 reserved_a[236]; // 8KB block_struct blocks[MAX_BLOCKS_PER_ROW]; -- cgit v1.2.3 From e929dec505f8d3692248fe0d42c84a37c994ad39 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 18 Aug 2012 02:37:49 +0300 Subject: psx_gpu: switch to 1024 width again. --- plugins/gpu_neon/psx_gpu/psx_gpu.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/gpu_neon/psx_gpu/psx_gpu.h') diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.h b/plugins/gpu_neon/psx_gpu/psx_gpu.h index 7252dc2..fc5b566 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu.h +++ b/plugins/gpu_neon/psx_gpu/psx_gpu.h @@ -57,7 +57,6 @@ typedef enum { RENDER_INTERLACE_ENABLED = 0x1, RENDER_INTERLACE_ODD = 0x2, - RENDER_DOUBLE_MODE = 0x4, } render_mode_enum; typedef struct @@ -183,6 +182,8 @@ typedef struct // enhancement stuff u16 *enhancement_buf_ptr; + u16 *enhancement_current_buf_ptr; + u32 enhancement_x_threshold; s16 saved_viewport_start_x; s16 saved_viewport_start_y; s16 saved_viewport_end_x; @@ -190,7 +191,7 @@ typedef struct // Align up to 64 byte boundary to keep the upcoming buffers cache line // aligned, also make reachable with single immediate addition - u8 reserved_a[236]; + u8 reserved_a[228]; // 8KB block_struct blocks[MAX_BLOCKS_PER_ROW]; -- cgit v1.2.3 From 3b3dee71d84bbbb376548d794b7a11cd38833cf0 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 18 Aug 2012 18:25:12 +0300 Subject: psx_gpu: do enhanced lines --- plugins/gpu_neon/psx_gpu/psx_gpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/gpu_neon/psx_gpu/psx_gpu.h') 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); -- cgit v1.2.3 From 7956599fa5f666016f71870d9889748c97839041 Mon Sep 17 00:00:00 2001 From: notaz Date: Mon, 22 Oct 2012 01:42:56 +0300 Subject: psx_gpu: select buffers differently this handles weird drawing areas better --- plugins/gpu_neon/psx_gpu/psx_gpu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/gpu_neon/psx_gpu/psx_gpu.h') diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.h b/plugins/gpu_neon/psx_gpu/psx_gpu.h index f8547f3..846658c 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu.h +++ b/plugins/gpu_neon/psx_gpu/psx_gpu.h @@ -188,10 +188,11 @@ typedef struct s16 saved_viewport_start_y; s16 saved_viewport_end_x; s16 saved_viewport_end_y; + u8 enhancement_buf_by_x16[64]; // Align up to 64 byte boundary to keep the upcoming buffers cache line // aligned, also make reachable with single immediate addition - u8 reserved_a[228]; + u8 reserved_a[164]; // 8KB block_struct blocks[MAX_BLOCKS_PER_ROW]; -- cgit v1.2.3