mirror of https://github.com/PCSX2/pcsx2.git
Replaced more SysPrintf's with Console:: functions then I want to think about. A few minor changes in passing, mainly format-related.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@843 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
5969bcc621
commit
4ea9d9292f
|
@ -254,7 +254,7 @@ FILE *_cdvdOpenMechaVer() {
|
|||
// if file doesnt exist, create empty one
|
||||
fd = fopen(file, "r+b");
|
||||
if (fd == NULL) {
|
||||
SysPrintf("MEC File Not Found , Creating Blank File\n");
|
||||
Console::Notice("MEC File Not Found , Creating Blank File");
|
||||
fd = fopen(file, "wb");
|
||||
if (fd == NULL) {
|
||||
Msgbox::Alert("_cdvdOpenMechaVer: Error creating %s", params file);
|
||||
|
@ -299,7 +299,7 @@ FILE *_cdvdOpenNVM() {
|
|||
// if file doesnt exist, create empty one
|
||||
fd = fopen(file, "r+b");
|
||||
if (fd == NULL) {
|
||||
SysPrintf("NVM File Not Found , Creating Blank File\n");
|
||||
Console::Notice("NVM File Not Found , Creating Blank File");
|
||||
fd = fopen(file, "wb");
|
||||
if (fd == NULL) {
|
||||
Msgbox::Alert("_cdvdOpenNVM: Error creating %s", params file);
|
||||
|
@ -565,7 +565,7 @@ s32 cdvdGetToc(void* toc)
|
|||
//the code below handles only CdGetToc!
|
||||
//if(cdvd.Param[0]==0x01)
|
||||
//{
|
||||
SysPrintf("CDGetToc Param[0]=%d, Param[1]=%d\n",cdvd.Param[0],cdvd.Param[1]);
|
||||
Console::WriteLn("CDGetToc Param[0]=%d, Param[1]=%d", params cdvd.Param[0],cdvd.Param[1]);
|
||||
//}
|
||||
type = CDVDgetDiskType();
|
||||
if (CDVDgetTN(&diskInfo) == -1) { diskInfo.etrack = 0;diskInfo.strack = 1; }
|
||||
|
@ -914,7 +914,7 @@ int cdvdReadSector() {
|
|||
// be more correct. (air)
|
||||
psxCpu->Clear( HW_DMA3_MADR, cdvd.BlockSize/4 );
|
||||
|
||||
// SysPrintf("sector %x;%x;%x\n", PSXMu8(madr+0), PSXMu8(madr+1), PSXMu8(madr+2));
|
||||
// Console::WriteLn("sector %x;%x;%x", params PSXMu8(madr+0), PSXMu8(madr+1), PSXMu8(madr+2));
|
||||
|
||||
HW_DMA3_BCR_H16-= (cdvd.BlockSize / (HW_DMA3_BCR_L16*4));
|
||||
HW_DMA3_MADR+= cdvd.BlockSize;
|
||||
|
@ -962,9 +962,9 @@ __forceinline void cdvdActionInterrupt()
|
|||
// inlined due to being referenced in only one place.
|
||||
__forceinline void cdvdReadInterrupt()
|
||||
{
|
||||
//SysPrintf("cdvdReadInterrupt %x %x %x %x %x\n", cpuRegs.interrupt, cdvd.Readed, cdvd.Reading, cdvd.nSectors, (HW_DMA3_BCR_H16 * HW_DMA3_BCR_L16) *4);
|
||||
//Console::WriteLn("cdvdReadInterrupt %x %x %x %x %x", params cpuRegs.interrupt, cdvd.Readed, cdvd.Reading, cdvd.nSectors, (HW_DMA3_BCR_H16 * HW_DMA3_BCR_L16) *4);
|
||||
|
||||
cdvd.Ready = 0x00;
|
||||
cdvd.Ready = 0x00;
|
||||
if (cdvd.Readed == 0)
|
||||
{
|
||||
// Seeking finished. Process the track we requested before, and
|
||||
|
@ -1278,7 +1278,7 @@ u8 cdvdRead39(void) { // KEY-XOR
|
|||
u8 cdvdRead3A(void) { // DEC_SET
|
||||
CDR_LOG("cdvdRead3A(DecSet) %x\n", cdvd.decSet);
|
||||
|
||||
SysPrintf("DecSet Read: %02X\n", cdvd.decSet);
|
||||
Console::WriteLn("DecSet Read: %02X", params cdvd.decSet);
|
||||
return cdvd.decSet;
|
||||
}
|
||||
|
||||
|
@ -1642,7 +1642,7 @@ void cdvdWrite16(u8 rt) // SCOMMAND
|
|||
} else {
|
||||
SetResultSize(1);
|
||||
cdvd.Result[0] = 0x80;
|
||||
SysPrintf("*Unknown Mecacon Command param[0]=%02X\n", cdvd.Param[0]);
|
||||
Console::WriteLn("*Unknown Mecacon Command param[0]=%02X", params cdvd.Param[0]);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1671,9 +1671,9 @@ void cdvdWrite16(u8 rt) // SCOMMAND
|
|||
if(cdvd.Result[3] <= 7) cdvd.Result[5] += 1;
|
||||
cdvd.Result[6] = itob(cdvd.RTC.month)+0x80; //Month
|
||||
cdvd.Result[7] = itob(cdvd.RTC.year); //Year
|
||||
/*SysPrintf("RTC Read Sec %x Min %x Hr %x Day %x Month %x Year %x\n", cdvd.Result[1], cdvd.Result[2],
|
||||
/*Console::WriteLn("RTC Read Sec %x Min %x Hr %x Day %x Month %x Year %x", params cdvd.Result[1], cdvd.Result[2],
|
||||
cdvd.Result[3], cdvd.Result[5], cdvd.Result[6], cdvd.Result[7]);
|
||||
SysPrintf("RTC Read Real Sec %d Min %d Hr %d Day %d Month %d Year %d\n", cdvd.RTC.second, cdvd.RTC.minute,
|
||||
Console::WriteLn("RTC Read Real Sec %d Min %d Hr %d Day %d Month %d Year %d", params cdvd.RTC.second, cdvd.RTC.minute,
|
||||
cdvd.RTC.hour, cdvd.RTC.day, cdvd.RTC.month, cdvd.RTC.year);*/
|
||||
|
||||
break;
|
||||
|
@ -1690,9 +1690,9 @@ void cdvdWrite16(u8 rt) // SCOMMAND
|
|||
if(cdvd.Param[cdvd.ParamP-5] <= 7) cdvd.RTC.day -= 1;
|
||||
cdvd.RTC.month = btoi(cdvd.Param[cdvd.ParamP-2]-0x80);
|
||||
cdvd.RTC.year = btoi(cdvd.Param[cdvd.ParamP-1]);
|
||||
/*SysPrintf("RTC write incomming Sec %x Min %x Hr %x Day %x Month %x Year %x\n", cdvd.Param[cdvd.ParamP-7], cdvd.Param[cdvd.ParamP-6],
|
||||
/*Console::WriteLn("RTC write incomming Sec %x Min %x Hr %x Day %x Month %x Year %x", params cdvd.Param[cdvd.ParamP-7], cdvd.Param[cdvd.ParamP-6],
|
||||
cdvd.Param[cdvd.ParamP-5], cdvd.Param[cdvd.ParamP-3], cdvd.Param[cdvd.ParamP-2], cdvd.Param[cdvd.ParamP-1]);
|
||||
SysPrintf("RTC Write Sec %d Min %d Hr %d Day %d Month %d Year %d\n", cdvd.RTC.second, cdvd.RTC.minute,
|
||||
Console::WriteLn("RTC Write Sec %d Min %d Hr %d Day %d Month %d Year %d", params cdvd.RTC.second, cdvd.RTC.minute,
|
||||
cdvd.RTC.hour, cdvd.RTC.day, cdvd.RTC.month, cdvd.RTC.year);*/
|
||||
//memcpy_fast((u8*)&cdvd.RTC, cdvd.Param, 7);
|
||||
SetResultSize(1);
|
||||
|
@ -1753,7 +1753,7 @@ void cdvdWrite16(u8 rt) // SCOMMAND
|
|||
break;
|
||||
|
||||
case 0x15: // sceCdForbidDVDP (0:1)
|
||||
//SysPrintf("sceCdForbidDVDP\n");
|
||||
//Console::WriteLn("sceCdForbidDVDP");
|
||||
SetResultSize(1);
|
||||
cdvd.Result[0] = 5;
|
||||
break;
|
||||
|
@ -1778,7 +1778,7 @@ void cdvdWrite16(u8 rt) // SCOMMAND
|
|||
|
||||
case 0x1A: // sceCdBootCertify (4:1)//(4:16 in psx?)
|
||||
SetResultSize(1);//on input there are 4 bytes: 1;?10;J;C for 18000; 1;60;E;C for 39002 from ROMVER
|
||||
cdvd.Result[0]=1;//i guess that means okay
|
||||
cdvd.Result[0] = 1;//i guess that means okay
|
||||
break;
|
||||
|
||||
case 0x1B: // sceCdCancelPOffRdy (0:1) - Call73 from Xcdvdman (1:1)
|
||||
|
@ -1886,7 +1886,7 @@ void cdvdWrite16(u8 rt) // SCOMMAND
|
|||
SetResultSize(15);
|
||||
cdvdGetMechaVer(&cdvd.Result[1]);
|
||||
cdvd.Result[0] = cdvdReadRegionParams(&cdvd.Result[3]);//size==8
|
||||
SysPrintf("REGION PARAMS = %s %s\n", mg_zones[cdvd.Result[1]], &cdvd.Result[3]);
|
||||
Console::WriteLn("REGION PARAMS = %s %s", params mg_zones[cdvd.Result[1]], &cdvd.Result[3]);
|
||||
cdvd.Result[1] = 1 << cdvd.Result[1]; //encryption zone; see offset 0x1C in encrypted headers
|
||||
//////////////////////////////////////////
|
||||
cdvd.Result[2] = 0; //??
|
||||
|
@ -2063,7 +2063,7 @@ void cdvdWrite16(u8 rt) // SCOMMAND
|
|||
if (cdvd.mg_buffer[bit_ofs+5] || cdvd.mg_buffer[bit_ofs+6] || cdvd.mg_buffer[bit_ofs+7])goto fail_pol_cal;
|
||||
if (cdvd.mg_buffer[bit_ofs+4] * 16 + bit_ofs + 8 + 16 != *(u16*)&cdvd.mg_buffer[0x14]){
|
||||
fail_pol_cal:
|
||||
SysPrintf("[MG] ERROR - Make sure the file is already decrypted!!!\n");
|
||||
Console::Error("[MG] ERROR - Make sure the file is already decrypted!!!");
|
||||
cdvd.Result[0] = 0x80;
|
||||
break;
|
||||
}
|
||||
|
@ -2074,7 +2074,7 @@ fail_pol_cal:
|
|||
case 0x90: // sceMgWriteHeaderStart
|
||||
cdvd.mg_size = 0;
|
||||
cdvd.mg_datatype = 1;//header data
|
||||
SysPrintf("[MG] hcode=%d cnum=%d a2=%d length=0x%X\n",
|
||||
Console::WriteLn("[MG] hcode=%d cnum=%d a2=%d length=0x%X", params
|
||||
cdvd.Param[0], cdvd.Param[3], cdvd.Param[4], cdvd.mg_maxsize = cdvd.Param[1] | (((int)cdvd.Param[2])<<8));
|
||||
SetResultSize(1);//in:5
|
||||
cdvd.Result[0] = 0; // 0 complete ; 1 busy ; 0x80 error
|
||||
|
@ -2088,7 +2088,7 @@ fail_pol_cal:
|
|||
}
|
||||
cdvd.mg_maxsize = 0; // don't allow any write
|
||||
cdvd.mg_size = 8+16*cdvd.mg_buffer[4];//new offset, i just moved the data
|
||||
SysPrintf("[MG] BIT count=%d\n", cdvd.mg_buffer[4]);
|
||||
Console::WriteLn("[MG] BIT count=%d", params cdvd.mg_buffer[4]);
|
||||
|
||||
cdvd.Result[0] = cdvd.mg_datatype==1 ? 0 : 0x80; // 0 complete ; 1 busy ; 0x80 error
|
||||
cdvd.Result[1] = (cdvd.mg_size >> 0) & 0xFF;
|
||||
|
@ -2143,7 +2143,7 @@ fail_pol_cal:
|
|||
|
||||
default:
|
||||
// fake a 'correct' command
|
||||
SysPrintf("SCMD Unknown %x\n", rt);
|
||||
Console::WriteLn("SCMD Unknown %x", params rt);
|
||||
SetResultSize(1); //in:0
|
||||
cdvd.Result[0] = 0; // 0 complete ; 1 busy ; 0x80 error
|
||||
break;
|
||||
|
@ -2163,11 +2163,11 @@ void cdvdWrite17(u8 rt) { // SDATAIN
|
|||
|
||||
void cdvdWrite18(u8 rt) { // SDATAOUT
|
||||
CDR_LOG("cdvdWrite18(SDataOut) %x\n", rt);
|
||||
SysPrintf("*PCSX2* SDATAOUT\n");
|
||||
Console::WriteLn("*PCSX2* SDATAOUT");
|
||||
}
|
||||
|
||||
void cdvdWrite3A(u8 rt) { // DEC-SET
|
||||
CDR_LOG("cdvdWrite3A(DecSet) %x\n", rt);
|
||||
cdvd.decSet = rt;
|
||||
SysPrintf("DecSet Write: %02X\n", cdvd.decSet);
|
||||
Console::WriteLn("DecSet Write: %02X", params cdvd.decSet);
|
||||
}
|
|
@ -362,7 +362,7 @@ int CDVD_findfile(const char* fname, TocEntry* tocEntry){
|
|||
current_sector++;
|
||||
if (CdRead(current_sector,1,toc,&cdReadMode) != TRUE)
|
||||
{
|
||||
SysPrintf("Couldn't Read from CD !\n");
|
||||
Console::Error("Couldn't Read from CD !");
|
||||
return -1;
|
||||
}
|
||||
// CdSync(0x00);
|
||||
|
|
|
@ -87,7 +87,7 @@ void MapTLB(int i)
|
|||
|
||||
void UnmapTLB(int i)
|
||||
{
|
||||
//SysPrintf("Clear TLB %d: %08x-> [%08x %08x] S=%d G=%d ASID=%d Mask= %03X\n",i,tlb[i].VPN2,tlb[i].PFN0,tlb[i].PFN1,tlb[i].S,tlb[i].G,tlb[i].ASID,tlb[i].Mask);
|
||||
//Console::WriteLn("Clear TLB %d: %08x-> [%08x %08x] S=%d G=%d ASID=%d Mask= %03X", params i,tlb[i].VPN2,tlb[i].PFN0,tlb[i].PFN1,tlb[i].S,tlb[i].G,tlb[i].ASID,tlb[i].Mask);
|
||||
u32 mask, addr;
|
||||
u32 saddr, eaddr;
|
||||
|
||||
|
@ -102,7 +102,7 @@ void UnmapTLB(int i)
|
|||
mask = ((~tlb[i].Mask) << 1) & 0xfffff;
|
||||
saddr = tlb[i].VPN2 >> 12;
|
||||
eaddr = saddr + tlb[i].Mask + 1;
|
||||
// SysPrintf("Clear TLB: %08x ~ %08x\n",saddr,eaddr-1);
|
||||
// Console::WriteLn("Clear TLB: %08x ~ %08x",params saddr,eaddr-1);
|
||||
for (addr=saddr; addr<eaddr; addr++) {
|
||||
if ((addr & mask) == ((tlb[i].VPN2 >> 12) & mask)) { //match
|
||||
memClearPageAddr(addr << 12);
|
||||
|
@ -115,7 +115,7 @@ void UnmapTLB(int i)
|
|||
mask = ((~tlb[i].Mask) << 1) & 0xfffff;
|
||||
saddr = (tlb[i].VPN2 >> 12) + tlb[i].Mask + 1;
|
||||
eaddr = saddr + tlb[i].Mask + 1;
|
||||
// SysPrintf("Clear TLB: %08x ~ %08x\n",saddr,eaddr-1);
|
||||
// Console::WriteLn("Clear TLB: %08x ~ %08x",params saddr,eaddr-1);
|
||||
for (addr=saddr; addr<eaddr; addr++) {
|
||||
if ((addr & mask) == ((tlb[i].VPN2 >> 12) & mask)) { //match
|
||||
memClearPageAddr(addr << 12);
|
||||
|
@ -308,7 +308,7 @@ void MFC0()
|
|||
if( (_Rd_ != 9) && !_Rt_ ) return;
|
||||
if(_Rd_ != 9) { COP0_LOG("%s\n", disR5900Current.getCString() ); }
|
||||
|
||||
//if(bExecBIOS == FALSE && _Rd_ == 25) SysPrintf("MFC0 _Rd_ %x = %x\n", _Rd_, cpuRegs.CP0.r[_Rd_]);
|
||||
//if(bExecBIOS == FALSE && _Rd_ == 25) Console::WriteLn("MFC0 _Rd_ %x = %x", params _Rd_, cpuRegs.CP0.r[_Rd_]);
|
||||
switch (_Rd_)
|
||||
{
|
||||
case 12:
|
||||
|
@ -332,7 +332,7 @@ void MFC0()
|
|||
cpuRegs.GPR.r[_Rt_].SD[0] = (s32)cpuRegs.PERF.n.pcr1;
|
||||
break;
|
||||
}
|
||||
/*SysPrintf("MFC0 PCCR = %x PCR0 = %x PCR1 = %x IMM= %x\n",
|
||||
/*Console::WriteLn("MFC0 PCCR = %x PCR0 = %x PCR1 = %x IMM= %x", params
|
||||
cpuRegs.PERF.n.pccr, cpuRegs.PERF.n.pcr0, cpuRegs.PERF.n.pcr1, _Imm_ & 0x3F);*/
|
||||
break;
|
||||
|
||||
|
@ -357,11 +357,24 @@ void MFC0()
|
|||
void MTC0()
|
||||
{
|
||||
COP0_LOG("%s\n", disR5900Current.getCString());
|
||||
//if(bExecBIOS == FALSE && _Rd_ == 25) SysPrintf("MTC0 _Rd_ %x = %x\n", _Rd_, cpuRegs.CP0.r[_Rd_]);
|
||||
//if(bExecBIOS == FALSE && _Rd_ == 25) Console::WriteLn("MTC0 _Rd_ %x = %x", params _Rd_, cpuRegs.CP0.r[_Rd_]);
|
||||
switch (_Rd_)
|
||||
{
|
||||
case 9:
|
||||
s_iLastCOP0Cycle = cpuRegs.cycle;
|
||||
cpuRegs.CP0.r[9] = cpuRegs.GPR.r[_Rt_].UL[0];
|
||||
break;
|
||||
|
||||
case 12:
|
||||
WriteCP0Status(cpuRegs.GPR.r[_Rt_].UL[0]);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
Console::WriteLn("MTC0 Breakpoint debug Registers code = %x", params cpuRegs.code & 0x3FF);
|
||||
break;
|
||||
|
||||
case 25:
|
||||
/*if(bExecBIOS == FALSE && _Rd_ == 25) SysPrintf("MTC0 PCCR = %x PCR0 = %x PCR1 = %x IMM= %x\n",
|
||||
/*if(bExecBIOS == FALSE && _Rd_ == 25) Console::WriteLn("MTC0 PCCR = %x PCR0 = %x PCR1 = %x IMM= %x", params
|
||||
cpuRegs.PERF.n.pccr, cpuRegs.PERF.n.pcr0, cpuRegs.PERF.n.pcr1, _Imm_ & 0x3F);*/
|
||||
switch(_Imm_ & 0x3F)
|
||||
{
|
||||
|
@ -383,17 +396,7 @@ void MTC0()
|
|||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 24:
|
||||
Console::WriteLn("MTC0 Breakpoint debug Registers code = %x", params cpuRegs.code & 0x3FF);
|
||||
break;
|
||||
|
||||
case 12: WriteCP0Status(cpuRegs.GPR.r[_Rt_].UL[0]); break;
|
||||
case 9:
|
||||
s_iLastCOP0Cycle = cpuRegs.cycle;
|
||||
cpuRegs.CP0.r[9] = cpuRegs.GPR.r[_Rt_].UL[0];
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
cpuRegs.CP0.r[_Rd_] = cpuRegs.GPR.r[_Rt_].UL[0];
|
||||
break;
|
||||
|
|
|
@ -48,7 +48,7 @@ void BC2F()
|
|||
{
|
||||
if (CP2COND == 0)
|
||||
{
|
||||
SysPrintf("VU0 Macro Branch \n");
|
||||
Console::WriteLn("VU0 Macro Branch");
|
||||
intDoBranch(_BranchTarget_);
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ void BC2T()
|
|||
{
|
||||
if (CP2COND == 1)
|
||||
{
|
||||
SysPrintf("VU0 Macro Branch \n");
|
||||
Console::WriteLn("VU0 Macro Branch");
|
||||
intDoBranch(_BranchTarget_);
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ void BC2FL()
|
|||
{
|
||||
if (CP2COND == 0)
|
||||
{
|
||||
SysPrintf("VU0 Macro Branch \n");
|
||||
Console::WriteLn("VU0 Macro Branch");
|
||||
intDoBranch(_BranchTarget_);
|
||||
}
|
||||
else
|
||||
|
@ -77,7 +77,7 @@ void BC2TL()
|
|||
{
|
||||
if (CP2COND == 1)
|
||||
{
|
||||
SysPrintf("VU0 Macro Branch \n");
|
||||
Console::WriteLn("VU0 Macro Branch");
|
||||
intDoBranch(_BranchTarget_);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -456,7 +456,7 @@ __forceinline bool rcntUpdate_vSync()
|
|||
if( vblankinc > 1 )
|
||||
{
|
||||
if( hsc != vSyncInfo.hScanlinesPerFrame )
|
||||
SysPrintf( " ** vSync > Abnormal Scanline Count: %d\n", hsc );
|
||||
Console::WriteLn( " ** vSync > Abnormal Scanline Count: %d", params hsc );
|
||||
hsc = 0;
|
||||
vblankinc = 0;
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ using namespace std; // for min / max
|
|||
// If we have an infinity value, then Overflow has occured.
|
||||
#define checkOverflow(xReg, cFlagsToSet, shouldReturn) { \
|
||||
if ( ( xReg & ~0x80000000 ) == PosInfinity ) { \
|
||||
/*SysPrintf( "FPU OVERFLOW!: Changing to +/-Fmax!!!!!!!!!!!!\n" );*/ \
|
||||
/*Console::Notice( "FPU OVERFLOW!: Changing to +/-Fmax!!!!!!!!!!!!\n" );*/ \
|
||||
xReg = ( xReg & 0x80000000 ) | posFmax; \
|
||||
_ContVal_ |= cFlagsToSet; \
|
||||
if ( shouldReturn ) { return; } \
|
||||
|
@ -93,7 +93,7 @@ using namespace std; // for min / max
|
|||
// If we have a denormal value, then Underflow has occured.
|
||||
#define checkUnderflow(xReg, cFlagsToSet, shouldReturn) { \
|
||||
if ( ( ( xReg & 0x7F800000 ) == 0 ) && ( ( xReg & 0x007FFFFF ) != 0 ) ) { \
|
||||
/*SysPrintf( "FPU UNDERFLOW!: Changing to +/-0!!!!!!!!!!!!\n" );*/ \
|
||||
/*Console::Notice( "FPU UNDERFLOW!: Changing to +/-0!!!!!!!!!!!!\n" );*/ \
|
||||
xReg &= 0x80000000; \
|
||||
_ContVal_ |= cFlagsToSet; \
|
||||
if ( shouldReturn ) { return; } \
|
||||
|
|
|
@ -32,6 +32,7 @@ using namespace std;
|
|||
|
||||
using namespace R5900;
|
||||
|
||||
// This should be done properly with the other logs.
|
||||
#ifdef DEBUG
|
||||
#define MTGS_LOG SysPrintf
|
||||
#else
|
||||
|
@ -319,7 +320,7 @@ void gsCSRwrite(u32 value)
|
|||
|
||||
// Our emulated GS has no FIFO...
|
||||
/*if( value & 0x100 ) { // FLUSH
|
||||
//SysPrintf("GS_CSR FLUSH GS fifo: %x (CSRr=%x)\n", value, GSCSRr);
|
||||
//Console::WriteLn("GS_CSR FLUSH GS fifo: %x (CSRr=%x)", params value, GSCSRr);
|
||||
}*/
|
||||
|
||||
if (value & 0x200) { // resetGS
|
||||
|
@ -593,7 +594,7 @@ void gsSyncLimiterLostTime( s32 deltaTime )
|
|||
|
||||
if( !m_StrictSkipping ) return;
|
||||
|
||||
//SysPrintf("LostTime on the EE!\n");
|
||||
//Console::WriteLn("LostTime on the EE!");
|
||||
|
||||
if( mtgsThread != NULL )
|
||||
{
|
||||
|
@ -749,7 +750,7 @@ __forceinline void gsFrameSkip( bool forceskip )
|
|||
return;
|
||||
}
|
||||
|
||||
//SysPrintf( "Consecutive Frames -- Lateness: %d\n", (int)( sSlowDeltaTime / m_iSlowTicks ) );
|
||||
//Console::WriteLn( "Consecutive Frames -- Lateness: %d", params (int)( sSlowDeltaTime / m_iSlowTicks ) );
|
||||
|
||||
// -- Consecutive frames section --
|
||||
// Force-render consecutive frames without skipping.
|
||||
|
|
|
@ -39,7 +39,7 @@ __forceinline void gsInterrupt() {
|
|||
GIF_LOG("gsInterrupt: %8.8x\n", cpuRegs.cycle);
|
||||
|
||||
if((gif->chcr & 0x100) == 0){
|
||||
//SysPrintf("Eh? why are you still interrupting! chcr %x, qwc %x, done = %x\n", gif->chcr, gif->qwc, done);
|
||||
//Console::WriteLn("Eh? why are you still interrupting! chcr %x, qwc %x, done = %x", params gif->chcr, gif->qwc, done);
|
||||
return;
|
||||
}
|
||||
if(gif->qwc > 0 || gspath3done == 0) {
|
||||
|
@ -52,7 +52,7 @@ __forceinline void gsInterrupt() {
|
|||
|
||||
GIFdma();
|
||||
#ifdef GSPATH3FIX
|
||||
// re-reaise the IRQ as part of the mysterious Path3fix.
|
||||
// re-raise the IRQ as part of the mysterious Path3fix.
|
||||
// fixme - this hack *should* have the gs_irq raised from the VIF, I think. It would be
|
||||
// more efficient and more correct. (air)
|
||||
/*if (!(vif1Regs->mskpath3 && (vif1ch->chcr & 0x100)) || (psHu32(GIF_MODE) & 0x1))
|
||||
|
@ -103,12 +103,11 @@ static void WRITERING_DMA(u32 *pMem, u32 qwc)
|
|||
else
|
||||
{
|
||||
GSGIFTRANSFER3(pMem, qwc);
|
||||
if( GSgetLastTag != NULL )
|
||||
if( GSgetLastTag != NULL )
|
||||
{
|
||||
GSgetLastTag(&s_gstag);
|
||||
if( s_gstag == 1 )
|
||||
Path3transfer = 0; /* fixes SRS and others */
|
||||
}
|
||||
GSgetLastTag(&s_gstag);
|
||||
if( s_gstag == 1 ) Path3transfer = 0; /* fixes SRS and others */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -158,7 +157,7 @@ void GIFdma()
|
|||
gscycles= prevcycles ? prevcycles: gscycles;
|
||||
|
||||
if( (psHu32(GIF_CTRL) & 8) ) { // temporarily stop
|
||||
SysPrintf("Gif dma temp paused?\n");
|
||||
Console::WriteLn("Gif dma temp paused?");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -176,7 +175,7 @@ void GIFdma()
|
|||
#endif
|
||||
|
||||
if ((psHu32(DMAC_CTRL) & 0xC0) == 0x80 && prevcycles != 0) { // STD == GIF
|
||||
SysPrintf("GS Stall Control Source = %x, Drain = %x\n MADR = %x, STADR = %x", (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3, gif->madr, psHu32(DMAC_STADR));
|
||||
Console::WriteLn("GS Stall Control Source = %x, Drain = %x\n MADR = %x, STADR = %x", params (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3, gif->madr, psHu32(DMAC_STADR));
|
||||
|
||||
if( gif->madr + (gif->qwc * 16) > psHu32(DMAC_STADR) ) {
|
||||
CPU_INT(2, gscycles);
|
||||
|
@ -212,7 +211,7 @@ void GIFdma()
|
|||
|
||||
if ((gif->chcr & 0x80) && ptag[0] >> 31) { //Check TIE bit of CHCR and IRQ bit of tag
|
||||
GIF_LOG("PATH3 MSK dmaIrq Set\n");
|
||||
SysPrintf("GIF TIE\n");
|
||||
Console::WriteLn("GIF TIE");
|
||||
gspath3done |= 1;
|
||||
}
|
||||
}
|
||||
|
@ -225,7 +224,7 @@ void GIFdma()
|
|||
FreezeRegs(0); // Theres a comment below that says not to unfreeze the xmm regs, so not sure about this.
|
||||
|
||||
if((gspath3done == 1 || (gif->chcr & 0xc) == 0) && gif->qwc == 0){
|
||||
if(gif->qwc > 0) SysPrintf("Hurray\n");
|
||||
if(gif->qwc > 0) Console::WriteLn("Hurray!");
|
||||
gspath3done = 0;
|
||||
gif->chcr &= ~0x100;
|
||||
//psHu32(GIF_MODE)&= ~0x4;
|
||||
|
@ -244,7 +243,7 @@ void GIFdma()
|
|||
if ((gif->chcr & 0xc) == 0 || gif->qwc > 0) { // Normal Mode
|
||||
//gscount++;
|
||||
if ((psHu32(DMAC_CTRL) & 0xC0) == 0x80 && (gif->chcr & 0xc) == 0) {
|
||||
SysPrintf("DMA Stall Control on GIF normal\n");
|
||||
Console::WriteLn("DMA Stall Control on GIF normal");
|
||||
}
|
||||
FreezeRegs(1);
|
||||
GIFchain(); //Transfers the data set by the switch
|
||||
|
@ -272,7 +271,7 @@ void GIFdma()
|
|||
// Transfer dma tag if tte is set
|
||||
if (gif->chcr & 0x40) {
|
||||
//u32 temptag[4] = {0};
|
||||
//SysPrintf("GIF TTE: %x_%x\n", ptag[3], ptag[2]);
|
||||
//Console::WriteLn("GIF TTE: %x_%x", params ptag[3], ptag[2]);
|
||||
|
||||
//temptag[0] = ptag[2];
|
||||
//temptag[1] = ptag[3];
|
||||
|
@ -292,7 +291,7 @@ void GIFdma()
|
|||
// there are still bugs, need to also check if gif->madr +16*qwc >= stadr, if not, stall
|
||||
if(!gspath3done && gif->madr + (gif->qwc * 16) > psHu32(DMAC_STADR) && id == 4) {
|
||||
// stalled
|
||||
SysPrintf("GS Stall Control Source = %x, Drain = %x\n MADR = %x, STADR = %x", (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3,gif->madr, psHu32(DMAC_STADR));
|
||||
Console::WriteLn("GS Stall Control Source = %x, Drain = %x\n MADR = %x, STADR = %x", params (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3,gif->madr, psHu32(DMAC_STADR));
|
||||
prevcycles = gscycles;
|
||||
gif->tadr -= 16;
|
||||
hwDmacIrq(13);
|
||||
|
@ -346,12 +345,8 @@ void dmaGIF() {
|
|||
// CPU_INT(2, 48); //Wait time for the buffer to fill, fixes some timing problems in path 3 masking
|
||||
//} //It takes the time of 24 QW for the BUS to become ready - The Punisher, And1 Streetball
|
||||
//else
|
||||
|
||||
|
||||
|
||||
|
||||
if ((psHu32(DMAC_CTRL) & 0xC) == 0xC ) { // GIF MFIFO
|
||||
SysPrintf("GIF MFIFO\n");
|
||||
Console::WriteLn("GIF MFIFO");
|
||||
gifMFIFOInterrupt();
|
||||
return;
|
||||
}
|
||||
|
@ -381,7 +376,7 @@ void dmaGIF() {
|
|||
}
|
||||
|
||||
if(gif->qwc > 0 && (gif->chcr & 0x4) == 0x4) {
|
||||
//SysPrintf("HL Hack\n");
|
||||
//Console::WriteLn("HL Hack");
|
||||
gspath3done = 1; //Halflife sets a QWC amount in chain mode, no tadr set.
|
||||
if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0)
|
||||
{
|
||||
|
@ -393,9 +388,7 @@ void dmaGIF() {
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//GIFdma();
|
||||
if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0)
|
||||
{
|
||||
|
@ -405,7 +398,6 @@ void dmaGIF() {
|
|||
{
|
||||
CPU_INT(2, gif->qwc /** BIAS*/);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#define spr0 ((DMACh*)&PS2MEM_HW[0xD000])
|
||||
|
@ -429,9 +421,9 @@ static __forceinline int mfifoGIFrbTransfer() {
|
|||
int mfifoqwc = min(gifqwc, qwc);
|
||||
u32 *src;
|
||||
|
||||
|
||||
/* Check if the transfer should wrap around the ring buffer */
|
||||
if ((gif->madr+mfifoqwc*16) > (psHu32(DMAC_RBOR) + psHu32(DMAC_RBSR)+16)) {
|
||||
if ((gif->madr+mfifoqwc*16) > (psHu32(DMAC_RBOR) + psHu32(DMAC_RBSR)+16))
|
||||
{
|
||||
int s1 = ((psHu32(DMAC_RBOR) + psHu32(DMAC_RBSR)+16) - gif->madr) >> 4;
|
||||
|
||||
// fixme - I don't think these should use WRITERING_DMA, since our source
|
||||
|
@ -447,7 +439,9 @@ static __forceinline int mfifoGIFrbTransfer() {
|
|||
if (src == NULL) return -1;
|
||||
WRITERING_DMA(src, (mfifoqwc - s1));
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/* it doesn't, so just transfer 'qwc*16' words
|
||||
from 'gif->madr' to GS */
|
||||
src = (u32*)PSM(gif->madr);
|
||||
|
@ -473,9 +467,12 @@ static __forceinline int mfifoGIFchain() {
|
|||
if (gif->qwc == 0) return 0;
|
||||
|
||||
if (gif->madr >= psHu32(DMAC_RBOR) &&
|
||||
gif->madr <= (psHu32(DMAC_RBOR)+psHu32(DMAC_RBSR))) {
|
||||
gif->madr <= (psHu32(DMAC_RBOR)+psHu32(DMAC_RBSR)))
|
||||
{
|
||||
if (mfifoGIFrbTransfer() == -1) return -1;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
int mfifoqwc = (psHu32(GIF_MODE) & 0x4 && vif1Regs->mskpath3) ? min(8, (int)gif->qwc) : gif->qwc;
|
||||
u32 *pMem = (u32*)dmaGetAddr(gif->madr);
|
||||
if (pMem == NULL) return -1;
|
||||
|
@ -511,7 +508,7 @@ void mfifoGIFtransfer(int qwc) {
|
|||
if(gif->tadr == spr0->madr) {
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
/*if( gifqwc > 1 )
|
||||
SysPrintf("gif mfifo tadr==madr but qwc = %d\n", gifqwc);*/
|
||||
Console::WriteLn("gif mfifo tadr==madr but qwc = %d", params gifqwc);*/
|
||||
#endif
|
||||
//hwDmacIrq(14);
|
||||
|
||||
|
@ -520,7 +517,7 @@ void mfifoGIFtransfer(int qwc) {
|
|||
gif->tadr = psHu32(DMAC_RBOR) + (gif->tadr & psHu32(DMAC_RBSR));
|
||||
ptag = (u32*)dmaGetAddr(gif->tadr);
|
||||
|
||||
id = (ptag[0] >> 28) & 0x7;
|
||||
id = (ptag[0] >> 28) & 0x7;
|
||||
gif->qwc = (ptag[0] & 0xffff);
|
||||
gif->madr = ptag[1];
|
||||
mfifocycles += 2;
|
||||
|
@ -569,7 +566,7 @@ void mfifoGIFtransfer(int qwc) {
|
|||
}
|
||||
FreezeRegs(1);
|
||||
if (mfifoGIFchain() == -1) {
|
||||
SysPrintf("GIF dmaChain error size=%d, madr=%lx, tadr=%lx\n",
|
||||
Console::WriteLn("GIF dmaChain error size=%d, madr=%lx, tadr=%lx\n", params
|
||||
gif->qwc, gif->madr, gif->tadr);
|
||||
gifstate = GIF_STATE_STALL;
|
||||
}
|
||||
|
@ -583,11 +580,11 @@ void mfifoGIFtransfer(int qwc) {
|
|||
|
||||
void gifMFIFOInterrupt()
|
||||
{
|
||||
if(!(gif->chcr & 0x100)) { SysPrintf("WTF GIFMFIFO\n");cpuRegs.interrupt &= ~(1 << 11); return ; }
|
||||
if(!(gif->chcr & 0x100)) { Console::WriteLn("WTF GIFMFIFO");cpuRegs.interrupt &= ~(1 << 11); return ; }
|
||||
|
||||
if(gifstate != GIF_STATE_STALL) {
|
||||
if(gifqwc <= 0) {
|
||||
//SysPrintf("Empty\n");
|
||||
//Console::WriteLn("Empty");
|
||||
psHu32(GIF_STAT)&= ~0xE00; // OPH=0 | APATH=0
|
||||
hwDmacIrq(14);
|
||||
return;
|
||||
|
@ -601,7 +598,7 @@ void gifMFIFOInterrupt()
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
//if(gifqwc > 0)SysPrintf("GIF MFIFO ending with stuff in it %x\n", gifqwc);
|
||||
//if(gifqwc > 0) Console::WriteLn("GIF MFIFO ending with stuff in it %x", params gifqwc);
|
||||
if( gifmfifoirq == 0) gifqwc = 0;
|
||||
gifstate = GIF_STATE_EMPTY;
|
||||
gif->chcr &= ~0x100;
|
||||
|
|
|
@ -188,7 +188,7 @@ int hwDmacSrcChainWithStack(DMACh *dma, int id) {
|
|||
dma->chcr = (dma->chcr & 0xffffffcf) | 0x20; //2 Addresses in call stack
|
||||
dma->asr1 = dma->madr + (dma->qwc << 4); //If no store Succeeding tag in ASR1
|
||||
}else {
|
||||
SysPrintf("Call Stack Overflow (report if it fixes/breaks anything)\n");
|
||||
Console::Notice("Call Stack Overflow (report if it fixes/breaks anything)");
|
||||
return 1; //Return done
|
||||
}
|
||||
dma->tadr = temp; //Set TADR to temporarily stored ADDR
|
||||
|
@ -465,7 +465,7 @@ __forceinline void __fastcall hwWrite32(u32 mem, u32 value)
|
|||
case 0x10001820: rcntWtarget(3, value); break;
|
||||
|
||||
case GIF_CTRL:
|
||||
//SysPrintf("GIF_CTRL write %x\n", value);
|
||||
//Console::WriteLn("GIF_CTRL write %x", params value);
|
||||
psHu32(mem) = value & 0x8;
|
||||
if (value & 0x1) gsGIFReset();
|
||||
else if( value & 8 ) psHu32(GIF_STAT) |= 8;
|
||||
|
@ -482,7 +482,7 @@ __forceinline void __fastcall hwWrite32(u32 mem, u32 value)
|
|||
break;
|
||||
|
||||
case GIF_STAT: // stat is readonly
|
||||
SysPrintf("Gifstat write value = %x\n", value);
|
||||
Console::WriteLn("Gifstat write value = %x", params value);
|
||||
return;
|
||||
|
||||
case 0x10008000: // dma0 - vif0
|
||||
|
|
|
@ -320,7 +320,7 @@ static __forceinline u8* dmaGetAddr(u32 mem)
|
|||
mem &= ~0xf;
|
||||
|
||||
if( (mem&0xffff0000) == 0x50000000 ) {// reserved scratch pad mem
|
||||
SysPrintf("dmaGetAddr: reserved scratch pad mem\n");
|
||||
Console::WriteLn("dmaGetAddr: reserved scratch pad mem");
|
||||
return NULL;//(u8*)&PS2MEM_SCRATCH[(mem) & 0x3ff0];
|
||||
}
|
||||
|
||||
|
@ -330,13 +330,12 @@ static __forceinline u8* dmaGetAddr(u32 mem)
|
|||
// do manual LUT since IPU/SPR seems to use addrs 0x3000xxxx quite often
|
||||
// linux doesn't suffer from this because it has better vm support
|
||||
if( memLUT[ (p-PS2MEM_BASE)>>12 ].aPFNs == NULL ) {
|
||||
SysPrintf("dmaGetAddr: memLUT PFN warning\n");
|
||||
Console::WriteLn("dmaGetAddr: memLUT PFN warning");
|
||||
return NULL;//p;
|
||||
}
|
||||
|
||||
pbase = (u8*)memLUT[ (p-PS2MEM_BASE)>>12 ].aVFNs[0];
|
||||
if( pbase != NULL )
|
||||
p = pbase + ((u32)p&0xfff);
|
||||
if( pbase != NULL ) p = pbase + ((u32)p&0xfff);
|
||||
#endif
|
||||
|
||||
return p;
|
||||
|
|
|
@ -48,7 +48,7 @@ static __forceinline void DmaExec8( void (*func)(), u32 mem, u8 value )
|
|||
psHu8(mem) = (u8)value;
|
||||
if ((psHu8(mem) & 0x1) && (psHu32(DMAC_CTRL) & 0x1))
|
||||
{
|
||||
/*SysPrintf("Running DMA 8 %x\n", psHu32(mem & ~0x1));*/
|
||||
/*Console::WriteLn("Running DMA 8 %x", params psHu32(mem & ~0x1));*/
|
||||
func();
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ static __forceinline void DmaExec16( void (*func)(), u32 mem, u16 value )
|
|||
psHu16(mem) = (u16)value;
|
||||
if ((psHu16(mem) & 0x100) && (psHu32(DMAC_CTRL) & 0x1))
|
||||
{
|
||||
//SysPrintf("16bit DMA Start\n");
|
||||
//Console::WriteLn("16bit DMA Start");
|
||||
func();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -358,7 +358,7 @@ __forceinline void ipuWrite32(u32 mem, u32 value)
|
|||
case 0x10: // IPU_CTRL
|
||||
ipuRegs->ctrl._u32 = (value&0x47f30000)|(ipuRegs->ctrl._u32&0x8000ffff);
|
||||
if( ipuRegs->ctrl.IDP == 3 ) {
|
||||
SysPrintf("IPU Invalid Intra DC Precision, switching to 9 bits\n");
|
||||
Console::WriteLn("IPU Invalid Intra DC Precision, switching to 9 bits");
|
||||
ipuRegs->ctrl.IDP = 1;
|
||||
}
|
||||
if (ipuRegs->ctrl.RST & 0x1) { // RESET
|
||||
|
@ -645,11 +645,14 @@ static BOOL __fastcall ipuCSC(u32 val)
|
|||
tIPU_CMD_CSC csc( val );
|
||||
|
||||
IPU_LOG("IPU CSC(Colorspace conversion from YCbCr) command (%d).\n",csc.MBC);
|
||||
if (csc.OFM){ IPU_LOG("Output format is RGB16. ");}
|
||||
else{ IPU_LOG("Output format is RGB32. ");}
|
||||
if (csc.DTE){ IPU_LOG("Dithering enabled."); }
|
||||
if (csc.OFM)
|
||||
IPU_LOG("Output format is RGB16. ");
|
||||
else
|
||||
IPU_LOG("Output format is RGB32. ");
|
||||
|
||||
if (csc.DTE) IPU_LOG("Dithering enabled.");
|
||||
|
||||
//SysPrintf("CSC\n");
|
||||
//Console::WriteLn("CSC");
|
||||
for (;g_nCmdIndex<(int)csc.MBC; g_nCmdIndex++){
|
||||
|
||||
if( g_nCmdPos[0] < 3072/8 ) {
|
||||
|
@ -754,7 +757,7 @@ void IPUCMD_WRITE(u32 val) {
|
|||
// don't process anything if currently busy
|
||||
if( ipuRegs->ctrl.BUSY ) {
|
||||
// wait for thread
|
||||
SysPrintf("IPU BUSY!\n");
|
||||
Console::WriteLn("IPU BUSY!");
|
||||
}
|
||||
|
||||
ipuRegs->ctrl.ECD = 0;
|
||||
|
@ -983,7 +986,7 @@ void IPUWorker()
|
|||
return;
|
||||
|
||||
default:
|
||||
SysPrintf("Unknown IPU command: %x\n", ipuRegs->cmd.CMD);
|
||||
Console::WriteLn("Unknown IPU command: %x", params ipuRegs->cmd.CMD);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1306,7 +1309,7 @@ void __fastcall ipu_dither2(const macroblock_rgb32* rgb32, macroblock_rgb16 *rgb
|
|||
|
||||
void __fastcall ipu_dither(macroblock_8 *mb8, macroblock_rgb16 *rgb16, int dte)
|
||||
{
|
||||
//SysPrintf("IPU: Dither not implemented");
|
||||
//Console::Error("IPU: Dither not implemented");
|
||||
}
|
||||
|
||||
void __fastcall ipu_vq(macroblock_rgb16 *rgb16, u8* indx4){
|
||||
|
@ -1437,7 +1440,7 @@ int IPU1dma()
|
|||
IPU1chain();
|
||||
|
||||
if ((ipu1dma->chcr & 0x80) && (g_nDMATransfer&IPU_DMA_DOTIE1)) { //Check TIE bit of CHCR and IRQ bit of tag
|
||||
SysPrintf("IPU1 TIE\n");
|
||||
Console::WriteLn("IPU1 TIE");
|
||||
|
||||
IPU_INT_TO(totalqwc*BIAS);
|
||||
g_nDMATransfer &= ~(IPU_DMA_ACTV1|IPU_DMA_DOTIE1);
|
||||
|
@ -1485,7 +1488,7 @@ int IPU1dma()
|
|||
}
|
||||
|
||||
if ((ipu1dma->chcr & 0xc) == 0 && ipu1dma->qwc == 0) { // Normal Mode
|
||||
//SysPrintf("ipu1 normal empty qwc?\n");
|
||||
//Console::WriteLn("ipu1 normal empty qwc?");
|
||||
return totalqwc;
|
||||
}
|
||||
|
||||
|
@ -1504,7 +1507,7 @@ int IPU1dma()
|
|||
//while (done == 0) { // Loop while Dn_CHCR.STR is 1
|
||||
ptag = (u32*)dmaGetAddr(ipu1dma->tadr); //Set memory pointer to TADR
|
||||
if (ptag == NULL) { //Is ptag empty?
|
||||
SysPrintf("IPU1 BUSERR\n");
|
||||
Console::Error("IPU1 BUSERR");
|
||||
ipu1dma->chcr = ( ipu1dma->chcr & 0xFFFF ) | ( (*ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15
|
||||
psHu32(DMAC_STAT)|= 1<<15; //If yes, set BEIS (BUSERR) in DMAC_STAT register
|
||||
return totalqwc;
|
||||
|
@ -1564,7 +1567,7 @@ int IPU1dma()
|
|||
IPU1chain();
|
||||
|
||||
if ((ipu1dma->chcr & 0x80) && (ptag[0]&0x80000000) && ipu1dma->qwc == 0) { //Check TIE bit of CHCR and IRQ bit of tag
|
||||
SysPrintf("IPU1 TIE\n");
|
||||
Console::WriteLn("IPU1 TIE");
|
||||
|
||||
if( done ) {
|
||||
ptag = (u32*)dmaGetAddr(ipu1dma->tadr);
|
||||
|
@ -1629,7 +1632,7 @@ int FIFOfrom_write(const u32 *value,int size)
|
|||
|
||||
ipuRegs->ctrl.OFC+=firsttrans;
|
||||
IPU0dma();
|
||||
//SysPrintf("Written %d qwords, %d\n",firsttrans,ipuRegs->ctrl.OFC);
|
||||
//Console::WriteLn("Written %d qwords, %d", params firsttrans,ipuRegs->ctrl.OFC);
|
||||
|
||||
return firsttrans;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ static void execI()
|
|||
//runs++;
|
||||
//if (runs > 1599999999){ //leave some time to startup the testgame
|
||||
// if (opcode.Name[0] == 'L') { //find all opcodes beginning with "L"
|
||||
// SysPrintf ("Load %s\n",opcode.Name);
|
||||
// Console::WriteLn ("Load %s", params opcode.Name);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
@ -101,7 +101,7 @@ static void __fastcall doBranch( u32 target )
|
|||
|
||||
void __fastcall intDoBranch(u32 target)
|
||||
{
|
||||
//SysPrintf("Interpreter Branch \n");
|
||||
//Console::WriteLn("Interpreter Branch ");
|
||||
_doBranch_shared( target );
|
||||
|
||||
if( Cpu == &intCpu )
|
||||
|
|
|
@ -174,7 +174,7 @@ static void __fastcall _rcntTestTarget( int i )
|
|||
psxCounters[i].count -= psxCounters[i].target;
|
||||
if(!(psxCounters[i].mode & 0x40))
|
||||
{
|
||||
SysPrintf("Counter %x repeat intr not set on zero ret, ignoring target\n", i);
|
||||
Console::WriteLn("Counter %x repeat intr not set on zero ret, ignoring target", params i);
|
||||
psxCounters[i].target |= IOPCNT_FUTURE_TARGET;
|
||||
}
|
||||
} else psxCounters[i].target |= IOPCNT_FUTURE_TARGET;
|
||||
|
@ -563,7 +563,7 @@ void psxRcnt2Wmode(u32 value)
|
|||
|
||||
if((psxCounters[2].mode & 0x7) == 0x7 || (psxCounters[2].mode & 0x7) == 0x1)
|
||||
{
|
||||
//SysPrintf("Gate set on IOP C2, disabling\n");
|
||||
//Console::WriteLn("Gate set on IOP C2, disabling");
|
||||
psxCounters[2].mode |= IOPCNT_STOPPED;
|
||||
}
|
||||
|
||||
|
@ -614,7 +614,7 @@ void psxRcnt4Wmode(u32 value)
|
|||
// Need to set a rate and target
|
||||
if((psxCounters[4].mode & 0x7) == 0x7 || (psxCounters[4].mode & 0x7) == 0x1)
|
||||
{
|
||||
SysPrintf("Gate set on IOP C4, disabling\n");
|
||||
Console::WriteLn("Gate set on IOP C4, disabling");
|
||||
psxCounters[4].mode |= IOPCNT_STOPPED;
|
||||
}
|
||||
|
||||
|
@ -641,7 +641,7 @@ void psxRcnt5Wmode(u32 value)
|
|||
// Need to set a rate and target
|
||||
if((psxCounters[5].mode & 0x7) == 0x7 || (psxCounters[5].mode & 0x7) == 0x1)
|
||||
{
|
||||
SysPrintf("Gate set on IOP C5, disabling\n");
|
||||
Console::WriteLn("Gate set on IOP C5, disabling");
|
||||
psxCounters[5].mode |= IOPCNT_STOPPED;
|
||||
}
|
||||
|
||||
|
|
|
@ -1356,8 +1356,7 @@ u8 psxHw4Read8(u32 add) {
|
|||
case 0x1f402039: return cdvdRead39();
|
||||
case 0x1f40203A: return cdvdRead3A();
|
||||
default:
|
||||
// note: use SysPrintF to notify console since this is a potentially serious
|
||||
// emulation problem:
|
||||
// note: notify the console since this is a potentially serious emulation problem:
|
||||
PSXHW_LOG("*Unknown 8bit read at address 0x%x\n", add);
|
||||
Console::Error( "IOP Unknown 8bit read from addr 0x%x", params add );
|
||||
return 0;
|
||||
|
@ -1402,10 +1401,10 @@ void psxDmaInterrupt(int n) {
|
|||
void psxDmaInterrupt2(int n) {
|
||||
if (HW_DMA_ICR2 & (1 << (16 + n))) {
|
||||
/* if (HW_DMA_ICR2 & (1 << (24 + n))) {
|
||||
SysPrintf("*PCSX2*: HW_DMA_ICR2 n=%d already set\n", n);
|
||||
Console::WriteLn("*PCSX2*: HW_DMA_ICR2 n=%d already set", params n);
|
||||
}
|
||||
if (psxHu32(0x1070) & 8) {
|
||||
SysPrintf("*PCSX2*: psxHu32(0x1070) 8 already set (n=%d)\n", n);
|
||||
Console::WriteLn("*PCSX2*: psxHu32(0x1070) 8 already set (n=%d)", params n);
|
||||
}*/
|
||||
HW_DMA_ICR2|= (1 << (24 + n));
|
||||
psxRegs.CP0.n.Cause |= 1 << (16 + n);
|
||||
|
|
|
@ -301,11 +301,14 @@ void iopMemWrite8(u32 mem, u8 value)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (t == 0x1D00) SysPrintf("sw8 [0x%08X]=0x%08X\n", mem, value);
|
||||
if (t == 0x1d00) {
|
||||
psxSu8(mem) = value; return;
|
||||
if (t == 0x1d00)
|
||||
{
|
||||
Console::WriteLn("sw8 [0x%08X]=0x%08X", params mem, value);
|
||||
psxSu8(mem) = value;
|
||||
return;
|
||||
}
|
||||
if (t == 0x1000) {
|
||||
if (t == 0x1000)
|
||||
{
|
||||
DEV9write8(mem, value); return;
|
||||
}
|
||||
PSXMEM_LOG("err sb %8.8lx = %x\n", mem, value);
|
||||
|
@ -329,7 +332,7 @@ void iopMemWrite16(u32 mem, u16 value)
|
|||
u8* p = (u8 *)(psxMemWLUT[mem >> 16]);
|
||||
if (p != NULL && !(psxRegs.CP0.n.Status & 0x10000) )
|
||||
{
|
||||
if( t==0x1D00 ) SysPrintf("sw16 [0x%08X]=0x%08X\n", mem, value);
|
||||
if( t==0x1D00 ) Console::WriteLn("sw16 [0x%08X]=0x%08X", params mem, value);
|
||||
*(u16 *)(p + (mem & 0xffff)) = value;
|
||||
psxCpu->Clear(mem&~3, 1);
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ void sio2_fifoIn(u8 value){
|
|||
SIODMAWrite(value);
|
||||
|
||||
if (sio2.packet.sendSize > BUFSIZE) {//asadr
|
||||
SysPrintf("*PCSX2*: sendSize >= %d\n", BUFSIZE);
|
||||
Console::WriteLn("*PCSX2*: sendSize >= %d", params BUFSIZE);
|
||||
} else {
|
||||
sio2.buf[sio2.packet.sendSize] = sioRead8();
|
||||
sio2.packet.sendSize++;
|
||||
|
|
|
@ -952,7 +952,7 @@ int mtgsThreadObject::PrepDataPacket( GIF_PATH pathidx, const u8* srcdata, u32 s
|
|||
else // always true - if( writepos + size == MTGS_RINGBUFFEREND )
|
||||
{
|
||||
// Yay. Perfect fit. What are the odds?
|
||||
//SysPrintf( "MTGS > Perfect Fit!\n");
|
||||
//Console::WriteLn( "MTGS > Perfect Fit!");
|
||||
|
||||
PrepEventWait();
|
||||
while( true )
|
||||
|
|
|
@ -132,7 +132,7 @@ u8 *psS = NULL; //0.015 mb, scratch pad
|
|||
void MyMemCheck(u32 mem)
|
||||
{
|
||||
if( mem == 0x1c02f2a0 )
|
||||
SysPrintf("yo\n");
|
||||
Console::WriteLn("yo; (mem == 0x1c02f2a0) in MyMemCheck...");
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
|
@ -254,7 +254,7 @@ mem8_t __fastcall _ext_memRead8 (u32 mem)
|
|||
case 7: // dev9
|
||||
{
|
||||
mem8_t retval = DEV9read8(mem & ~0xa4000000);
|
||||
SysPrintf("DEV9 read8 %8.8lx: %2.2lx\n", mem & ~0xa4000000, retval);
|
||||
Console::WriteLn("DEV9 read8 %8.8lx: %2.2lx", params mem & ~0xa4000000, retval);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ mem16_t __fastcall _ext_memRead16(u32 mem)
|
|||
case 7: // dev9
|
||||
{
|
||||
mem16_t retval = DEV9read16(mem & ~0xa4000000);
|
||||
SysPrintf("DEV9 read16 %8.8lx: %4.4lx\n", mem & ~0xa4000000, retval);
|
||||
Console::WriteLn("DEV9 read16 %8.8lx: %4.4lx", params mem & ~0xa4000000, retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,7 @@ mem32_t __fastcall _ext_memRead32(u32 mem)
|
|||
case 7: // dev9
|
||||
{
|
||||
mem32_t retval = DEV9read32(mem & ~0xa4000000);
|
||||
SysPrintf("DEV9 read32 %8.8lx: %8.8lx\n", mem & ~0xa4000000, retval);
|
||||
Console::WriteLn("DEV9 read32 %8.8lx: %8.8lx", params mem & ~0xa4000000, retval);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ void __fastcall _ext_memWrite8 (u32 mem, u8 value)
|
|||
gsWrite8(mem, value); return;
|
||||
case 7: // dev9
|
||||
DEV9write8(mem & ~0xa4000000, value);
|
||||
SysPrintf("DEV9 write8 %8.8lx: %2.2lx\n", mem & ~0xa4000000, value);
|
||||
Console::WriteLn("DEV9 write8 %8.8lx: %2.2lx", params mem & ~0xa4000000, value);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -385,7 +385,7 @@ void __fastcall _ext_memWrite16(u32 mem, u16 value)
|
|||
gsWrite16(mem, value); return;
|
||||
case 7: // dev9
|
||||
DEV9write16(mem & ~0xa4000000, value);
|
||||
SysPrintf("DEV9 write16 %8.8lx: %4.4lx\n", mem & ~0xa4000000, value);
|
||||
Console::WriteLn("DEV9 write16 %8.8lx: %4.4lx", params mem & ~0xa4000000, value);
|
||||
return;
|
||||
case 8: // spu2
|
||||
SPU2write(mem, value); return;
|
||||
|
@ -404,7 +404,7 @@ void __fastcall _ext_memWrite32(u32 mem, u32 value)
|
|||
gsWrite32(mem, value); return;
|
||||
case 7: // dev9
|
||||
DEV9write32(mem & ~0xa4000000, value);
|
||||
SysPrintf("DEV9 write32 %8.8lx: %8.8lx\n", mem & ~0xa4000000, value);
|
||||
Console::WriteLn("DEV9 write32 %8.8lx: %8.8lx", params mem & ~0xa4000000, value);
|
||||
return;
|
||||
}
|
||||
MEM_LOG("Unknown Memory write32 to address %x with data %8.8x\n", mem, value);
|
||||
|
@ -588,7 +588,7 @@ void __fastcall vuMicroWrite128(u32 addr,const mem128_t* data)
|
|||
|
||||
void memSetPageAddr(u32 vaddr, u32 paddr)
|
||||
{
|
||||
//SysPrintf("memSetPageAddr: %8.8x -> %8.8x\n", vaddr, paddr);
|
||||
//Console::WriteLn("memSetPageAddr: %8.8x -> %8.8x", params vaddr, paddr);
|
||||
|
||||
vtlb_VMap(vaddr,paddr,0x1000);
|
||||
|
||||
|
@ -596,7 +596,7 @@ void memSetPageAddr(u32 vaddr, u32 paddr)
|
|||
|
||||
void memClearPageAddr(u32 vaddr)
|
||||
{
|
||||
//SysPrintf("memClearPageAddr: %8.8x\n", vaddr);
|
||||
//Console::WriteLn("memClearPageAddr: %8.8x", params vaddr);
|
||||
|
||||
vtlb_VMapUnmap(vaddr,0x1000); // -> whut ?
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ void CALLBACK GS_printf(int timeout, char *fmt, ...) {
|
|||
vsprintf(msg, fmt, list);
|
||||
va_end(list);
|
||||
|
||||
SysPrintf(msg);
|
||||
Console::WriteLn(msg);
|
||||
}
|
||||
|
||||
s32 CALLBACK GS_freeze(int mode, freezeData *data) { data->size = 0; return 0; }
|
||||
|
|
|
@ -76,7 +76,7 @@ void psxShutdown() {
|
|||
|
||||
void psxException(u32 code, u32 bd) {
|
||||
// PSXCPU_LOG("psxException %x: %x, %x\n", code, psxHu32(0x1070), psxHu32(0x1074));
|
||||
//SysPrintf("!! psxException %x: %x, %x\n", code, psxHu32(0x1070), psxHu32(0x1074));
|
||||
//Console::WriteLn("!! psxException %x: %x, %x", params code, psxHu32(0x1070), psxHu32(0x1074));
|
||||
// Set the Cause
|
||||
psxRegs.CP0.n.Cause &= ~0x7f;
|
||||
psxRegs.CP0.n.Cause |= code;
|
||||
|
@ -169,7 +169,7 @@ __forceinline void PSX_INT( IopEventId n, s32 ecycle )
|
|||
|
||||
// Exception: IRQ16 - SIO - it drops ints like crazy when handling PAD stuff.
|
||||
//if( /*n!=16 &&*/ psxRegs.interrupt & (1<<n) )
|
||||
// SysPrintf( "***** IOP > Twice-thrown int on IRQ %d\n", n );
|
||||
// Console::WriteLn( "***** IOP > Twice-thrown int on IRQ %d", n );
|
||||
|
||||
psxRegs.interrupt |= 1 << n;
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ void zeroEx()
|
|||
|
||||
fname = irxlibs[i].names[code];
|
||||
//if( strcmp(fname, "setIOPrcvaddr") == 0 ) {
|
||||
// SysPrintf("yo\n");
|
||||
// Console::WriteLn("yo");
|
||||
// varLog |= 0x100000;
|
||||
// Log = 1;
|
||||
// }
|
||||
|
|
|
@ -159,7 +159,7 @@ void psxSYSCALL() {
|
|||
}
|
||||
|
||||
void psxRFE() {
|
||||
// SysPrintf("RFE\n");
|
||||
// Console::WriteLn("RFE\n");
|
||||
psxRegs.CP0.n.Status = (psxRegs.CP0.n.Status & 0xfffffff0) |
|
||||
((psxRegs.CP0.n.Status & 0x3c) >> 2);
|
||||
// Log=0;
|
||||
|
@ -299,11 +299,11 @@ void psxMTC0() { _rFs_ = _u32(_rRt_); }
|
|||
void psxCTC0() { _rFs_ = _u32(_rRt_); }
|
||||
|
||||
/*********************************************************
|
||||
* Unknow instruction (would generate an exception) *
|
||||
* Unknown instruction (would generate an exception) *
|
||||
* Format: ? *
|
||||
*********************************************************/
|
||||
void psxNULL() {
|
||||
SysPrintf("psx: Unimplemented op %x\n", psxRegs.code);
|
||||
Console::Notice("psx: Unimplemented op %x", params psxRegs.code);
|
||||
}
|
||||
|
||||
void psxSPECIAL() {
|
||||
|
|
|
@ -220,7 +220,7 @@ __forceinline void _cpuTestMissingINTC() {
|
|||
if (cpuRegs.CP0.n.Status.val & 0x400 &&
|
||||
psHu32(INTC_STAT) & psHu32(INTC_MASK)) {
|
||||
if ((cpuRegs.interrupt & (1 << 30)) == 0) {
|
||||
SysPrintf("*PCSX2*: Error, missing INTC Interrupt\n");
|
||||
Console::Error("*PCSX2*: Error, missing INTC Interrupt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ __forceinline void _cpuTestMissingDMAC() {
|
|||
(psHu16(0xe012) & psHu16(0xe010) ||
|
||||
psHu16(0xe010) & 0x8000)) {
|
||||
if ((cpuRegs.interrupt & (1 << 31)) == 0) {
|
||||
SysPrintf("*PCSX2*: Error, missing DMAC Interrupt\n");
|
||||
Console::Error("*PCSX2*: Error, missing DMAC Interrupt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -784,7 +784,7 @@ int __Deci2Call(int call, u32 *addr)
|
|||
deci2addr[3], deci2addr[2], deci2addr[1], deci2addr[0]);
|
||||
|
||||
// cpuRegs.pc = deci2handler;
|
||||
// SysPrintf("deci2msg: %s", (char*)PSM(deci2addr[4]+0xc));
|
||||
// Console::WriteLn("deci2msg: %s", params (char*)PSM(deci2addr[4]+0xc));
|
||||
if (deci2addr == NULL) return 1;
|
||||
if (deci2addr[1]>0xc){
|
||||
u8* pdeciaddr = (u8*)dmaGetAddr(deci2addr[4]+0xc);
|
||||
|
|
|
@ -74,7 +74,7 @@ int _SPR0chain() {
|
|||
//SPR0transfer(pMem, qwc << 2);
|
||||
|
||||
if ((psHu32(DMAC_CTRL) & 0xC) >= 0x8) { // 0x8 VIF1 MFIFO, 0xC GIF MFIFO
|
||||
if((spr0->madr & ~psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR)) SysPrintf("SPR MFIFO Write outside MFIFO area\n");
|
||||
if((spr0->madr & ~psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR)) Console::WriteLn("SPR MFIFO Write outside MFIFO area");
|
||||
hwMFIFOWrite(spr0->madr, (u8*)&PS2MEM_SCRATCH[spr0->sadr & 0x3fff], spr0->qwc << 4);
|
||||
spr0->madr += spr0->qwc << 4;
|
||||
spr0->madr = psHu32(DMAC_RBOR) + (spr0->madr & psHu32(DMAC_RBSR));
|
||||
|
@ -105,7 +105,7 @@ void _SPR0interleave() {
|
|||
int cycles = 0;
|
||||
u32 *pMem;
|
||||
if(tqwc == 0) tqwc = qwc;
|
||||
//SysPrintf("dmaSPR0 interleave\n");
|
||||
//Console::WriteLn("dmaSPR0 interleave");
|
||||
SPR_LOG("SPR0 interleave size=%d, tqwc=%d, sqwc=%d, addr=%lx sadr=%lx\n",
|
||||
spr0->qwc, tqwc, sqwc, spr0->madr, spr0->sadr);
|
||||
|
||||
|
@ -133,18 +133,12 @@ void _SPR0interleave() {
|
|||
}
|
||||
|
||||
static __forceinline void _dmaSPR0() {
|
||||
|
||||
|
||||
if ((psHu32(DMAC_CTRL) & 0x30) == 0x20) { // STS == fromSPR
|
||||
SysPrintf("SPR0 stall %d\n", (psHu32(DMAC_CTRL)>>6)&3);
|
||||
Console::WriteLn("SPR0 stall %d", params (psHu32(DMAC_CTRL)>>6)&3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Transfer Dn_QWC from SPR to Dn_MADR
|
||||
|
||||
|
||||
|
||||
if ((spr0->chcr & 0xc) == 0x0) { // Normal Mode
|
||||
int cycles = 0;
|
||||
SPR0chain();
|
||||
|
@ -183,7 +177,7 @@ static __forceinline void _dmaSPR0() {
|
|||
ptag[1], ptag[0], spr0->qwc, id, spr0->madr, spr0->sadr);
|
||||
|
||||
if ((psHu32(DMAC_CTRL) & 0x30) == 0x20) { // STS == fromSPR
|
||||
SysPrintf("SPR stall control\n");
|
||||
Console::WriteLn("SPR stall control");
|
||||
}
|
||||
|
||||
switch (id) {
|
||||
|
@ -201,13 +195,12 @@ static __forceinline void _dmaSPR0() {
|
|||
}
|
||||
SPR0chain();
|
||||
if (spr0->chcr & 0x80 && ptag[0] >> 31) { //Check TIE bit of CHCR and IRQ bit of tag
|
||||
//SysPrintf("SPR0 TIE\n");
|
||||
//Console::WriteLn("SPR0 TIE");
|
||||
done = 1;
|
||||
spr0->qwc = 0;
|
||||
//break;
|
||||
}
|
||||
|
||||
|
||||
/* if (spr0->chcr & 0x80 && ptag[0] >> 31) {
|
||||
SPR_LOG("dmaIrq Set\n");
|
||||
|
||||
|
@ -245,16 +238,16 @@ void SPRFROMinterrupt()
|
|||
_dmaSPR0();
|
||||
|
||||
if ((psHu32(DMAC_CTRL) & 0xC) == 0xC) { // GIF MFIFO
|
||||
if((spr0->madr & ~psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR)) SysPrintf("GIF MFIFO Write outside MFIFO area\n");
|
||||
if((spr0->madr & ~psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR)) Console::WriteLn("GIF MFIFO Write outside MFIFO area");
|
||||
spr0->madr = psHu32(DMAC_RBOR) + (spr0->madr & psHu32(DMAC_RBSR));
|
||||
//SysPrintf("mfifoGIFtransfer %x madr %x, tadr %x\n", gif->chcr, gif->madr, gif->tadr);
|
||||
//Console::WriteLn("mfifoGIFtransfer %x madr %x, tadr %x", params gif->chcr, gif->madr, gif->tadr);
|
||||
mfifoGIFtransfer(mfifotransferred);
|
||||
mfifotransferred = 0;
|
||||
} else
|
||||
if ((psHu32(DMAC_CTRL) & 0xC) == 0x8) { // VIF1 MFIFO
|
||||
if((spr0->madr & ~psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR)) SysPrintf("VIF MFIFO Write outside MFIFO area\n");
|
||||
if((spr0->madr & ~psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR)) Console::WriteLn("VIF MFIFO Write outside MFIFO area");
|
||||
spr0->madr = psHu32(DMAC_RBOR) + (spr0->madr & psHu32(DMAC_RBSR));
|
||||
//SysPrintf("mfifoVIF1transfer %x madr %x, tadr %x\n", vif1ch->chcr, vif1ch->madr, vif1ch->tadr);
|
||||
//Console::WriteLn("mfifoVIF1transfer %x madr %x, tadr %x", params vif1ch->chcr, vif1ch->madr, vif1ch->tadr);
|
||||
//vifqwc+= qwc;
|
||||
mfifoVIF1transfer(mfifotransferred);
|
||||
mfifotransferred = 0;
|
||||
|
@ -282,9 +275,6 @@ void dmaSPR0() { // fromSPR
|
|||
// It merely assumes that the last one has finished then starts another one (broke with the DMA fix)
|
||||
// This "shouldn't" cause any problems as SPR is generally faster than the other DMAS anyway. (Refraction)
|
||||
CPU_INT(8, spr0->qwc / BIAS);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
__forceinline static void SPR1transfer(u32 *data, int size) {
|
||||
|
@ -341,7 +331,6 @@ void _SPR1interleave() {
|
|||
spr1->qwc = 0;
|
||||
spr1finished = 1;
|
||||
//CPU_INT(9, cycles);
|
||||
|
||||
}
|
||||
|
||||
void _dmaSPR1() { // toSPR work function
|
||||
|
@ -353,13 +342,12 @@ void _dmaSPR1() { // toSPR work function
|
|||
spr1finished = 1;
|
||||
//CPU_INT(9, cycles);
|
||||
return;
|
||||
} else
|
||||
if ((spr1->chcr & 0xc) == 0x4){
|
||||
int cycles = 0;
|
||||
u32 *ptag;
|
||||
int id, done=0;
|
||||
}
|
||||
else if ((spr1->chcr & 0xc) == 0x4){
|
||||
int cycles = 0;
|
||||
u32 *ptag;
|
||||
int id, done=0;
|
||||
|
||||
|
||||
if(spr1->qwc > 0){
|
||||
//if(spr1->qwc == 0 && (spr1->chcr & 0xc) == 1) spr1->qwc = 0xffff;
|
||||
// Transfer Dn_QWC from Dn_MADR to SPR1
|
||||
|
@ -373,7 +361,7 @@ void _dmaSPR1() { // toSPR work function
|
|||
// while (done == 0) { // Loop while Dn_CHCR.STR is 1
|
||||
ptag = (u32*)dmaGetAddr(spr1->tadr); //Set memory pointer to TADR
|
||||
if (ptag == NULL) { //Is ptag empty?
|
||||
SysPrintf("SPR1 Tag BUSERR\n");
|
||||
Console::WriteLn("SPR1 Tag BUSERR");
|
||||
spr1->chcr = ( spr1->chcr & 0xFFFF ) | ( (*ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15
|
||||
psHu32(DMAC_STAT)|= 1<<15; //If yes, set BEIS (BUSERR) in DMAC_STAT register
|
||||
done = 1;
|
||||
|
@ -382,7 +370,7 @@ void _dmaSPR1() { // toSPR work function
|
|||
}
|
||||
spr1->chcr = ( spr1->chcr & 0xFFFF ) | ( (*ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15
|
||||
|
||||
id = (ptag[0] >> 28) & 0x7; //ID for DmaChain copied from bit 28 of the tag
|
||||
id = (ptag[0] >> 28) & 0x7; //ID for DmaChain copied from bit 28 of the tag
|
||||
spr1->qwc = (u16)ptag[0]; //QWC set to lower 16bits of the tag
|
||||
spr1->madr = ptag[1]; //MADR = ADDR field
|
||||
|
||||
|
@ -401,7 +389,7 @@ void _dmaSPR1() { // toSPR work function
|
|||
if (spr1->chcr & 0x80 && ptag[0] >> 31) { //Check TIE bit of CHCR and IRQ bit of tag
|
||||
SPR_LOG("dmaIrq Set\n");
|
||||
|
||||
//SysPrintf("SPR1 TIE\n");
|
||||
//Console::WriteLn("SPR1 TIE");
|
||||
spr1->qwc = 0;
|
||||
done = 1;
|
||||
// break;
|
||||
|
@ -421,13 +409,10 @@ void _dmaSPR1() { // toSPR work function
|
|||
}
|
||||
void dmaSPR1() { // toSPR
|
||||
|
||||
|
||||
#ifdef SPR_LOG
|
||||
SPR_LOG("dmaSPR1 chcr = 0x%x, madr = 0x%x, qwc = 0x%x\n"
|
||||
" tadr = 0x%x, sadr = 0x%x\n",
|
||||
spr1->chcr, spr1->madr, spr1->qwc,
|
||||
spr1->tadr, spr1->sadr);
|
||||
#endif
|
||||
|
||||
if ((spr1->chcr & 0xc) == 0x4 && spr1->qwc == 0){
|
||||
u32 *ptag;
|
||||
|
@ -440,8 +425,6 @@ void dmaSPR1() { // toSPR
|
|||
// It merely assumes that the last one has finished then starts another one (broke with the DMA fix)
|
||||
// This "shouldn't" cause any problems as SPR is generally faster than the other DMAS anyway. (Refraction)
|
||||
CPU_INT(9, spr1->qwc / BIAS);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void SPRTOinterrupt()
|
||||
|
|
|
@ -174,7 +174,7 @@ __forceinline void SIF0Dma()
|
|||
{
|
||||
|
||||
/*if ((psHu32(DMAC_CTRL) & 0xC0)) {
|
||||
SysPrintf("DMA Stall Control %x\n",(psHu32(DMAC_CTRL) & 0xC0));
|
||||
Console::WriteLn("DMA Stall Control %x", params (psHu32(DMAC_CTRL) & 0xC0));
|
||||
}*/
|
||||
if(iopsifbusy[0] == 1) // If EE SIF0 is enabled
|
||||
{
|
||||
|
@ -312,7 +312,7 @@ __forceinline void SIF0Dma()
|
|||
sif0dma->chcr = (sif0dma->chcr & 0xffff) | (tag[0] & 0xffff0000);
|
||||
|
||||
/*if ((sif0dma->chcr & 0x80) && (tag[0] >> 31)) {
|
||||
SysPrintf("SIF0 TIE\n");
|
||||
Console::WriteLn("SIF0 TIE");
|
||||
}*/
|
||||
SIF_LOG(" EE SIF dest chain tag madr:%08X qwc:%04X id:%X irq:%d(%08X_%08X)\n", sif0dma->madr, sif0dma->qwc, (tag[0]>>28)&3, (tag[0]>>31)&1, tag[1], tag[0]);
|
||||
|
||||
|
@ -367,7 +367,7 @@ __forceinline void SIF1Dma()
|
|||
sif1dma->qwc = (u16)ptag[0];
|
||||
|
||||
if (sif1dma->chcr & 0x40) {
|
||||
SysPrintf("SIF1 TTE\n");
|
||||
Console::WriteLn("SIF1 TTE");
|
||||
SIF1write(ptag+2, 2);
|
||||
}
|
||||
|
||||
|
@ -410,10 +410,10 @@ __forceinline void SIF1Dma()
|
|||
break;
|
||||
|
||||
default:
|
||||
SysPrintf("Bad addr1 source chain\n");
|
||||
Console::WriteLn("Bad addr1 source chain");
|
||||
}
|
||||
if ((sif1dma->chcr & 0x80) && (ptag[0] >> 31)) {
|
||||
SysPrintf("SIF1 TIE\n");
|
||||
Console::WriteLn("SIF1 TIE");
|
||||
sif1.end = 1;
|
||||
}
|
||||
}
|
||||
|
@ -535,7 +535,7 @@ __forceinline void dmaSIF0() {
|
|||
}
|
||||
// if(sif0dma->qwc > 0 & (sif0dma->chcr & 0x4) == 0x4) {
|
||||
// sif0dma->chcr &= ~4; //Halflife sets a QWC amount in chain mode, no tadr set.
|
||||
// SysPrintf("yo\n");
|
||||
// Console::WriteLn("yo");
|
||||
// }
|
||||
|
||||
psHu32(0x1000F240) |= 0x2000;
|
||||
|
@ -560,7 +560,7 @@ __forceinline void dmaSIF1() {
|
|||
|
||||
// if(sif1dma->qwc > 0 & (sif1dma->chcr & 0x4) == 0x4) {
|
||||
// sif1dma->chcr &= ~4; //Halflife sets a QWC amount in chain mode, no tadr set.
|
||||
// SysPrintf("yo2\n");
|
||||
// Console::WriteLn("yo2");
|
||||
// }
|
||||
|
||||
psHu32(0x1000F240) |= 0x4000;
|
||||
|
@ -582,7 +582,7 @@ __forceinline void dmaSIF2() {
|
|||
|
||||
sif2dma->chcr&= ~0x100;
|
||||
hwDmacIrq(7);
|
||||
SysPrintf("*PCSX2*: dmaSIF2\n");
|
||||
Console::WriteLn("*PCSX2*: dmaSIF2");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ void statsClose() {
|
|||
#else
|
||||
f = fopen(LOGS_DIR "/stats.txt", "w");
|
||||
#endif
|
||||
if (!f) { SysPrintf("Can't open stats.txt\n"); return; }
|
||||
if (!f) { Console::WriteLn("Can't open stats.txt"); return; }
|
||||
fprintf(f, "-- PCSX2 v%s statics--\n\n", PCSX2_VERSION);
|
||||
fprintf(f, "Ran for %d seconds\n", t);
|
||||
fprintf(f, "Total VSyncs: %d (%s)\n", stats.vsyncCount, Config.PsxType ? "PAL" : "NTSC");
|
||||
|
|
|
@ -165,14 +165,14 @@ void CTC2() {
|
|||
Console::Error("fixme: VU0 Force Break");
|
||||
}
|
||||
if (cpuRegs.GPR.r[_Rt_].UL[0] & 0x2) { // VU0 Reset
|
||||
//SysPrintf("fixme: VU0 Reset\n");
|
||||
//Console::WriteLn("fixme: VU0 Reset");
|
||||
vu0ResetRegs();
|
||||
}
|
||||
if (cpuRegs.GPR.r[_Rt_].UL[0] & 0x100) { // VU1 Force Break
|
||||
Console::Error("fixme: VU1 Force Break");
|
||||
}
|
||||
if (cpuRegs.GPR.r[_Rt_].UL[0] & 0x200) { // VU1 Reset
|
||||
// SysPrintf("fixme: VU1 Reset\n");
|
||||
// Console::WriteLn("fixme: VU1 Reset");
|
||||
vu1ResetRegs();
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -54,7 +54,7 @@ static void _vu0Exec(VURegs* VU)
|
|||
|
||||
if(VU0.VI[REG_TPC].UL >= VU0.maxmicro){
|
||||
#ifdef CPU_LOG
|
||||
SysPrintf("VU0 memory overflow!!: %x\n", VU->VI[REG_TPC].UL);
|
||||
Console::WriteLn("VU0 memory overflow!!: %x", params VU->VI[REG_TPC].UL);
|
||||
#endif
|
||||
VU0.VI[REG_VPU_STAT].UL&= ~0x1;
|
||||
VU->cycle++;
|
||||
|
@ -69,7 +69,7 @@ static void _vu0Exec(VURegs* VU)
|
|||
}
|
||||
if (ptr[1] & 0x20000000) { /* M flag */
|
||||
VU->flags|= VUFLAG_MFLAGSET;
|
||||
// SysPrintf("fixme: M flag set\n");
|
||||
// Console::WriteLn("fixme: M flag set");
|
||||
}
|
||||
if (ptr[1] & 0x10000000) { /* D flag */
|
||||
if (VU0.VI[REG_FBRST].UL & 0x4) {
|
||||
|
@ -108,19 +108,19 @@ static void _vu0Exec(VURegs* VU)
|
|||
vfreg = 0; vireg = 0;
|
||||
if (uregs.VFwrite) {
|
||||
if (lregs.VFwrite == uregs.VFwrite) {
|
||||
// SysPrintf("*PCSX2*: Warning, VF write to the same reg in both lower/upper cycle\n");
|
||||
// Console::Notice("*PCSX2*: Warning, VF write to the same reg in both lower/upper cycle");
|
||||
discard = 1;
|
||||
}
|
||||
if (lregs.VFread0 == uregs.VFwrite ||
|
||||
lregs.VFread1 == uregs.VFwrite) {
|
||||
// SysPrintf("saving reg %d at pc=%x\n", i, VU->VI[REG_TPC].UL);
|
||||
// Console::WriteLn("saving reg %d at pc=%x", params i, VU->VI[REG_TPC].UL);
|
||||
_VF = VU->VF[uregs.VFwrite];
|
||||
vfreg = uregs.VFwrite;
|
||||
}
|
||||
}
|
||||
if (uregs.VIread & (1 << REG_CLIP_FLAG)) {
|
||||
if (lregs.VIwrite & (1 << REG_CLIP_FLAG)) {
|
||||
SysPrintf("*PCSX2*: Warning, VI write to the same reg in both lower/upper cycle\n");
|
||||
Console::Notice("*PCSX2*: Warning, VI write to the same reg in both lower/upper cycle");
|
||||
discard = 1;
|
||||
}
|
||||
if (lregs.VIread & (1 << REG_CLIP_FLAG)) {
|
||||
|
@ -178,7 +178,7 @@ void vu0Exec(VURegs* VU)
|
|||
{
|
||||
if (VU->VI[REG_TPC].UL >= VU->maxmicro) {
|
||||
#ifdef CPU_LOG
|
||||
SysPrintf("VU0 memory overflow!!: %x\n", VU->VI[REG_TPC].UL);
|
||||
Console::Notice("VU0 memory overflow!!: %x", params VU->VI[REG_TPC].UL);
|
||||
#endif
|
||||
VU0.VI[REG_VPU_STAT].UL&= ~0x1;
|
||||
} else {
|
||||
|
|
|
@ -104,19 +104,19 @@ static void _vu1Exec(VURegs* VU)
|
|||
vfreg = 0; vireg = 0;
|
||||
if (uregs.VFwrite) {
|
||||
if (lregs.VFwrite == uregs.VFwrite) {
|
||||
// SysPrintf("*PCSX2*: Warning, VF write to the same reg in both lower/upper cycle\n");
|
||||
// Console::Notice("*PCSX2*: Warning, VF write to the same reg in both lower/upper cycle");
|
||||
discard = 1;
|
||||
}
|
||||
if (lregs.VFread0 == uregs.VFwrite ||
|
||||
lregs.VFread1 == uregs.VFwrite) {
|
||||
// SysPrintf("saving reg %d at pc=%x\n", i, VU->VI[REG_TPC].UL);
|
||||
// Console::WriteLn("saving reg %d at pc=%x", params i, VU->VI[REG_TPC].UL);
|
||||
_VF = VU->VF[uregs.VFwrite];
|
||||
vfreg = uregs.VFwrite;
|
||||
}
|
||||
}
|
||||
if (uregs.VIread & (1 << REG_CLIP_FLAG)) {
|
||||
if (lregs.VIwrite & (1 << REG_CLIP_FLAG)) {
|
||||
SysPrintf("*PCSX2*: Warning, VI write to the same reg in both lower/upper cycle\n");
|
||||
Console::Notice("*PCSX2*: Warning, VI write to the same reg in both lower/upper cycle");
|
||||
discard = 1;
|
||||
}
|
||||
if (lregs.VIread & (1 << REG_CLIP_FLAG)) {
|
||||
|
|
|
@ -179,9 +179,8 @@ void _vuFMACAdd(VURegs * VU, int reg, int xyzw) {
|
|||
if (VU->fmac[i].enable == 1) continue;
|
||||
break;
|
||||
}
|
||||
if (i==8) {
|
||||
// SysPrintf("*PCSX2*: error , out of fmacs %d\n", VU->cycle);
|
||||
}
|
||||
//if (i==8) Console::Error("*PCSX2*: error , out of fmacs %d", params VU->cycle);
|
||||
|
||||
|
||||
VUM_LOG("adding FMAC pipe[%d]; xyzw=%x\n", i, xyzw);
|
||||
|
||||
|
|
|
@ -554,7 +554,7 @@ void mfifoVIF1transfer(int qwc) {
|
|||
temp = vif1ch->madr; //Temporarily Store ADDR
|
||||
vif1ch->madr = psHu32(DMAC_RBOR) + ((vif1ch->tadr + 16) & psHu32(DMAC_RBSR)); //Set MADR to QW following the tag
|
||||
vif1ch->tadr = temp; //Copy temporarily stored ADDR to Tag
|
||||
if((temp & psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR)) SysPrintf("Next tag = %x outside ring %x size %x\n", temp, psHu32(DMAC_RBOR), psHu32(DMAC_RBSR));
|
||||
if((temp & psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR)) Console::WriteLn("Next tag = %x outside ring %x size %x", params temp, psHu32(DMAC_RBOR), psHu32(DMAC_RBSR));
|
||||
vif1.done = 0;
|
||||
break;
|
||||
|
||||
|
@ -581,7 +581,7 @@ void mfifoVIF1transfer(int qwc) {
|
|||
vif1.inprogress |= 1;
|
||||
|
||||
/*if (ret == -1) {
|
||||
SysPrintf("VIF dmaChain error size=%d, madr=%lx, tadr=%lx\n",
|
||||
Console::WriteLn("VIF dmaChain error size=%d, madr=%lx, tadr=%lx", params
|
||||
vif1ch->qwc, vif1ch->madr, vif1ch->tadr);
|
||||
vif1.done = 1;
|
||||
//CPU_INT(10,g_vifCycles);
|
||||
|
@ -622,7 +622,7 @@ void vifMFIFOInterrupt()
|
|||
if(vif1.done != 1 || vif1.inprogress & 1) {
|
||||
|
||||
if(vifqwc <= 0){
|
||||
//SysPrintf("Empty\n");
|
||||
//Console::WriteLn("Empty");
|
||||
vif1.inprogress |= 0x10;
|
||||
hwDmacIrq(14);
|
||||
return;
|
||||
|
@ -641,7 +641,7 @@ void vifMFIFOInterrupt()
|
|||
|
||||
return;
|
||||
} else if(vifqwc <= 0){
|
||||
//SysPrintf("Empty\n");
|
||||
//Console::WriteLn("Empty");
|
||||
//vif1.inprogress |= 0x10;
|
||||
hwDmacIrq(14);
|
||||
//return;
|
||||
|
@ -649,8 +649,7 @@ void vifMFIFOInterrupt()
|
|||
|
||||
//On a TIE break we do not clear the MFIFO (Art of Fighting)
|
||||
//If we dont clear it on MFIFO end, Tekken Tag breaks, understandably (Refraction)
|
||||
if(mfifodmairq == 0)
|
||||
vifqwc = 0;
|
||||
if(mfifodmairq == 0) vifqwc = 0;
|
||||
|
||||
vif1.done = 1;
|
||||
g_vifCycles = 0;
|
||||
|
|
400
pcsx2/VifDma.cpp
400
pcsx2/VifDma.cpp
|
@ -305,7 +305,7 @@ static void ProcessMemSkip(int size, unsigned int unpackType, const unsigned int
|
|||
VIFUNPACK_LOG("Processing V4-5 skip, size = %d\n", size);
|
||||
break;
|
||||
default:
|
||||
SysPrintf("Invalid unpack type %x\n", unpackType);
|
||||
Console::WriteLn("Invalid unpack type %x", params unpackType);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -369,9 +369,9 @@ static void VIFunpack(u32 *data, vifCode *v, int size, const unsigned int VIFdma
|
|||
VIF_LOG("*PCSX2*: warning v->size != size\n");
|
||||
}
|
||||
if ((v->addr+size*4) > memsize) {
|
||||
SysPrintf("*PCSX2*: fixme unpack overflow\n");
|
||||
SysPrintf( "VIF%d UNPACK: Mode=%x, v->size=%d, size=%d, v->addr=%x\n",
|
||||
VIFdmanum, v->cmd & 0xf, v->size, size, v->addr );
|
||||
Console::Notice("*PCSX2*: fixme unpack overflow\n");
|
||||
Console::WriteLn( "VIF%d UNPACK: Mode=%x, v->size=%d, size=%d, v->addr=%x\n",
|
||||
params VIFdmanum, v->cmd & 0xf, v->size, size, v->addr );
|
||||
}
|
||||
#endif
|
||||
// The unpack type
|
||||
|
@ -409,14 +409,14 @@ static void VIFunpack(u32 *data, vifCode *v, int size, const unsigned int VIFdma
|
|||
{
|
||||
if(((u32)size/(u32)ft->dsize) < ((u32)ft->qsize - vifRegs->offset))
|
||||
{
|
||||
SysPrintf("wasnt enough left size/dsize = %x left to write %x\n", (size/ft->dsize), (ft->qsize - vifRegs->offset));
|
||||
Console::WriteLn("wasnt enough left size/dsize = %x left to write %x", params (size/ft->dsize), (ft->qsize - vifRegs->offset));
|
||||
}
|
||||
unpacksize = min(((u32)size/(u32)ft->dsize), ((u32)ft->qsize - vifRegs->offset));
|
||||
}
|
||||
else
|
||||
{
|
||||
unpacksize = 0;
|
||||
SysPrintf("Unpack align offset = 0\n");
|
||||
Console::WriteLn("Unpack align offset = 0");
|
||||
}
|
||||
destinc = (4 - ft->qsize) + unpacksize;
|
||||
|
||||
|
@ -672,7 +672,7 @@ static void vuExecMicro( u32 addr, const u32 VIFdmanum )
|
|||
vif1FLUSH();
|
||||
}
|
||||
if(VU->vifRegs->itops > (VIFdmanum ? 0x3ffu : 0xffu))
|
||||
SysPrintf("VIF%d ITOP overrun! %x\n", VIFdmanum, VU->vifRegs->itops);
|
||||
Console::WriteLn("VIF%d ITOP overrun! %x", params VIFdmanum, VU->vifRegs->itops);
|
||||
|
||||
VU->vifRegs->itop = VU->vifRegs->itops;
|
||||
|
||||
|
@ -727,7 +727,7 @@ static __forceinline void vif0UNPACK(u32 *data) {
|
|||
int len;
|
||||
|
||||
if(vif0Regs->cycle.wl == 0 && vif0Regs->cycle.wl < vif0Regs->cycle.cl){
|
||||
SysPrintf("Vif0 CL %d, WL %d\n", vif0Regs->cycle.cl, vif0Regs->cycle.wl);
|
||||
Console::WriteLn("Vif0 CL %d, WL %d", params vif0Regs->cycle.cl, vif0Regs->cycle.wl);
|
||||
vif0.cmd &= ~0x7f;
|
||||
return;
|
||||
}
|
||||
|
@ -759,7 +759,7 @@ static __forceinline void vif0UNPACK(u32 *data) {
|
|||
}
|
||||
|
||||
static __forceinline void _vif0mpgTransfer(u32 addr, u32 *data, int size) {
|
||||
/* SysPrintf("_vif0mpgTransfer addr=%x; size=%x\n", addr, size);
|
||||
/* Console::WriteLn("_vif0mpgTransfer addr=%x; size=%x", params addr, size);
|
||||
{
|
||||
FILE *f = fopen("vu1.raw", "wb");
|
||||
fwrite(data, 1, size*4, f);
|
||||
|
@ -777,7 +777,7 @@ static __forceinline void _vif0mpgTransfer(u32 addr, u32 *data, int size) {
|
|||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int __fastcall Vif0TransNull(u32 *data){ // Shouldnt go here
|
||||
SysPrintf("VIF0 Shouldnt go here CMD = %x\n", vif0Regs->code);
|
||||
Console::WriteLn("VIF0 Shouldnt go here CMD = %x", params vif0Regs->code);
|
||||
vif0.cmd = 0;
|
||||
return 0;
|
||||
}
|
||||
|
@ -941,7 +941,7 @@ static void Vif0CMDMPGTransfer(){ // MPG
|
|||
static void Vif0CMDNull(){ // invalid opcode
|
||||
// if ME1, then force the vif to interrupt
|
||||
if ((vif0Regs->err & 0x4) == 0) { //Ignore vifcode and tag mismatch error
|
||||
SysPrintf( "UNKNOWN VifCmd: %x\n", vif0.cmd );
|
||||
Console::WriteLn( "UNKNOWN VifCmd: %x", params vif0.cmd );
|
||||
vif0Regs->stat |= 1 << 13;
|
||||
vif0.irq++;
|
||||
}
|
||||
|
@ -972,7 +972,7 @@ int VIF0transfer(u32 *data, int size, int istag) {
|
|||
|
||||
|
||||
|
||||
if(vif0.tag.size != 0) SysPrintf("no vif0 cmd but tag size is left last cmd read %x\n", vif0Regs->code);
|
||||
if(vif0.tag.size != 0) Console::WriteLn("no vif0 cmd but tag size is left last cmd read %x", params vif0Regs->code);
|
||||
// if interrupt and new cmd is NOT MARK
|
||||
if(vif0.irq) break;
|
||||
|
||||
|
@ -988,7 +988,7 @@ int VIF0transfer(u32 *data, int size, int istag) {
|
|||
|
||||
if((vif0.cmd & 0x7f) > 0x4A){
|
||||
if ((vif0Regs->err & 0x4) == 0) { //Ignore vifcode and tag mismatch error
|
||||
SysPrintf( "UNKNOWN VifCmd: %x\n", vif0.cmd );
|
||||
Console::WriteLn( "UNKNOWN VifCmd: %x", params vif0.cmd );
|
||||
vif0Regs->stat |= 1 << 13;
|
||||
vif0.irq++;
|
||||
}
|
||||
|
@ -1025,7 +1025,7 @@ int VIF0transfer(u32 *data, int size, int istag) {
|
|||
vif0.vifstalled = 1;
|
||||
|
||||
if(((vif0Regs->code >> 24) & 0x7f) != 0x7)vif0Regs->stat|= VIF0_STAT_VIS;
|
||||
//else SysPrintf("VIF0 IRQ on MARK\n");
|
||||
//else Console::WriteLn("VIF0 IRQ on MARK");
|
||||
// spiderman doesn't break on qw boundaries
|
||||
vif0.irqoffset = transferred%4; // cannot lose the offset
|
||||
|
||||
|
@ -1036,7 +1036,7 @@ int VIF0transfer(u32 *data, int size, int istag) {
|
|||
transferred = transferred >> 2;
|
||||
vif0ch->madr+= (transferred << 4);
|
||||
vif0ch->qwc-= transferred;
|
||||
//SysPrintf("Stall on vif0, FromSPR = %x, Vif0MADR = %x Sif0MADR = %x STADR = %x\n", psHu32(0x1000d010), vif0ch->madr, psHu32(0x1000c010), psHu32(DMAC_STADR));
|
||||
//Console::WriteLn("Stall on vif0, FromSPR = %x, Vif0MADR = %x Sif0MADR = %x STADR = %x", params psHu32(0x1000d010), vif0ch->madr, psHu32(0x1000c010), psHu32(DMAC_STADR));
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
@ -1081,7 +1081,7 @@ int _chainVIF0() {
|
|||
|
||||
vif0ptag = (u32*)dmaGetAddr(vif0ch->tadr); //Set memory pointer to TADR
|
||||
if (vif0ptag == NULL) { //Is vif0ptag empty?
|
||||
SysPrintf("Vif0 Tag BUSERR\n");
|
||||
Console::Error("Vif0 Tag BUSERR");
|
||||
vif0ch->chcr = ( vif0ch->chcr & 0xFFFF ) | ( (*vif0ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15
|
||||
psHu32(DMAC_STAT)|= 1<<15; //If yes, set BEIS (BUSERR) in DMAC_STAT register
|
||||
return -1; //Return -1 as an error has occurred
|
||||
|
@ -1152,13 +1152,13 @@ void vif0Interrupt() {
|
|||
}
|
||||
|
||||
|
||||
if((vif0ch->chcr & 0x100) == 0) SysPrintf("Vif0 running when CHCR = %x\n", vif0ch->chcr);
|
||||
if((vif0ch->chcr & 0x100) == 0) Console::WriteLn("Vif0 running when CHCR = %x", params vif0ch->chcr);
|
||||
|
||||
|
||||
if (vif0ch->chcr & 0x4 && vif0.done == 0 && vif0.vifstalled == 0) {
|
||||
|
||||
if( !(psHu32(DMAC_CTRL) & 0x1) ) {
|
||||
SysPrintf("vif0 dma masked\n");
|
||||
Console::WriteLn("vif0 dma masked\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1169,8 +1169,8 @@ void vif0Interrupt() {
|
|||
}
|
||||
|
||||
|
||||
if(vif0ch->qwc > 0) SysPrintf("VIF0 Ending with QWC left\n");
|
||||
if(vif0.cmd != 0) SysPrintf("vif0.cmd still set %x\n", vif0.cmd);
|
||||
if(vif0ch->qwc > 0) Console::WriteLn("VIF0 Ending with QWC left");
|
||||
if(vif0.cmd != 0) Console::WriteLn("vif0.cmd still set %x", params vif0.cmd);
|
||||
vif0ch->chcr &= ~0x100;
|
||||
hwDmacIrq(DMAC_VIF0);
|
||||
vif0Regs->stat&= ~0xF000000; // FQC=0
|
||||
|
@ -1226,7 +1226,7 @@ void dmaVIF0() {
|
|||
|
||||
if (!(vif0ch->chcr & 0x4) || vif0ch->qwc > 0) { // Normal Mode
|
||||
if(_VIF0chain() == -2) {
|
||||
SysPrintf("Stall on normal %x\n", vif0Regs->stat);
|
||||
Console::WriteLn("Stall on normal %x", params vif0Regs->stat);
|
||||
vif0.vifstalled = 1;
|
||||
return;
|
||||
}
|
||||
|
@ -1242,19 +1242,22 @@ void dmaVIF0() {
|
|||
|
||||
|
||||
void vif0Write32(u32 mem, u32 value) {
|
||||
if (mem == 0x10003830) { // MARK
|
||||
if (mem == 0x10003830) // MARK
|
||||
{
|
||||
VIF_LOG("VIF0_MARK write32 0x%8.8x\n", value);
|
||||
|
||||
/* Clear mark flag in VIF0_STAT and set mark with 'value' */
|
||||
vif0Regs->stat&= ~VIF0_STAT_MRK;
|
||||
vif0Regs->mark = value;
|
||||
} else
|
||||
if (mem == 0x10003810) { // FBRST
|
||||
}
|
||||
else if (mem == 0x10003810) // FBRST
|
||||
{
|
||||
VIF_LOG("VIF0_FBRST write32 0x%8.8x\n", value);
|
||||
|
||||
if (value & 0x1) {
|
||||
if (value & 0x1)
|
||||
{
|
||||
/* Reset VIF */
|
||||
//SysPrintf("Vif0 Reset %x\n", vif0Regs->stat);
|
||||
//Console::WriteLn("Vif0 Reset %x", params vif0Regs->stat);
|
||||
memzero_obj(vif0);
|
||||
vif0ch->qwc = 0; //?
|
||||
cpuRegs.interrupt &= ~1; //Stop all vif0 DMA's
|
||||
|
@ -1264,7 +1267,8 @@ void vif0Write32(u32 mem, u32 value) {
|
|||
vif0Regs->err = 0;
|
||||
vif0Regs->stat&= ~(0xF000000|VIF0_STAT_INT|VIF0_STAT_VSS|VIF0_STAT_VIS|VIF0_STAT_VFS|VIF0_STAT_VPS); // FQC=0
|
||||
}
|
||||
if (value & 0x2) {
|
||||
if (value & 0x2)
|
||||
{
|
||||
/* Force Break the VIF */
|
||||
/* I guess we should stop the VIF dma here
|
||||
but not 100% sure (linuz) */
|
||||
|
@ -1272,9 +1276,10 @@ void vif0Write32(u32 mem, u32 value) {
|
|||
vif0Regs->stat |= VIF0_STAT_VFS;
|
||||
vif0Regs->stat &= ~VIF0_STAT_VPS;
|
||||
vif0.vifstalled = 1;
|
||||
SysPrintf("vif0 force break\n");
|
||||
Console::WriteLn("vif0 force break");
|
||||
}
|
||||
if (value & 0x4) {
|
||||
if (value & 0x4)
|
||||
{
|
||||
/* Stop VIF */
|
||||
/* Not completly sure about this, can't remember what game
|
||||
used this, but 'draining' the VIF helped it, instead of
|
||||
|
@ -1283,47 +1288,59 @@ void vif0Write32(u32 mem, u32 value) {
|
|||
vif0Regs->stat &= ~VIF0_STAT_VPS;
|
||||
vif0.vifstalled = 1;
|
||||
}
|
||||
if (value & 0x8) {
|
||||
if (value & 0x8)
|
||||
{
|
||||
int cancel = 0;
|
||||
|
||||
/* Cancel stall, first check if there is a stall to cancel,
|
||||
and then clear VIF0_STAT VSS|VFS|VIS|INT|ER0|ER1 bits */
|
||||
if (vif0Regs->stat & (VIF0_STAT_VSS|VIF0_STAT_VIS|VIF0_STAT_VFS)) {
|
||||
if (vif0Regs->stat & (VIF0_STAT_VSS|VIF0_STAT_VIS|VIF0_STAT_VFS))
|
||||
cancel = 1;
|
||||
}
|
||||
|
||||
vif0Regs->stat &= ~(VIF0_STAT_VSS | VIF0_STAT_VFS | VIF0_STAT_VIS |
|
||||
VIF0_STAT_INT | VIF0_STAT_ER0 | VIF0_STAT_ER1);
|
||||
if (cancel) {
|
||||
|
||||
if( vif0.vifstalled ) {
|
||||
if (cancel)
|
||||
{
|
||||
if( vif0.vifstalled )
|
||||
{
|
||||
g_vifCycles = 0;
|
||||
|
||||
// loop necessary for spiderman
|
||||
if(vif0.stallontag == 1){
|
||||
_chainVIF0();
|
||||
} else _VIF0chain();
|
||||
if(vif0.stallontag == 1)
|
||||
_chainVIF0();
|
||||
else
|
||||
_VIF0chain();
|
||||
|
||||
vif0ch->chcr |= 0x100;
|
||||
CPU_INT(0, g_vifCycles); // Gets the timing right - Flatout
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
if (mem == 0x10003820) { // ERR
|
||||
}
|
||||
else if (mem == 0x10003820)
|
||||
{ // ERR
|
||||
VIF_LOG("VIF0_ERR write32 0x%8.8x\n", value);
|
||||
|
||||
/* Set VIF0_ERR with 'value' */
|
||||
vif0Regs->err = value;
|
||||
} else{
|
||||
SysPrintf("Unknown Vif0 write to %x\n", mem);
|
||||
if( mem >= 0x10003900 && mem < 0x10003980 ) {
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Console::WriteLn("Unknown Vif0 write to %x", params mem);
|
||||
if( mem >= 0x10003900 && mem < 0x10003980 )
|
||||
{
|
||||
assert( (mem&0xf) == 0 );
|
||||
|
||||
if( mem < 0x10003940 )
|
||||
g_vifRow0[(mem>>4)&3] = value;
|
||||
else
|
||||
g_vifCol0[(mem>>4)&3] = value;
|
||||
} else psHu32(mem) = value;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
psHu32(mem) = value;
|
||||
}
|
||||
}
|
||||
|
||||
/* Other registers are read-only so do nothing for them */
|
||||
|
@ -1372,50 +1389,57 @@ void vif1Init() {
|
|||
|
||||
static __forceinline void vif1UNPACK(u32 *data) {
|
||||
int vifNum;
|
||||
int vl, vn;
|
||||
//int len;
|
||||
if(vif1Regs->cycle.wl == 0){
|
||||
if(vif1Regs->cycle.wl < vif1Regs->cycle.cl){
|
||||
SysPrintf("Vif1 CL %d, WL %d\n", vif1Regs->cycle.cl, vif1Regs->cycle.wl);
|
||||
int vl, vn;
|
||||
|
||||
if(vif1Regs->cycle.wl == 0)
|
||||
{
|
||||
if(vif1Regs->cycle.wl < vif1Regs->cycle.cl)
|
||||
{
|
||||
Console::WriteLn("Vif1 CL %d, WL %d", params vif1Regs->cycle.cl, vif1Regs->cycle.wl);
|
||||
vif1.cmd &= ~0x7f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
vif1FLUSH();
|
||||
|
||||
vl = (vif1.cmd ) & 0x3;
|
||||
vn = (vif1.cmd >> 2) & 0x3;
|
||||
vl = (vif1.cmd) & 0x3;
|
||||
vn = (vif1.cmd >> 2) & 0x3;
|
||||
|
||||
vif1.usn = (vif1Regs->code >> 14) & 0x1;
|
||||
vifNum = (vif1Regs->code >> 16) & 0xff;
|
||||
if ( vifNum == 0 ) vifNum = 256;
|
||||
vif1.usn = (vif1Regs->code >> 14) & 0x1;
|
||||
vifNum = (vif1Regs->code >> 16) & 0xff;
|
||||
|
||||
if ( vifNum == 0 ) vifNum = 256;
|
||||
vif1Regs->num = vifNum;
|
||||
|
||||
if ( vif1Regs->cycle.wl <= vif1Regs->cycle.cl ) {
|
||||
vif1.tag.size = ((( 32 >> vl ) * ( vn + 1 )) * vifNum + 31) >> 5;
|
||||
} else {
|
||||
int n = vif1Regs->cycle.cl * (vifNum / vif1Regs->cycle.wl) +
|
||||
_limit( vifNum % vif1Regs->cycle.wl, vif1Regs->cycle.cl );
|
||||
vif1.tag.size = ( ((( 32 >> vl ) * ( vn + 1 )) * n) + 31 ) >> 5;
|
||||
}
|
||||
if ( ( vif1Regs->code >> 15) & 0x1 ) {
|
||||
vif1.tag.addr = (vif1Regs->code + vif1Regs->tops) & 0x3ff;
|
||||
} else vif1.tag.addr = vif1Regs->code & 0x3ff;
|
||||
if ( vif1Regs->cycle.wl <= vif1Regs->cycle.cl )
|
||||
{
|
||||
vif1.tag.size = ((( 32 >> vl ) * ( vn + 1 )) * vifNum + 31) >> 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
int n = vif1Regs->cycle.cl * (vifNum / vif1Regs->cycle.wl) +
|
||||
_limit( vifNum % vif1Regs->cycle.wl, vif1Regs->cycle.cl );
|
||||
vif1.tag.size = ( ((( 32 >> vl ) * ( vn + 1 )) * n) + 31 ) >> 5;
|
||||
}
|
||||
if (( vif1Regs->code >> 15) & 0x1)
|
||||
vif1.tag.addr = (vif1Regs->code + vif1Regs->tops) & 0x3ff;
|
||||
else
|
||||
vif1.tag.addr = vif1Regs->code & 0x3ff;
|
||||
|
||||
vif1.cl = 0;
|
||||
vif1.tag.addr <<= 4;
|
||||
vif1.cl = 0;
|
||||
vif1.tag.addr <<= 4;
|
||||
|
||||
vif1.tag.cmd = vif1.cmd;
|
||||
vif1.tag.cmd = vif1.cmd;
|
||||
}
|
||||
|
||||
static __forceinline void _vif1mpgTransfer(u32 addr, u32 *data, int size) {
|
||||
/* SysPrintf("_vif1mpgTransfer addr=%x; size=%x\n", addr, size);
|
||||
/* Console::WriteLn("_vif1mpgTransfer addr=%x; size=%x", params addr, size);
|
||||
{
|
||||
FILE *f = fopen("vu1.raw", "wb");
|
||||
fwrite(data, 1, size*4, f);
|
||||
fclose(f);
|
||||
}*/
|
||||
assert( VU1.Micro > 0 );
|
||||
assert( VU1.Micro > 0 );
|
||||
if (memcmp(VU1.Micro + addr, data, size << 2)) {
|
||||
CpuVU1.Clear(addr, size << 2); // Clear before writing! :/
|
||||
memcpy_fast(VU1.Micro + addr, data, size << 2);
|
||||
|
@ -1427,7 +1451,7 @@ static __forceinline void _vif1mpgTransfer(u32 addr, u32 *data, int size) {
|
|||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int __fastcall Vif1TransNull(u32 *data){ // Shouldnt go here
|
||||
SysPrintf("Shouldnt go here CMD = %x\n", vif1Regs->code);
|
||||
Console::WriteLn("Shouldnt go here CMD = %x", params vif1Regs->code);
|
||||
vif1.cmd = 0;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1442,7 +1466,7 @@ static int __fastcall Vif1TransSTMask(u32 *data){ // STMASK
|
|||
}
|
||||
|
||||
static int __fastcall Vif1TransSTRow(u32 *data){
|
||||
int ret;
|
||||
int ret;
|
||||
|
||||
u32* pmem = &vif1Regs->r0+(vif1.tag.addr<<2);
|
||||
u32* pmem2 = g_vifRow1+vif1.tag.addr;
|
||||
|
@ -1469,7 +1493,7 @@ static int __fastcall Vif1TransSTCol(u32 *data){
|
|||
u32* pmem = &vif1Regs->c0+(vif1.tag.addr<<2);
|
||||
u32* pmem2 = g_vifCol1+vif1.tag.addr;
|
||||
ret = min(4-vif1.tag.addr, vif1.vifpacketsize);
|
||||
switch(ret) {
|
||||
switch(ret) {
|
||||
case 4: pmem[12] = data[3]; pmem2[3] = data[3];
|
||||
case 3: pmem[8] = data[2]; pmem2[2] = data[2];
|
||||
case 2: pmem[4] = data[1]; pmem2[1] = data[1];
|
||||
|
@ -1477,25 +1501,28 @@ static int __fastcall Vif1TransSTCol(u32 *data){
|
|||
jNO_DEFAULT;
|
||||
}
|
||||
vif1.tag.addr += ret;
|
||||
vif1.tag.size -= ret;
|
||||
vif1.tag.size -= ret;
|
||||
if(vif1.tag.size == 0) vif1.cmd = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __fastcall Vif1TransMPG(u32 *data){
|
||||
if (vif1.vifpacketsize < vif1.tag.size) {
|
||||
if (vif1.vifpacketsize < vif1.tag.size)
|
||||
{
|
||||
_vif1mpgTransfer(vif1.tag.addr, data, vif1.vifpacketsize);
|
||||
vif1.tag.addr += vif1.vifpacketsize << 2;
|
||||
vif1.tag.size -= vif1.vifpacketsize;
|
||||
return vif1.vifpacketsize;
|
||||
} else {
|
||||
vif1.tag.addr += vif1.vifpacketsize << 2;
|
||||
vif1.tag.size -= vif1.vifpacketsize;
|
||||
return vif1.vifpacketsize;
|
||||
}
|
||||
else
|
||||
{
|
||||
int ret;
|
||||
_vif1mpgTransfer(vif1.tag.addr, data, vif1.tag.size);
|
||||
ret = vif1.tag.size;
|
||||
vif1.tag.size = 0;
|
||||
vif1.tag.size = 0;
|
||||
vif1.cmd = 0;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
u32 splittransfer[4];
|
||||
u32 splitptr = 0;
|
||||
|
@ -1503,7 +1530,6 @@ u32 splitptr = 0;
|
|||
static int __fastcall Vif1TransDirectHL(u32 *data){
|
||||
int ret = 0;
|
||||
|
||||
|
||||
if(splitptr > 0){ //Leftover data from the last packet, filling the rest and sending to the GS
|
||||
if(splitptr < 4 && vif1.vifpacketsize >= (4-splitptr)){
|
||||
|
||||
|
@ -1640,31 +1666,38 @@ static void Vif1CMDSTMod(){ // STMOD
|
|||
static void Vif1CMDMskPath3(){ // MSKPATH3
|
||||
|
||||
vif1Regs->mskpath3 = (vif1Regs->code >> 15) & 0x1;
|
||||
//SysPrintf("VIF MSKPATH3 %x\n", vif1Regs->mskpath3);
|
||||
#ifdef GSPATH3FIX
|
||||
//Console::WriteLn("VIF MSKPATH3 %x", params vif1Regs->mskpath3);
|
||||
|
||||
if ( (vif1Regs->code >> 15) & 0x1 ) {
|
||||
while((gif->chcr & 0x100)){ //Can be done 2 different ways, depends on the game/company
|
||||
if(path3hack == 0)if(Path3transfer == 0 && gif->qwc == 0) break;
|
||||
#ifdef GSPATH3FIX
|
||||
if ( (vif1Regs->code >> 15) & 0x1 )
|
||||
{
|
||||
while((gif->chcr & 0x100)) //Can be done 2 different ways, depends on the game/company
|
||||
{
|
||||
if ((path3hack == 0) && (Path3transfer == 0) && (gif->qwc == 0)) break;
|
||||
|
||||
gsInterrupt();
|
||||
|
||||
if(path3hack == 1)if(gif->qwc == 0) break; //add games not working with it to elfheader.c to enable this instead
|
||||
if ((path3hack == 1) && (gif->qwc == 0)) break; //add games not working with it to elfheader.c to enable this instead
|
||||
}
|
||||
//while(gif->chcr & 0x100) gsInterrupt(); // Finish the transfer first
|
||||
psHu32(GIF_STAT) |= 0x2;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
if(gif->chcr & 0x100) CPU_INT(2, (transferred>>2) * BIAS); // Restart Path3 on its own, time it right!
|
||||
psHu32(GIF_STAT) &= ~0x2;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if ( vif1Regs->mskpath3 ) {
|
||||
if ( vif1Regs->mskpath3 )
|
||||
{
|
||||
if(gif->qwc) _GIFchain(); // Finish the transfer first
|
||||
psHu32(GIF_STAT) |= 0x2;
|
||||
} else {
|
||||
psHu32(GIF_STAT) |= 0x2;
|
||||
}
|
||||
else
|
||||
{
|
||||
psHu32(GIF_STAT) &= ~0x2;
|
||||
if(gif->qwc) _GIFchain(); // Finish the transfer first
|
||||
}
|
||||
}
|
||||
#endif
|
||||
vif1.cmd &= ~0x7f;
|
||||
}
|
||||
|
@ -1700,38 +1733,43 @@ static void Vif1CMDSTMask(){ // STMASK
|
|||
}
|
||||
static void Vif1CMDSTRowCol(){// STROW / STCOL
|
||||
vif1.tag.addr = 0;
|
||||
vif1.tag.size = 4;
|
||||
vif1.tag.size = 4;
|
||||
}
|
||||
|
||||
static void Vif1CMDMPGTransfer(){ // MPG
|
||||
int vifNum;
|
||||
vif1FLUSH();
|
||||
vifNum = (u8)(vif1Regs->code >> 16);
|
||||
if (vifNum == 0) vifNum = 256;
|
||||
vif1.tag.addr = (u16)((vif1Regs->code) << 3) & 0x3fff;
|
||||
vif1.tag.size = vifNum * 2;
|
||||
vifNum = (u8)(vif1Regs->code >> 16);
|
||||
|
||||
if (vifNum == 0) vifNum = 256;
|
||||
|
||||
vif1.tag.addr = (u16)((vif1Regs->code) << 3) & 0x3fff;
|
||||
vif1.tag.size = vifNum * 2;
|
||||
}
|
||||
static void Vif1CMDDirectHL(){ // DIRECT/HL
|
||||
int vifImm;
|
||||
vifImm = (u16)vif1Regs->code;
|
||||
if (vifImm == 0) {
|
||||
|
||||
if (vifImm == 0)
|
||||
vif1.tag.size = 65536 << 2;
|
||||
} else {
|
||||
else
|
||||
vif1.tag.size = vifImm << 2;
|
||||
|
||||
while((gif->chcr & 0x100) && (vif1.cmd & 0x7f) == 0x51)
|
||||
{
|
||||
gsInterrupt(); //DirectHL flushes the lot
|
||||
//if((psHu32(GIF_STAT) & 0xE00) == 0) break;
|
||||
}
|
||||
while((gif->chcr & 0x100) && (vif1.cmd & 0x7f) == 0x51){
|
||||
gsInterrupt(); //DirectHL flushes the lot
|
||||
//if((psHu32(GIF_STAT) & 0xE00) == 0) break;
|
||||
}
|
||||
}
|
||||
static void Vif1CMDNull(){ // invalid opcode
|
||||
// if ME1, then force the vif to interrupt
|
||||
|
||||
if ((vif1Regs->err & 0x4) == 0) { //Ignore vifcode and tag mismatch error
|
||||
SysPrintf( "UNKNOWN VifCmd: %x\n", vif1.cmd );
|
||||
vif1Regs->stat |= 1 << 13;
|
||||
vif1.irq++;
|
||||
}
|
||||
if ((vif1Regs->err & 0x4) == 0) //Ignore vifcode and tag mismatch error
|
||||
{
|
||||
Console::WriteLn( "UNKNOWN VifCmd: %x\n", params vif1.cmd );
|
||||
vif1Regs->stat |= 1 << 13;
|
||||
vif1.irq++;
|
||||
}
|
||||
vif1.cmd = 0;
|
||||
}
|
||||
|
||||
|
@ -1812,12 +1850,14 @@ int VIF1transfer(u32 *data, int size, int istag) {
|
|||
vif1Regs->stat |= VIF1_STAT_VPS_D;
|
||||
if ((vif1.cmd & 0x60) == 0x60) {
|
||||
vif1UNPACK(data);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
VIF_LOG( "VIFtransfer: cmd %x, num %x, imm %x, size %x\n", vif1.cmd, (data[0] >> 16) & 0xff, data[0] & 0xffff, vif1.vifpacketsize );
|
||||
|
||||
if((vif1.cmd & 0x7f) > 0x51){
|
||||
if ((vif1Regs->err & 0x4) == 0) { //Ignore vifcode and tag mismatch error
|
||||
SysPrintf( "UNKNOWN VifCmd: %x\n", vif1.cmd );
|
||||
Console::WriteLn( "UNKNOWN VifCmd: %x\n", params vif1.cmd );
|
||||
vif1Regs->stat |= 1 << 13;
|
||||
vif1.irq++;
|
||||
}
|
||||
|
@ -1859,15 +1899,14 @@ int VIF1transfer(u32 *data, int size, int istag) {
|
|||
|
||||
// spiderman doesn't break on qw boundaries
|
||||
|
||||
if( istag ) {
|
||||
return -2;
|
||||
}
|
||||
if (istag) return -2;
|
||||
|
||||
|
||||
transferred = transferred >> 2;
|
||||
vif1ch->madr+= (transferred << 4);
|
||||
vif1ch->qwc-= transferred;
|
||||
if(vif1ch->qwc == 0 && vif1.irqoffset == 0) vif1.inprogress = 0;
|
||||
//SysPrintf("Stall on vif1, FromSPR = %x, Vif1MADR = %x Sif0MADR = %x STADR = %x\n", psHu32(0x1000d010), vif1ch->madr, psHu32(0x1000c010), psHu32(DMAC_STADR));
|
||||
//Console::WriteLn("Stall on vif1, FromSPR = %x, Vif1MADR = %x Sif0MADR = %x STADR = %x", params psHu32(0x1000d010), vif1ch->madr, psHu32(0x1000c010), psHu32(DMAC_STADR));
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
@ -1875,7 +1914,6 @@ int VIF1transfer(u32 *data, int size, int istag) {
|
|||
if( vif1.cmd ) vif1Regs->stat |= VIF1_STAT_VPS_W; //Otherwise we wait for the data
|
||||
|
||||
if( !istag ) {
|
||||
|
||||
transferred = transferred >> 2;
|
||||
vif1ch->madr+= (transferred << 4);
|
||||
vif1ch->qwc-= transferred;
|
||||
|
@ -1892,7 +1930,7 @@ void vif1TransferFromMemory(){
|
|||
// VIF from gsMemory
|
||||
|
||||
if (pMem == NULL) { //Is vif0ptag empty?
|
||||
SysPrintf("Vif1 Tag BUSERR\n");
|
||||
Console::WriteLn("Vif1 Tag BUSERR");
|
||||
psHu32(DMAC_STAT)|= 1<<15; //If yes, set BEIS (BUSERR) in DMAC_STAT register
|
||||
vif1.done = 1;
|
||||
vif1Regs->stat&= ~0x1f000000;
|
||||
|
@ -1956,12 +1994,11 @@ int _VIF1chain() {
|
|||
VIF_LOG("VIF1chain size=%d, madr=%lx, tadr=%lx\n",
|
||||
vif1ch->qwc, vif1ch->madr, vif1ch->tadr);
|
||||
|
||||
if( vif1.vifstalled ) {
|
||||
if( vif1.vifstalled )
|
||||
ret = VIF1transfer(pMem+vif1.irqoffset, vif1ch->qwc*4-vif1.irqoffset, 0);
|
||||
}
|
||||
else {
|
||||
else
|
||||
ret = VIF1transfer(pMem, vif1ch->qwc*4, 0);
|
||||
}
|
||||
|
||||
/*vif1ch->madr+= (vif1ch->qwc << 4);
|
||||
vif1ch->qwc-= qwc;*/
|
||||
|
||||
|
@ -1971,8 +2008,9 @@ int _VIF1chain() {
|
|||
static int prevvifcycles = 0;
|
||||
static u32* prevviftag = NULL;
|
||||
u32 *vif1ptag;
|
||||
int _chainVIF1() {
|
||||
|
||||
|
||||
int _chainVIF1()
|
||||
{
|
||||
return vif1.done;//Return Done
|
||||
}
|
||||
|
||||
|
@ -1988,18 +2026,16 @@ __forceinline void vif1SetupTransfer() {
|
|||
case 2: //Chain
|
||||
int id;
|
||||
int ret;
|
||||
|
||||
|
||||
|
||||
|
||||
vif1ptag = (u32*)dmaGetAddr(vif1ch->tadr); //Set memory pointer to TADR
|
||||
if (vif1ptag == NULL) { //Is vif0ptag empty?
|
||||
SysPrintf("Vif1 Tag BUSERR\n");
|
||||
Console::Error("Vif1 Tag BUSERR");
|
||||
vif1ch->chcr = ( vif1ch->chcr & 0xFFFF ) | ( (*vif1ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15
|
||||
psHu32(DMAC_STAT)|= 1<<15; //If yes, set BEIS (BUSERR) in DMAC_STAT register
|
||||
return; //Return -1 as an error has occurred
|
||||
}
|
||||
|
||||
id = (vif1ptag[0] >> 28) & 0x7; //ID for DmaChain copied from bit 28 of the tag
|
||||
id = (vif1ptag[0] >> 28) & 0x7; //ID for DmaChain copied from bit 28 of the tag
|
||||
vif1ch->qwc = (u16)vif1ptag[0]; //QWC set to lower 16bits of the tag
|
||||
vif1ch->madr = vif1ptag[1]; //MADR = ADDR field
|
||||
g_vifCycles+=1; // Add 1 g_vifCycles from the QW read for the tag
|
||||
|
@ -2009,9 +2045,6 @@ __forceinline void vif1SetupTransfer() {
|
|||
|
||||
VIF_LOG("VIF1 Tag %8.8x_%8.8x size=%d, id=%d, madr=%lx, tadr=%lx\n",
|
||||
vif1ptag[1], vif1ptag[0], vif1ch->qwc, id, vif1ch->madr, vif1ch->tadr);
|
||||
|
||||
//} else
|
||||
|
||||
|
||||
if (!vif1.done && (psHu32(DMAC_CTRL) & 0xC0) == 0x40 && id == 4) { // STD == VIF1
|
||||
//vif1.done |= hwDmacSrcChainWithStack(vif1ch, id);
|
||||
|
@ -2025,17 +2058,18 @@ __forceinline void vif1SetupTransfer() {
|
|||
}
|
||||
|
||||
if (vif1ch->chcr & 0x40) {
|
||||
if(vif1.vifstalled == 1) ret = VIF1transfer(vif1ptag+(2+vif1.irqoffset), 2-vif1.irqoffset, 1); //Transfer Tag on stall
|
||||
else ret = VIF1transfer(vif1ptag+2, 2, 1); //Transfer Tag
|
||||
|
||||
if(vif1.vifstalled == 1)
|
||||
ret = VIF1transfer(vif1ptag+(2+vif1.irqoffset), 2-vif1.irqoffset, 1); //Transfer Tag on stall
|
||||
else
|
||||
ret = VIF1transfer(vif1ptag+2, 2, 1); //Transfer Tag
|
||||
|
||||
if (ret == -1) return; //There has been an error
|
||||
if (ret == -2) {
|
||||
return; //IRQ set by VIFTransfer
|
||||
}
|
||||
if (ret == -2) return; //IRQ set by VIFTransfer
|
||||
}
|
||||
|
||||
vif1.inprogress = 1;
|
||||
vif1.done |= hwDmacSrcChainWithStack(vif1ch, id);
|
||||
|
||||
|
||||
if ((vif1ch->chcr & 0x80) && (vif1ptag[0] >> 31)) { //Check TIE bit of CHCR and IRQ bit of tag
|
||||
VIF_LOG( "dmaIrq Set\n" );
|
||||
|
@ -2050,13 +2084,8 @@ __forceinline void vif1Interrupt() {
|
|||
VIF_LOG("vif1Interrupt: %8.8x\n", cpuRegs.cycle);
|
||||
|
||||
g_vifCycles = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//}
|
||||
if((vif1ch->chcr & 0x100) == 0) SysPrintf("Vif1 running when CHCR == %x\n", vif1ch->chcr);
|
||||
if((vif1ch->chcr & 0x100) == 0) Console::WriteLn("Vif1 running when CHCR == %x", params vif1ch->chcr);
|
||||
|
||||
if(vif1.inprogress == 1) _VIF1chain();
|
||||
|
||||
|
@ -2074,11 +2103,10 @@ __forceinline void vif1Interrupt() {
|
|||
}
|
||||
else if(vif1ch->qwc > 0 || vif1.irqoffset > 0)
|
||||
{
|
||||
if(vif1.stallontag == 1)
|
||||
{
|
||||
if (vif1.stallontag == 1)
|
||||
vif1SetupTransfer();
|
||||
}
|
||||
else _VIF1chain();//CPU_INT(13, vif1ch->qwc * BIAS);
|
||||
else
|
||||
_VIF1chain();//CPU_INT(13, vif1ch->qwc * BIAS);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2086,7 +2114,7 @@ __forceinline void vif1Interrupt() {
|
|||
if (vif1.done == 0 || vif1.inprogress == 1) {
|
||||
|
||||
if( !(psHu32(DMAC_CTRL) & 0x1) ) {
|
||||
SysPrintf("vif1 dma masked\n");
|
||||
Console::WriteLn("vif1 dma masked");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2097,8 +2125,8 @@ __forceinline void vif1Interrupt() {
|
|||
return;
|
||||
}
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
if(vif1ch->qwc > 0) SysPrintf("VIF1 Ending with %x QWC left\n");
|
||||
if(vif1.cmd != 0) SysPrintf("vif1.cmd still set %x\n", vif1.cmd);
|
||||
if(vif1ch->qwc > 0) Console::WriteLn("VIF1 Ending with %x QWC left");
|
||||
if(vif1.cmd != 0) Console::WriteLn("vif1.cmd still set %x", params vif1.cmd);
|
||||
#endif
|
||||
|
||||
prevviftag = NULL;
|
||||
|
@ -2123,8 +2151,8 @@ void dmaVIF1()
|
|||
vif1.inprogress = 0;
|
||||
|
||||
if (((psHu32(DMAC_CTRL) & 0xC) == 0x8)) { // VIF MFIFO
|
||||
//SysPrintf("VIFMFIFO\n");
|
||||
if(!(vif1ch->chcr & 0x4)) SysPrintf("MFIFO mode != Chain! %x\n", vif1ch->chcr);
|
||||
//Console::WriteLn("VIFMFIFO\n");
|
||||
if(!(vif1ch->chcr & 0x4)) Console::WriteLn("MFIFO mode != Chain! %x", params vif1ch->chcr);
|
||||
/*if(vif1ch->madr != spr0->madr)*/vifMFIFOInterrupt();
|
||||
//else vif1.inprogress |= 0x10;
|
||||
return;
|
||||
|
@ -2132,25 +2160,29 @@ void dmaVIF1()
|
|||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
if ((psHu32(DMAC_CTRL) & 0xC0) == 0x40) { // STD == VIF1
|
||||
//SysPrintf("VIF Stall Control Source = %x, Drain = %x\n", (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3);
|
||||
//DevCon::WriteLn("VIF Stall Control Source = %x, Drain = %x", params (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3);
|
||||
//return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
vif1Regs->stat|= 0x10000000; // FQC=16
|
||||
|
||||
if (!(vif1ch->chcr & 0x4) || vif1ch->qwc > 0) { // Normal Mode
|
||||
|
||||
if ((psHu32(DMAC_CTRL) & 0xC0) == 0x40) {
|
||||
SysPrintf("DMA Stall Control on VIF1 normal\n");
|
||||
}
|
||||
if ((vif1ch->chcr & 0x1)) { // to Memory
|
||||
/*if(_VIF1chain() == -2) {
|
||||
SysPrintf("Stall on normal\n");
|
||||
if ((psHu32(DMAC_CTRL) & 0xC0) == 0x40)
|
||||
Console::WriteLn("DMA Stall Control on VIF1 normal");
|
||||
|
||||
if ((vif1ch->chcr & 0x1)) // to Memory
|
||||
vif1.dmamode = 0;
|
||||
else
|
||||
vif1.dmamode = 1;
|
||||
|
||||
/*if ((vif1ch->chcr & 0x1)) {
|
||||
if(_VIF1chain() == -2) {
|
||||
Console::WriteLn("Stall on normal");
|
||||
//vif1.vifstalled = 1;
|
||||
}
|
||||
CPU_INT(1, g_vifCycles);*/
|
||||
CPU_INT(1, g_vifCycles);
|
||||
vif1.dmamode = 0;
|
||||
} else {
|
||||
vif1.dmamode = 1;
|
||||
|
@ -2160,7 +2192,7 @@ void dmaVIF1()
|
|||
// VIF from gsMemory
|
||||
|
||||
if (pMem == NULL) { //Is vif0ptag empty?
|
||||
SysPrintf("Vif1 Tag BUSERR\n");
|
||||
Console::Error("Vif1 Tag BUSERR");
|
||||
psHu32(DMAC_STAT)|= 1<<15; //If yes, set BEIS (BUSERR) in DMAC_STAT register
|
||||
vif1.done = 1;
|
||||
vif1Regs->stat&= ~0x1f000000;
|
||||
|
@ -2199,9 +2231,9 @@ void dmaVIF1()
|
|||
g_vifCycles += vif1ch->qwc * 2;
|
||||
vif1ch->madr += vif1ch->qwc * 16; // mgs3 scene changes
|
||||
vif1ch->qwc = 0;
|
||||
CPU_INT(1, g_vifCycles);*/
|
||||
CPU_INT(1, g_vifCycles);
|
||||
}
|
||||
/*vif1.done = 1;
|
||||
vif1.done = 1;
|
||||
return;*/
|
||||
} else vif1.dmamode = 2;
|
||||
|
||||
|
@ -2218,8 +2250,8 @@ void vif1Write32(u32 mem, u32 value) {
|
|||
/* Clear mark flag in VIF1_STAT and set mark with 'value' */
|
||||
vif1Regs->stat&= ~VIF1_STAT_MRK;
|
||||
vif1Regs->mark = value;
|
||||
} else
|
||||
if (mem == 0x10003c10) { // FBRST
|
||||
}
|
||||
else if (mem == 0x10003c10) { // FBRST
|
||||
VIF_LOG("VIF1_FBRST write32 0x%8.8x\n", value);
|
||||
|
||||
if (value & 0x1) {
|
||||
|
@ -2242,7 +2274,7 @@ void vif1Write32(u32 mem, u32 value) {
|
|||
vif1Regs->stat &= ~VIF1_STAT_VPS;
|
||||
cpuRegs.interrupt &= ~((1<<1) | (1<<10)); //Stop all vif1 DMA's
|
||||
vif1.vifstalled = 1;
|
||||
SysPrintf("vif1 force break\n");
|
||||
Console::WriteLn("vif1 force break");
|
||||
}
|
||||
if (value & 0x4) {
|
||||
/* Stop VIF */
|
||||
|
@ -2265,20 +2297,21 @@ void vif1Write32(u32 mem, u32 value) {
|
|||
vif1Regs->stat &= ~(VIF1_STAT_VSS | VIF1_STAT_VFS | VIF1_STAT_VIS |
|
||||
VIF1_STAT_INT | VIF1_STAT_ER0 | VIF1_STAT_ER1);
|
||||
if (cancel) {
|
||||
|
||||
if( vif1.vifstalled ) {
|
||||
g_vifCycles = 0;
|
||||
// loop necessary for spiderman
|
||||
if((psHu32(DMAC_CTRL) & 0xC) == 0x8){
|
||||
|
||||
//SysPrintf("MFIFO Stall\n");
|
||||
//Console::WriteLn("MFIFO Stall");
|
||||
//CPU_INT(10, 0);
|
||||
CPU_INT(10, vif1ch->qwc * BIAS);
|
||||
}else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/*if(vif1.stallontag == 1){
|
||||
//SysPrintf("Sorting VIF Stall on tag\n");
|
||||
//Console::WriteLn("Sorting VIF Stall on tag");
|
||||
vif1SetupTransfer();
|
||||
} *///else _VIF1chain();
|
||||
//} *///else _VIF1chain();
|
||||
|
||||
//CPU_INT(1, g_vifCycles); // Gets the timing right - Flatout
|
||||
CPU_INT(1, vif1ch->qwc * BIAS);
|
||||
|
@ -2287,14 +2320,14 @@ void vif1Write32(u32 mem, u32 value) {
|
|||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
if (mem == 0x10003c20) { // ERR
|
||||
}
|
||||
else if (mem == 0x10003c20) { // ERR
|
||||
VIF_LOG("VIF1_ERR write32 0x%8.8x\n", value);
|
||||
|
||||
/* Set VIF1_ERR with 'value' */
|
||||
vif1Regs->err = value;
|
||||
} else
|
||||
if (mem == 0x10003c00) { // STAT
|
||||
}
|
||||
else if (mem == 0x10003c00) { // STAT
|
||||
VIF_LOG("VIF1_STAT write32 0x%8.8x\n", value);
|
||||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
|
@ -2302,7 +2335,7 @@ void vif1Write32(u32 mem, u32 value) {
|
|||
if( (vif1Regs->stat & VIF1_STAT_FDR) ^ (value & VIF1_STAT_FDR) ) {
|
||||
// different so can't be stalled
|
||||
if (vif1Regs->stat & (VIF1_STAT_INT|VIF1_STAT_VSS|VIF1_STAT_VIS|VIF1_STAT_VFS)) {
|
||||
SysPrintf("changing dir when vif1 fifo stalled\n");
|
||||
Console::WriteLn("changing dir when vif1 fifo stalled");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -2310,19 +2343,20 @@ void vif1Write32(u32 mem, u32 value) {
|
|||
vif1Regs->stat = (vif1Regs->stat & ~VIF1_STAT_FDR) | (value & VIF1_STAT_FDR);
|
||||
if (vif1Regs->stat & VIF1_STAT_FDR) {
|
||||
vif1Regs->stat|= 0x01000000;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
vif1ch->qwc = 0;
|
||||
vif1.vifstalled = 0;
|
||||
vif1.done = 1;
|
||||
vif1Regs->stat&= ~0x1F000000; // FQC=0
|
||||
}
|
||||
}
|
||||
else
|
||||
if (mem == 0x10003c50) { // MODE
|
||||
else if (mem == 0x10003c50) { // MODE
|
||||
vif1Regs->mode = value;
|
||||
}
|
||||
else {
|
||||
SysPrintf("Unknown Vif1 write to %x\n", mem);
|
||||
Console::WriteLn("Unknown Vif1 write to %x", params mem);
|
||||
if( mem >= 0x10003d00 && mem < 0x10003d80 ) {
|
||||
assert( (mem&0xf) == 0 );
|
||||
if( mem < 0x10003d40) g_vifRow1[(mem>>4)&3] = value;
|
||||
|
|
|
@ -104,7 +104,7 @@ __forceinline DataType __fastcall MemOp_r0(u32 addr)
|
|||
//has to: translate, find function, call function
|
||||
u32 hand=(u8)vmv;
|
||||
u32 paddr=ppf-hand+0x80000000;
|
||||
//SysPrintf("Translated 0x%08X to 0x%08X\n",addr,paddr);
|
||||
//Console::WriteLn("Translated 0x%08X to 0x%08X",params addr,paddr);
|
||||
//return reinterpret_cast<TemplateHelper<DataSize,false>::HandlerType*>(vtlbdata.RWFT[TemplateHelper<DataSize,false>::sidx][0][hand])(paddr,data);
|
||||
|
||||
switch( DataSize )
|
||||
|
@ -135,7 +135,7 @@ __forceinline void __fastcall MemOp_r1(u32 addr, DataType* data)
|
|||
//has to: translate, find function, call function
|
||||
u32 hand=(u8)vmv;
|
||||
u32 paddr=ppf-hand+0x80000000;
|
||||
//SysPrintf("Translated 0x%08X to 0x%08X\n",addr,paddr);
|
||||
//Console::WriteLn("Translated 0x%08X to 0x%08X",params addr,paddr);
|
||||
//return reinterpret_cast<TemplateHelper<DataSize,false>::HandlerType*>(RWFT[TemplateHelper<DataSize,false>::sidx][0][hand])(paddr,data);
|
||||
|
||||
switch( DataSize )
|
||||
|
@ -162,7 +162,7 @@ __forceinline void __fastcall MemOp_w0(u32 addr, DataType data)
|
|||
//has to: translate, find function, call function
|
||||
u32 hand=(u8)vmv;
|
||||
u32 paddr=ppf-hand+0x80000000;
|
||||
//SysPrintf("Translated 0x%08X to 0x%08X\n",addr,paddr);
|
||||
//Console::WriteLn("Translated 0x%08X to 0x%08X",params addr,paddr);
|
||||
|
||||
switch( DataSize )
|
||||
{
|
||||
|
@ -191,7 +191,7 @@ __forceinline void __fastcall MemOp_w1(u32 addr,const DataType* data)
|
|||
//has to: translate, find function, call function
|
||||
u32 hand=(u8)vmv;
|
||||
u32 paddr=ppf-hand+0x80000000;
|
||||
//SysPrintf("Translated 0x%08X to 0x%08X\n",addr,paddr);
|
||||
//Console::WriteLn("Translated 0x%08X to 0x%08X",params addr,paddr);
|
||||
switch( DataSize )
|
||||
{
|
||||
case 64: return ((vtlbMemW64FP*)vtlbdata.RWFT[3][1][hand])(paddr, data);
|
||||
|
|
|
@ -681,7 +681,7 @@ static void (*recComOpXMM_to_XMM[] )(x86SSERegType, x86SSERegType) = {
|
|||
int recCommutativeOp(int info, int regd, int op)
|
||||
{
|
||||
int t0reg = _allocTempXMMreg(XMMT_FPS, -1);
|
||||
//if (t0reg == -1) {SysPrintf("FPU: CommutativeOp Allocation Error!\n");}
|
||||
//if (t0reg == -1) {Console::WriteLn("FPU: CommutativeOp Allocation Error!");}
|
||||
|
||||
switch(info & (PROCESS_EE_S|PROCESS_EE_T) ) {
|
||||
case PROCESS_EE_S:
|
||||
|
@ -805,7 +805,7 @@ void recC_EQ_xmm(int info)
|
|||
int tempReg;
|
||||
int t0reg;
|
||||
|
||||
//SysPrintf("recC_EQ_xmm()\n");
|
||||
//Console::WriteLn("recC_EQ_xmm()");
|
||||
|
||||
switch(info & (PROCESS_EE_S|PROCESS_EE_T) ) {
|
||||
case PROCESS_EE_S:
|
||||
|
@ -875,7 +875,7 @@ void recC_LE_xmm(int info )
|
|||
int tempReg; //tempX86reg
|
||||
int t0reg; //tempXMMreg
|
||||
|
||||
//SysPrintf("recC_LE_xmm()\n");
|
||||
//Console::WriteLn("recC_LE_xmm()");
|
||||
|
||||
switch(info & (PROCESS_EE_S|PROCESS_EE_T) ) {
|
||||
case PROCESS_EE_S:
|
||||
|
@ -949,7 +949,7 @@ void recC_LT_xmm(int info)
|
|||
int tempReg;
|
||||
int t0reg;
|
||||
|
||||
//SysPrintf("recC_LT_xmm()\n");
|
||||
//Console::WriteLn("recC_LT_xmm()");
|
||||
|
||||
switch(info & (PROCESS_EE_S|PROCESS_EE_T) ) {
|
||||
case PROCESS_EE_S:
|
||||
|
@ -1141,10 +1141,10 @@ void recDIV_S_xmm(int info)
|
|||
int roundmodeFlag = 0;
|
||||
int t0reg = _allocTempXMMreg(XMMT_FPS, -1);
|
||||
//if (t0reg == -1) {Console::Error("FPU: DIV Allocation Error!");}
|
||||
//SysPrintf("DIV\n");
|
||||
//Console::WriteLn("DIV");
|
||||
|
||||
if ((g_sseMXCSR & 0x00006000) != 0x00000000) { // Set roundmode to nearest if it isn't already
|
||||
//SysPrintf("div to nearest\n");
|
||||
//Console::WriteLn("div to nearest");
|
||||
roundmode_temp[0] = (g_sseMXCSR & 0xFFFF9FFF); // Set new roundmode
|
||||
roundmode_temp[1] = g_sseMXCSR; // Backup old Roundmode
|
||||
SSE_LDMXCSR ((uptr)&roundmode_temp[0]); // Recompile Roundmode Change
|
||||
|
@ -1153,14 +1153,14 @@ void recDIV_S_xmm(int info)
|
|||
|
||||
switch(info & (PROCESS_EE_S|PROCESS_EE_T) ) {
|
||||
case PROCESS_EE_S:
|
||||
//SysPrintf("FPU: DIV case 1\n");
|
||||
//Console::WriteLn("FPU: DIV case 1");
|
||||
SSE_MOVSS_XMM_to_XMM(EEREC_D, EEREC_S);
|
||||
SSE_MOVSS_M32_to_XMM(t0reg, (uptr)&fpuRegs.fpr[_Ft_]);
|
||||
if (CHECK_FPU_EXTRA_FLAGS) recDIVhelper1(EEREC_D, t0reg);
|
||||
else recDIVhelper2(EEREC_D, t0reg);
|
||||
break;
|
||||
case PROCESS_EE_T:
|
||||
//SysPrintf("FPU: DIV case 2\n");
|
||||
//Console::WriteLn("FPU: DIV case 2");
|
||||
if (EEREC_D == EEREC_T) {
|
||||
SSE_MOVSS_XMM_to_XMM(t0reg, EEREC_T);
|
||||
SSE_MOVSS_M32_to_XMM(EEREC_D, (uptr)&fpuRegs.fpr[_Fs_]);
|
||||
|
@ -1174,7 +1174,7 @@ void recDIV_S_xmm(int info)
|
|||
}
|
||||
break;
|
||||
case (PROCESS_EE_S|PROCESS_EE_T):
|
||||
//SysPrintf("FPU: DIV case 3\n");
|
||||
//Console::WriteLn("FPU: DIV case 3");
|
||||
if (EEREC_D == EEREC_T) {
|
||||
SSE_MOVSS_XMM_to_XMM(t0reg, EEREC_T);
|
||||
SSE_MOVSS_XMM_to_XMM(EEREC_D, EEREC_S);
|
||||
|
@ -1188,7 +1188,7 @@ void recDIV_S_xmm(int info)
|
|||
}
|
||||
break;
|
||||
default:
|
||||
//SysPrintf("FPU: DIV case 4\n");
|
||||
//Console::WriteLn("FPU: DIV case 4");
|
||||
SSE_MOVSS_M32_to_XMM(t0reg, (uptr)&fpuRegs.fpr[_Ft_]);
|
||||
SSE_MOVSS_M32_to_XMM(EEREC_D, (uptr)&fpuRegs.fpr[_Fs_]);
|
||||
if (CHECK_FPU_EXTRA_FLAGS) recDIVhelper1(EEREC_D, t0reg);
|
||||
|
@ -1626,19 +1626,19 @@ void recSUBhelper(int regd, int regt)
|
|||
void recSUBop(int info, int regd)
|
||||
{
|
||||
int t0reg = _allocTempXMMreg(XMMT_FPS, -1);
|
||||
//if (t0reg == -1) {SysPrintf("FPU: SUB Allocation Error!\n");}
|
||||
//if (t0reg == -1) {Console::Error("FPU: SUB Allocation Error!");}
|
||||
|
||||
//AND32ItoM((uptr)&fpuRegs.fprc[31], ~(FPUflagO|FPUflagU)); // Clear O and U flags
|
||||
|
||||
switch(info & (PROCESS_EE_S|PROCESS_EE_T) ) {
|
||||
case PROCESS_EE_S:
|
||||
//SysPrintf("FPU: SUB case 1\n");
|
||||
//Console::WriteLn("FPU: SUB case 1");
|
||||
if (regd != EEREC_S) SSE_MOVSS_XMM_to_XMM(regd, EEREC_S);
|
||||
SSE_MOVSS_M32_to_XMM(t0reg, (uptr)&fpuRegs.fpr[_Ft_]);
|
||||
recSUBhelper(regd, t0reg);
|
||||
break;
|
||||
case PROCESS_EE_T:
|
||||
//SysPrintf("FPU: SUB case 2\n");
|
||||
//Console::WriteLn("FPU: SUB case 2");
|
||||
if (regd == EEREC_T) {
|
||||
SSE_MOVSS_XMM_to_XMM(t0reg, EEREC_T);
|
||||
SSE_MOVSS_M32_to_XMM(regd, (uptr)&fpuRegs.fpr[_Fs_]);
|
||||
|
@ -1650,7 +1650,7 @@ void recSUBop(int info, int regd)
|
|||
}
|
||||
break;
|
||||
case (PROCESS_EE_S|PROCESS_EE_T):
|
||||
//SysPrintf("FPU: SUB case 3\n");
|
||||
//Console::WriteLn("FPU: SUB case 3");
|
||||
if (regd == EEREC_T) {
|
||||
SSE_MOVSS_XMM_to_XMM(t0reg, EEREC_T);
|
||||
SSE_MOVSS_XMM_to_XMM(regd, EEREC_S);
|
||||
|
@ -1698,10 +1698,10 @@ void recSQRT_S_xmm(int info)
|
|||
u8* pjmp;
|
||||
static u32 PCSX2_ALIGNED16(roundmode_temp[4]) = { 0x00000000, 0x00000000, 0x00000000, 0x00000000 };
|
||||
int roundmodeFlag = 0;
|
||||
//SysPrintf("FPU: SQRT\n");
|
||||
//Console::WriteLn("FPU: SQRT");
|
||||
|
||||
if ((g_sseMXCSR & 0x00006000) != 0x00000000) { // Set roundmode to nearest if it isn't already
|
||||
//SysPrintf("sqrt to nearest\n");
|
||||
//Console::WriteLn("sqrt to nearest");
|
||||
roundmode_temp[0] = (g_sseMXCSR & 0xFFFF9FFF); // Set new roundmode
|
||||
roundmode_temp[1] = g_sseMXCSR; // Backup old Roundmode
|
||||
SSE_LDMXCSR ((uptr)&roundmode_temp[0]); // Recompile Roundmode Change
|
||||
|
@ -1820,32 +1820,32 @@ void recRSQRT_S_xmm(int info)
|
|||
{
|
||||
int t0reg = _allocTempXMMreg(XMMT_FPS, -1);
|
||||
//if (t0reg == -1) {Console::Error("FPU: RSQRT Allocation Error!");}
|
||||
//SysPrintf("FPU: RSQRT\n");
|
||||
//Console::WriteLn("FPU: RSQRT");
|
||||
|
||||
switch(info & (PROCESS_EE_S|PROCESS_EE_T) ) {
|
||||
case PROCESS_EE_S:
|
||||
//SysPrintf("FPU: RSQRT case 1\n");
|
||||
//Console::WriteLn("FPU: RSQRT case 1");
|
||||
SSE_MOVSS_XMM_to_XMM(EEREC_D, EEREC_S);
|
||||
SSE_MOVSS_M32_to_XMM(t0reg, (uptr)&fpuRegs.fpr[_Ft_]);
|
||||
if (CHECK_FPU_EXTRA_FLAGS) recRSQRThelper1(EEREC_D, t0reg);
|
||||
else recRSQRThelper2(EEREC_D, t0reg);
|
||||
break;
|
||||
case PROCESS_EE_T:
|
||||
//SysPrintf("FPU: RSQRT case 2\n");
|
||||
//Console::WriteLn("FPU: RSQRT case 2");
|
||||
SSE_MOVSS_XMM_to_XMM(t0reg, EEREC_T);
|
||||
SSE_MOVSS_M32_to_XMM(EEREC_D, (uptr)&fpuRegs.fpr[_Fs_]);
|
||||
if (CHECK_FPU_EXTRA_FLAGS) recRSQRThelper1(EEREC_D, t0reg);
|
||||
else recRSQRThelper2(EEREC_D, t0reg);
|
||||
break;
|
||||
case (PROCESS_EE_S|PROCESS_EE_T):
|
||||
//SysPrintf("FPU: RSQRT case 3\n");
|
||||
//Console::WriteLn("FPU: RSQRT case 3");
|
||||
SSE_MOVSS_XMM_to_XMM(t0reg, EEREC_T);
|
||||
SSE_MOVSS_XMM_to_XMM(EEREC_D, EEREC_S);
|
||||
if (CHECK_FPU_EXTRA_FLAGS) recRSQRThelper1(EEREC_D, t0reg);
|
||||
else recRSQRThelper2(EEREC_D, t0reg);
|
||||
break;
|
||||
default:
|
||||
//SysPrintf("FPU: RSQRT case 4\n");
|
||||
//Console::WriteLn("FPU: RSQRT case 4");
|
||||
SSE_MOVSS_M32_to_XMM(t0reg, (uptr)&fpuRegs.fpr[_Ft_]);
|
||||
SSE_MOVSS_M32_to_XMM(EEREC_D, (uptr)&fpuRegs.fpr[_Fs_]);
|
||||
if (CHECK_FPU_EXTRA_FLAGS) recRSQRThelper1(EEREC_D, t0reg);
|
||||
|
|
|
@ -645,10 +645,10 @@ void recDIV_S_xmm(int info)
|
|||
static u32 PCSX2_ALIGNED16(roundmode_temp[4]) = { 0x00000000, 0x00000000, 0x00000000, 0x00000000 };
|
||||
int roundmodeFlag = 0;
|
||||
//if (t0reg == -1) {Console::Error("FPU: DIV Allocation Error!");}
|
||||
//SysPrintf("DIV\n");
|
||||
//Console::WriteLn("DIV");
|
||||
|
||||
if ((g_sseMXCSR & 0x00006000) != 0x00000000) { // Set roundmode to nearest if it isn't already
|
||||
//SysPrintf("div to nearest\n");
|
||||
//Console::WriteLn("div to nearest");
|
||||
roundmode_temp[0] = (g_sseMXCSR & 0xFFFF9FFF); // Set new roundmode
|
||||
roundmode_temp[1] = g_sseMXCSR; // Backup old Roundmode
|
||||
SSE_LDMXCSR ((uptr)&roundmode_temp[0]); // Recompile Roundmode Change
|
||||
|
@ -908,10 +908,10 @@ void recSQRT_S_xmm(int info)
|
|||
if (tempReg == -1) {Console::Error("FPU: SQRT Allocation Error!"); tempReg = EAX;}
|
||||
int t1reg = _allocTempXMMreg(XMMT_FPS, -1);
|
||||
if (t1reg == -1) {Console::Error("FPU: SQRT Allocation Error!");}
|
||||
//SysPrintf("FPU: SQRT\n");
|
||||
//Console::WriteLn("FPU: SQRT");
|
||||
|
||||
if ((g_sseMXCSR & 0x00006000) != 0x00000000) { // Set roundmode to nearest if it isn't already
|
||||
//SysPrintf("sqrt to nearest\n");
|
||||
//Console::WriteLn("sqrt to nearest");
|
||||
roundmode_temp[0] = (g_sseMXCSR & 0xFFFF9FFF); // Set new roundmode
|
||||
roundmode_temp[1] = g_sseMXCSR; // Backup old Roundmode
|
||||
SSE_LDMXCSR ((uptr)&roundmode_temp[0]); // Recompile Roundmode Change
|
||||
|
@ -1031,7 +1031,7 @@ void recRSQRT_S_xmm(int info)
|
|||
static u32 PCSX2_ALIGNED16(roundmode_temp[4]) = { 0x00000000, 0x00000000, 0x00000000, 0x00000000 };
|
||||
int roundmodeFlag = 0;
|
||||
if ((g_sseMXCSR & 0x00006000) != 0x00000000) { // Set roundmode to nearest if it isn't already
|
||||
//SysPrintf("rsqrt to nearest\n");
|
||||
//Console::WriteLn("rsqrt to nearest");
|
||||
roundmode_temp[0] = (g_sseMXCSR & 0xFFFF9FFF); // Set new roundmode
|
||||
roundmode_temp[1] = g_sseMXCSR; // Backup old Roundmode
|
||||
SSE_LDMXCSR ((uptr)&roundmode_temp[0]); // Recompile Roundmode Change
|
||||
|
|
|
@ -1497,7 +1497,7 @@ CPU_SSE_XMMCACHE_END
|
|||
_deleteEEreg(_Rd_, 0);
|
||||
|
||||
//Done - Refraction - Crude but quicker than int
|
||||
//SysPrintf("PEXTLB\n");
|
||||
//Console::WriteLn("PEXTLB");
|
||||
//Rs = cpuRegs.GPR.r[_Rs_]; Rt = cpuRegs.GPR.r[_Rt_];
|
||||
MOV8MtoR(EAX, (uptr)&cpuRegs.GPR.r[_Rs_].UC[7]);
|
||||
MOV8RtoM((uptr)&cpuRegs.GPR.r[_Rd_].UC[15], EAX);
|
||||
|
@ -1969,7 +1969,7 @@ CPU_SSE_XMMCACHE_END
|
|||
void recQFSRV()
|
||||
{
|
||||
if ( !_Rd_ ) return;
|
||||
//SysPrintf("recQFSRV()\n");
|
||||
//Console::WriteLn("recQFSRV()");
|
||||
|
||||
CPU_SSE2_XMMCACHE_START( XMMINFO_READS | XMMINFO_READT | XMMINFO_WRITED )
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ static void iIopDumpBlock( int startpc, u8 * ptr )
|
|||
u8 used[34];
|
||||
int numused, count;
|
||||
|
||||
SysPrintf( "dump1 %x:%x, %x\n", startpc, psxpc, psxRegs.cycle );
|
||||
Console::WriteLn( "dump1 %x:%x, %x", params startpc, psxpc, psxRegs.cycle );
|
||||
Path::CreateDirectory( "dumps" );
|
||||
|
||||
string filename( Path::Combine( "dumps", fmt_string( "psxdump%.8X.txt", startpc ) ) );
|
||||
|
@ -847,7 +847,7 @@ static void checkcodefn()
|
|||
#else
|
||||
__asm__("movl %%eax, %[pctemp]" : : [pctemp]"m"(pctemp) );
|
||||
#endif
|
||||
SysPrintf("iop code changed! %x\n", pctemp);
|
||||
Console::WriteLn("iop code changed! %x", params pctemp);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1775,7 +1775,7 @@ static void rpsxCOP0() { rpsxCP0[_Rs_](); }
|
|||
//static void rpsxBASIC() { rpsxCP2BSC[_Rs_](); }
|
||||
|
||||
static void rpsxNULL() {
|
||||
SysPrintf("psxUNK: %8.8x\n", psxRegs.code);
|
||||
Console::WriteLn("psxUNK: %8.8x", params psxRegs.code);
|
||||
}
|
||||
|
||||
void (*rpsxBSC[64])() = {
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace VU1micro
|
|||
mkdir("dumps", 0755);
|
||||
sprintf( filename, "dumps/vu%.4X.txt", VU1.VI[ REG_TPC ].UL );
|
||||
#endif
|
||||
SysPrintf( "dump1 %x => %x (%s)\n", VU1.VI[ REG_TPC ].UL, pc, filename );
|
||||
Console::WriteLn( "dump1 %x => %x (%s)", params VU1.VI[ REG_TPC ].UL, pc, filename );
|
||||
|
||||
f = fopen( filename, "wb" );
|
||||
for ( i = VU1.VI[REG_TPC].UL; i < pc; i += 8 ) {
|
||||
|
@ -101,7 +101,7 @@ namespace VU1micro
|
|||
#endif
|
||||
|
||||
if((VU0.VI[REG_VPU_STAT].UL & 0x100) == 0){
|
||||
//SysPrintf("Execute block VU1, VU1 not busy\n");
|
||||
//Console::WriteLn("Execute block VU1, VU1 not busy");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -162,13 +162,13 @@ void _recvuFDIVflush(VURegs * VU, bool intermediate) {
|
|||
|
||||
if( intermediate ) {
|
||||
if ((vucycle - VU->fdiv.sCycle) > VU->fdiv.Cycle) {
|
||||
// SysPrintf("flushing FDIV pipe\n");
|
||||
// Console::WriteLn("flushing FDIV pipe");
|
||||
VU->fdiv.enable = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ((vucycle - VU->fdiv.sCycle) >= VU->fdiv.Cycle) {
|
||||
// SysPrintf("flushing FDIV pipe\n");
|
||||
// Console::WriteLn("flushing FDIV pipe");
|
||||
VU->fdiv.enable = 0;
|
||||
}
|
||||
}
|
||||
|
@ -179,13 +179,13 @@ void _recvuEFUflush(VURegs * VU, bool intermediate) {
|
|||
|
||||
if( intermediate ) {
|
||||
if ((vucycle - VU->efu.sCycle) > VU->efu.Cycle) {
|
||||
// SysPrintf("flushing FDIV pipe\n");
|
||||
// Console::WriteLn("flushing FDIV pipe");
|
||||
VU->efu.enable = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ((vucycle - VU->efu.sCycle) >= VU->efu.Cycle) {
|
||||
// SysPrintf("flushing FDIV pipe\n");
|
||||
// Console::WriteLn("flushing FDIV pipe");
|
||||
VU->efu.enable = 0;
|
||||
}
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ void _recvuFMACAdd(VURegs * VU, int reg, int xyzw) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (i==8) SysPrintf("*PCSX2*: error , out of fmacs\n");
|
||||
if (i==8) Console::Error("*PCSX2*: error , out of fmacs");
|
||||
// VUM_LOG("adding FMAC pipe[%d]; reg %d\n", i, reg);
|
||||
|
||||
VU->fmac[i].enable = 1;
|
||||
|
@ -302,14 +302,14 @@ void _recvuFMACAdd(VURegs * VU, int reg, int xyzw) {
|
|||
}
|
||||
|
||||
void _recvuFDIVAdd(VURegs * VU, int cycles) {
|
||||
// SysPrintf("adding FDIV pipe\n");
|
||||
// Console::WriteLn("adding FDIV pipe");
|
||||
VU->fdiv.enable = 1;
|
||||
VU->fdiv.sCycle = vucycle;
|
||||
VU->fdiv.Cycle = cycles;
|
||||
}
|
||||
|
||||
void _recvuEFUAdd(VURegs * VU, int cycles) {
|
||||
// SysPrintf("adding EFU pipe\n");
|
||||
// Console::WriteLn("adding EFU pipe");
|
||||
VU->efu.enable = 1;
|
||||
VU->efu.sCycle = vucycle;
|
||||
VU->efu.Cycle = cycles;
|
||||
|
@ -324,7 +324,7 @@ void _recvuIALUAdd(VURegs * VU, int reg, int cycles) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (i==8) SysPrintf("*PCSX2*: error , out of ialus\n");
|
||||
if (i==8) Console::Error("*PCSX2*: error , out of ialus");
|
||||
|
||||
VU->ialu[i].enable = 1;
|
||||
VU->ialu[i].sCycle = vucycle;
|
||||
|
@ -388,7 +388,7 @@ void _recvuFlushFDIV(VURegs * VU) {
|
|||
if (VU->fdiv.enable == 0) return;
|
||||
|
||||
cycle = VU->fdiv.Cycle - (vucycle - VU->fdiv.sCycle);
|
||||
// SysPrintf("waiting FDIV pipe %d\n", cycle);
|
||||
// Console::WriteLn("waiting FDIV pipe %d", params cycle);
|
||||
VU->fdiv.enable = 0;
|
||||
vucycle+= cycle;
|
||||
}
|
||||
|
@ -399,7 +399,7 @@ void _recvuFlushEFU(VURegs * VU) {
|
|||
if (VU->efu.enable == 0) return;
|
||||
|
||||
cycle = VU->efu.Cycle - (vucycle - VU->efu.sCycle);
|
||||
// SysPrintf("waiting FDIV pipe %d\n", cycle);
|
||||
// Console::WriteLn("waiting FDIV pipe %d", params cycle);
|
||||
VU->efu.enable = 0;
|
||||
vucycle+= cycle;
|
||||
}
|
||||
|
@ -1724,9 +1724,9 @@ void testPrintOverflow() {
|
|||
tempRegX[2] &= 0xff800000;
|
||||
tempRegX[3] &= 0xff800000;
|
||||
if ( (tempRegX[0] == 0x7f800000) || (tempRegX[1] == 0x7f800000) || (tempRegX[2] == 0x7f800000) || (tempRegX[3] == 0x7f800000) )
|
||||
SysPrintf( "VU OVERFLOW!: Changing to +Fmax!!!!!!!!!!!!\n" );
|
||||
Console::Notice( "VU OVERFLOW!: Changing to +Fmax!!!!!!!!!!!!" );
|
||||
if ( (tempRegX[0] == 0xff800000) || (tempRegX[1] == 0xff800000) || (tempRegX[2] == 0xff800000) || (tempRegX[3] == 0xff800000) )
|
||||
SysPrintf( "VU OVERFLOW!: Changing to -Fmax!!!!!!!!!!!!\n" );
|
||||
Console::Notice( "VU OVERFLOW!: Changing to -Fmax!!!!!!!!!!!!" );
|
||||
}
|
||||
|
||||
// Outputs to the console when overflow has occured.
|
||||
|
|
|
@ -91,7 +91,7 @@ void recVUMI_DIV(VURegs *VU, int info)
|
|||
u8 *pjmp, *pjmp1;
|
||||
u32 *ajmp32, *bjmp32;
|
||||
|
||||
//SysPrintf("recVUMI_DIV()\n");
|
||||
//Console::WriteLn("recVUMI_DIV()");
|
||||
AND32ItoM(VU_VI_ADDR(REG_STATUS_FLAG, 2), 0xFCF); // Clear D/I flags
|
||||
|
||||
// FT can be zero here! so we need to check if its zero and set the correct flag.
|
||||
|
@ -154,7 +154,7 @@ void recVUMI_DIV(VURegs *VU, int info)
|
|||
void recVUMI_SQRT( VURegs *VU, int info )
|
||||
{
|
||||
u8* pjmp;
|
||||
//SysPrintf("recVUMI_SQRT()\n");
|
||||
//Console::WriteLn("recVUMI_SQRT()");
|
||||
|
||||
_unpackVFSS_xyzw(EEREC_TEMP, EEREC_T, _Ftf_);
|
||||
AND32ItoM(VU_VI_ADDR(REG_STATUS_FLAG, 2), 0xFCF); // Clear D/I flags
|
||||
|
@ -183,7 +183,7 @@ void recVUMI_RSQRT(VURegs *VU, int info)
|
|||
u8 *ajmp8, *bjmp8;
|
||||
u8 *qjmp1, *qjmp2;
|
||||
int t1reg, t1boolean;
|
||||
//SysPrintf("recVUMI_RSQRT()\n");
|
||||
//Console::WriteLn("recVUMI_RSQRT()");
|
||||
|
||||
_unpackVFSS_xyzw(EEREC_TEMP, EEREC_T, _Ftf_);
|
||||
AND32ItoM(VU_VI_ADDR(REG_STATUS_FLAG, 2), 0xFCF); // Clear D/I flags
|
||||
|
@ -292,7 +292,7 @@ void recVUMI_IADDI(VURegs *VU, int info)
|
|||
s16 imm;
|
||||
|
||||
if ( _Ft_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_IADDI \n");
|
||||
//Console::WriteLn("recVUMI_IADDI");
|
||||
imm = ( VU->code >> 6 ) & 0x1f;
|
||||
imm = ( imm & 0x10 ? 0xfff0 : 0) | ( imm & 0xf );
|
||||
_addISIMMtoIT(VU, imm, info);
|
||||
|
@ -308,7 +308,7 @@ void recVUMI_IADDIU(VURegs *VU, int info)
|
|||
s16 imm;
|
||||
|
||||
if ( _Ft_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_IADDIU \n");
|
||||
//Console::WriteLn("recVUMI_IADDIU");
|
||||
imm = ( ( VU->code >> 10 ) & 0x7800 ) | ( VU->code & 0x7ff );
|
||||
_addISIMMtoIT(VU, imm, info);
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ void recVUMI_IADD( VURegs *VU, int info )
|
|||
{
|
||||
int fdreg, fsreg = -1, ftreg = -1;
|
||||
if ( _Fd_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_IADD \n");
|
||||
//Console::WriteLn("recVUMI_IADD");
|
||||
if ( ( _Ft_ == 0 ) && ( _Fs_ == 0 ) ) {
|
||||
fdreg = ALLOCVI(_Fd_, MODE_WRITE);
|
||||
XOR32RtoR(fdreg, fdreg);
|
||||
|
@ -368,7 +368,7 @@ void recVUMI_IAND( VURegs *VU, int info )
|
|||
{
|
||||
int fdreg, fsreg = -1, ftreg = -1;
|
||||
if ( _Fd_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_IAND \n");
|
||||
//Console::WriteLn("recVUMI_IAND");
|
||||
if ( ( _Fs_ == 0 ) || ( _Ft_ == 0 ) ) {
|
||||
fdreg = ALLOCVI(_Fd_, MODE_WRITE);
|
||||
XOR32RtoR(fdreg, fdreg);
|
||||
|
@ -399,7 +399,7 @@ void recVUMI_IOR( VURegs *VU, int info )
|
|||
{
|
||||
int fdreg, fsreg = -1, ftreg = -1;
|
||||
if ( _Fd_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_IOR \n");
|
||||
//Console::WriteLn("recVUMI_IOR");
|
||||
if ( ( _Ft_ == 0 ) && ( _Fs_ == 0 ) ) {
|
||||
fdreg = ALLOCVI(_Fd_, MODE_WRITE);
|
||||
XOR32RtoR(fdreg, fdreg);
|
||||
|
@ -447,7 +447,7 @@ void recVUMI_ISUB( VURegs *VU, int info )
|
|||
{
|
||||
int fdreg, fsreg = -1, ftreg = -1;
|
||||
if ( _Fd_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_ISUB \n");
|
||||
//Console::WriteLn("recVUMI_ISUB");
|
||||
if ( ( _Ft_ == 0 ) && ( _Fs_ == 0 ) ) {
|
||||
fdreg = ALLOCVI(_Fd_, MODE_WRITE);
|
||||
XOR32RtoR(fdreg, fdreg);
|
||||
|
@ -499,7 +499,7 @@ void recVUMI_ISUBIU( VURegs *VU, int info )
|
|||
s16 imm;
|
||||
|
||||
if ( _Ft_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_ISUBIU \n");
|
||||
//Console::WriteLn("recVUMI_ISUBIU");
|
||||
imm = ( ( VU->code >> 10 ) & 0x7800 ) | ( VU->code & 0x7ff );
|
||||
imm = -imm;
|
||||
_addISIMMtoIT(VU, imm, info);
|
||||
|
@ -513,7 +513,7 @@ void recVUMI_ISUBIU( VURegs *VU, int info )
|
|||
void recVUMI_MOVE( VURegs *VU, int info )
|
||||
{
|
||||
if ( (_Ft_ == 0) || (_X_Y_Z_W == 0) ) return;
|
||||
//SysPrintf("recVUMI_MOVE \n");
|
||||
//Console::WriteLn("recVUMI_MOVE");
|
||||
if (_X_Y_Z_W == 0x8) SSE_MOVSS_XMM_to_XMM(EEREC_T, EEREC_S);
|
||||
else if (_X_Y_Z_W == 0xf) SSE_MOVAPS_XMM_to_XMM(EEREC_T, EEREC_S);
|
||||
else {
|
||||
|
@ -530,7 +530,7 @@ void recVUMI_MOVE( VURegs *VU, int info )
|
|||
void recVUMI_MFIR( VURegs *VU, int info )
|
||||
{
|
||||
if ( (_Ft_ == 0) || (_X_Y_Z_W == 0) ) return;
|
||||
//SysPrintf("recVUMI_MFIR \n");
|
||||
//Console::WriteLn("recVUMI_MFIR");
|
||||
_deleteX86reg(X86TYPE_VI|((VU==&VU1)?X86TYPE_VU1:0), _Fs_, 1);
|
||||
|
||||
if( _XYZW_SS ) {
|
||||
|
@ -561,7 +561,7 @@ void recVUMI_MFIR( VURegs *VU, int info )
|
|||
void recVUMI_MTIR( VURegs *VU, int info )
|
||||
{
|
||||
if ( _Ft_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_MTIR \n");
|
||||
//Console::WriteLn("recVUMI_MTIR");
|
||||
_deleteX86reg(X86TYPE_VI|((VU==&VU1)?X86TYPE_VU1:0), _Ft_, 2);
|
||||
|
||||
if( _Fsf_ == 0 ) {
|
||||
|
@ -583,7 +583,7 @@ void recVUMI_MTIR( VURegs *VU, int info )
|
|||
void recVUMI_MR32( VURegs *VU, int info )
|
||||
{
|
||||
if ( (_Ft_ == 0) || (_X_Y_Z_W == 0) ) return;
|
||||
//SysPrintf("recVUMI_MR32 \n");
|
||||
//Console::WriteLn("recVUMI_MR32");
|
||||
if (_X_Y_Z_W != 0xf) {
|
||||
SSE_MOVAPS_XMM_to_XMM(EEREC_TEMP, EEREC_S);
|
||||
SSE_SHUFPS_XMM_to_XMM(EEREC_TEMP, EEREC_TEMP, 0x39);
|
||||
|
@ -721,7 +721,7 @@ void recVUMI_LQ(VURegs *VU, int info)
|
|||
{
|
||||
s16 imm;
|
||||
if ( _Ft_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_LQ \n");
|
||||
//Console::WriteLn("recVUMI_LQ");
|
||||
imm = (VU->code & 0x400) ? (VU->code & 0x3ff) | 0xfc00 : (VU->code & 0x3ff);
|
||||
if (_Fs_ == 0) {
|
||||
_loadEAX(VU, -1, (uptr)GET_VU_MEM(VU, (u32)imm*16), info);
|
||||
|
@ -740,7 +740,7 @@ void recVUMI_LQ(VURegs *VU, int info)
|
|||
void recVUMI_LQD( VURegs *VU, int info )
|
||||
{
|
||||
int fsreg;
|
||||
//SysPrintf("recVUMI_LQD \n");
|
||||
//Console::WriteLn("recVUMI_LQD");
|
||||
if ( _Fs_ != 0 ) {
|
||||
fsreg = ALLOCVI(_Fs_, MODE_READ|MODE_WRITE);
|
||||
SUB16ItoR( fsreg, 1 );
|
||||
|
@ -760,7 +760,7 @@ void recVUMI_LQD( VURegs *VU, int info )
|
|||
void recVUMI_LQI(VURegs *VU, int info)
|
||||
{
|
||||
int fsreg;
|
||||
//SysPrintf("recVUMI_LQI \n");
|
||||
//Console::WriteLn("recVUMI_LQI");
|
||||
if ( _Ft_ == 0 ) {
|
||||
if( _Fs_ != 0 ) {
|
||||
if( (fsreg = _checkX86reg(X86TYPE_VI|(VU==&VU1?X86TYPE_VU1:0), _Fs_, MODE_WRITE|MODE_READ)) >= 0 ) {
|
||||
|
@ -951,7 +951,7 @@ void _saveEAX(VURegs *VU, int x86reg, uptr offset, int info)
|
|||
void recVUMI_SQ(VURegs *VU, int info)
|
||||
{
|
||||
s16 imm;
|
||||
//SysPrintf("recVUMI_SQ \n");
|
||||
//Console::WriteLn("recVUMI_SQ");
|
||||
imm = ( VU->code & 0x400) ? ( VU->code & 0x3ff) | 0xfc00 : ( VU->code & 0x3ff);
|
||||
if ( _Ft_ == 0 ) _saveEAX(VU, -1, (uptr)GET_VU_MEM(VU, (int)imm * 16), info);
|
||||
else {
|
||||
|
@ -967,7 +967,7 @@ void recVUMI_SQ(VURegs *VU, int info)
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_SQD(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_SQD \n");
|
||||
//Console::WriteLn("recVUMI_SQD");
|
||||
if (_Ft_ == 0) _saveEAX(VU, -1, (uptr)VU->Mem, info);
|
||||
else {
|
||||
int ftreg = ALLOCVI(_Ft_, MODE_READ|MODE_WRITE);
|
||||
|
@ -983,7 +983,7 @@ void recVUMI_SQD(VURegs *VU, int info)
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_SQI(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_SQI \n");
|
||||
//Console::WriteLn("recVUMI_SQI");
|
||||
if (_Ft_ == 0) _saveEAX(VU, -1, (uptr)VU->Mem, info);
|
||||
else {
|
||||
int ftreg = ALLOCVI(_Ft_, MODE_READ|MODE_WRITE);
|
||||
|
@ -1003,7 +1003,7 @@ void recVUMI_ILW(VURegs *VU, int info)
|
|||
s16 imm, off;
|
||||
|
||||
if ( ( _Ft_ == 0 ) || ( _X_Y_Z_W == 0 ) ) return;
|
||||
//SysPrintf("recVUMI_ILW \n");
|
||||
//Console::WriteLn("recVUMI_ILW");
|
||||
imm = ( VU->code & 0x400) ? ( VU->code & 0x3ff) | 0xfc00 : ( VU->code & 0x3ff);
|
||||
if (_X) off = 0;
|
||||
else if (_Y) off = 4;
|
||||
|
@ -1030,7 +1030,7 @@ void recVUMI_ILW(VURegs *VU, int info)
|
|||
void recVUMI_ISW( VURegs *VU, int info )
|
||||
{
|
||||
s16 imm;
|
||||
//SysPrintf("recVUMI_ISW \n");
|
||||
//Console::WriteLn("recVUMI_ISW");
|
||||
imm = ( VU->code & 0x400) ? ( VU->code & 0x3ff) | 0xfc00 : ( VU->code & 0x3ff);
|
||||
|
||||
if (_Fs_ == 0) {
|
||||
|
@ -1068,7 +1068,7 @@ void recVUMI_ILWR( VURegs *VU, int info )
|
|||
int off, ftreg;
|
||||
|
||||
if ( ( _Ft_ == 0 ) || ( _X_Y_Z_W == 0 ) ) return;
|
||||
//SysPrintf("recVUMI_ILWR \n");
|
||||
//Console::WriteLn("recVUMI_ILWR");
|
||||
if (_X) off = 0;
|
||||
else if (_Y) off = 4;
|
||||
else if (_Z) off = 8;
|
||||
|
@ -1094,7 +1094,7 @@ void recVUMI_ILWR( VURegs *VU, int info )
|
|||
void recVUMI_ISWR( VURegs *VU, int info )
|
||||
{
|
||||
int ftreg;
|
||||
//SysPrintf("recVUMI_ISWR \n");
|
||||
//Console::WriteLn("recVUMI_ISWR");
|
||||
ADD_VI_NEEDED(_Fs_);
|
||||
ftreg = ALLOCVI(_Ft_, MODE_READ);
|
||||
|
||||
|
@ -1123,7 +1123,7 @@ void recVUMI_ISWR( VURegs *VU, int info )
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_RINIT(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_RINIT()\n");
|
||||
//Console::WriteLn("recVUMI_RINIT()");
|
||||
if( (xmmregs[EEREC_S].mode & MODE_WRITE) && (xmmregs[EEREC_S].mode & MODE_NOFLUSH) ) {
|
||||
_deleteX86reg(X86TYPE_VI|(VU==&VU1?X86TYPE_VU1:0), REG_R, 2);
|
||||
_unpackVFSS_xyzw(EEREC_TEMP, EEREC_S, _Fsf_);
|
||||
|
@ -1155,7 +1155,7 @@ void recVUMI_RINIT(VURegs *VU, int info)
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_RGET(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_RGET()\n");
|
||||
//Console::WriteLn("recVUMI_RGET()");
|
||||
if ( (_Ft_ == 0) || (_X_Y_Z_W == 0) ) return;
|
||||
|
||||
_deleteX86reg(X86TYPE_VI|(VU==&VU1?X86TYPE_VU1:0), REG_R, 1);
|
||||
|
@ -1179,7 +1179,7 @@ void recVUMI_RGET(VURegs *VU, int info)
|
|||
void recVUMI_RNEXT( VURegs *VU, int info )
|
||||
{
|
||||
int rreg, x86temp0, x86temp1;
|
||||
//SysPrintf("recVUMI_RNEXT()\n");
|
||||
//Console::WriteLn("recVUMI_RNEXT()");
|
||||
|
||||
rreg = ALLOCVI(REG_R, MODE_WRITE|MODE_READ);
|
||||
|
||||
|
@ -1220,7 +1220,7 @@ void recVUMI_RNEXT( VURegs *VU, int info )
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_RXOR( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf("recVUMI_RXOR()\n");
|
||||
//Console::WriteLn("recVUMI_RXOR()");
|
||||
if( (xmmregs[EEREC_S].mode & MODE_WRITE) && (xmmregs[EEREC_S].mode & MODE_NOFLUSH) ) {
|
||||
_deleteX86reg(X86TYPE_VI|(VU==&VU1?X86TYPE_VU1:0), REG_R, 1);
|
||||
_unpackVFSS_xyzw(EEREC_TEMP, EEREC_S, _Fsf_);
|
||||
|
@ -1253,7 +1253,7 @@ void recVUMI_RXOR( VURegs *VU, int info )
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_WAITQ( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf("recVUMI_WAITQ \n");
|
||||
//Console::WriteLn("recVUMI_WAITQ");
|
||||
// if( info & PROCESS_VU_SUPER ) {
|
||||
// //CALLFunc(waitqfn);
|
||||
// SuperVUFlush(0, 1);
|
||||
|
@ -1269,7 +1269,7 @@ void recVUMI_FSAND( VURegs *VU, int info )
|
|||
{
|
||||
int ftreg;
|
||||
u16 imm;
|
||||
//SysPrintf("recVUMI_FSAND \n");
|
||||
//Console::WriteLn("recVUMI_FSAND");
|
||||
imm = (((VU->code >> 21 ) & 0x1) << 11) | (VU->code & 0x7ff);
|
||||
if(_Ft_ == 0) return;
|
||||
|
||||
|
@ -1288,7 +1288,7 @@ void recVUMI_FSEQ( VURegs *VU, int info )
|
|||
int ftreg;
|
||||
u16 imm;
|
||||
if ( _Ft_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_FSEQ\n");
|
||||
//Console::WriteLn("recVUMI_FSEQ");
|
||||
imm = (((VU->code >> 21 ) & 0x1) << 11) | (VU->code & 0x7ff);
|
||||
|
||||
ftreg = ALLOCVI(_Ft_, MODE_WRITE|MODE_8BITREG);
|
||||
|
@ -1309,7 +1309,7 @@ void recVUMI_FSOR( VURegs *VU, int info )
|
|||
int ftreg;
|
||||
u32 imm;
|
||||
if(_Ft_ == 0) return;
|
||||
//SysPrintf("recVUMI_FSOR \n");
|
||||
//Console::WriteLn("recVUMI_FSOR");
|
||||
imm = (((VU->code >> 21 ) & 0x1) << 11) | (VU->code & 0x7ff);
|
||||
|
||||
ftreg = ALLOCVI(_Ft_, MODE_WRITE);
|
||||
|
@ -1329,7 +1329,7 @@ void recVUMI_FSSET(VURegs *VU, int info)
|
|||
u32 prevaddr = VU_VI_ADDR(REG_STATUS_FLAG, 2);
|
||||
|
||||
u16 imm = 0;
|
||||
//SysPrintf("recVUMI_FSSET \n");
|
||||
//Console::WriteLn("recVUMI_FSSET");
|
||||
imm = (((VU->code >> 21 ) & 0x1) << 11) | (VU->code & 0x7FF);
|
||||
|
||||
// keep the low 6 bits ONLY if the upper instruction is an fmac instruction (otherwise rewrite) - metal gear solid 3
|
||||
|
@ -1353,7 +1353,7 @@ void recVUMI_FMAND( VURegs *VU, int info )
|
|||
{
|
||||
int fsreg, ftreg;
|
||||
if ( _Ft_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_FMAND \n");
|
||||
//Console::WriteLn("recVUMI_FMAND");
|
||||
fsreg = _checkX86reg(X86TYPE_VI|(VU==&VU1?X86TYPE_VU1:0), _Fs_, MODE_READ);
|
||||
ftreg = ALLOCVI(_Ft_, MODE_WRITE);//|MODE_8BITREG);
|
||||
|
||||
|
@ -1374,7 +1374,7 @@ void recVUMI_FMEQ( VURegs *VU, int info )
|
|||
{
|
||||
int ftreg, fsreg;
|
||||
if ( _Ft_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_FMEQ \n");
|
||||
//Console::WriteLn("recVUMI_FMEQ");
|
||||
if( _Ft_ == _Fs_ ) {
|
||||
ftreg = ALLOCVI(_Ft_, MODE_WRITE|MODE_READ);//|MODE_8BITREG
|
||||
|
||||
|
@ -1403,7 +1403,7 @@ void recVUMI_FMOR( VURegs *VU, int info )
|
|||
{
|
||||
int fsreg, ftreg;
|
||||
if ( _Ft_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_FMOR \n");
|
||||
//Console::WriteLn("recVUMI_FMOR");
|
||||
if( _Fs_ == 0 ) {
|
||||
ftreg = ALLOCVI(_Ft_, MODE_WRITE);//|MODE_8BITREG);
|
||||
MOVZX32M16toR( ftreg, VU_VI_ADDR(REG_MAC_FLAG, 1) );
|
||||
|
@ -1433,7 +1433,7 @@ void recVUMI_FMOR( VURegs *VU, int info )
|
|||
void recVUMI_FCAND( VURegs *VU, int info )
|
||||
{
|
||||
int ftreg = ALLOCVI(1, MODE_WRITE|MODE_8BITREG);
|
||||
//SysPrintf("recVUMI_FCAND \n");
|
||||
//Console::WriteLn("recVUMI_FCAND");
|
||||
MOV32MtoR( EAX, VU_VI_ADDR(REG_CLIP_FLAG, 1) );
|
||||
XOR32RtoR( ftreg, ftreg );
|
||||
AND32ItoR( EAX, VU->code & 0xFFFFFF );
|
||||
|
@ -1449,7 +1449,7 @@ void recVUMI_FCAND( VURegs *VU, int info )
|
|||
void recVUMI_FCEQ( VURegs *VU, int info )
|
||||
{
|
||||
int ftreg = ALLOCVI(1, MODE_WRITE|MODE_8BITREG);
|
||||
//SysPrintf("recVUMI_FCEQ \n");
|
||||
//Console::WriteLn("recVUMI_FCEQ");
|
||||
MOV32MtoR( EAX, VU_VI_ADDR(REG_CLIP_FLAG, 1) );
|
||||
AND32ItoR( EAX, 0xffffff );
|
||||
XOR32RtoR( ftreg, ftreg );
|
||||
|
@ -1466,7 +1466,7 @@ void recVUMI_FCEQ( VURegs *VU, int info )
|
|||
void recVUMI_FCOR( VURegs *VU, int info )
|
||||
{
|
||||
int ftreg;
|
||||
//SysPrintf("recVUMI_FCOR\n");
|
||||
//Console::WriteLn("recVUMI_FCOR");
|
||||
ftreg = ALLOCVI(1, MODE_WRITE);
|
||||
MOV32MtoR( ftreg, VU_VI_ADDR(REG_CLIP_FLAG, 1) );
|
||||
OR32ItoR ( ftreg, VU->code );
|
||||
|
@ -1483,7 +1483,7 @@ void recVUMI_FCOR( VURegs *VU, int info )
|
|||
void recVUMI_FCSET( VURegs *VU, int info )
|
||||
{
|
||||
u32 addr = VU_VI_ADDR(REG_CLIP_FLAG, 0);
|
||||
//SysPrintf("recVUMI_FCSET \n");
|
||||
//Console::WriteLn("recVUMI_FCSET");
|
||||
MOV32ItoM(addr ? addr : VU_VI_ADDR(REG_CLIP_FLAG, 2), VU->code&0xffffff );
|
||||
|
||||
if( !(info & (PROCESS_VU_SUPER|PROCESS_VU_COP2)) )
|
||||
|
@ -1499,7 +1499,7 @@ void recVUMI_FCGET( VURegs *VU, int info )
|
|||
{
|
||||
int ftreg;
|
||||
if(_Ft_ == 0) return;
|
||||
//SysPrintf("recVUMI_FCGET \n");
|
||||
//Console::WriteLn("recVUMI_FCGET");
|
||||
ftreg = ALLOCVI(_Ft_, MODE_WRITE);
|
||||
|
||||
MOV32MtoR(ftreg, VU_VI_ADDR(REG_CLIP_FLAG, 1));
|
||||
|
@ -1521,7 +1521,7 @@ void recVUMI_FCGET( VURegs *VU, int info )
|
|||
void recVUMI_MFP(VURegs *VU, int info)
|
||||
{
|
||||
if ( (_Ft_ == 0) || (_X_Y_Z_W == 0) ) return;
|
||||
//SysPrintf("recVUMI_MFP \n");
|
||||
//Console::WriteLn("recVUMI_MFP");
|
||||
if( _XYZW_SS ) {
|
||||
_vuFlipRegSS(VU, EEREC_T);
|
||||
SSE_MOVSS_M32_to_XMM(EEREC_TEMP, VU_VI_ADDR(REG_P, 1));
|
||||
|
@ -1547,7 +1547,7 @@ void recVUMI_MFP(VURegs *VU, int info)
|
|||
static PCSX2_ALIGNED16(float s_tempmem[4]);
|
||||
void recVUMI_WAITP(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_WAITP \n");
|
||||
//Console::WriteLn("recVUMI_WAITP");
|
||||
// if( info & PROCESS_VU_SUPER )
|
||||
// SuperVUFlush(1, 1);
|
||||
}
|
||||
|
@ -1561,7 +1561,7 @@ void recVUMI_WAITP(VURegs *VU, int info)
|
|||
//------------------------------------------------------------------
|
||||
void vuSqSumXYZ(int regd, int regs, int regtemp) // regd.x = x ^ 2 + y ^ 2 + z ^ 2
|
||||
{
|
||||
//SysPrintf("VU: SUMXYZ\n");
|
||||
//Console::WriteLn("VU: SUMXYZ");
|
||||
if( cpucaps.hasStreamingSIMD4Extensions )
|
||||
{
|
||||
SSE_MOVAPS_XMM_to_XMM(regd, regs);
|
||||
|
@ -1596,7 +1596,7 @@ void vuSqSumXYZ(int regd, int regs, int regtemp) // regd.x = x ^ 2 + y ^ 2 + z
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_ESADD( VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf("VU: ESADD\n");
|
||||
//Console::WriteLn("VU: ESADD");
|
||||
assert( VU == &VU1 );
|
||||
if( EEREC_TEMP == EEREC_D ) { // special code to reset P ( FixMe: don't know if this is still needed! (cottonvibes) )
|
||||
Console::Notice("ESADD: Resetting P reg!!!\n");
|
||||
|
@ -1615,7 +1615,7 @@ void recVUMI_ESADD( VURegs *VU, int info)
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_ERSADD( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf("VU: ERSADD\n");
|
||||
//Console::WriteLn("VU: ERSADD");
|
||||
assert( VU == &VU1 );
|
||||
vuSqSumXYZ(EEREC_D, EEREC_S, EEREC_TEMP);
|
||||
// don't use RCPSS (very bad precision)
|
||||
|
@ -1632,7 +1632,7 @@ void recVUMI_ERSADD( VURegs *VU, int info )
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_ELENG( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf("VU: ELENG\n");
|
||||
//Console::WriteLn("VU: ELENG");
|
||||
assert( VU == &VU1 );
|
||||
vuSqSumXYZ(EEREC_D, EEREC_S, EEREC_TEMP);
|
||||
if (CHECK_VU_OVERFLOW) SSE_MINSS_M32_to_XMM(EEREC_D, (uptr)g_maxvals); // Only need to do positive clamp since (x ^ 2 + y ^ 2 + z ^ 2) is positive
|
||||
|
@ -1647,7 +1647,7 @@ void recVUMI_ELENG( VURegs *VU, int info )
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_ERLENG( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf("VU: ERLENG\n");
|
||||
//Console::WriteLn("VU: ERLENG");
|
||||
assert( VU == &VU1 );
|
||||
vuSqSumXYZ(EEREC_D, EEREC_S, EEREC_TEMP);
|
||||
if (CHECK_VU_OVERFLOW) SSE_MINSS_M32_to_XMM(EEREC_D, (uptr)g_maxvals); // Only need to do positive clamp since (x ^ 2 + y ^ 2 + z ^ 2) is positive
|
||||
|
@ -1666,7 +1666,7 @@ void recVUMI_ERLENG( VURegs *VU, int info )
|
|||
void recVUMI_EATANxy( VURegs *VU, int info )
|
||||
{
|
||||
assert( VU == &VU1 );
|
||||
//SysPrintf("recVUMI_EATANxy \n");
|
||||
//Console::WriteLn("recVUMI_EATANxy");
|
||||
if( (xmmregs[EEREC_S].mode & MODE_WRITE) && (xmmregs[EEREC_S].mode&MODE_NOFLUSH) ) {
|
||||
SSE_MOVLPS_XMM_to_M64((uptr)s_tempmem, EEREC_S);
|
||||
FLD32((uptr)&s_tempmem[0]);
|
||||
|
@ -1694,7 +1694,7 @@ void recVUMI_EATANxy( VURegs *VU, int info )
|
|||
void recVUMI_EATANxz( VURegs *VU, int info )
|
||||
{
|
||||
assert( VU == &VU1 );
|
||||
//SysPrintf("recVUMI_EATANxz \n");
|
||||
//Console::WriteLn("recVUMI_EATANxz");
|
||||
if( (xmmregs[EEREC_S].mode & MODE_WRITE) && (xmmregs[EEREC_S].mode&MODE_NOFLUSH) ) {
|
||||
SSE_MOVLPS_XMM_to_M64((uptr)s_tempmem, EEREC_S);
|
||||
FLD32((uptr)&s_tempmem[0]);
|
||||
|
@ -1720,7 +1720,7 @@ void recVUMI_EATANxz( VURegs *VU, int info )
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_ESUM( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf("VU: ESUM\n");
|
||||
//Console::WriteLn("VU: ESUM");
|
||||
assert( VU == &VU1 );
|
||||
|
||||
if( cpucaps.hasStreamingSIMD3Extensions ) {
|
||||
|
@ -1749,7 +1749,7 @@ void recVUMI_ESUM( VURegs *VU, int info )
|
|||
void recVUMI_ERCPR( VURegs *VU, int info )
|
||||
{
|
||||
assert( VU == &VU1 );
|
||||
//SysPrintf("VU1: ERCPR\n");
|
||||
//Console::WriteLn("VU1: ERCPR");
|
||||
|
||||
// don't use RCPSS (very bad precision)
|
||||
switch ( _Fsf_ ) {
|
||||
|
@ -1794,7 +1794,7 @@ void recVUMI_ESQRT( VURegs *VU, int info )
|
|||
{
|
||||
assert( VU == &VU1 );
|
||||
|
||||
//SysPrintf("VU1: ESQRT\n");
|
||||
//Console::WriteLn("VU1: ESQRT");
|
||||
_unpackVFSS_xyzw(EEREC_TEMP, EEREC_S, _Fsf_);
|
||||
SSE_ANDPS_M128_to_XMM(EEREC_TEMP, (uptr)const_clip); // abs(x)
|
||||
if (CHECK_VU_OVERFLOW) SSE_MINSS_M32_to_XMM(EEREC_TEMP, (uptr)g_maxvals); // Only need to do positive clamp
|
||||
|
@ -1813,7 +1813,7 @@ void recVUMI_ERSQRT( VURegs *VU, int info )
|
|||
int t1reg = _vuGetTempXMMreg(info);
|
||||
|
||||
assert( VU == &VU1 );
|
||||
//SysPrintf("VU1: ERSQRT\n");
|
||||
//Console::WriteLn("VU1: ERSQRT");
|
||||
|
||||
_unpackVFSS_xyzw(EEREC_TEMP, EEREC_S, _Fsf_);
|
||||
SSE_ANDPS_M128_to_XMM(EEREC_TEMP, (uptr)const_clip); // abs(x)
|
||||
|
@ -1847,7 +1847,7 @@ void recVUMI_ESIN( VURegs *VU, int info )
|
|||
{
|
||||
assert( VU == &VU1 );
|
||||
|
||||
//SysPrintf("recVUMI_ESIN \n");
|
||||
//Console::WriteLn("recVUMI_ESIN");
|
||||
if( (xmmregs[EEREC_S].mode & MODE_WRITE) && (xmmregs[EEREC_S].mode&MODE_NOFLUSH) ) {
|
||||
switch(_Fsf_) {
|
||||
case 0: SSE_MOVSS_XMM_to_M32((uptr)s_tempmem, EEREC_S);
|
||||
|
@ -1878,7 +1878,7 @@ void recVUMI_EATAN( VURegs *VU, int info )
|
|||
{
|
||||
assert( VU == &VU1 );
|
||||
|
||||
//SysPrintf("recVUMI_EATAN \n");
|
||||
//Console::WriteLn("recVUMI_EATAN");
|
||||
if( (xmmregs[EEREC_S].mode & MODE_WRITE) && (xmmregs[EEREC_S].mode&MODE_NOFLUSH) ) {
|
||||
switch(_Fsf_) {
|
||||
case 0: SSE_MOVSS_XMM_to_M32((uptr)s_tempmem, EEREC_S);
|
||||
|
@ -1908,7 +1908,7 @@ void recVUMI_EATAN( VURegs *VU, int info )
|
|||
void recVUMI_EEXP( VURegs *VU, int info )
|
||||
{
|
||||
assert( VU == &VU1 );
|
||||
//SysPrintf("recVUMI_EEXP \n");
|
||||
//Console::WriteLn("recVUMI_EEXP");
|
||||
FLDL2E();
|
||||
|
||||
if( (xmmregs[EEREC_S].mode & MODE_WRITE) && (xmmregs[EEREC_S].mode&MODE_NOFLUSH) ) {
|
||||
|
@ -1951,7 +1951,7 @@ void recVUMI_XITOP( VURegs *VU, int info )
|
|||
{
|
||||
int ftreg;
|
||||
if (_Ft_ == 0) return;
|
||||
//SysPrintf("recVUMI_XITOP \n");
|
||||
//Console::WriteLn("recVUMI_XITOP");
|
||||
ftreg = ALLOCVI(_Ft_, MODE_WRITE);
|
||||
MOVZX32M16toR( ftreg, (uptr)&VU->vifRegs->itop );
|
||||
}
|
||||
|
@ -1965,7 +1965,7 @@ void recVUMI_XTOP( VURegs *VU, int info )
|
|||
{
|
||||
int ftreg;
|
||||
if ( _Ft_ == 0 ) return;
|
||||
//SysPrintf("recVUMI_XTOP \n");
|
||||
//Console::WriteLn("recVUMI_XTOP");
|
||||
ftreg = ALLOCVI(_Ft_, MODE_WRITE);
|
||||
MOVZX32M16toR( ftreg, (uptr)&VU->vifRegs->top );
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ void recUpdateFlags(VURegs * VU, int reg, int info)
|
|||
return;
|
||||
}
|
||||
|
||||
//SysPrintf ("recUpdateFlags\n");
|
||||
//Console::WriteLn ("recUpdateFlags");
|
||||
|
||||
macaddr = VU_VI_ADDR(REG_MAC_FLAG, 0);
|
||||
stataddr = VU_VI_ADDR(REG_STATUS_FLAG, 0); // write address
|
||||
|
@ -164,7 +164,7 @@ void recUpdateFlags(VURegs * VU, int reg, int info)
|
|||
|
||||
if( stataddr == 0 ) stataddr = prevstataddr;
|
||||
if( macaddr == 0 ) {
|
||||
SysPrintf( "VU ALLOCATION WARNING: Using Mac Flag Previous Address!\n" );
|
||||
Console::WriteLn( "VU ALLOCATION WARNING: Using Mac Flag Previous Address!" );
|
||||
macaddr = VU_VI_ADDR(REG_MAC_FLAG, 2);
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ void recUpdateFlags(VURegs * VU, int reg, int info)
|
|||
if (reg == EEREC_TEMP) {
|
||||
t1reg = _vuGetTempXMMreg(info);
|
||||
if (t1reg < 0) {
|
||||
//SysPrintf( "VU ALLOCATION ERROR: Temp reg can't be allocated!!!!\n" );
|
||||
//Console::WriteLn( "VU ALLOCATION ERROR: Temp reg can't be allocated!!!!" );
|
||||
t1reg = (reg == 0) ? 1 : 0; // Make t1reg != reg
|
||||
SSE_MOVAPS_XMM_to_M128( (uptr)TEMPXMMData, t1reg ); // Backup data to temp address
|
||||
t1regBoolean = 1;
|
||||
|
@ -796,7 +796,7 @@ void SSE_SUBSS_M32_to_XMM_custom(int info, int regd, int regt) {
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_ABS(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_ABS()\n");
|
||||
//Console::WriteLn("recVUMI_ABS()");
|
||||
if ( (_Ft_ == 0) || (_X_Y_Z_W == 0) ) return;
|
||||
|
||||
if ((_X_Y_Z_W == 0x8) || (_X_Y_Z_W == 0xf)) {
|
||||
|
@ -818,7 +818,7 @@ void recVUMI_ABS(VURegs *VU, int info)
|
|||
PCSX2_ALIGNED16(float s_two[4]) = {0,0,0,2};
|
||||
void recVUMI_ADD(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_ADD()\n");
|
||||
//Console::WriteLn("recVUMI_ADD()");
|
||||
if ( _X_Y_Z_W == 0 ) goto flagUpdate; // Don't do anything and just clear flags
|
||||
if ( !_Fd_ ) info = (info & ~PROCESS_EE_SET_D(0xf)) | PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
|
||||
|
@ -862,7 +862,7 @@ flagUpdate:
|
|||
|
||||
void recVUMI_ADD_iq(VURegs *VU, uptr addr, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_ADD_iq()\n");
|
||||
//Console::WriteLn("recVUMI_ADD_iq()");
|
||||
if ( _X_Y_Z_W == 0 ) goto flagUpdate;
|
||||
if ( !_Fd_ ) info = (info & ~PROCESS_EE_SET_D(0xf)) | PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
|
@ -922,7 +922,7 @@ flagUpdate:
|
|||
|
||||
void recVUMI_ADD_xyzw(VURegs *VU, int xyzw, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_ADD_xyzw()\n");
|
||||
//Console::WriteLn("recVUMI_ADD_xyzw()");
|
||||
if ( _X_Y_Z_W == 0 ) goto flagUpdate;
|
||||
if ( !_Fd_ ) info = (info & ~PROCESS_EE_SET_D(0xf)) | PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
|
@ -986,7 +986,7 @@ void recVUMI_ADDw(VURegs *VU, int info) { recVUMI_ADD_xyzw(VU, 3, info); }
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_ADDA(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_ADDA()\n");
|
||||
//Console::WriteLn("recVUMI_ADDA()");
|
||||
if ( _X_Y_Z_W == 0 ) goto flagUpdate;
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, _X_Y_Z_W );
|
||||
|
@ -1021,7 +1021,7 @@ flagUpdate:
|
|||
|
||||
void recVUMI_ADDA_iq(VURegs *VU, uptr addr, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_ADDA_iq()\n");
|
||||
//Console::WriteLn("recVUMI_ADDA_iq()");
|
||||
if ( _X_Y_Z_W == 0 ) goto flagUpdate;
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
vuFloat3(addr);
|
||||
|
@ -1073,7 +1073,7 @@ flagUpdate:
|
|||
|
||||
void recVUMI_ADDA_xyzw(VURegs *VU, int xyzw, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_ADDA_xyzw()\n");
|
||||
//Console::WriteLn("recVUMI_ADDA_xyzw()");
|
||||
if ( _X_Y_Z_W == 0 ) goto flagUpdate;
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, _X_Y_Z_W );
|
||||
|
@ -1131,7 +1131,7 @@ void recVUMI_ADDAw(VURegs *VU, int info) { recVUMI_ADDA_xyzw(VU, 3, info); }
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_SUB(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_SUB()\n");
|
||||
//Console::WriteLn("recVUMI_SUB()");
|
||||
if ( _X_Y_Z_W == 0 ) goto flagUpdate;
|
||||
if ( !_Fd_ ) info = (info & ~PROCESS_EE_SET_D(0xf)) | PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
|
||||
|
@ -1190,7 +1190,7 @@ flagUpdate:
|
|||
|
||||
void recVUMI_SUB_iq(VURegs *VU, uptr addr, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_SUB_iq()\n");
|
||||
//Console::WriteLn("recVUMI_SUB_iq()");
|
||||
if ( _X_Y_Z_W == 0 ) goto flagUpdate;
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
vuFloat3(addr);
|
||||
|
@ -1263,7 +1263,7 @@ flagUpdate:
|
|||
|
||||
void recVUMI_SUB_xyzw(VURegs *VU, int xyzw, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_SUB_xyzw()\n");
|
||||
//Console::WriteLn("recVUMI_SUB_xyzw()");
|
||||
if ( _X_Y_Z_W == 0 ) goto flagUpdate;
|
||||
if ( !_Fd_ ) info = (info & ~PROCESS_EE_SET_D(0xf)) | PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
|
@ -1341,7 +1341,7 @@ void recVUMI_SUBw(VURegs *VU, int info) { recVUMI_SUB_xyzw(VU, 3, info); }
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_SUBA(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf("recVUMI_SUBA()\n");
|
||||
//Console::WriteLn("recVUMI_SUBA()");
|
||||
if ( _X_Y_Z_W == 0 ) goto flagUpdate;
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, _X_Y_Z_W );
|
||||
|
@ -1388,7 +1388,7 @@ flagUpdate:
|
|||
|
||||
void recVUMI_SUBA_iq(VURegs *VU, uptr addr, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_SUBA_iq \n");
|
||||
//Console::WriteLn ("recVUMI_SUBA_iq");
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
vuFloat3(addr);
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, _X_Y_Z_W );
|
||||
|
@ -1445,7 +1445,7 @@ void recVUMI_SUBA_iq(VURegs *VU, uptr addr, int info)
|
|||
|
||||
void recVUMI_SUBA_xyzw(VURegs *VU, int xyzw, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_SUBA_xyzw \n");
|
||||
//Console::WriteLn ("recVUMI_SUBA_xyzw");
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, _X_Y_Z_W );
|
||||
if (_Ft_) vuFloat5_useEAX( EEREC_T, EEREC_TEMP, ( 1 << (3 - xyzw) ) );
|
||||
|
@ -1504,7 +1504,7 @@ void recVUMI_SUBAw(VURegs *VU, int info) { recVUMI_SUBA_xyzw(VU, 3, info); }
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_MUL_toD(VURegs *VU, int regd, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MUL_toD \n");
|
||||
//Console::WriteLn ("recVUMI_MUL_toD");
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, _X_Y_Z_W );
|
||||
if (_Ft_) vuFloat5_useEAX( EEREC_T, EEREC_TEMP, _X_Y_Z_W );
|
||||
|
@ -1545,7 +1545,7 @@ void recVUMI_MUL_toD(VURegs *VU, int regd, int info)
|
|||
|
||||
void recVUMI_MUL_iq_toD(VURegs *VU, uptr addr, int regd, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MUL_iq_toD \n");
|
||||
//Console::WriteLn ("recVUMI_MUL_iq_toD");
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
vuFloat3(addr);
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, _X_Y_Z_W );
|
||||
|
@ -1601,7 +1601,7 @@ void recVUMI_MUL_iq_toD(VURegs *VU, uptr addr, int regd, int info)
|
|||
|
||||
void recVUMI_MUL_xyzw_toD(VURegs *VU, int xyzw, int regd, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MUL_xyzw_toD \n");
|
||||
//Console::WriteLn ("recVUMI_MUL_xyzw_toD");
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
if (_Ft_) vuFloat5_useEAX( EEREC_T, EEREC_TEMP, ( 1 << (3 - xyzw) ) );
|
||||
}
|
||||
|
@ -1669,7 +1669,7 @@ void recVUMI_MUL_xyzw_toD(VURegs *VU, int xyzw, int regd, int info)
|
|||
|
||||
void recVUMI_MUL(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MUL \n");
|
||||
//Console::WriteLn ("recVUMI_MUL");
|
||||
if( !_Fd_ ) info |= PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
recVUMI_MUL_toD(VU, EEREC_D, info);
|
||||
recUpdateFlags(VU, EEREC_D, info);
|
||||
|
@ -1677,7 +1677,7 @@ void recVUMI_MUL(VURegs *VU, int info)
|
|||
|
||||
void recVUMI_MUL_iq(VURegs *VU, int addr, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MUL_iq \n");
|
||||
//Console::WriteLn ("recVUMI_MUL_iq");
|
||||
if( !_Fd_ ) info |= PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
recVUMI_MUL_iq_toD(VU, addr, EEREC_D, info);
|
||||
recUpdateFlags(VU, EEREC_D, info);
|
||||
|
@ -1686,7 +1686,7 @@ void recVUMI_MUL_iq(VURegs *VU, int addr, int info)
|
|||
|
||||
void recVUMI_MUL_xyzw(VURegs *VU, int xyzw, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MUL_xyzw \n");
|
||||
//Console::WriteLn ("recVUMI_MUL_xyzw");
|
||||
if( !_Fd_ ) info |= PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
recVUMI_MUL_xyzw_toD(VU, xyzw, EEREC_D, info);
|
||||
recUpdateFlags(VU, EEREC_D, info);
|
||||
|
@ -1706,21 +1706,21 @@ void recVUMI_MULw(VURegs *VU, int info) { recVUMI_MUL_xyzw(VU, 3, info); }
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_MULA( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf ("recVUMI_MULA \n");
|
||||
//Console::WriteLn ("recVUMI_MULA");
|
||||
recVUMI_MUL_toD(VU, EEREC_ACC, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MULA_iq(VURegs *VU, int addr, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MULA_iq \n");
|
||||
//Console::WriteLn ("recVUMI_MULA_iq");
|
||||
recVUMI_MUL_iq_toD(VU, addr, EEREC_ACC, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MULA_xyzw(VURegs *VU, int xyzw, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MULA_xyzw \n");
|
||||
//Console::WriteLn ("recVUMI_MULA_xyzw");
|
||||
recVUMI_MUL_xyzw_toD(VU, xyzw, EEREC_ACC, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
@ -1739,7 +1739,7 @@ void recVUMI_MULAw(VURegs *VU, int info) { recVUMI_MULA_xyzw(VU, 3, info); }
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_MADD_toD(VURegs *VU, int regd, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MADD_toD \n");
|
||||
//Console::WriteLn ("recVUMI_MADD_toD");
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, _X_Y_Z_W );
|
||||
if (_Ft_) vuFloat5_useEAX( EEREC_T, EEREC_TEMP, _X_Y_Z_W );
|
||||
|
@ -1807,7 +1807,7 @@ void recVUMI_MADD_toD(VURegs *VU, int regd, int info)
|
|||
|
||||
void recVUMI_MADD_iq_toD(VURegs *VU, uptr addr, int regd, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MADD_iq_toD \n");
|
||||
//Console::WriteLn ("recVUMI_MADD_iq_toD");
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
vuFloat3(addr);
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, _X_Y_Z_W );
|
||||
|
@ -1905,7 +1905,7 @@ void recVUMI_MADD_iq_toD(VURegs *VU, uptr addr, int regd, int info)
|
|||
|
||||
void recVUMI_MADD_xyzw_toD(VURegs *VU, int xyzw, int regd, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MADD_xyzw_toD \n");
|
||||
//Console::WriteLn ("recVUMI_MADD_xyzw_toD");
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
if (_Ft_) vuFloat5_useEAX( EEREC_T, EEREC_TEMP, ( 1 << (3 - xyzw) ) );
|
||||
vuFloat5_useEAX( EEREC_ACC, EEREC_TEMP, _X_Y_Z_W );
|
||||
|
@ -2018,7 +2018,7 @@ void recVUMI_MADD_xyzw_toD(VURegs *VU, int xyzw, int regd, int info)
|
|||
|
||||
void recVUMI_MADD(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MADD \n");
|
||||
//Console::WriteLn ("recVUMI_MADD");
|
||||
if( !_Fd_ ) info |= PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
recVUMI_MADD_toD(VU, EEREC_D, info);
|
||||
recUpdateFlags(VU, EEREC_D, info);
|
||||
|
@ -2026,7 +2026,7 @@ void recVUMI_MADD(VURegs *VU, int info)
|
|||
|
||||
void recVUMI_MADD_iq(VURegs *VU, int addr, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MADD_iq \n");
|
||||
//Console::WriteLn ("recVUMI_MADD_iq");
|
||||
if( !_Fd_ ) info |= PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
recVUMI_MADD_iq_toD(VU, addr, EEREC_D, info);
|
||||
recUpdateFlags(VU, EEREC_D, info);
|
||||
|
@ -2034,7 +2034,7 @@ void recVUMI_MADD_iq(VURegs *VU, int addr, int info)
|
|||
|
||||
void recVUMI_MADD_xyzw(VURegs *VU, int xyzw, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MADD_xyzw \n");
|
||||
//Console::WriteLn ("recVUMI_MADD_xyzw");
|
||||
if( !_Fd_ ) info |= PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
recVUMI_MADD_xyzw_toD(VU, xyzw, EEREC_D, info);
|
||||
recUpdateFlags(VU, EEREC_D, info);
|
||||
|
@ -2055,49 +2055,49 @@ void recVUMI_MADDw(VURegs *VU, int info) { recVUMI_MADD_xyzw(VU, 3, info); }
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_MADDA( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf ("recVUMI_MADDA \n");
|
||||
//Console::WriteLn ("recVUMI_MADDA");
|
||||
recVUMI_MADD_toD(VU, EEREC_ACC, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MADDAi( VURegs *VU , int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MADDAi \n");
|
||||
//Console::WriteLn ("recVUMI_MADDAi");
|
||||
recVUMI_MADD_iq_toD( VU, VU_VI_ADDR(REG_I, 1), EEREC_ACC, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MADDAq( VURegs *VU , int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MADDAq \n");
|
||||
//Console::WriteLn ("recVUMI_MADDAq ");
|
||||
recVUMI_MADD_iq_toD( VU, VU_REGQ_ADDR, EEREC_ACC, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MADDAx( VURegs *VU , int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MADDAx \n");
|
||||
//Console::WriteLn ("recVUMI_MADDAx");
|
||||
recVUMI_MADD_xyzw_toD(VU, 0, EEREC_ACC, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MADDAy( VURegs *VU , int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MADDAy \n");
|
||||
//Console::WriteLn ("recVUMI_MADDAy");
|
||||
recVUMI_MADD_xyzw_toD(VU, 1, EEREC_ACC, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MADDAz( VURegs *VU , int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MADDAz \n");
|
||||
//Console::WriteLn ("recVUMI_MADDAz");
|
||||
recVUMI_MADD_xyzw_toD(VU, 2, EEREC_ACC, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MADDAw( VURegs *VU , int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MADDAw \n");
|
||||
//Console::WriteLn ("recVUMI_MADDAw");
|
||||
recVUMI_MADD_xyzw_toD(VU, 3, EEREC_ACC, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
@ -2109,7 +2109,7 @@ void recVUMI_MADDAw( VURegs *VU , int info)
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_MSUB_toD(VURegs *VU, int regd, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUB_toD \n");
|
||||
//Console::WriteLn ("recVUMI_MSUB_toD");
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, _X_Y_Z_W );
|
||||
if (_Ft_) vuFloat5_useEAX( EEREC_T, EEREC_TEMP, _X_Y_Z_W );
|
||||
|
@ -2170,7 +2170,7 @@ void recVUMI_MSUB_toD(VURegs *VU, int regd, int info)
|
|||
|
||||
void recVUMI_MSUB_temp_toD(VURegs *VU, int regd, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUB_temp_toD \n");
|
||||
//Console::WriteLn ("recVUMI_MSUB_temp_toD");
|
||||
|
||||
if (_X_Y_Z_W != 0xf) {
|
||||
int t1reg = _vuGetTempXMMreg(info);
|
||||
|
@ -2222,7 +2222,7 @@ void recVUMI_MSUB_temp_toD(VURegs *VU, int regd, int info)
|
|||
|
||||
void recVUMI_MSUB_iq_toD(VURegs *VU, int regd, int addr, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUB_iq_toD \n");
|
||||
//Console::WriteLn ("recVUMI_MSUB_iq_toD");
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, _X_Y_Z_W );
|
||||
vuFloat5_useEAX( EEREC_ACC, EEREC_TEMP, _X_Y_Z_W );
|
||||
|
@ -2235,7 +2235,7 @@ void recVUMI_MSUB_iq_toD(VURegs *VU, int regd, int addr, int info)
|
|||
|
||||
void recVUMI_MSUB_xyzw_toD(VURegs *VU, int regd, int xyzw, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUB_xyzw_toD \n");
|
||||
//Console::WriteLn ("recVUMI_MSUB_xyzw_toD");
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, _X_Y_Z_W );
|
||||
if (_Ft_) vuFloat5_useEAX( EEREC_T, EEREC_TEMP, 1 << (3 - xyzw));
|
||||
|
@ -2247,7 +2247,7 @@ void recVUMI_MSUB_xyzw_toD(VURegs *VU, int regd, int xyzw, int info)
|
|||
|
||||
void recVUMI_MSUB(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUB \n");
|
||||
//Console::WriteLn ("recVUMI_MSUB");
|
||||
if( !_Fd_ ) info |= PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
recVUMI_MSUB_toD(VU, EEREC_D, info);
|
||||
recUpdateFlags(VU, EEREC_D, info);
|
||||
|
@ -2255,7 +2255,7 @@ void recVUMI_MSUB(VURegs *VU, int info)
|
|||
|
||||
void recVUMI_MSUB_iq(VURegs *VU, int addr, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUB_iq \n");
|
||||
//Console::WriteLn ("recVUMI_MSUB_iq");
|
||||
if( !_Fd_ ) info |= PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
recVUMI_MSUB_iq_toD(VU, EEREC_D, addr, info);
|
||||
recUpdateFlags(VU, EEREC_D, info);
|
||||
|
@ -2265,7 +2265,7 @@ void recVUMI_MSUBi(VURegs *VU, int info) { recVUMI_MSUB_iq(VU, VU_VI_ADDR(REG_I,
|
|||
void recVUMI_MSUBq(VURegs *VU, int info) { recVUMI_MSUB_iq(VU, VU_REGQ_ADDR, info); }
|
||||
void recVUMI_MSUBx(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUBx \n");
|
||||
//Console::WriteLn ("recVUMI_MSUBx");
|
||||
if( !_Fd_ ) info |= PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
recVUMI_MSUB_xyzw_toD(VU, EEREC_D, 0, info);
|
||||
recUpdateFlags(VU, EEREC_D, info);
|
||||
|
@ -2273,7 +2273,7 @@ void recVUMI_MSUBx(VURegs *VU, int info)
|
|||
|
||||
void recVUMI_MSUBy(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUBy \n");
|
||||
//Console::WriteLn ("recVUMI_MSUBy");
|
||||
if( !_Fd_ ) info |= PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
recVUMI_MSUB_xyzw_toD(VU, EEREC_D, 1, info);
|
||||
recUpdateFlags(VU, EEREC_D, info);
|
||||
|
@ -2281,7 +2281,7 @@ void recVUMI_MSUBy(VURegs *VU, int info)
|
|||
|
||||
void recVUMI_MSUBz(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUBz \n");
|
||||
//Console::WriteLn ("recVUMI_MSUBz");
|
||||
if( !_Fd_ ) info |= PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
recVUMI_MSUB_xyzw_toD(VU, EEREC_D, 2, info);
|
||||
recUpdateFlags(VU, EEREC_D, info);
|
||||
|
@ -2289,7 +2289,7 @@ void recVUMI_MSUBz(VURegs *VU, int info)
|
|||
|
||||
void recVUMI_MSUBw(VURegs *VU, int info)
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUBw \n");
|
||||
//Console::WriteLn ("recVUMI_MSUBw");
|
||||
if( !_Fd_ ) info |= PROCESS_EE_SET_D(EEREC_TEMP);
|
||||
recVUMI_MSUB_xyzw_toD(VU, EEREC_D, 3, info);
|
||||
recUpdateFlags(VU, EEREC_D, info);
|
||||
|
@ -2302,49 +2302,49 @@ void recVUMI_MSUBw(VURegs *VU, int info)
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_MSUBA( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUBA \n");
|
||||
//Console::WriteLn ("recVUMI_MSUBA");
|
||||
recVUMI_MSUB_toD(VU, EEREC_ACC, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MSUBAi( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUBAi \n");
|
||||
//Console::WriteLn ("recVUMI_MSUBAi ");
|
||||
recVUMI_MSUB_iq_toD( VU, EEREC_ACC, VU_VI_ADDR(REG_I, 1), info );
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MSUBAq( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUBAq \n");
|
||||
//Console::WriteLn ("recVUMI_MSUBAq");
|
||||
recVUMI_MSUB_iq_toD( VU, EEREC_ACC, VU_REGQ_ADDR, info );
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MSUBAx( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUBAx \n");
|
||||
//Console::WriteLn ("recVUMI_MSUBAx");
|
||||
recVUMI_MSUB_xyzw_toD(VU, EEREC_ACC, 0, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MSUBAy( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUBAy \n");
|
||||
//Console::WriteLn ("recVUMI_MSUBAy");
|
||||
recVUMI_MSUB_xyzw_toD(VU, EEREC_ACC, 1, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MSUBAz( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUBAz \n");
|
||||
//Console::WriteLn ("recVUMI_MSUBAz ");
|
||||
recVUMI_MSUB_xyzw_toD(VU, EEREC_ACC, 2, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
||||
void recVUMI_MSUBAw( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf ("recVUMI_MSUBAw \n");
|
||||
//Console::WriteLn ("recVUMI_MSUBAw");
|
||||
recVUMI_MSUB_xyzw_toD(VU, EEREC_ACC, 3, info);
|
||||
recUpdateFlags(VU, EEREC_ACC, info);
|
||||
}
|
||||
|
@ -2460,7 +2460,7 @@ void MINMAXlogical(VURegs *VU, int info, int min, int mode, uptr addr = 0, int x
|
|||
void recVUMI_MAX(VURegs *VU, int info)
|
||||
{
|
||||
if ( _Fd_ == 0 ) return;
|
||||
//SysPrintf ("recVUMI_MAX \n");
|
||||
//Console::WriteLn ("recVUMI_MAX");
|
||||
|
||||
if (MINMAXFIX)
|
||||
MINMAXlogical(VU, info, 0, 0);
|
||||
|
@ -2498,7 +2498,7 @@ void recVUMI_MAX(VURegs *VU, int info)
|
|||
void recVUMI_MAX_iq(VURegs *VU, uptr addr, int info)
|
||||
{
|
||||
if ( _Fd_ == 0 ) return;
|
||||
//SysPrintf ("recVUMI_MAX_iq \n");
|
||||
//Console::WriteLn ("recVUMI_MAX_iq");
|
||||
|
||||
if (MINMAXFIX)
|
||||
MINMAXlogical(VU, info, 0, 1, addr);
|
||||
|
@ -2561,7 +2561,7 @@ void recVUMI_MAX_iq(VURegs *VU, uptr addr, int info)
|
|||
void recVUMI_MAX_xyzw(VURegs *VU, int xyzw, int info)
|
||||
{
|
||||
if ( _Fd_ == 0 ) return;
|
||||
//SysPrintf ("recVUMI_MAX_xyzw \n");
|
||||
//Console::WriteLn ("recVUMI_MAX_xyzw");
|
||||
|
||||
if (_Fs_ == 0 && _Ft_ == 0)
|
||||
{
|
||||
|
@ -2645,7 +2645,7 @@ void recVUMI_MAXw(VURegs *VU, int info) { recVUMI_MAX_xyzw(VU, 3, info); }
|
|||
void recVUMI_MINI(VURegs *VU, int info)
|
||||
{
|
||||
if ( _Fd_ == 0 ) return;
|
||||
//SysPrintf ("recVUMI_MINI\n");
|
||||
//Console::WriteLn ("recVUMI_MINI");
|
||||
|
||||
if (MINMAXFIX)
|
||||
MINMAXlogical(VU, info, 1, 0);
|
||||
|
@ -2689,7 +2689,7 @@ void recVUMI_MINI(VURegs *VU, int info)
|
|||
void recVUMI_MINI_iq(VURegs *VU, uptr addr, int info)
|
||||
{
|
||||
if ( _Fd_ == 0 ) return;
|
||||
//SysPrintf ("recVUMI_MINI_iq \n");
|
||||
//Console::WriteLn ("recVUMI_MINI_iq");
|
||||
|
||||
if (MINMAXFIX)
|
||||
MINMAXlogical(VU, info, 1, 1, addr);
|
||||
|
@ -2753,7 +2753,7 @@ void recVUMI_MINI_iq(VURegs *VU, uptr addr, int info)
|
|||
void recVUMI_MINI_xyzw(VURegs *VU, int xyzw, int info)
|
||||
{
|
||||
if ( _Fd_ == 0 ) return;
|
||||
//SysPrintf ("recVUMI_MINI_xyzw \n");
|
||||
//Console::WriteLn ("recVUMI_MINI_xyzw");
|
||||
|
||||
if (_Fs_ == 0 && _Ft_ == 0)
|
||||
{
|
||||
|
@ -2825,7 +2825,7 @@ void recVUMI_MINIw(VURegs *VU, int info) { recVUMI_MINI_xyzw(VU, 3, info); }
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_OPMULA( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf ("recVUMI_OPMULA \n");
|
||||
//Console::WriteLn ("recVUMI_OPMULA");
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, 0xE);
|
||||
if (_Ft_) vuFloat5_useEAX( EEREC_T, EEREC_TEMP, 0xE);
|
||||
|
@ -2852,7 +2852,7 @@ void recVUMI_OPMULA( VURegs *VU, int info )
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_OPMSUB( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf ("recVUMI_OPMSUB \n");
|
||||
//Console::WriteLn ("recVUMI_OPMSUB");
|
||||
if (CHECK_VU_EXTRA_OVERFLOW) {
|
||||
if (_Fs_) vuFloat5_useEAX( EEREC_S, EEREC_TEMP, 0xE);
|
||||
if (_Ft_) vuFloat5_useEAX( EEREC_T, EEREC_TEMP, 0xE);
|
||||
|
@ -2882,7 +2882,7 @@ void recVUMI_OPMSUB( VURegs *VU, int info )
|
|||
//------------------------------------------------------------------
|
||||
void recVUMI_NOP( VURegs *VU, int info )
|
||||
{
|
||||
//SysPrintf ("recVUMI_NOP \n");
|
||||
//Console::WriteLn ("recVUMI_NOP");
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
|
||||
|
@ -2894,7 +2894,7 @@ static const PCSX2_ALIGNED16(int rec_const_0x8000000[4]) = { 0x80000000, 0x80000
|
|||
|
||||
void recVUMI_FTOI_Saturate(int rec_s, int rec_t, int rec_tmp1, int rec_tmp2)
|
||||
{
|
||||
//SysPrintf ("recVUMI_FTOI_Saturate \n");
|
||||
//Console::WriteLn ("recVUMI_FTOI_Saturate");
|
||||
//Duplicate the xor'd sign bit to the whole value
|
||||
//FFFF FFFF for positive, 0 for negative
|
||||
SSE_MOVAPS_XMM_to_XMM(rec_tmp1, rec_s);
|
||||
|
@ -2929,7 +2929,7 @@ void recVUMI_FTOI0(VURegs *VU, int info)
|
|||
|
||||
if ( _Ft_ == 0 ) return;
|
||||
|
||||
//SysPrintf ("recVUMI_FTOI0 \n");
|
||||
//Console::WriteLn ("recVUMI_FTOI0");
|
||||
|
||||
if (_X_Y_Z_W != 0xf) {
|
||||
SSE_MOVAPS_XMM_to_XMM(EEREC_TEMP, EEREC_S);
|
||||
|
@ -3030,7 +3030,7 @@ void recVUMI_FTOIX(VURegs *VU, int addr, int info)
|
|||
|
||||
if ( _Ft_ == 0 ) return;
|
||||
|
||||
//SysPrintf ("recVUMI_FTOIX \n");
|
||||
//Console::WriteLn ("recVUMI_FTOIX");
|
||||
if (_X_Y_Z_W != 0xf) {
|
||||
SSE_MOVAPS_XMM_to_XMM(EEREC_TEMP, EEREC_S);
|
||||
SSE_MULPS_M128_to_XMM(EEREC_TEMP, addr);
|
||||
|
@ -3140,7 +3140,7 @@ void recVUMI_ITOF0( VURegs *VU, int info )
|
|||
{
|
||||
if ( _Ft_ == 0 ) return;
|
||||
|
||||
//SysPrintf ("recVUMI_ITOF0 \n");
|
||||
//Console::WriteLn ("recVUMI_ITOF0");
|
||||
if (_X_Y_Z_W != 0xf) {
|
||||
SSE2_CVTDQ2PS_XMM_to_XMM(EEREC_TEMP, EEREC_S);
|
||||
vuFloat_useEAX( info, EEREC_TEMP, 15); // Clamp infinities
|
||||
|
@ -3157,7 +3157,7 @@ void recVUMI_ITOFX(VURegs *VU, int addr, int info)
|
|||
{
|
||||
if ( _Ft_ == 0 ) return;
|
||||
|
||||
//SysPrintf ("recVUMI_ITOFX \n");
|
||||
//Console::WriteLn ("recVUMI_ITOFX");
|
||||
if (_X_Y_Z_W != 0xf) {
|
||||
SSE2_CVTDQ2PS_XMM_to_XMM(EEREC_TEMP, EEREC_S);
|
||||
SSE_MULPS_M128_to_XMM(EEREC_TEMP, addr);
|
||||
|
@ -3191,7 +3191,7 @@ void recVUMI_CLIP(VURegs *VU, int info)
|
|||
u32 prevclipaddr = VU_VI_ADDR(REG_CLIP_FLAG, 2);
|
||||
|
||||
if( clipaddr == 0 ) { // battle star has a clip right before fcset
|
||||
SysPrintf("skipping vu clip\n");
|
||||
Console::WriteLn("skipping vu clip");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3208,7 +3208,7 @@ void recVUMI_CLIP(VURegs *VU, int info)
|
|||
x86temp1 = ALLOCTEMPX86(MODE_8BITREG);
|
||||
x86temp2 = ALLOCTEMPX86(MODE_8BITREG);
|
||||
|
||||
//if ( (x86temp1 == 0) || (x86temp2 == 0) ) SysPrintf("VU CLIP Allocation Error: EAX being allocated! \n");
|
||||
//if ( (x86temp1 == 0) || (x86temp2 == 0) ) Console::Error("VU CLIP Allocation Error: EAX being allocated!");
|
||||
|
||||
_freeXMMreg(t1reg); // These should have been freed at allocation in eeVURecompileCode()
|
||||
_freeXMMreg(t2reg); // but if they've been used since then, then free them. (just doing this incase :p (cottonvibes))
|
||||
|
|
|
@ -445,7 +445,7 @@ void __fastcall SuperVUClear(u32 startpc, u32 size, int vuindex)
|
|||
plist->push_back(*it);
|
||||
if( plist->size() > 30 ) {
|
||||
// list is too big, delete
|
||||
//SysPrintf("Performance warning: deleting cached VU programm!\n");
|
||||
//Console::Notice("Performance warning: deleting cached VU program!");
|
||||
delete plist->front();
|
||||
plist->pop_front();
|
||||
}
|
||||
|
@ -516,7 +516,7 @@ void SuperVUDumpBlock(list<VuBaseBlock*>& blocks, int vuindex)
|
|||
|
||||
Path::CreateDirectory( "dumps" );
|
||||
string filename( Path::Combine( "dumps", fmt_string( "svu%cdump%.4X.txt", s_vu?'0':'1', s_pFnHeader->startpc ) ) );
|
||||
//SysPrintf( "dump1 %x => %s\n", s_pFnHeader->startpc, filename );
|
||||
//Console::WriteLn( "dump1 %x => %s", params s_pFnHeader->startpc, filename );
|
||||
|
||||
f = fopen( filename.c_str(), "w" );
|
||||
|
||||
|
@ -611,7 +611,7 @@ void SuperVUDumpBlock(list<VuBaseBlock*>& blocks, int vuindex)
|
|||
if( (*itblock)->pcode != NULL ) {
|
||||
char command[255];
|
||||
FILE* fasm = fopen( "mydump1", "wb" );
|
||||
//SysPrintf("writing: %x, %x\n", (*itblock)->startpc, (uptr)(*itblock)->pendcode - (uptr)(*itblock)->pcode);
|
||||
//Console::WriteLn("writing: %x, %x", params (*itblock)->startpc, (uptr)(*itblock)->pendcode - (uptr)(*itblock)->pcode);
|
||||
fwrite( (*itblock)->pcode, 1, (uptr)(*itblock)->pendcode - (uptr)(*itblock)->pcode, fasm );
|
||||
fclose( fasm );
|
||||
sprintf( command, "objdump -D --target=binary --architecture=i386 -M intel mydump1 > tempdump");
|
||||
|
@ -769,11 +769,11 @@ static VuFunctionHeader* SuperVURecompileProgram(u32 startpc, int vuindex)
|
|||
{
|
||||
assert( vuindex < 2 );
|
||||
assert( s_recVUPtr != NULL );
|
||||
//SysPrintf("svu%c rec: %x\n", '0'+vuindex, startpc);
|
||||
//Console::WriteLn("svu%c rec: %x", params '0'+vuindex, startpc);
|
||||
|
||||
// if recPtr reached the mem limit reset whole mem
|
||||
if ( ( (uptr)s_recVUPtr - (uptr)s_recVUMem ) >= VU_EXESIZE-0x40000 ) {
|
||||
//SysPrintf("SuperVU reset mem\n");
|
||||
//Console::WriteLn("SuperVU reset mem");
|
||||
SuperVUReset(0);
|
||||
SuperVUReset(1);
|
||||
SuperVUReset(-1);
|
||||
|
@ -871,7 +871,7 @@ static int _recbranchAddr(u32 vucode) {
|
|||
s32 bpc = pc + (_Imm11_ << 3);
|
||||
/*
|
||||
if ( bpc < 0 ) {
|
||||
SysPrintf("zerorec branch warning: bpc < 0 ( %x ); Using unsigned imm11\n", bpc);
|
||||
Console::WriteLn("zerorec branch warning: bpc < 0 ( %x ); Using unsigned imm11", params bpc);
|
||||
bpc = pc + (_UImm11_ << 3);
|
||||
}*/
|
||||
bpc &= (s_MemSize[s_vu]-1);
|
||||
|
@ -943,7 +943,7 @@ static VuInstruction* getDelayInst(VuInstruction* pInst)
|
|||
static VuBaseBlock* SuperVUBuildBlocks(VuBaseBlock* parent, u32 startpc, const VUPIPELINES& pipes)
|
||||
{
|
||||
// check if block already exists
|
||||
//SysPrintf("startpc %x\n", startpc);
|
||||
//Console::WriteLn("startpc %x", params startpc);
|
||||
startpc &= (s_vu ? 0x3fff : 0xfff);
|
||||
VuBlockHeader* pbh = &recVUBlocks[s_vu][startpc/8];
|
||||
|
||||
|
@ -1097,7 +1097,7 @@ static VuBaseBlock* SuperVUBuildBlocks(VuBaseBlock* parent, u32 startpc, const V
|
|||
case 0x16: // fsand
|
||||
if( (ptr[0]&0xc0) ) {
|
||||
// sometimes full sticky bits are needed (simple series 2000 - oane chapara)
|
||||
//SysPrintf("needSticky: %x-%x\n", s_pFnHeader->startpc, startpc);
|
||||
//Console::WriteLn("needSticky: %x-%x", params s_pFnHeader->startpc, startpc);
|
||||
needFullStatusFlag = 2;
|
||||
}
|
||||
break;
|
||||
|
@ -3023,7 +3023,7 @@ void VuInstruction::Recompile(list<VuInstruction>::iterator& itinst, u32 vuxyz)
|
|||
}
|
||||
else {
|
||||
s_ClipRead = s_pCurBlock->GetInstIterAtPc(nParentPc)->pClipWrite;
|
||||
if (s_ClipRead == 0) SysPrintf("super ClipRead allocation error! \n");
|
||||
if (s_ClipRead == 0) Console::WriteLn("super ClipRead allocation error!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3085,7 +3085,7 @@ void VuInstruction::Recompile(list<VuInstruction>::iterator& itinst, u32 vuxyz)
|
|||
}
|
||||
else {
|
||||
s_StatusRead = s_pCurBlock->GetInstIterAtPc(nParentPc)->pStatusWrite;
|
||||
if (s_StatusRead == 0) SysPrintf("super StatusRead allocation error! \n");
|
||||
if (s_StatusRead == 0) Console::WriteLn("super StatusRead allocation error!");
|
||||
// if( pc >= (u32)s_pCurBlock->endpc-8 ) {
|
||||
// // towards the end, so variable might be leaded to another block (silent hill 4)
|
||||
// uptr tempstatus = (uptr)SuperVUStaticAlloc(4);
|
||||
|
@ -3389,7 +3389,7 @@ void VuInstruction::Recompile(list<VuInstruction>::iterator& itinst, u32 vuxyz)
|
|||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
if ( regs[1].VIread & regs[0].VIwrite & ~((1<<REG_Q)|(1<<REG_P)|(1<<REG_VF0_FLAG)|(1<<REG_ACC_FLAG))) {
|
||||
SysPrintf("*PCSX2*: Warning, VI write to the same reg %x in both lower/upper cycle %x\n", regs[1].VIread & regs[0].VIwrite, s_pCurBlock->startpc);
|
||||
Console::Notice("*PCSX2*: Warning, VI write to the same reg %x in both lower/upper cycle %x", params regs[1].VIread & regs[0].VIwrite, s_pCurBlock->startpc);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -3404,7 +3404,7 @@ void VuInstruction::Recompile(list<VuInstruction>::iterator& itinst, u32 vuxyz)
|
|||
assert( regs[1].VFwrite > 0 );
|
||||
|
||||
if (vfwrite[0] == vfwrite[1]) {
|
||||
//SysPrintf("*PCSX2*: Warning, VF write to the same reg in both lower/upper cycle %x\n", s_pCurBlock->startpc);
|
||||
//Console::WriteLn("*PCSX2*: Warning, VF write to the same reg in both lower/upper cycle %x", params s_pCurBlock->startpc);
|
||||
}
|
||||
|
||||
if (vfread0[0] == vfwrite[1] || vfread1[0] == vfwrite[1] ) {
|
||||
|
@ -3475,7 +3475,7 @@ void VuInstruction::Recompile(list<VuInstruction>::iterator& itinst, u32 vuxyz)
|
|||
//
|
||||
// CALLFunc((u32)branchfn);
|
||||
// assert( itinst->regs[0].VIwrite & 0xffff );
|
||||
// SysPrintf("vi write before branch\n");
|
||||
// Console::WriteLn("vi write before branch");
|
||||
// for(s_CacheVIReg = 0; s_CacheVIReg < 16; ++s_CacheVIReg) {
|
||||
// if( itinst->regs[0].VIwrite & (1<<s_CacheVIReg) )
|
||||
// break;
|
||||
|
@ -4159,5 +4159,5 @@ void recVULowerOP_T3_11( VURegs* VU, s32 info )
|
|||
|
||||
void recVUunknown( VURegs* VU, s32 info )
|
||||
{
|
||||
SysPrintf("Unknown SVU micromode opcode called\n");
|
||||
Console::Notice("Unknown SVU micromode opcode called");
|
||||
}
|
||||
|
|
|
@ -1048,12 +1048,12 @@ void iFlushCall(int flushtype)
|
|||
// int i;
|
||||
// for(i = 0; i < 32; ++i ) {
|
||||
// if( fpuRegs.fpr[i].UL== 0x7f800000 || fpuRegs.fpr[i].UL == 0xffc00000) {
|
||||
// SysPrintf("bad fpu: %x %x %x\n", i, cpuRegs.cycle, g_lastpc);
|
||||
// Console::WriteLn("bad fpu: %x %x %x", params i, cpuRegs.cycle, g_lastpc);
|
||||
// }
|
||||
//
|
||||
// if( VU0.VF[i].UL[0] == 0xffc00000 || //(VU0.VF[i].UL[1]&0xffc00000) == 0xffc00000 ||
|
||||
// VU0.VF[i].UL[0] == 0x7f800000) {
|
||||
// SysPrintf("bad vu0: %x %x %x\n", i, cpuRegs.cycle, g_lastpc);
|
||||
// Console::WriteLn("bad vu0: %x %x %x", params i, cpuRegs.cycle, g_lastpc);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
@ -1390,7 +1390,7 @@ void recRecompile( const u32 startpc )
|
|||
s_pCurBlockEx = recBlocks.New(HWADDR(startpc), (uptr)recPtr);
|
||||
|
||||
if( s_pCurBlockEx == NULL ) {
|
||||
//SysPrintf("ee reset (blocks)\n");
|
||||
//Console::WriteLn("ee reset (blocks)");
|
||||
recResetEE();
|
||||
x86SetPtr( recPtr );
|
||||
s_pCurBlockEx = recBlocks.New(HWADDR(startpc), (uptr)recPtr);
|
||||
|
|
|
@ -492,7 +492,7 @@ EERECOMPILE_CODE0(BNEL, XMMINFO_READS|XMMINFO_READT);
|
|||
////////////////////////////////////////////////////
|
||||
//void recBLTZAL( void )
|
||||
//{
|
||||
// SysPrintf("BLTZAL\n");
|
||||
// Console::WriteLn("BLTZAL");
|
||||
// _eeFlushAllUnused();
|
||||
// MOV32ItoM( (int)&cpuRegs.code, cpuRegs.code );
|
||||
// MOV32ItoM( (int)&cpuRegs.pc, pc );
|
||||
|
|
|
@ -58,7 +58,7 @@ void MOV128_MtoM( x86IntRegType destRm, x86IntRegType srcRm )
|
|||
//has to: translate, find function, call function
|
||||
u32 hand=(u8)vmv;
|
||||
u32 paddr=ppf-hand+0x80000000;
|
||||
//SysPrintf("Translted 0x%08X to 0x%08X\n",addr,paddr);
|
||||
//Console::WriteLn("Translated 0x%08X to 0x%08X",params addr,paddr);
|
||||
return reinterpret_cast<TemplateHelper<DataSize,false>::HandlerType*>(RWFT[TemplateHelper<DataSize,false>::sidx][0][hand])(paddr,data);
|
||||
}
|
||||
|
||||
|
|
|
@ -82,14 +82,18 @@ int LoadPatch( const string& crc)
|
|||
bool loadOkay = doc.LoadFile();
|
||||
if ( !loadOkay )
|
||||
{
|
||||
//SysPrintf("XML Patch Loader: Could not load file '%s'. Error='%s'.\n", pfile, doc.ErrorDesc() );
|
||||
//Console::Error("XML Patch Loader: Could not load file '%s'. Error='%s'.", pfile, doc.ErrorDesc() );
|
||||
return -1;
|
||||
} else SysPrintf("XML Patch Loader: '%s' Found\n", pfile);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Console::WriteLn("XML Patch Loader: '%s' Found", params pfile);
|
||||
}
|
||||
|
||||
TiXmlNode *root = doc.FirstChild("GAME");
|
||||
if(!root)
|
||||
{
|
||||
SysPrintf("XML Patch Loader: Root node is not GAME, invalid patch file.\n");
|
||||
Console::Error("XML Patch Loader: Root node is not GAME, invalid patch file.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -97,7 +101,7 @@ int LoadPatch( const string& crc)
|
|||
|
||||
const char *title=rootelement->Attribute("title");
|
||||
if(title)
|
||||
SysPrintf("XML Patch Loader: Game Title: %s\n",title);
|
||||
Console::WriteLn("XML Patch Loader: Game Title: %s", params title);
|
||||
|
||||
int result=LoadGroup(root,-1);
|
||||
if(result) {
|
||||
|
@ -118,7 +122,7 @@ int LoadGroup(TiXmlNode *group,int gParent)
|
|||
|
||||
const char *gtitle=groupelement->Attribute("title");
|
||||
if(gtitle)
|
||||
SysPrintf("XML Patch Loader: Group Title: %s\n",gtitle);
|
||||
Console::WriteLn("XML Patch Loader: Group Title: %s", params gtitle);
|
||||
|
||||
const char *enable=groupelement->Attribute("enabled");
|
||||
bool gEnabled=true;
|
||||
|
@ -126,7 +130,7 @@ int LoadGroup(TiXmlNode *group,int gParent)
|
|||
{
|
||||
if(strcmp(enable,"false")==0)
|
||||
{
|
||||
SysPrintf("XML Patch Loader: Group is disabled.\n");
|
||||
Console::WriteLn("XML Patch Loader: Group is disabled.");
|
||||
gEnabled=false;
|
||||
}
|
||||
}
|
||||
|
@ -137,7 +141,7 @@ int LoadGroup(TiXmlNode *group,int gParent)
|
|||
TiXmlElement *cmelement = comment->ToElement();
|
||||
const char *comment = cmelement->GetText();
|
||||
if(comment)
|
||||
SysPrintf("XML Patch Loader: Group Comment:\n%s\n---\n",comment);
|
||||
Console::WriteLn("XML Patch Loader: Group Comment:\n%s\n---", params comment);
|
||||
}
|
||||
|
||||
string t;
|
||||
|
@ -162,8 +166,11 @@ int LoadGroup(TiXmlNode *group,int gParent)
|
|||
{
|
||||
TiXmlElement *rm=zerogs->ToElement();
|
||||
const char* pid = rm->FirstAttribute()->Value();
|
||||
if( pid != NULL ) sscanf(pid, "%x", &g_ZeroGSOptions);
|
||||
else SysPrintf("zerogs attribute wrong");
|
||||
|
||||
if( pid != NULL )
|
||||
sscanf(pid, "%x", &g_ZeroGSOptions);
|
||||
else
|
||||
Console::WriteLn("zerogs attribute wrong");
|
||||
}
|
||||
|
||||
TiXmlNode *roundmode=group->FirstChild("ROUNDMODE");
|
||||
|
@ -211,7 +218,7 @@ int LoadGroup(TiXmlNode *group,int gParent)
|
|||
}
|
||||
}
|
||||
if(( eetype == 0xffff )||( vutype == 0xffff )) {
|
||||
printf("XML Patch Loader: WARNING: Invalid value in ROUNDMODE.\n");
|
||||
Console::Notice("XML Patch Loader: WARNING: Invalid value in ROUNDMODE.");
|
||||
}
|
||||
else {
|
||||
SetRoundMode(eetype,vutype);
|
||||
|
@ -224,7 +231,7 @@ int LoadGroup(TiXmlNode *group,int gParent)
|
|||
TiXmlElement *celement = cpatch->ToElement();
|
||||
if(!celement)
|
||||
{
|
||||
SysPrintf("XML Patch Loader: ERROR: Couldn't convert node to element.\n" );
|
||||
Console::Error("XML Patch Loader: ERROR: Couldn't convert node to element." );
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -238,7 +245,7 @@ int LoadGroup(TiXmlNode *group,int gParent)
|
|||
const char *value=celement->Attribute("value");
|
||||
|
||||
if(ptitle) {
|
||||
SysPrintf("XML Patch Loader: Patch title: %s\n", ptitle);
|
||||
Console::WriteLn("XML Patch Loader: Patch title: %s", params ptitle);
|
||||
}
|
||||
|
||||
bool penabled=gEnabled;
|
||||
|
@ -246,7 +253,7 @@ int LoadGroup(TiXmlNode *group,int gParent)
|
|||
{
|
||||
if(strcmp(penable,"false")==0)
|
||||
{
|
||||
SysPrintf("XML Patch Loader: Patch is disabled.\n");
|
||||
Console::Notice("XML Patch Loader: Patch is disabled.");
|
||||
penabled=false;
|
||||
}
|
||||
}
|
||||
|
@ -254,15 +261,15 @@ int LoadGroup(TiXmlNode *group,int gParent)
|
|||
if(!applymode) applymode="frame";
|
||||
if(!place) place="EE";
|
||||
if(!address) {
|
||||
SysPrintf("XML Patch Loader: ERROR: Patch doesn't contain an address.\n");
|
||||
Console::Error("XML Patch Loader: ERROR: Patch doesn't contain an address.");
|
||||
return -1;
|
||||
}
|
||||
if(!value) {
|
||||
SysPrintf("XML Patch Loader: ERROR: Patch doesn't contain a value.\n");
|
||||
Console::Error("XML Patch Loader: ERROR: Patch doesn't contain a value.");
|
||||
return -1;
|
||||
}
|
||||
if(!size) {
|
||||
SysPrintf("XML Patch Loader: WARNING: Patch doesn't contain the size. Trying to deduce from the value size.\n");
|
||||
Console::Notice("XML Patch Loader: WARNING: Patch doesn't contain the size. Trying to deduce from the value size.");
|
||||
switch(strlen(value))
|
||||
{
|
||||
case 8:
|
||||
|
@ -297,7 +304,7 @@ int LoadGroup(TiXmlNode *group,int gParent)
|
|||
patch[patchnumber].placetopatch=1;
|
||||
} else
|
||||
{
|
||||
SysPrintf("XML Patch Loader: ERROR: Invalid applymode attribute.\n");
|
||||
Console::Error("XML Patch Loader: ERROR: Invalid applymode attribute.\n");
|
||||
patchnumber=0;
|
||||
return -1;
|
||||
}
|
||||
|
@ -311,7 +318,7 @@ int LoadGroup(TiXmlNode *group,int gParent)
|
|||
patch[patchnumber].cpu= CPU_IOP;
|
||||
} else
|
||||
{
|
||||
SysPrintf("XML Patch Loader: ERROR: Invalid place attribute.\n");
|
||||
Console::Error("XML Patch Loader: ERROR: Invalid place attribute.\n");
|
||||
patchnumber=0;
|
||||
return -1;
|
||||
}
|
||||
|
@ -333,7 +340,7 @@ int LoadGroup(TiXmlNode *group,int gParent)
|
|||
patch[patchnumber].type = BYTE_T;
|
||||
} else
|
||||
{
|
||||
SysPrintf("XML Patch Loader: ERROR: Invalid size attribute.\n");
|
||||
Console::Error("XML Patch Loader: ERROR: Invalid size attribute.\n");
|
||||
patchnumber=0;
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue