From 56f802c80ff895caf5e44cb5660d7e5eed0bbf5f Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sat, 7 Mar 2009 00:48:57 +0000 Subject: [PATCH] Linux: Fix up the .S files to match recent changes. Make changes to SafeArray to avoid compiler warnings on every file. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@706 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/NakedAsm.h | 2 ++ pcsx2/SafeArray.h | 11 +++++++++-- pcsx2/x86/aR3000A.S | 26 +++++++++++++++++--------- pcsx2/x86/ix86-32/aR5900-32.S | 21 ++++++++++++++------- 4 files changed, 42 insertions(+), 18 deletions(-) diff --git a/pcsx2/NakedAsm.h b/pcsx2/NakedAsm.h index bd5af2c682..c744b2ece5 100644 --- a/pcsx2/NakedAsm.h +++ b/pcsx2/NakedAsm.h @@ -53,12 +53,14 @@ void svudispfn(); // aR3000A.S void iopJITCompile(); +void iopJITCompileInBlock(); void iopDispatcher(); void iopDispatcherClear(); void iopDispatcherReg(); // aR5900-32.S void JITCompile(); +void JITCompileInBlock(); void Dispatcher(); void DispatcherClear(); void DispatcherReg(); diff --git a/pcsx2/SafeArray.h b/pcsx2/SafeArray.h index 11f156f3c6..9abf6bd80a 100644 --- a/pcsx2/SafeArray.h +++ b/pcsx2/SafeArray.h @@ -19,7 +19,7 @@ #ifndef __SAFEARRAY_H__ #define __SAFEARRAY_H__ -#include "MemcpyFast.h" +#include "System.h" extern void* __fastcall pcsx2_aligned_malloc(size_t size, size_t align); extern void* __fastcall pcsx2_aligned_realloc(void* handle, size_t size, size_t align); @@ -219,9 +219,15 @@ protected: const static std::string m_str_Unnamed; protected: + virtual T* _virtual_realloc( int newsize ) + { + return (T*)realloc( m_ptr, newsize * sizeof(T) ); + } + void _boundsCheck( uint i ) { - if( IsDevBuild && i >= (uint)m_length ) +#ifdef PCSX2_DEVBUILD + if( i >= (uint)m_length ) { assert( 0 ); // makes debugging easier sometimes. :) throw Exception::IndexBoundsFault( @@ -230,6 +236,7 @@ protected: ", length=" + to_string(m_length) + ")" ); } +#endif } public: diff --git a/pcsx2/x86/aR3000A.S b/pcsx2/x86/aR3000A.S index 92568b13b9..9af67a3c52 100644 --- a/pcsx2/x86/aR3000A.S +++ b/pcsx2/x86/aR3000A.S @@ -36,9 +36,13 @@ iopJITCompile: mov ebx, esi shr esi, 16 mov ecx, dword ptr [RECLUT+esi*4] - jmp dword ptr [ecx+ebx*2] - + jmp dword ptr [ecx+ebx] +.global iopJITCompileInBlock +iopJITCompileInBlock: + + jmp iopJITCompile + ////////////////////////////////////////////////////////////////////////// // Recompiles the next block, and links the old block directly to it. // This is a on-shot execution for any block which uses it. Once the block @@ -55,9 +59,11 @@ iopDispatcher: mov ebx, eax shr eax, 16 mov ecx, dword ptr [RECLUT+eax*4] - mov eax, dword ptr [ecx+ebx*2] + mov eax, dword ptr [ecx+ebx] - cmp eax, offset JITCompile + cmp eax, offset iopJITCompile + je Dispatch_notcompiled + cmp eax, offset iopJITCompileInBlock je Dispatch_notcompiled lea ebx, [eax-4] sub ebx, edx @@ -67,7 +73,7 @@ iopDispatcher: .align 16 Dispatch_notcompiled: mov esi, edx - lea edi, [ecx+ebx*2] + lea edi, [ecx+ebx] push ebx call iopRecRecompile add esp, 4 @@ -92,16 +98,18 @@ iopDispatcherClear: mov ebx, edx shr edx, 16 mov ecx, dword ptr [RECLUT+edx*4] - mov eax, dword ptr [ecx+ebx*2] + mov eax, dword ptr [ecx+ebx] - cmp eax, offset JITCompile + cmp eax, offset iopJITCompile + je Clear_notcompiled + cmp eax, offset iopJITCompileInBlock je Clear_notcompiled add esp, 4 jmp eax .align 16 Clear_notcompiled: - lea edi, [ecx+ebx*2] + lea edi, [ecx+ebx] push ebx call iopRecRecompile add esp, 4 @@ -126,4 +134,4 @@ iopDispatcherReg: mov ebx, eax shr eax, 16 mov ecx, dword ptr [RECLUT+eax*4] - jmp dword ptr [ecx+ebx*2] + jmp dword ptr [ecx+ebx] diff --git a/pcsx2/x86/ix86-32/aR5900-32.S b/pcsx2/x86/ix86-32/aR5900-32.S index a8d4c179bb..92fad3a2c2 100644 --- a/pcsx2/x86/ix86-32/aR5900-32.S +++ b/pcsx2/x86/ix86-32/aR5900-32.S @@ -36,9 +36,12 @@ JITCompile: mov ebx, esi shr esi, 16 mov ecx, dword ptr [RECLUT+esi*4] - jmp dword ptr [ecx+ebx*2] - + jmp dword ptr [ecx+ebx] +.global JITCompileInBlock +JITCompileInBlock: + jmp JITCompile + ////////////////////////////////////////////////////////////////////////// // Recompiles the next block, and links the old block directly to it. // This is a on-shot execution for any block which uses it. Once the block @@ -55,10 +58,12 @@ Dispatcher: mov ebx, eax shr eax, 16 mov ecx, dword ptr [RECLUT+eax*4] - mov eax, dword ptr [ecx+ebx*2] + mov eax, dword ptr [ecx+ebx] cmp eax, offset JITCompile je Dispatch_notcompiled + cmp eax, offset JITCompileInBlock + je Dispatch_notcompiled lea ebx, [eax-4] sub ebx, edx mov dword ptr [edx], ebx @@ -67,7 +72,7 @@ Dispatcher: .align 16 Dispatch_notcompiled: mov esi, edx - lea edi, [ecx+ebx*2] + lea edi, [ecx+ebx] push ebx call recRecompile add esp, 4 @@ -92,16 +97,18 @@ DispatcherClear: mov ebx, edx shr edx, 16 mov ecx, dword ptr [RECLUT+edx*4] - mov eax, dword ptr [ecx+ebx*2] + mov eax, dword ptr [ecx+ebx] cmp eax, offset JITCompile je Clear_notcompiled + cmp eax, offset JITCompileInBlock + je Clear_notcompiled add esp, 4 jmp eax .align 16 Clear_notcompiled: - lea edi, [ecx+ebx*2] + lea edi, [ecx+ebx] push ebx call recRecompile add esp, 4 @@ -126,4 +133,4 @@ DispatcherReg: mov ebx, eax shr eax, 16 mov ecx, dword ptr [RECLUT+eax*4] - jmp dword ptr [ecx+ebx*2] + jmp dword ptr [ecx+ebx]