Minor SVN Maintenence; added eol-style:native property to some files missing it.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2162 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-11-08 17:15:52 +00:00
parent a06803d263
commit 921f91d826
6 changed files with 2912 additions and 2912 deletions

View File

@ -15,7 +15,7 @@
#pragma once
//#define mVUdebug // Prints Extra Info to Console
//#define mVUlogProg // Dumps MicroPrograms to \logs\*.html
#define mVUlogProg // Dumps MicroPrograms to \logs\*.html
class AsciiFile;

View File

@ -1,127 +1,127 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 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 PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "Utilities/AsciiFile.h"
// writes text directly to mVU->logFile, no newlines appended.
microVUx(void) __mVULog(const char* fmt, ...) {
microVU* mVU = mVUx;
if (!mVU->logFile) return;
char tmp[2024];
va_list list;
va_start(list, fmt);
// concatenate the log message after the prefix:
int length = vsprintf(tmp, fmt, list);
va_end(list);
mVU->logFile->Write( tmp );
mVU->logFile->Flush();
}
#define commaIf() { if (bitX[6]) { mVUlog(","); bitX[6] = 0; } }
#include "AppConfig.h"
microVUx(void) __mVUdumpProgram(int progIndex) {
microVU* mVU = mVUx;
bool bitX[7];
int delay = 0;
int bBranch = mVUbranch;
int bCode = mVU->code;
int bPC = iPC;
mVUbranch = 0;
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");
mVUlog("<title>microVU%d MicroProgram Log</title>\n", vuIndex);
mVUlog("<body bgcolor=\"#000000\" LINK=\"#1111ff\" VLINK=\"#1111ff\">\n");
mVUlog("<font face=\"Courier New\" color=\"#ffffff\">\n");
mVUlog("<font size=\"5\" color=\"#7099ff\">");
mVUlog("*********************\n<br>", progIndex);
mVUlog("* Micro-Program #%02d *\n<br>", progIndex);
mVUlog("*********************\n\n<br><br>", progIndex);
mVUlog("</font>");
for (u32 i = 0; i < mVU->progSize; i+=2) {
if (delay) { delay--; mVUlog("</font>"); if (!delay) mVUlog("<hr/>"); }
if (mVUbranch) { delay = 1; mVUbranch = 0; }
mVU->code = mVU->prog.prog[progIndex].data[i+1];
bitX[0] = 0;
bitX[1] = 0;
bitX[2] = 0;
bitX[3] = 0;
bitX[4] = 0;
bitX[5] = 0;
bitX[6] = 0;
if (mVU->code & _Ibit_) { bitX[0] = 1; bitX[5] = 1; }
if (mVU->code & _Ebit_) { bitX[1] = 1; bitX[5] = 1; delay = 2; }
if (mVU->code & _Mbit_) { bitX[2] = 1; bitX[5] = 1; }
if (mVU->code & _Dbit_) { bitX[3] = 1; bitX[5] = 1; }
if (mVU->code & _Tbit_) { bitX[4] = 1; bitX[5] = 1; }
if (delay == 2) { mVUlog("<font color=\"#FFFF00\">"); }
if (delay == 1) { mVUlog("<font color=\"#999999\">"); }
iPC = (i+1);
mVUlog("<a name=\"addr%04x\">", i*4);
mVUlog("[%04x] (%08x)</a> ", i*4, mVU->code);
mVUopU(mVU, 2);
if (bitX[5]) {
mVUlog(" (");
if (bitX[0]) { mVUlog("I"); bitX[6] = 1; }
if (bitX[1]) { commaIf(); mVUlog("E"); bitX[6] = 1; }
if (bitX[2]) { commaIf(); mVUlog("M"); bitX[6] = 1; }
if (bitX[3]) { commaIf(); mVUlog("D"); bitX[6] = 1; }
if (bitX[4]) { commaIf(); mVUlog("T"); }
mVUlog(")");
}
iPC = i;
mVU->code = mVU->prog.prog[progIndex].data[i];
if(bitX[0]) {
mVUlog("<br>\n<font color=\"#FF7000\">");
mVUlog("[%04x] (%08x) %f", i*4, mVU->code, *(float*)&mVU->code);
mVUlog("</font>\n\n<br><br>");
}
else {
mVUlog("<br>\n[%04x] (%08x) ", i*4, mVU->code);
mVUopL(mVU, 2);
mVUlog("\n\n<br><br>");
}
}
mVUlog("</font>\n");
mVUlog("</body>\n");
mVUlog("</html>\n");
safe_delete( mVU->logFile );
mVUbranch = bBranch;
mVU->code = bCode;
iPC = bPC;
setCode();
}
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 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 PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "Utilities/AsciiFile.h"
// writes text directly to mVU->logFile, no newlines appended.
microVUx(void) __mVULog(const char* fmt, ...) {
microVU* mVU = mVUx;
if (!mVU->logFile) return;
char tmp[2024];
va_list list;
va_start(list, fmt);
// concatenate the log message after the prefix:
int length = vsprintf(tmp, fmt, list);
va_end(list);
mVU->logFile->Write( tmp );
mVU->logFile->Flush();
}
#define commaIf() { if (bitX[6]) { mVUlog(","); bitX[6] = 0; } }
#include "AppConfig.h"
microVUx(void) __mVUdumpProgram(int progIndex) {
microVU* mVU = mVUx;
bool bitX[7];
int delay = 0;
int bBranch = mVUbranch;
int bCode = mVU->code;
int bPC = iPC;
mVUbranch = 0;
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");
mVUlog("<title>microVU%d MicroProgram Log</title>\n", vuIndex);
mVUlog("<body bgcolor=\"#000000\" LINK=\"#1111ff\" VLINK=\"#1111ff\">\n");
mVUlog("<font face=\"Courier New\" color=\"#ffffff\">\n");
mVUlog("<font size=\"5\" color=\"#7099ff\">");
mVUlog("*********************\n<br>", progIndex);
mVUlog("* Micro-Program #%02d *\n<br>", progIndex);
mVUlog("*********************\n\n<br><br>", progIndex);
mVUlog("</font>");
for (u32 i = 0; i < mVU->progSize; i+=2) {
if (delay) { delay--; mVUlog("</font>"); if (!delay) mVUlog("<hr/>"); }
if (mVUbranch) { delay = 1; mVUbranch = 0; }
mVU->code = mVU->prog.prog[progIndex].data[i+1];
bitX[0] = 0;
bitX[1] = 0;
bitX[2] = 0;
bitX[3] = 0;
bitX[4] = 0;
bitX[5] = 0;
bitX[6] = 0;
if (mVU->code & _Ibit_) { bitX[0] = 1; bitX[5] = 1; }
if (mVU->code & _Ebit_) { bitX[1] = 1; bitX[5] = 1; delay = 2; }
if (mVU->code & _Mbit_) { bitX[2] = 1; bitX[5] = 1; }
if (mVU->code & _Dbit_) { bitX[3] = 1; bitX[5] = 1; }
if (mVU->code & _Tbit_) { bitX[4] = 1; bitX[5] = 1; }
if (delay == 2) { mVUlog("<font color=\"#FFFF00\">"); }
if (delay == 1) { mVUlog("<font color=\"#999999\">"); }
iPC = (i+1);
mVUlog("<a name=\"addr%04x\">", i*4);
mVUlog("[%04x] (%08x)</a> ", i*4, mVU->code);
mVUopU(mVU, 2);
if (bitX[5]) {
mVUlog(" (");
if (bitX[0]) { mVUlog("I"); bitX[6] = 1; }
if (bitX[1]) { commaIf(); mVUlog("E"); bitX[6] = 1; }
if (bitX[2]) { commaIf(); mVUlog("M"); bitX[6] = 1; }
if (bitX[3]) { commaIf(); mVUlog("D"); bitX[6] = 1; }
if (bitX[4]) { commaIf(); mVUlog("T"); }
mVUlog(")");
}
iPC = i;
mVU->code = mVU->prog.prog[progIndex].data[i];
if(bitX[0]) {
mVUlog("<br>\n<font color=\"#FF7000\">");
mVUlog("[%04x] (%08x) %f", i*4, mVU->code, *(float*)&mVU->code);
mVUlog("</font>\n\n<br><br>");
}
else {
mVUlog("<br>\n[%04x] (%08x) ", i*4, mVU->code);
mVUopL(mVU, 2);
mVUlog("\n\n<br><br>");
}
}
mVUlog("</font>\n");
mVUlog("</body>\n");
mVUlog("</html>\n");
safe_delete( mVU->logFile );
mVUbranch = bBranch;
mVU->code = bCode;
iPC = bPC;
setCode();
}

