X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fgpulib%2Fvout_pl.c;h=9a844324f319e13acbfde33e539f265af5e51366;hp=47c28f3e73fe445ed521c653707203e45702a053;hb=a8be0debff95f9b56af7c4c19eaacee782a09e28;hpb=0b02eb7712f1272fa7f38b0af41968b53af3b5a8 diff --git a/plugins/gpulib/vout_pl.c b/plugins/gpulib/vout_pl.c index 47c28f3e..9a844324 100644 --- a/plugins/gpulib/vout_pl.c +++ b/plugins/gpulib/vout_pl.c @@ -35,7 +35,7 @@ static void check_mode_change(void) int h = gpu.screen.h; gpu.state.enhancement_active = - gpu.enhancement_bufer != NULL && gpu.state.enhancement_enable + gpu.get_enhancement_bufer != NULL && gpu.state.enhancement_enable && w <= 512 && h <= 256 && !gpu.status.rgb24; if (gpu.state.enhancement_active) { @@ -68,18 +68,12 @@ 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; - x *= 2; - y *= 2; - w *= 2; - h *= 2; - stride *= 2; - vram_mask = 1024 * 1024 - 1; - } + if (gpu.state.enhancement_active) + vram = gpu.get_enhancement_bufer(&x, &y, &w, &h, &stride, &vram_mask); + fb_offs = y * vram_stride + x; // only do centering, at least for now @@ -128,10 +122,15 @@ void vout_update(void) void vout_blank(void) { - check_mode_change(); if (cbs->pl_vout_raw_flip == NULL) { + int w = gpu.screen.hres; + int h = gpu.screen.h; int bytespp = gpu.status.rgb24 ? 3 : 2; - memset(screen_buf, 0, gpu.screen.hres * gpu.screen.h * bytespp); + if (gpu.state.enhancement_active) { + w *= 2; + h *= 2; + } + memset(screen_buf, 0, w * h * bytespp); screen_buf = cbs->pl_vout_flip(); } }