aboutsummaryrefslogtreecommitdiff
path: root/plugins/gpulib
diff options
context:
space:
mode:
authornotaz2012-08-18 02:37:49 +0300
committernotaz2012-10-12 00:05:08 +0300
commite929dec505f8d3692248fe0d42c84a37c994ad39 (patch)
treeb79f2f336a93618c2310bb8c70735a621aaa9957 /plugins/gpulib
parent99d767a0cbf8ee7406000cbac647d9681d885282 (diff)
downloadpcsx_rearmed-e929dec505f8d3692248fe0d42c84a37c994ad39.tar.gz
pcsx_rearmed-e929dec505f8d3692248fe0d42c84a37c994ad39.tar.bz2
pcsx_rearmed-e929dec505f8d3692248fe0d42c84a37c994ad39.zip
psx_gpu: switch to 1024 width again.
Diffstat (limited to 'plugins/gpulib')
-rw-r--r--plugins/gpulib/gpu.c16
-rw-r--r--plugins/gpulib/gpu.h5
-rw-r--r--plugins/gpulib/vout_pl.c9
3 files changed, 10 insertions, 20 deletions
diff --git a/plugins/gpulib/gpu.c b/plugins/gpulib/gpu.c
index 462e301..e133f07 100644
--- a/plugins/gpulib/gpu.c
+++ b/plugins/gpulib/gpu.c
@@ -9,7 +9,6 @@
*/
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "gpu.h"
@@ -138,21 +137,8 @@ long GPUinit(void)
{
int ret;
ret = vout_init();
-
- gpu.state.enhancement_available = 0;
ret |= renderer_init();
- if (gpu.state.enhancement_available) {
- if (gpu.enhancement_bufer == NULL)
- gpu.enhancement_bufer = malloc(2048 * 1024 * 2 + 1024 * 512 * 2);
- if (gpu.enhancement_bufer == NULL)
- gpu_log("OOM for enhancement buffer\n");
- }
- else if (gpu.enhancement_bufer != NULL) {
- free(gpu.enhancement_bufer);
- gpu.enhancement_bufer = NULL;
- }
-
gpu.state.frame_count = &gpu.zero;
gpu.state.hcnt = &gpu.zero;
gpu.frameskip.active = 0;
@@ -164,6 +150,7 @@ long GPUinit(void)
long GPUshutdown(void)
{
+ renderer_finish();
return vout_finish();
}
@@ -221,6 +208,7 @@ void GPUwriteStatus(uint32_t data)
gpu.screen.vres = vres[(gpu.status.reg >> 19) & 3];
update_width();
update_height();
+ renderer_notify_res_change();
break;
default:
if ((cmd & 0xf0) == 0x10)
diff --git a/plugins/gpulib/gpu.h b/plugins/gpulib/gpu.h
index f514395..5ad2a46 100644
--- a/plugins/gpulib/gpu.h
+++ b/plugins/gpulib/gpu.h
@@ -67,7 +67,6 @@ struct psx_gpu {
uint32_t old_interlace:1;
uint32_t allow_interlace:2;
uint32_t blanked:1;
- uint32_t enhancement_available:1;
uint32_t enhancement_enable:1;
uint32_t enhancement_active:1;
uint32_t *frame_count;
@@ -90,7 +89,7 @@ struct psx_gpu {
uint32_t last_flip_frame;
uint32_t pending_fill[3];
} frameskip;
- void *enhancement_bufer;
+ uint16_t *enhancement_bufer;
};
extern struct psx_gpu gpu;
@@ -102,11 +101,13 @@ int do_cmd_list(uint32_t *list, int count, int *last_cmd);
struct rearmed_cbs;
int renderer_init(void);
+void renderer_finish(void);
void renderer_sync_ecmds(uint32_t * ecmds);
void renderer_update_caches(int x, int y, int w, int h);
void renderer_flush_queues(void);
void renderer_set_interlace(int enable, int is_odd);
void renderer_set_config(const struct rearmed_cbs *config);
+void renderer_notify_res_change(void);
int vout_init(void);
int vout_finish(void);
diff --git a/plugins/gpulib/vout_pl.c b/plugins/gpulib/vout_pl.c
index 5131034..cbd8034 100644
--- a/plugins/gpulib/vout_pl.c
+++ b/plugins/gpulib/vout_pl.c
@@ -68,18 +68,19 @@ static void blit(void)
uint8_t *dest;
dest = (uint8_t *)screen_buf;
- if (dest == NULL)
+ if (dest == NULL || w == 0 || stride == 0)
return;
if (gpu.state.enhancement_active) {
- vram = gpu.enhancement_bufer;
+ // this layout is gpu_neon specific..
+ vram = gpu.enhancement_bufer +
+ (x + 8) / stride * 1024 * 1024;
x *= 2;
y *= 2;
w *= 2;
h *= 2;
stride *= 2;
- vram_stride = 2048;
- vram_mask = 2048 * 1024 - 1;
+ vram_mask = 1024 * 1024 - 1;
}
fb_offs = y * vram_stride + x;