View File

@ -1,217 +1,217 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 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 PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
//------------------------------------------------------------------
// Declarations
//------------------------------------------------------------------
mVUop(mVU_UPPER_FD_00);
mVUop(mVU_UPPER_FD_01);
mVUop(mVU_UPPER_FD_10);
mVUop(mVU_UPPER_FD_11);
mVUop(mVULowerOP);
mVUop(mVULowerOP_T3_00);
mVUop(mVULowerOP_T3_01);
mVUop(mVULowerOP_T3_10);
mVUop(mVULowerOP_T3_11);
mVUop(mVUunknown);
//------------------------------------------------------------------
//------------------------------------------------------------------
// Opcode Tables
//------------------------------------------------------------------
void (*mVULOWER_OPCODE [128])(mP) = {
mVU_LQ , mVU_SQ , mVUunknown , mVUunknown,
mVU_ILW , mVU_ISW , mVUunknown , mVUunknown,
mVU_IADDIU , mVU_ISUBIU , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_FCEQ , mVU_FCSET , mVU_FCAND , mVU_FCOR,
mVU_FSEQ , mVU_FSSET , mVU_FSAND , mVU_FSOR,
mVU_FMEQ , mVUunknown , mVU_FMAND , mVU_FMOR,
mVU_FCGET , mVUunknown , mVUunknown , mVUunknown,
mVU_B , mVU_BAL , mVUunknown , mVUunknown,
mVU_JR , mVU_JALR , mVUunknown , mVUunknown,
mVU_IBEQ , mVU_IBNE , mVUunknown , mVUunknown,
mVU_IBLTZ , mVU_IBGTZ , mVU_IBLEZ , mVU_IBGEZ,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVULowerOP , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
};
void (*mVULowerOP_T3_00_OPCODE [32])(mP) = {
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_MOVE , mVU_LQI , mVU_DIV , mVU_MTIR,
mVU_RNEXT , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVU_MFP , mVU_XTOP , mVU_XGKICK,
mVU_ESADD , mVU_EATANxy , mVU_ESQRT , mVU_ESIN,
};
void (*mVULowerOP_T3_01_OPCODE [32])(mP) = {
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_MR32 , mVU_SQI , mVU_SQRT , mVU_MFIR,
mVU_RGET , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVU_XITOP , mVUunknown,
mVU_ERSADD , mVU_EATANxz , mVU_ERSQRT , mVU_EATAN,
};
void (*mVULowerOP_T3_10_OPCODE [32])(mP) = {
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVU_LQD , mVU_RSQRT , mVU_ILWR,
mVU_RINIT , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_ELENG , mVU_ESUM , mVU_ERCPR , mVU_EEXP,
};
void (*mVULowerOP_T3_11_OPCODE [32])(mP) = {
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVU_SQD , mVU_WAITQ , mVU_ISWR,
mVU_RXOR , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_ERLENG , mVUunknown , mVU_WAITP , mVUunknown,
};
void (*mVULowerOP_OPCODE [64])(mP) = {
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_IADD , mVU_ISUB , mVU_IADDI , mVUunknown,
mVU_IAND , mVU_IOR , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVULowerOP_T3_00, mVULowerOP_T3_01, mVULowerOP_T3_10, mVULowerOP_T3_11,
};
void (*mVU_UPPER_OPCODE [64])(mP) = {
mVU_ADDx , mVU_ADDy , mVU_ADDz , mVU_ADDw,
mVU_SUBx , mVU_SUBy , mVU_SUBz , mVU_SUBw,
mVU_MADDx , mVU_MADDy , mVU_MADDz , mVU_MADDw,
mVU_MSUBx , mVU_MSUBy , mVU_MSUBz , mVU_MSUBw,
mVU_MAXx , mVU_MAXy , mVU_MAXz , mVU_MAXw,
mVU_MINIx , mVU_MINIy , mVU_MINIz , mVU_MINIw,
mVU_MULx , mVU_MULy , mVU_MULz , mVU_MULw,
mVU_MULq , mVU_MAXi , mVU_MULi , mVU_MINIi,
mVU_ADDq , mVU_MADDq , mVU_ADDi , mVU_MADDi,
mVU_SUBq , mVU_MSUBq , mVU_SUBi , mVU_MSUBi,
mVU_ADD , mVU_MADD , mVU_MUL , mVU_MAX,
mVU_SUB , mVU_MSUB , mVU_OPMSUB , mVU_MINI,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_UPPER_FD_00, mVU_UPPER_FD_01, mVU_UPPER_FD_10, mVU_UPPER_FD_11,
};
void (*mVU_UPPER_FD_00_TABLE [32])(mP) = {
mVU_ADDAx , mVU_SUBAx , mVU_MADDAx , mVU_MSUBAx,
mVU_ITOF0 , mVU_FTOI0 , mVU_MULAx , mVU_MULAq,
mVU_ADDAq , mVU_SUBAq , mVU_ADDA , mVU_SUBA,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
};
void (* mVU_UPPER_FD_01_TABLE [32])(mP) = {
mVU_ADDAy , mVU_SUBAy , mVU_MADDAy , mVU_MSUBAy,
mVU_ITOF4 , mVU_FTOI4 , mVU_MULAy , mVU_ABS,
mVU_MADDAq , mVU_MSUBAq , mVU_MADDA , mVU_MSUBA,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
};
void (* mVU_UPPER_FD_10_TABLE [32])(mP) = {
mVU_ADDAz , mVU_SUBAz , mVU_MADDAz , mVU_MSUBAz,
mVU_ITOF12 , mVU_FTOI12 , mVU_MULAz , mVU_MULAi,
mVU_ADDAi , mVU_SUBAi , mVU_MULA , mVU_OPMULA,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
};
void (* mVU_UPPER_FD_11_TABLE [32])(mP) = {
mVU_ADDAw , mVU_SUBAw , mVU_MADDAw , mVU_MSUBAw,
mVU_ITOF15 , mVU_FTOI15 , mVU_MULAw , mVU_CLIP,
mVU_MADDAi , mVU_MSUBAi , mVUunknown , mVU_NOP,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
};
//------------------------------------------------------------------
// Table Functions
//------------------------------------------------------------------
mVUop(mVU_UPPER_FD_00) { mVU_UPPER_FD_00_TABLE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVU_UPPER_FD_01) { mVU_UPPER_FD_01_TABLE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVU_UPPER_FD_10) { mVU_UPPER_FD_10_TABLE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVU_UPPER_FD_11) { mVU_UPPER_FD_11_TABLE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVULowerOP) { mVULowerOP_OPCODE [ (mVU->code & 0x3f) ](mX); }
mVUop(mVULowerOP_T3_00) { mVULowerOP_T3_00_OPCODE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVULowerOP_T3_01) { mVULowerOP_T3_01_OPCODE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVULowerOP_T3_10) { mVULowerOP_T3_10_OPCODE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVULowerOP_T3_11) { mVULowerOP_T3_11_OPCODE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVUopU) { mVU_UPPER_OPCODE [ (mVU->code & 0x3f) ](mX); } // Gets Upper Opcode
mVUop(mVUopL) { mVULOWER_OPCODE [ (mVU->code >> 25) ](mX); } // Gets Lower Opcode
mVUop(mVUunknown) {
pass2 { Console.Error("microVU%d: Unknown Micro VU opcode called (%x) [%04x]\n", getIndex, mVU->code, xPC); }
pass3 { mVUlog("Unknown", mVU->code); }
}
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 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 PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
//------------------------------------------------------------------
// Declarations
//------------------------------------------------------------------
mVUop(mVU_UPPER_FD_00);
mVUop(mVU_UPPER_FD_01);
mVUop(mVU_UPPER_FD_10);
mVUop(mVU_UPPER_FD_11);
mVUop(mVULowerOP);
mVUop(mVULowerOP_T3_00);
mVUop(mVULowerOP_T3_01);
mVUop(mVULowerOP_T3_10);
mVUop(mVULowerOP_T3_11);
mVUop(mVUunknown);
//------------------------------------------------------------------
//------------------------------------------------------------------
// Opcode Tables
//------------------------------------------------------------------
void (*mVULOWER_OPCODE [128])(mP) = {
mVU_LQ , mVU_SQ , mVUunknown , mVUunknown,
mVU_ILW , mVU_ISW , mVUunknown , mVUunknown,
mVU_IADDIU , mVU_ISUBIU , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_FCEQ , mVU_FCSET , mVU_FCAND , mVU_FCOR,
mVU_FSEQ , mVU_FSSET , mVU_FSAND , mVU_FSOR,
mVU_FMEQ , mVUunknown , mVU_FMAND , mVU_FMOR,
mVU_FCGET , mVUunknown , mVUunknown , mVUunknown,
mVU_B , mVU_BAL , mVUunknown , mVUunknown,
mVU_JR , mVU_JALR , mVUunknown , mVUunknown,
mVU_IBEQ , mVU_IBNE , mVUunknown , mVUunknown,
mVU_IBLTZ , mVU_IBGTZ , mVU_IBLEZ , mVU_IBGEZ,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVULowerOP , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
};
void (*mVULowerOP_T3_00_OPCODE [32])(mP) = {
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_MOVE , mVU_LQI , mVU_DIV , mVU_MTIR,
mVU_RNEXT , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVU_MFP , mVU_XTOP , mVU_XGKICK,
mVU_ESADD , mVU_EATANxy , mVU_ESQRT , mVU_ESIN,
};
void (*mVULowerOP_T3_01_OPCODE [32])(mP) = {
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_MR32 , mVU_SQI , mVU_SQRT , mVU_MFIR,
mVU_RGET , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVU_XITOP , mVUunknown,
mVU_ERSADD , mVU_EATANxz , mVU_ERSQRT , mVU_EATAN,
};
void (*mVULowerOP_T3_10_OPCODE [32])(mP) = {
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVU_LQD , mVU_RSQRT , mVU_ILWR,
mVU_RINIT , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_ELENG , mVU_ESUM , mVU_ERCPR , mVU_EEXP,
};
void (*mVULowerOP_T3_11_OPCODE [32])(mP) = {
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVU_SQD , mVU_WAITQ , mVU_ISWR,
mVU_RXOR , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_ERLENG , mVUunknown , mVU_WAITP , mVUunknown,
};
void (*mVULowerOP_OPCODE [64])(mP) = {
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_IADD , mVU_ISUB , mVU_IADDI , mVUunknown,
mVU_IAND , mVU_IOR , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVULowerOP_T3_00, mVULowerOP_T3_01, mVULowerOP_T3_10, mVULowerOP_T3_11,
};
void (*mVU_UPPER_OPCODE [64])(mP) = {
mVU_ADDx , mVU_ADDy , mVU_ADDz , mVU_ADDw,
mVU_SUBx , mVU_SUBy , mVU_SUBz , mVU_SUBw,
mVU_MADDx , mVU_MADDy , mVU_MADDz , mVU_MADDw,
mVU_MSUBx , mVU_MSUBy , mVU_MSUBz , mVU_MSUBw,
mVU_MAXx , mVU_MAXy , mVU_MAXz , mVU_MAXw,
mVU_MINIx , mVU_MINIy , mVU_MINIz , mVU_MINIw,
mVU_MULx , mVU_MULy , mVU_MULz , mVU_MULw,
mVU_MULq , mVU_MAXi , mVU_MULi , mVU_MINIi,
mVU_ADDq , mVU_MADDq , mVU_ADDi , mVU_MADDi,
mVU_SUBq , mVU_MSUBq , mVU_SUBi , mVU_MSUBi,
mVU_ADD , mVU_MADD , mVU_MUL , mVU_MAX,
mVU_SUB , mVU_MSUB , mVU_OPMSUB , mVU_MINI,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVU_UPPER_FD_00, mVU_UPPER_FD_01, mVU_UPPER_FD_10, mVU_UPPER_FD_11,
};
void (*mVU_UPPER_FD_00_TABLE [32])(mP) = {
mVU_ADDAx , mVU_SUBAx , mVU_MADDAx , mVU_MSUBAx,
mVU_ITOF0 , mVU_FTOI0 , mVU_MULAx , mVU_MULAq,
mVU_ADDAq , mVU_SUBAq , mVU_ADDA , mVU_SUBA,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
};
void (* mVU_UPPER_FD_01_TABLE [32])(mP) = {
mVU_ADDAy , mVU_SUBAy , mVU_MADDAy , mVU_MSUBAy,
mVU_ITOF4 , mVU_FTOI4 , mVU_MULAy , mVU_ABS,
mVU_MADDAq , mVU_MSUBAq , mVU_MADDA , mVU_MSUBA,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
};
void (* mVU_UPPER_FD_10_TABLE [32])(mP) = {
mVU_ADDAz , mVU_SUBAz , mVU_MADDAz , mVU_MSUBAz,
mVU_ITOF12 , mVU_FTOI12 , mVU_MULAz , mVU_MULAi,
mVU_ADDAi , mVU_SUBAi , mVU_MULA , mVU_OPMULA,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
};
void (* mVU_UPPER_FD_11_TABLE [32])(mP) = {
mVU_ADDAw , mVU_SUBAw , mVU_MADDAw , mVU_MSUBAw,
mVU_ITOF15 , mVU_FTOI15 , mVU_MULAw , mVU_CLIP,
mVU_MADDAi , mVU_MSUBAi , mVUunknown , mVU_NOP,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
mVUunknown , mVUunknown , mVUunknown , mVUunknown,
};
//------------------------------------------------------------------
// Table Functions
//------------------------------------------------------------------
mVUop(mVU_UPPER_FD_00) { mVU_UPPER_FD_00_TABLE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVU_UPPER_FD_01) { mVU_UPPER_FD_01_TABLE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVU_UPPER_FD_10) { mVU_UPPER_FD_10_TABLE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVU_UPPER_FD_11) { mVU_UPPER_FD_11_TABLE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVULowerOP) { mVULowerOP_OPCODE [ (mVU->code & 0x3f) ](mX); }
mVUop(mVULowerOP_T3_00) { mVULowerOP_T3_00_OPCODE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVULowerOP_T3_01) { mVULowerOP_T3_01_OPCODE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVULowerOP_T3_10) { mVULowerOP_T3_10_OPCODE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVULowerOP_T3_11) { mVULowerOP_T3_11_OPCODE [((mVU->code >> 6) & 0x1f)](mX); }
mVUop(mVUopU) { mVU_UPPER_OPCODE [ (mVU->code & 0x3f) ](mX); } // Gets Upper Opcode
mVUop(mVUopL) { mVULOWER_OPCODE [ (mVU->code >> 25) ](mX); } // Gets Lower Opcode
mVUop(mVUunknown) {
pass2 { Console.Error("microVU%d: Unknown Micro VU opcode called (%x) [%04x]\n", getIndex, mVU->code, xPC); }
pass3 { mVUlog("Unknown", mVU->code); }
}

