From 20157ba7b53d5436ca94d077a7be7a714aa264bf Mon Sep 17 00:00:00 2001 From: dborth Date: Fri, 16 Jan 2009 04:48:15 +0000 Subject: [PATCH] use libogc's maketexture function --- source/ngc/video.cpp | 48 ++------------------------------------------ 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/source/ngc/video.cpp b/source/ngc/video.cpp index 2a61f34..6c323d8 100644 --- a/source/ngc/video.cpp +++ b/source/ngc/video.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "snes9x.h" #include "memmap.h" #include "aram.h" @@ -646,51 +647,6 @@ ResetVideo_Menu () GX_LoadProjectionMtx (p, GX_ORTHOGRAPHIC); } -/**************************************************************************** - * MakeTexture - * - * Proper GNU Asm rendition of the above, converted by shagkur. - Thanks! - ***************************************************************************/ -static void -MakeTexture (const void *src, void *dst, s32 width, s32 height) -{ - register u32 tmp0 = 0, tmp1 = 0, tmp2 = 0, tmp3 = 0; - - __asm__ __volatile__ (" srwi %6,%6,2\n" - " srwi %7,%7,2\n" - " subi %3,%4,4\n" - " mr %4,%3\n" - " subi %4,%4,4\n" - "2: mtctr %6\n" - " mr %0,%5\n" - // - "1: lwz %1,0(%5)\n" - " stwu %1,8(%4)\n" - " lwz %2,4(%5)\n" - " stwu %2,8(%3)\n" - " lwz %1,1024(%5)\n" - " stwu %1,8(%4)\n" - " lwz %2,1028(%5)\n" - " stwu %2,8(%3)\n" - " lwz %1,2048(%5)\n" - " stwu %1,8(%4)\n" - " lwz %2,2052(%5)\n" - " stwu %2,8(%3)\n" - " lwz %1,3072(%5)\n" - " stwu %1,8(%4)\n" - " lwz %2,3076(%5)\n" - " stwu %2,8(%3)\n" - " addi %5,%5,8\n" - " bdnz 1b\n" - " addi %5,%0,4096\n" - " subic. %7,%7,1\n" - " bne 2b" - // 0 1 2 3 4 5 6 7 - :"=&r" (tmp0), "=&r" (tmp1), "=&r" (tmp2), - "=&r" (tmp3), "+r" (dst):"r" (src), "r" (width), - "r" (height)); -} - /**************************************************************************** * Update Video ***************************************************************************/ @@ -765,7 +721,7 @@ update_video (int width, int height) CheckVideo = 0; } - MakeTexture ((char *) GFX.Screen, (char *) texturemem, vwidth, vheight); // convert image to texture + MakeTexture565((char *) GFX.Screen, (char *) texturemem, vwidth, vheight); // convert image to texture DCFlushRange (texturemem, TEX_WIDTH * TEX_HEIGHT * 2); // update the texture memory GX_InvalidateTexAll ();