X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fplugin_lib.c;h=aa771ed1c11488fb62e0973aab2dbcd4595c617f;hp=400e9ff2de3f58c3c83d42a5470b0a3d2d7d3b79;hb=da710571b75db7031b82924ab3ad47eb645ce215;hpb=02783d0b37a8b8c2d220f931e5bb2be2036dff87 diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c index 400e9ff2..aa771ed1 100644 --- a/frontend/plugin_lib.c +++ b/frontend/plugin_lib.c @@ -28,8 +28,9 @@ #include "plat.h" #include "pcnt.h" #include "pl_gun_ts.h" +#include "psemu_plugin_defs.h" #include "../libpcsxcore/new_dynarec/new_dynarec.h" -#include "../libpcsxcore/psemu_plugin_defs.h" +#include "../libpcsxcore/psxmem_map.h" #include "../plugins/gpulib/cspace.h" #include "../plugins/dfinput/externals.h" @@ -257,10 +258,6 @@ static void pl_vout_set_mode(int w, int h, int raw_w, int raw_h, int bpp) } #endif - if (pl_vout_buf != NULL && vout_w == pl_vout_w && vout_h == pl_vout_h - && vout_bpp == pl_vout_bpp) - return; - update_layer_size(vout_w, vout_h); pl_vout_buf = plat_gvideo_set_mode(&vout_w, &vout_h, &vout_bpp); @@ -701,15 +698,8 @@ static void pl_get_layer_pos(int *x, int *y, int *w, int *h) *h = g_layer_h; } -static void *pl_mmap(unsigned int size) -{ - return plat_mmap(0, size, 0, 0); -} - -static void pl_munmap(void *ptr, unsigned int size) -{ - plat_munmap(ptr, size); -} +static void *pl_mmap(unsigned int size); +static void pl_munmap(void *ptr, unsigned int size); struct rearmed_cbs pl_rearmed_cbs = { pl_get_layer_pos, @@ -777,6 +767,27 @@ void pl_start_watchdog(void) fprintf(stderr, "could not start watchdog: %d\n", ret); } +static void *pl_emu_mmap(unsigned long addr, size_t size, int is_fixed, + enum psxMapTag tag) +{ + return plat_mmap(addr, size, 0, is_fixed); +} + +static void pl_emu_munmap(void *ptr, size_t size, enum psxMapTag tag) +{ + plat_munmap(ptr, size); +} + +static void *pl_mmap(unsigned int size) +{ + return psxMapHook(0, size, 0, MAP_TAG_VRAM); +} + +static void pl_munmap(void *ptr, unsigned int size) +{ + psxUnmapHook(ptr, size, MAP_TAG_VRAM); +} + void pl_init(void) { extern unsigned int hSyncCount; // from psxcounters @@ -789,4 +800,7 @@ void pl_init(void) pl_rearmed_cbs.gpu_hcnt = &hSyncCount; pl_rearmed_cbs.gpu_frame_count = &frame_counter; + + psxMapHook = pl_emu_mmap; + psxUnmapHook = pl_emu_munmap; }