From 4d1dccbd25e1cb5775e03cc92e9ad29927e25747 Mon Sep 17 00:00:00 2001 From: ToadKing Date: Sat, 2 Feb 2013 21:47:27 -0500 Subject: [PATCH] (GX) fix video issue on non-multiple-of-4 texture --- gx/gx_video.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gx/gx_video.c b/gx/gx_video.c index 29ae770fb1..559e0a7c02 100644 --- a/gx/gx_video.c +++ b/gx/gx_video.c @@ -300,6 +300,8 @@ static void setup_video_mode(void) static void init_texture(unsigned width, unsigned height) { + width &= ~3; + height &= ~3; gx_video_t *gx = (gx_video_t*)driver.video_data; unsigned g_filter = g_settings.video.smooth ? GX_LINEAR : GX_NEAR; @@ -474,7 +476,7 @@ static void gx_start(void) gx_old_width = gx_old_height = 0; } -#define ASM_BLITTER +//#define ASM_BLITTER #ifdef ASM_BLITTER @@ -616,7 +618,7 @@ static void convert_texture16(const uint32_t *_src, uint32_t *_dst, height &= ~3; update_texture_asm(_src, _dst, width, height, pitch); #else - width &= ~15; + width &= ~3; height &= ~3; unsigned tmp_pitch = pitch >> 2; unsigned width2 = width >> 1; @@ -640,7 +642,7 @@ static void convert_texture16(const uint32_t *_src, uint32_t *_dst, static void convert_texture16_conv(const uint32_t *_src, uint32_t *_dst, unsigned width, unsigned height, unsigned pitch) { - width &= ~15; + width &= ~3; height &= ~3; unsigned tmp_pitch = pitch >> 2; unsigned width2 = width >> 1; @@ -661,7 +663,7 @@ static void convert_texture16_conv(const uint32_t *_src, uint32_t *_dst, static void convert_texture32(const uint32_t *_src, uint32_t *_dst, unsigned width, unsigned height, unsigned pitch) { - width &= ~15; + width &= ~3; height &= ~3; unsigned tmp_pitch = pitch >> 1; unsigned width2 = width << 1;