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
dfxvideo: patch up some unsafe macros
[pcsx_rearmed.git]
/
plugins
/
gpu_neon
/
psx_gpu_if.c
diff --git
a/plugins/gpu_neon/psx_gpu_if.c
b/plugins/gpu_neon/psx_gpu_if.c
index
62c4f9e
..
bb8bea0
100644
(file)
--- a/
plugins/gpu_neon/psx_gpu_if.c
+++ b/
plugins/gpu_neon/psx_gpu_if.c
@@
-43,17
+43,33
@@
int do_cmd_list(uint32_t *list, int count, int *last_cmd)
#define ENHANCEMENT_BUF_SIZE (1024 * 1024 * 2 * 4 + 4096 * 2)
#define ENHANCEMENT_BUF_SIZE (1024 * 1024 * 2 * 4 + 4096 * 2)
+static uint16_t *get_enhancement_bufer(int *x, int *y, int *w, int *h,
+ int *vram_h)
+{
+ uint16_t *ret = select_enhancement_buf_ptr(&egpu, *x);
+
+ *x *= 2;
+ *y *= 2;
+ *w = *w * 2;
+ *h = *h * 2;
+ *vram_h = 1024;
+ return ret;
+}
+
static void map_enhancement_buffer(void)
{
// currently we use 4x 1024*1024 buffers instead of single 2048*1024
// to be able to reuse 1024-width code better (triangle setup,
// dithering phase, lines).
static void map_enhancement_buffer(void)
{
// currently we use 4x 1024*1024 buffers instead of single 2048*1024
// to be able to reuse 1024-width code better (triangle setup,
// dithering phase, lines).
-
gpu.enhancement_bufe
r = gpu.mmap(ENHANCEMENT_BUF_SIZE);
- if (
gpu.enhancement_bufer == NULL)
+
egpu.enhancement_buf_pt
r = gpu.mmap(ENHANCEMENT_BUF_SIZE);
+ if (
egpu.enhancement_buf_ptr == NULL) {
fprintf(stderr, "failed to map enhancement buffer\n");
fprintf(stderr, "failed to map enhancement buffer\n");
- else
- gpu.enhancement_bufer += 4096 / 2;
- egpu.enhancement_buf_ptr = gpu.enhancement_bufer;
+ gpu.get_enhancement_bufer = NULL;
+ }
+ else {
+ egpu.enhancement_buf_ptr += 4096 / 2;
+ gpu.get_enhancement_bufer = get_enhancement_bufer;
+ }
}
int renderer_init(void)
}
int renderer_init(void)
@@
-63,7
+79,7
@@
int renderer_init(void)
initialized = 1;
}
initialized = 1;
}
- if (gpu.mmap != NULL &&
gpu.enhancement_bufe
r == NULL)
+ if (gpu.mmap != NULL &&
egpu.enhancement_buf_pt
r == NULL)
map_enhancement_buffer();
ex_regs = gpu.ex_regs;
map_enhancement_buffer();
ex_regs = gpu.ex_regs;
@@
-72,11
+88,10
@@
int renderer_init(void)
void renderer_finish(void)
{
void renderer_finish(void)
{
- if (
gpu.enhancement_bufe
r != NULL) {
-
gpu.enhancement_bufe
r -= 4096 / 2;
- gpu.munmap(
gpu.enhancement_bufe
r, ENHANCEMENT_BUF_SIZE);
+ if (
egpu.enhancement_buf_pt
r != NULL) {
+
egpu.enhancement_buf_pt
r -= 4096 / 2;
+ gpu.munmap(
egpu.enhancement_buf_pt
r, ENHANCEMENT_BUF_SIZE);
}
}
- gpu.enhancement_bufer = NULL;
egpu.enhancement_buf_ptr = NULL;
egpu.enhancement_current_buf_ptr = NULL;
initialized = 0;
egpu.enhancement_buf_ptr = NULL;
egpu.enhancement_current_buf_ptr = NULL;
initialized = 0;
@@
-118,7
+133,7
@@
void renderer_sync_ecmds(uint32_t *ecmds)
void renderer_update_caches(int x, int y, int w, int h)
{
update_texture_cache_region(&egpu, x, y, x + w - 1, y + h - 1);
void renderer_update_caches(int x, int y, int w, int h)
{
update_texture_cache_region(&egpu, x, y, x + w - 1, y + h - 1);
- if (gpu.state.enhancement_active && !
gpu.status.rgb24
)
+ if (gpu.state.enhancement_active && !
(gpu.status & PSX_GPU_STATUS_RGB24)
)
sync_enhancement_buffers(x, y, w, h);
}
sync_enhancement_buffers(x, y, w, h);
}
@@
-142,7
+157,7
@@
void renderer_notify_res_change(void)
if (egpu.enhancement_x_threshold != gpu.screen.hres)
{
egpu.enhancement_x_threshold = gpu.screen.hres;
if (egpu.enhancement_x_threshold != gpu.screen.hres)
{
egpu.enhancement_x_threshold = gpu.screen.hres;
- update_enhancement_buf_table(&egpu);
+ update_enhancement_buf_table
_from_hres
(&egpu);
}
}
}
}
@@
-165,6
+180,8
@@
void renderer_set_config(const struct rearmed_cbs *cbs)
initialized = 1;
}
initialized = 1;
}
- if (gpu.
enhancement_bufe
r == NULL)
+ if (gpu.
mmap != NULL && egpu.enhancement_buf_pt
r == NULL)
map_enhancement_buffer();
map_enhancement_buffer();
+ if (cbs->pl_set_gpu_caps)
+ cbs->pl_set_gpu_caps(GPU_CAP_SUPPORTS_2X);
}
}