- Added microVU_Flags.inl to the project file (somewhere along the lines it went missing)

- Fixed sVU COP2 to compile correctly (when disabling mVU Macro)
- Fixed minor mVU debug/logging bugs
- Made mVU0 exit execution every ~768 cycles which fixes Rachet and Clank hanging (mVU0 already did this before when the m-bit was set, but now it does it all the time even when the m-bit isn't set; other games might be effected by this change...)


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2158 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2009-11-08 03:13:31 +00:00
parent 3c54e2ba75
commit 61b2ab7583
7 changed files with 49 additions and 58 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1253"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Version="9.00"
Name="pcsx2"
ProjectGUID="{1CEFD830-2B76-4596-A4EE-BCD7280A60BD}"
RootNamespace="pcsx2"
@ -663,6 +663,10 @@
RelativePath="..\..\x86\microVU_Execute.inl"
>
</File>
<File
RelativePath="..\..\x86\microVU_Flags.inl"
>
</File>
<File
RelativePath="..\..\x86\microVU_IR.h"
>

View File

@ -26,7 +26,7 @@
#include "R5900OpcodeTables.h"
#include "VUmicro.h"
#include "sVU_Micro.h"
using namespace x86Emitter;
extern void _vu0WaitMicro();
#ifndef CHECK_MACROVU0

View File

@ -20,9 +20,7 @@
#include "VU.h"
#include "GS.h"
#include "x86emitter/x86emitter.h"
using namespace x86Emitter;
#include "microVU.h"
//------------------------------------------------------------------
@ -32,35 +30,37 @@ using namespace x86Emitter;
__aligned16 microVU microVU0;
__aligned16 microVU microVU1;
#define __four(val) { val, val, val, val }
const __aligned(32) mVU_Globals mVUglob =
{
// absclip / signbit
// minvals / maxlavs
__four( 0x7fffffff ), __four( 0x80000000 ),
__four( 0xff7fffff ), __four( 0x7f7fffff ),
__four( 0x3f800000 ), // ONE!
__four( 0x3f490fdb ), // PI4!
// T1 T2 T3 T4
// T5 T6 T7 T8
__four( 0x3f7ffff5 ), __four( 0xbeaaa61c ), __four( 0x3e4c40a6 ), __four( 0xbe0e6c63 ),
__four( 0x3dc577df ), __four( 0xbd6501c4 ), __four( 0x3cb31652 ), __four( 0xbb84d7e7 ),
// S2 S3 S4 S5
__four( 0xbe2aaaa4 ), __four( 0x3c08873e ), __four( 0xb94fb21f ), __four( 0x362e9c14 ),
// E1 E2 E3
// E4 E5 E6
__four( 0x3e7fffa8 ), __four( 0x3d0007f4 ), __four( 0x3b29d3ff ),
__four( 0x3933e553 ), __four( 0x36b63510 ), __four( 0x353961ac ),
// FTOI_4 / 12 / 15
// ITOF_4 / 12 / 15
__four( 16.0 ), __four( 4096.0 ), __four( 32768.0 ),
__four( 0.0625f ), __four( 0.000244140625 ), __four( 0.000030517578125 )
const __aligned(32) mVU_Globals mVUglob = {
__four(0x7fffffff), // absclip
__four(0x80000000), // signbit
__four(0xff7fffff), // minvals
__four(0x7f7fffff), // maxvals
__four(0x3f800000), // ONE!
__four(0x3f490fdb), // PI4!
__four(0x3f7ffff5), // T1
__four(0xbeaaa61c), // T5
__four(0x3e4c40a6), // T2
__four(0xbe0e6c63), // T3
__four(0x3dc577df), // T4
__four(0xbd6501c4), // T6
__four(0x3cb31652), // T7
__four(0xbb84d7e7), // T8
__four(0xbe2aaaa4), // S2
__four(0x3c08873e), // S3
__four(0xb94fb21f), // S4
__four(0x362e9c14), // S5
__four(0x3e7fffa8), // E1
__four(0x3d0007f4), // E2
__four(0x3b29d3ff), // E3
__four(0x3933e553), // E4
__four(0x36b63510), // E5
__four(0x353961ac), // E6
__four(16.0), // FTOI_4
__four(4096.0), // FTOI_12
__four(32768.0), // FTOI_15
__four(0.0625f), // ITOF_4
__four(0.000244140625), // ITOF_12
__four(0.000030517578125) // ITOF_15
};
//------------------------------------------------------------------

View File

@ -288,12 +288,12 @@ microVUt(void) mVUtestCycles(mV) {
SUB32ItoM((uptr)&mVU->cycles, mVUcycles);
if (IsDevBuild || !isVU1) {
u32* jmp32 = JG32(0);
if (!isVU1) { TEST32ItoM((uptr)&mVU->regs->flags, VUFLAG_MFLAGSET); vu0jmp = JZ32(0); }
//if (!isVU1) { TEST32ItoM((uptr)&mVU->regs->flags, VUFLAG_MFLAGSET); vu0jmp = JZ32(0); }
MOV32ItoR(gprT2, (uptr)mVU);
if (isVU1) CALLFunc((uptr)mVUwarning1);
//else CALLFunc((uptr)mVUwarning0); // VU0 is allowed early exit for COP2 Interlock Simulation
mVUendProgram(mVU, NULL, 0);
if (!isVU1) x86SetJ32(vu0jmp);
//if (!isVU1) x86SetJ32(vu0jmp);
x86SetJ32(jmp32);
}
}
@ -342,7 +342,6 @@ microVUr(void*) mVUcompile(microVU* mVU, u32 startPC, uptr pState) {
mVUsetupRange(mVU, startPC, 1); // Setup Program Bounds/Range
mVU->regAlloc->reset(); // Reset regAlloc
mVUinitFirstPass(mVU, pState, thisPtr);
for (int branch = 0; mVUcount < endCount; mVUcount++) {
incPC(1);
startLoop(mVU);

View File

@ -103,7 +103,7 @@ void mVUdispatcherB(mV) {
microVUx(void*) __fastcall mVUexecute(u32 startPC, u32 cycles) {
microVU* mVU = mVUx;
//mVUprint("microVU%x: startPC = 0x%x, cycles = 0x%x", vuIndex, startPC, cycles);
mVUprint("microVU%x: startPC = 0x%x, cycles = 0x%x", vuIndex, startPC, cycles);
mVUsearchProg<vuIndex>(); // Find and set correct program
mVU->cycles = cycles;

View File

@ -48,7 +48,7 @@ microVUx(void) __mVUdumpProgram(int progIndex) {
int bPC = iPC;
mVUbranch = 0;
const wxString logname( wxsFormat( L"microVU%d prog - %02d.html", L"logs", vuIndex, progIndex) );
const wxString logname( wxsFormat( L"microVU%d prog - %02d.html", vuIndex, progIndex) );
mVU->logFile = new AsciiFile( Path::Combine( g_Conf->Folders.Logs, logname), L"w" );
mVUlog("<html>\n");

View File

@ -19,28 +19,15 @@
// Global Variables
//------------------------------------------------------------------
struct mVU_Globals
{
u32 absclip[4], signbit[4],
minvals[4], maxvals[4];
struct mVU_Globals {
u32 absclip[4], signbit[4], minvals[4], maxvals[4];
u32 one[4];
u32 Pi4[4];
u32 T1[4], T2[4], T3[4], T4[4],
T5[4], T6[4], T7[4], T8[4];
u32 T1[4], T2[4], T3[4], T4[4], T5[4], T6[4], T7[4], T8[4];
u32 S2[4], S3[4], S4[4], S5[4];
u32 E1[4], E2[4], E3[4],
E4[4], E5[4], E6[4];
float FTOI_4[4],
FTOI_12[4],
FTOI_15[4];
float ITOF_4[4],
ITOF_12[4],
ITOF_15[4];
u32 E1[4], E2[4], E3[4], E4[4], E5[4], E6[4];
float FTOI_4[4], FTOI_12[4], FTOI_15[4];
float ITOF_4[4], ITOF_12[4], ITOF_15[4];
};
extern const __aligned(32) mVU_Globals mVUglob;
@ -169,6 +156,7 @@ typedef u32 (__fastcall *mVUCall)(void*, void*);
#endif
// Misc Macros...
#define __four(val) { val, val, val, val }
#define mVUprogI mVU->prog.prog[progIndex]
#define mVUcurProg mVU->prog.prog[mVU->prog.cur]
#define mVUblocks mVU->prog.prog[mVU->prog.cur].block
@ -241,7 +229,7 @@ typedef u32 (__fastcall *mVUCall)(void*, void*);
// Debug Stuff...
#ifdef mVUdebug
#define mVUprint Console.Status
#define mVUprint Console.WriteLn
#else
#define mVUprint 0&&
#endif