ReorderingMTGS: Assertion fixes, some comments notes on MARK behavior.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/ReorderingMTGS@3504 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2010-07-16 20:31:00 +00:00
parent 32942ec9a6
commit 5bbdb68896
3 changed files with 21 additions and 13 deletions

View File

@ -134,7 +134,6 @@ template<int idx> _f int _vifCode_Direct(int pass, u8* data, bool isDirectHL) {
}
pass2 {
vif1Only();
nVifStruct& v = nVif[1];
if (GSTransferStatus.PTH3 < IDLE_MODE || gifRegs->stat.P1Q == true)
{
@ -175,7 +174,7 @@ template<int idx> _f int _vifCode_Direct(int pass, u8* data, bool isDirectHL) {
// the tag size should ALWAYS be 128 bits (qwc). If it isn't, it means there's a serious bug
// somewhere in the VIF (likely relating to +/-'ing the tag.size during processing).
pxAssumeMsg( (vif1.tag.size & 1) == 0, "Invalid Vif1 DIRECT packet size detected!" );
pxAssumeMsg( (vif1.tag.size & 3) == 0, "Invalid Vif1 DIRECT packet size detected!" );
const int minSize = aMin(vif1.vifpacketsize, vif1.tag.size)/4;
uint ret;

View File

@ -36,16 +36,8 @@ _vifT bool analyzeIbit(u32* &data, int iBit) {
if (iBit && !vifX.cmd && !vifXRegs->err.MII) {
//DevCon.WriteLn("Vif I-Bit IRQ");
vifX.irq++;
// On i-bit, the command is run, vif stalls etc,
// however if the vifcode is MARK, you do NOT stall, just send IRQ. - Max Payne shows this up.
//if(((vifXRegs->code >> 24) & 0x7f) == 0x7) return 0;
// If we have a vifcode with i-bit, the following instruction
// should stall unless its MARK?.. we test that case here...
// Not 100% sure if this is the correct behavior, so printing
// a console message to see games that use this. (cottonvibes)
// Okay did some testing with Max Payne, it does this
// Okay did some testing with Max Payne, it does this:
// VifMark value = 0x666 (i know, evil!)
// NOP with I Bit
// VifMark value = 0
@ -53,6 +45,23 @@ _vifT bool analyzeIbit(u32* &data, int iBit) {
// If you break after the 2nd Mark has run, the game reports invalid mark 0 and the game dies.
// So it has to occur here, testing a theory that it only doesn't stall if the command with
// the iBit IS mark, but still sends the IRQ to let the cpu know the mark is there. (Refraction)
//
// --------------------------
//
// This is how it probably works: i-bit sets the IRQ flag, and VIF keeps running until it encounters
// a non-MARK instruction. This includes the *current* instruction. ie, execution only continues
// unimpeded if MARK[i] is specified, and keeps executing unimpeded until any non-MARK command.
// Any other command with an I bit should stall immediately.
// Example:
//
// VifMark[i] value = 0x321 (with I bit)
// VifMark value = 0
// VifMark value = 0x333
// NOP
//
// ... the VIF should not stall and raise the interrupt until after the NOP is processed.
// So the final value for MARK as the game sees it will be 0x333. --air
return runMark<idx>(data);
}
return 0;

View File

@ -878,11 +878,11 @@ __forceinline int GIFPath_CopyTag(GIF_PATH pathidx, const u128* pMem, u32 size)
{
case GIF_PATH_1:
pxAssertMsg(!s_gifPath[GIF_PATH_2].IsActive(), "GIFpath conflict: Attempted to start PATH1 while PATH2 is already active.");
pxAssertMsg(!s_gifPath[GIF_PATH_3].IsActive(), "GIFpath conflict: Attempted to start PATH1 while PATH3 is already active.");
pxAssertMsg(!s_gifPath[GIF_PATH_3].IsActive() || (GSTransferStatus.PTH3 == IMAGE_MODE), "GIFpath conflict: Attempted to start PATH1 while PATH3 is already active.");
return s_gifPath[GIF_PATH_1].CopyTag<GIF_PATH_1,true>(pMem, size);
case GIF_PATH_2:
pxAssertMsg(!s_gifPath[GIF_PATH_1].IsActive(), "GIFpath conflict: Attempted to start PATH2 while PATH1 is already active.");
pxAssertMsg(!s_gifPath[GIF_PATH_3].IsActive(), "GIFpath conflict: Attempted to start PATH2 while PATH3 is already active.");
pxAssertMsg(!s_gifPath[GIF_PATH_3].IsActive() || (GSTransferStatus.PTH3 == IMAGE_MODE), "GIFpath conflict: Attempted to start PATH2 while PATH3 is already active.");
return s_gifPath[GIF_PATH_2].CopyTag<GIF_PATH_2,false>(pMem, size);
case GIF_PATH_3:
pxAssertMsg(!s_gifPath[GIF_PATH_1].IsActive(), "GIFpath conflict: Attempted to start PATH3 while PATH1 is already active.");