File diff suppressed because it is too large Load Diff

View File

@ -1,56 +1,56 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 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 PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define REC_VUOP(VU, f) { \
_freeXMMregs(/*&VU*/); \
_freeMMXregs(); \
SetFPUstate();) \
MOV32ItoM((uptr)&VU.code, (u32)VU.code); \
CALLFunc((uptr)VU##MI_##f); \
}
#define REC_VUOPs(VU, f) { \
_freeXMMregs(); \
_freeMMXregs(); \
SetFPUstate();) \
if (VU==&VU1) { \
MOV32ItoM((uptr)&VU1.code, (u32)VU1.code); \
CALLFunc((uptr)VU1MI_##f); \
} \
else { \
MOV32ItoM((uptr)&VU0.code, (u32)VU0.code); \
CALLFunc((uptr)VU0MI_##f); \
} \
}
#define REC_VUOPFLAGS(VU, f) { \
_freeXMMregs(/*&VU*/); \
_freeMMXregs(); \
SetFPUstate(); \
MOV32ItoM((uptr)&VU.code, (u32)VU.code); \
CALLFunc((uptr)VU##MI_##f); \
}
#define REC_VUBRANCH(VU, f) { \
_freeXMMregs(/*&VU*/); \
_freeMMXregs(); \
SetFPUstate(); \
MOV32ItoM((uptr)&VU.code, (u32)VU.code); \
MOV32ItoM((uptr)&VU.VI[REG_TPC].UL, (u32)pc); \
CALLFunc((uptr)VU##MI_##f); \
branch = 1; \
}
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 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 PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define REC_VUOP(VU, f) { \
_freeXMMregs(/*&VU*/); \
_freeMMXregs(); \
SetFPUstate();) \
MOV32ItoM((uptr)&VU.code, (u32)VU.code); \
CALLFunc((uptr)VU##MI_##f); \
}
#define REC_VUOPs(VU, f) { \
_freeXMMregs(); \
_freeMMXregs(); \
SetFPUstate();) \
if (VU==&VU1) { \
MOV32ItoM((uptr)&VU1.code, (u32)VU1.code); \
CALLFunc((uptr)VU1MI_##f); \
} \
else { \
MOV32ItoM((uptr)&VU0.code, (u32)VU0.code); \
CALLFunc((uptr)VU0MI_##f); \
} \
}
#define REC_VUOPFLAGS(VU, f) { \
_freeXMMregs(/*&VU*/); \
_freeMMXregs(); \
SetFPUstate(); \
MOV32ItoM((uptr)&VU.code, (u32)VU.code); \
CALLFunc((uptr)VU##MI_##f); \
}
#define REC_VUBRANCH(VU, f) { \
_freeXMMregs(/*&VU*/); \
_freeMMXregs(); \
SetFPUstate(); \
MOV32ItoM((uptr)&VU.code, (u32)VU.code); \
MOV32ItoM((uptr)&VU.VI[REG_TPC].UL, (u32)pc); \
CALLFunc((uptr)VU##MI_##f); \
branch = 1; \
}

File diff suppressed because it is too large Load Diff