Linux: Quick fixes to the new .S files, and did a mild cleanup of the recLUT macros.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@688 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-03-05 18:27:16 +00:00
parent 482505d241
commit 8092692047
6 changed files with 44 additions and 46 deletions

View File

@ -16,11 +16,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define _SECURE_SCL 0
#include "PrecompiledHeader.h"
#include "BaseblockEx.h"
#define _SECURE_SCL 0
#include <vector>
using namespace std;

View File

@ -56,7 +56,12 @@ struct BASEBLOCKEX
// x * (sizeof(BASEBLOCK) / 4) sacrifices safety for speed compared to
// x / 4 * sizeof(BASEBLOCK) or a higher level approach.
#define PC_GETBLOCK_(x, reclut) ((BASEBLOCK*)(reclut[((u32)(x)) >> 16] + (x)*(sizeof(BASEBLOCK)/4)))
#define RECLUT_SETPAGE(reclut, page, p) do { reclut[page] = (uptr)(p) - ((page) << 14) * sizeof(BASEBLOCK); } while (0)
static void recLUT_SetPage( uptr reclut[0x10000], uint page, void* mapping )
{
jASSUME( page < 0x10000 );
reclut[page] = ((uptr)mapping) - ((page << 14) * sizeof(BASEBLOCK));
}
// This is needed because of the retarded GETBLOCK macro above.
C_ASSERT( sizeof(BASEBLOCK) == 8 );

View File

@ -8,11 +8,14 @@
// function names and the following two defines should ever differ:
#define REGINFO psxRegs
#define RECLUT psxRecLUT
#define PCOFFSET 0x208 // this must always match what Pcsx2 displays at startup
//////////////////////////////////////////////////////////////////////////
// Preprocessor Mess!
.extern REGINFO
.extern RECLUT
.extern iopRecRecompile
#define BLOCKTYPE_STARTPC 4 // startpc offset
@ -32,7 +35,7 @@ iopJITCompile:
add esp, 4
mov ebx, esi
shr esi, 16
mov ecx, dword ptr [recLUT+esi*4]
mov ecx, dword ptr [RECLUT+esi*4]
jmp dword ptr [ecx+ebx*2]
@ -51,7 +54,7 @@ iopDispatcher:
mov eax, dword ptr [REGINFO + PCOFFSET]
mov ebx, eax
shr eax, 16
mov ecx, dword ptr [recLUT+eax*4]
mov ecx, dword ptr [RECLUT+eax*4]
mov eax, dword ptr [ecx+ebx*2]
cmp eax, offset JITCompile
@ -88,7 +91,7 @@ iopDispatcherClear:
mov ebx, edx
shr edx, 16
mov ecx, dword ptr [recLUT+edx*4]
mov ecx, dword ptr [RECLUT+edx*4]
mov eax, dword ptr [ecx+ebx*2]
cmp eax, offset JITCompile
@ -122,5 +125,5 @@ iopDispatcherReg:
mov eax, dword ptr [REGINFO + PCOFFSET]
mov ebx, eax
shr eax, 16
mov ecx, dword ptr [recLUT+eax*4]
mov ecx, dword ptr [RECLUT+eax*4]
jmp dword ptr [ecx+ebx*2]

View File

@ -590,23 +590,23 @@ void recResetIOP()
// 0x80 comes from : (Ps2MemSize::IopRam / 0x10000) * 4
for (int i=0; i<0x80; i++)
{
RECLUT_SETPAGE(psxRecLUT, i + 0x0000, &recRAM[(i & 0x1f) << 14]);
RECLUT_SETPAGE(psxRecLUT, i + 0x8000, &recRAM[(i & 0x1f) << 14]);
RECLUT_SETPAGE(psxRecLUT, i + 0xa000, &recRAM[(i & 0x1f) << 14]);
recLUT_SetPage(psxRecLUT, i + 0x0000, &recRAM[(i & 0x1f) << 14]);
recLUT_SetPage(psxRecLUT, i + 0x8000, &recRAM[(i & 0x1f) << 14]);
recLUT_SetPage(psxRecLUT, i + 0xa000, &recRAM[(i & 0x1f) << 14]);
}
for (int i=0; i<(Ps2MemSize::Rom / 0x10000); i++)
{
RECLUT_SETPAGE(psxRecLUT, i + 0x1fc0, &recROM[i << 14]);
RECLUT_SETPAGE(psxRecLUT, i + 0x9fc0, &recROM[i << 14]);
RECLUT_SETPAGE(psxRecLUT, i + 0xbfc0, &recROM[i << 14]);
recLUT_SetPage(psxRecLUT, i + 0x1fc0, &recROM[i << 14]);
recLUT_SetPage(psxRecLUT, i + 0x9fc0, &recROM[i << 14]);
recLUT_SetPage(psxRecLUT, i + 0xbfc0, &recROM[i << 14]);
}
for (int i=0; i<(Ps2MemSize::Rom1 / 0x10000); i++)
{
RECLUT_SETPAGE(psxRecLUT, i + 0x1e00, &recROM1[i << 14]);
RECLUT_SETPAGE(psxRecLUT, i + 0x9e00, &recROM1[i << 14]);
RECLUT_SETPAGE(psxRecLUT, i + 0xbe00, &recROM1[i << 14]);
recLUT_SetPage(psxRecLUT, i + 0x1e00, &recROM1[i << 14]);
recLUT_SetPage(psxRecLUT, i + 0x9e00, &recROM1[i << 14]);
recLUT_SetPage(psxRecLUT, i + 0xbe00, &recROM1[i << 14]);
}
if( s_pInstCache )

