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=6a88beb7843c53b7f483a5b7722ffe46b14ad466;hb=b0d96051c9f087c22922966c651384c3ee84eee0;hp=a364eef3f01af30f8f488278929a2d04967834e7;hpb=a084eccd6fda714520f41a09774576e2f5053575;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 a364eef3..6a88beb7 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; @@ -435,7 +435,10 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_command) num_vertexes++; if(list_position >= list_end) - break; + { + current_command = (u32)-1; + goto breakloop; + } xy = *list_position; if((xy & 0xF000F000) == 0x50005000) @@ -496,7 +499,10 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_command) num_vertexes++; if(list_position >= list_end) - break; + { + current_command = (u32)-1; + goto breakloop; + } color = list_position[0]; if((color & 0xF000F000) == 0x50005000) @@ -774,9 +780,7 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_command) } } -#ifdef PCSX breakloop: -#endif if (last_command != NULL) *last_command = current_command; return list - list_start; @@ -864,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; @@ -1193,7 +1262,10 @@ u32 gpu_parse_enhanced(psx_gpu_struct *psx_gpu, u32 *list, u32 size, num_vertexes++; if(list_position >= list_end) - break; + { + current_command = (u32)-1; + goto breakloop; + } xy = *list_position; if((xy & 0xF000F000) == 0x50005000) @@ -1259,7 +1331,10 @@ u32 gpu_parse_enhanced(psx_gpu_struct *psx_gpu, u32 *list, u32 size, num_vertexes++; if(list_position >= list_end) - break; + { + current_command = (u32)-1; + goto breakloop; + } color = list_position[0]; if((color & 0xF000F000) == 0x50005000) @@ -1568,4 +1643,4 @@ breakloop: #endif /* PCSX */ -// vim:shiftwidth=2:expandtab +// vim:ts=2:shiftwidth=2:expandtab