diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index d39c27cb1..a53424876 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -2564,7 +2564,7 @@ void GPU_ligne(NDS_Screen * screen, u16 l) { u8 * dst = GPU_screen + (screen->offset + l) * 512; u8 * src = gpu->VRAMaddr + (l*512); - GPU_copyLine(dst, src); + memcpy (dst, src, 512); } break; case 3: diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index 358f4693a..8f564a305 100644 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -625,7 +625,7 @@ static void setTexture(unsigned int format, unsigned int texpal) texcache[i].coord=(format>>30); texcache[i].invSizeX=1.0f/((float)(sizeX*(1<<4))); texcache[i].invSizeY=1.0f/((float)(sizeY*(1<<4))); - memcpy_fast(texcache[i].texture,adr,std::min((size_t)imageSize,sizeof(texcache[i].texture))); + memcpy (texcache[i].texture,adr,std::min((size_t)imageSize,sizeof(texcache[i].texture))); texcache[i].numcolors=palSize[texcache[i].mode]; texcache[i].frm=format; diff --git a/desmume/src/common-x64.asm b/desmume/src/common-x64.asm deleted file mode 100644 index 4663d188f..000000000 --- a/desmume/src/common-x64.asm +++ /dev/null @@ -1,27 +0,0 @@ -; -; Copyright (C) 2006 yopyop -; Copyright (C) 2008 CrazyMax -; -; This file is part of DeSmuME -; -; DeSmuME is free software; you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation; either version 2 of the License, or -; (at your option) any later version. -; -; DeSmuME is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with DeSmuME; if not, write to the Free Software -; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - TITLE common-x64.asm - .code - -NOP_x64 PROC PUBLIC -ENDP - -end diff --git a/desmume/src/common-x86.asm b/desmume/src/common-x86.asm deleted file mode 100644 index cf4c8c9ac..000000000 --- a/desmume/src/common-x86.asm +++ /dev/null @@ -1,104 +0,0 @@ -; -; Copyright (C) 2006 yopyop -; Copyright (C) 2008 CrazyMax -; -; This file is part of DeSmuME -; -; DeSmuME is free software; you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation; either version 2 of the License, or -; (at your option) any later version. -; -; DeSmuME is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with DeSmuME; if not, write to the Free Software -; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - TITLE common-x86.asm - .686P - .XMM - .model flat - .code - -@memcpy_fast@12 PROC PUBLIC - push esi - push edi ; cauntion: stack increased on 8 - - mov esi, edx - mov edi, ecx - mov ecx, [esp+12] - - cmp ecx, 40h ; 64 bytes - jl remain_loop ;not enought bytes - - mov eax, ecx - shr eax, 6 - and ecx, 63 - -ALIGN 8 -loop_copy: - movq mm0, [esi] - movq mm1, [esi+ 8] - movntq [edi], mm0 - movntq [edi+8], mm1 - movq mm2, [esi+16] - movq mm3, [esi+24] - movntq [edi+16], mm2 - movntq [edi+24], mm3 - movq mm4, [esi+32] - movq mm5, [esi+40] - movntq [edi+32], mm4 - movntq [edi+40], mm5 - movq mm6, [esi+48] - movq mm7, [esi+56] - movntq [edi+48], mm6 - movntq [edi+56], mm7 - add esi, 64 - add edi, 64 - dec eax - jne loop_copy - - emms - -remain_loop: - rep movsb -end_loop: - pop edi - pop esi - ret 4 -@memcpy_fast@12 ENDP - -@GPU_copyLine@8 PROC PUBLIC - mov eax, 8 -ALIGN 8 -loop_copy: - movq mm0, [edx] - movq mm1, [edx+8] - movntq [ecx], mm0 - movntq [ecx+8], mm1 - movq mm2, [edx+16] - movq mm3, [edx+24] - movntq [ecx+16], mm2 - movntq [ecx+24], mm3 - movq mm4, [edx+32] - movq mm5, [edx+40] - movntq [ecx+32], mm4 - movntq [ecx+40], mm5 - movq mm6, [edx+48] - movq mm7, [edx+56] - movntq [ecx+48], mm6 - movntq [ecx+56], mm7 - add edx, 64 - add ecx, 64 - dec eax - jne loop_copy - - emms - ret 0 -@GPU_copyLine@8 ENDP - -end diff --git a/desmume/src/common.h b/desmume/src/common.h index 0f971e038..e890e290e 100644 --- a/desmume/src/common.h +++ b/desmume/src/common.h @@ -28,35 +28,18 @@ #include "types.h" #ifdef WIN32 -#define _WINSOCKAPI_ -#include + #define _WINSOCKAPI_ + #include -#define CLASSNAME "DeSmuME" + #define CLASSNAME "DeSmuME" -extern HINSTANCE hAppInst; + extern HINSTANCE hAppInst; -extern char IniName[MAX_PATH]; -extern void GetINIPath(); -extern void WritePrivateProfileInt(char* appname, char* keyname, int val, char* file); - -// temporally while fix x64 build -#ifndef _WIN64 -#define memcpy_fast(d,s,c) memcpy(d,s,c) -#define GPU_copyLine(d,s) memcpy(d,s,512) -#else -extern "C" -{ - void __fastcall memcpy_fast(void* dest, void* src, size_t count); - void __fastcall GPU_copyLine(void* dest, const void* src); -} -#endif - -// check it in other ports -#else -#define memcpy_fast(d,s,c) memcpy(d,s,c) -#define GPU_copyLine(d,s) memcpy(d,s,512) + extern char IniName[MAX_PATH]; + extern void GetINIPath(); + extern void WritePrivateProfileInt(char* appname, char* keyname, int val, char* file); #endif -extern u8 reverseBitsInByte(u8 x); + extern u8 reverseBitsInByte(u8 x); #endif \ No newline at end of file diff --git a/desmume/src/common_sse2-x64.asm b/desmume/src/common_sse2-x64.asm deleted file mode 100644 index 77aeeef4c..000000000 --- a/desmume/src/common_sse2-x64.asm +++ /dev/null @@ -1,27 +0,0 @@ -; -; Copyright (C) 2006 yopyop -; Copyright (C) 2008 CrazyMax -; -; This file is part of DeSmuME -; -; DeSmuME is free software; you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation; either version 2 of the License, or -; (at your option) any later version. -; -; DeSmuME is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with DeSmuME; if not, write to the Free Software -; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - TITLE common_sse2-x64.asm - .code - -NOP_SSE2_x64 PROC PUBLIC -ENDP - -end diff --git a/desmume/src/common_sse2-x86.asm b/desmume/src/common_sse2-x86.asm deleted file mode 100644 index c9ae2569f..000000000 --- a/desmume/src/common_sse2-x86.asm +++ /dev/null @@ -1,151 +0,0 @@ -; -; Copyright (C) 2006 yopyop -; Copyright (C) 2008 CrazyMax -; -; This file is part of DeSmuME -; -; DeSmuME is free software; you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation; either version 2 of the License, or -; (at your option) any later version. -; -; DeSmuME is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with DeSmuME; if not, write to the Free Software -; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - TITLE common_sse2-x86.asm - .686P - .XMM - .model flat - .code - -@memcpy_fast@12 PROC PUBLIC - push esi - push edi - - mov esi, edx - mov edi, ecx - mov ecx, [esp+12] - - prefetchnta [esi] - prefetchnta [esi+64] - prefetchnta [esi+128] - prefetchnta [esi+192] - prefetchnta [esi+256] - - cmp ecx, 40h ; 64 bytes - jl remain_loop ;not enought bytes - - mov edx, edi - and edx, 15 - je _aligned - - mov eax, ecx - sub edx, 16 - neg edx - sub eax, edx - mov ecx, edx - rep movsb - mov ecx, eax - -_aligned: - mov eax, ecx - shr eax, 6 - and ecx, 63 - test esi, 15 - je aligned_copy_loop - -ALIGN 8 -unaligned_copy_loop: - prefetchnta [esi+320] - movups xmm0, [esi] - movups xmm1, [esi+16] - movntps [edi], xmm0 - movntps [edi+16], xmm1 - movups xmm2, [esi+32] - movups xmm3, [esi+48] - movntps [edi+32], xmm2 - movntps [edi+48], xmm3 - add esi, 64 - add edi, 64 - dec eax - jne unaligned_copy_loop - sfence - jmp remain_loop - -ALIGN 8 -aligned_copy_loop: - prefetchnta [esi+320] - movaps xmm0, [esi] - movaps xmm1, [esi+16] - movntps [edi], xmm0 - movntps [edi+16], xmm1 - movaps xmm2, [esi+32] - movaps xmm3, [esi+48] - movntps [edi+32], xmm2 - movntps [edi+48], xmm3 - add esi, 64 - add edi, 64 - dec eax - jne aligned_copy_loop - sfence - -remain_loop: - cmp ecx, 3 - jg remain_loop2 - rep movsb - pop edi - pop esi - ret 4 -remain_loop2: - mov eax, ecx - shr ecx, 2 - rep movsd - test al, 2 - je skip_word - movsw -skip_word: - test al, 1 - je end_loop - movsb - -end_loop: - pop edi - pop esi - ret 4 -@memcpy_fast@12 ENDP - -@GPU_copyLine@8 PROC PUBLIC - prefetchnta [edx] - prefetchnta [edx+64] - prefetchnta [edx+128] - prefetchnta [edx+192] - prefetchnta [edx+256] - mov eax, 8 - -aligned_copy_loop: - prefetchnta [edx+320] - movaps xmm0, [edx] - movaps xmm1, [edx+16] - movntps [ecx], xmm0 - movntps [ecx+16], xmm1 - movaps xmm2, [edx+32] - movaps xmm3, [edx+48] - movntps [ecx+32], xmm2 - movntps [ecx+48], xmm3 - add edx, 64 - add ecx, 64 - dec eax - jne aligned_copy_loop - sfence - - ret 0 -@GPU_copyLine@8 ENDP - -end - diff --git a/desmume/src/windows/DeSmuME_2008.vcproj b/desmume/src/windows/DeSmuME_2008.vcproj index a78ce0727..d4eb073f5 100644 --- a/desmume/src/windows/DeSmuME_2008.vcproj +++ b/desmume/src/windows/DeSmuME_2008.vcproj @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -956,16 +752,6 @@ CommandLine="ml64 /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" " /> - - - + + + + + + - - -