View File

@ -8,12 +8,14 @@
// function names and the following two defines should ever differ:
#define REGINFO cpuRegs
#define RECLUT recLUT
#define PCOFFSET 0x2a8 // this must always match what Pcsx2 displays at startup
//////////////////////////////////////////////////////////////////////////
// Preprocessor Mess!
.extern REGINFO
.extern RECLUT
.extern recRecompile
#define BLOCKTYPE_STARTPC 4 // startpc offset
@ -33,7 +35,7 @@ JITCompile:
add esp, 4
mov ebx, esi
shr esi, 16
mov ecx, dword ptr [recLUT+esi*4]
mov ecx, dword ptr [RECLUT+esi*4]
jmp dword ptr [ecx+ebx*2]
@ -52,7 +54,7 @@ Dispatcher:
mov eax, dword ptr [REGINFO + PCOFFSET]
mov ebx, eax
shr eax, 16
mov ecx, dword ptr [recLUT+eax*4]
mov ecx, dword ptr [RECLUT+eax*4]
mov eax, dword ptr [ecx+ebx*2]
cmp eax, offset JITCompile
@ -89,7 +91,7 @@ DispatcherClear:
mov ebx, edx
shr edx, 16
mov ecx, dword ptr [recLUT+edx*4]
mov ecx, dword ptr [RECLUT+edx*4]
mov eax, dword ptr [ecx+ebx*2]
cmp eax, offset JITCompile
@ -123,5 +125,5 @@ DispatcherReg:
mov eax, dword ptr [REGINFO + PCOFFSET]
mov ebx, eax
shr eax, 16
mov ecx, dword ptr [recLUT+eax*4]
mov ecx, dword ptr [RECLUT+eax*4]
jmp dword ptr [ecx+ebx*2]

View File

@ -556,28 +556,28 @@ void recResetEE( void )
for ( int i = 0x0000; i < 0x0200; i++ )
{
RECLUT_SETPAGE(recLUT, i + 0x0000, &recRAM[ i << 14 ]);
RECLUT_SETPAGE(recLUT, i + 0x2000, &recRAM[ i << 14 ]);
RECLUT_SETPAGE(recLUT, i + 0x3000, &recRAM[ i << 14 ]);
RECLUT_SETPAGE(recLUT, i + 0x8000, &recRAM[ i << 14 ]);
RECLUT_SETPAGE(recLUT, i + 0xa000, &recRAM[ i << 14 ]);
RECLUT_SETPAGE(recLUT, i + 0xb000, &recRAM[ i << 14 ]);
RECLUT_SETPAGE(recLUT, i + 0xc000, &recRAM[ i << 14 ]);
RECLUT_SETPAGE(recLUT, i + 0xd000, &recRAM[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0x0000, &recRAM[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0x2000, &recRAM[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0x3000, &recRAM[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0x8000, &recRAM[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0xa000, &recRAM[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0xb000, &recRAM[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0xc000, &recRAM[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0xd000, &recRAM[ i << 14 ]);
}
for ( int i = 0x0000; i < 0x0040; i++ )
{
RECLUT_SETPAGE(recLUT, i + 0x1fc0, &recROM[ i << 14 ]);
RECLUT_SETPAGE(recLUT, i + 0x9fc0, &recROM[ i << 14 ]);
RECLUT_SETPAGE(recLUT, i + 0xbfc0, &recROM[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0x1fc0, &recROM[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0x9fc0, &recROM[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0xbfc0, &recROM[ i << 14 ]);
}
for ( int i = 0x0000; i < 0x0004; i++ )
{
RECLUT_SETPAGE(recLUT, i + 0x1e00, &recROM1[ i << 14 ]);
RECLUT_SETPAGE(recLUT, i + 0x9e00, &recROM1[ i << 14 ]);
RECLUT_SETPAGE(recLUT, i + 0xbe00, &recROM1[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0x1e00, &recROM1[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0x9e00, &recROM1[ i << 14 ]);
recLUT_SetPage(recLUT, i + 0xbe00, &recROM1[ i << 14 ]);
}
// drk||Raziel says this is useful but I'm not sure why. Something to do with forward jumps.
@ -1244,18 +1244,6 @@ static void checkcodefn()
assert(0);
}
//#ifdef _DEBUG
//#define CHECK_XMMCHANGED() CALLFunc((uptr)checkxmmchanged);
//#else
//#define CHECK_XMMCHANGED()
//#endif
//
//static void checkxmmchanged()
//{
// assert( !g_globalMMXSaved );
// assert( !g_globalXMMSaved );
//}
u32 recompileCodeSafe(u32 temppc)
{
BASEBLOCK* pblock = PC_GETBLOCK(temppc);