X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fgpu_neon%2Fpsx_gpu%2Fpsx_gpu_parse.c;h=376225801db412638154f770b265a2f0c1f808b7;hb=d91ab53739f331e6ce979463afdbbe7b5fd638cd;hp=ffa9b9a0f373b998b052f7da693cbbf4a82f02a5;hpb=804789d73ee66857216f1e32c74c80dd65ef587f;p=pcsx_rearmed.git diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c index ffa9b9a0..37622580 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c +++ b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c @@ -45,7 +45,6 @@ void update_texture_ptr(psx_gpu_struct *psx_gpu) switch((psx_gpu->render_state_base >> 8) & 0x3) { - default: case TEXTURE_MODE_4BPP: texture_base = psx_gpu->texture_4bpp_cache[psx_gpu->current_texture_page]; @@ -75,6 +74,7 @@ void update_texture_ptr(psx_gpu_struct *psx_gpu) texture_ptr += (psx_gpu->texture_window_y >> 4) << 12; break; + default: case TEXTURE_MODE_16BPP: texture_base = (u8 *)(psx_gpu->vram_ptr); texture_base += (psx_gpu->current_texture_page & 0xF) * 128; @@ -798,7 +798,7 @@ static void update_enhancement_buf_table_from_hres(psx_gpu_struct *psx_gpu) s = psx_gpu->enhancement_x_threshold; for (x = 0; x < sizeof(psx_gpu->enhancement_buf_by_x16); x++) { - if (b < 3 && x * ENH_BUF_TABLE_STEP >= s - ENH_BUF_TABLE_STEP - 1) + if (b < 3 && x * ENH_BUF_TABLE_STEP >= s) { s += psx_gpu->enhancement_x_threshold; b++; @@ -868,7 +868,72 @@ extern void scale2x_tiles8(void *dst, const void *src, int w8, int h); #ifndef NEON_BUILD // TODO? -void scale2x_tiles8(void *dst, const void *src, int w8, int h) {} +void scale2x_tiles8(void *dst, const void *src, int w8, int h) +{ + uint16_t* d = (uint16_t*)dst; + const uint16_t* s = (const uint16_t*)src; + + while ( h-- ) + { + uint16_t* d_save = d; + const uint16_t* s_save = s; + int w = w8; + + while ( w-- ) + { + d[ 0 ] = *s; + d[ 1 ] = *s; + d[ 1024 ] = *s; + d[ 1025 ] = *s; + d += 2; s++; + + d[ 0 ] = *s; + d[ 1 ] = *s; + d[ 1024 ] = *s; + d[ 1025 ] = *s; + d += 2; s++; + + d[ 0 ] = *s; + d[ 1 ] = *s; + d[ 1024 ] = *s; + d[ 1025 ] = *s; + d += 2; s++; + + d[ 0 ] = *s; + d[ 1 ] = *s; + d[ 1024 ] = *s; + d[ 1025 ] = *s; + d += 2; s++; + + d[ 0 ] = *s; + d[ 1 ] = *s; + d[ 1024 ] = *s; + d[ 1025 ] = *s; + d += 2; s++; + + d[ 0 ] = *s; + d[ 1 ] = *s; + d[ 1024 ] = *s; + d[ 1025 ] = *s; + d += 2; s++; + + d[ 0 ] = *s; + d[ 1 ] = *s; + d[ 1024 ] = *s; + d[ 1025 ] = *s; + d += 2; s++; + + d[ 0 ] = *s; + d[ 1 ] = *s; + d[ 1024 ] = *s; + d[ 1025 ] = *s; + d += 2; s++; + } + + d = d_save + 2048; + s = s_save + 1024; /* or 512? */ + } +} #endif static int disable_main_render; @@ -1578,4 +1643,4 @@ breakloop: #endif /* PCSX */ -// vim:shiftwidth=2:expandtab +// vim:ts=2:shiftwidth=2:expandtab