Merge pull request #439 from refractionpcsx2/vif_force_break_2

VIF: Stall on Force Break
This commit is contained in:
PSISP 2020-08-02 12:04:25 -04:00 committed by GitHub
commit ac1bf8d5a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 5 deletions

View file

@ -80,8 +80,13 @@ bool VectorInterface::check_vif_stall(uint32_t value)
printf("[VIF] VIF%x Stopped (Stall)\n", get_id());
vif_stalled |= STALL_STOP;
}
if (vif_forcebreak)
{
printf("[VIF] VIF%x Force Break (Stall)\n", get_id());
vif_stalled |= STALL_FORCEBREAK;
}
}
is_stalled = vif_stalled & (STALL_IBIT | STALL_STOP);
is_stalled = vif_stalled & (STALL_IBIT | STALL_STOP | STALL_FORCEBREAK);
return is_stalled;
}
@ -1073,9 +1078,10 @@ void VectorInterface::set_fbrst(uint32_t value)
if (value & 0x8)
{
printf("[VIF] VIF%x Resumed\n", get_id());
vif_stalled &= ~(STALL_IBIT | STALL_STOP);
vif_stalled &= ~(STALL_IBIT | STALL_STOP | STALL_FORCEBREAK);
vif_interrupt = false;
vif_stop = false;
vif_forcebreak = false;
}
if (value & 0x4)
{
@ -1093,6 +1099,7 @@ void VectorInterface::set_fbrst(uint32_t value)
wait_for_VU = false;
wait_for_PATH3 = false;
direct_wait = false;
vif_forcebreak = true;
vif_cmd_status = VIF_IDLE;
}
if (value & 0x1)
@ -1112,6 +1119,7 @@ void VectorInterface::set_fbrst(uint32_t value)
vif_ibit_detected = false;
vif_interrupt = false;
vif_stop = false;
vif_forcebreak = false;
mark_detected = false;
flush_stall = false;
stall_condition_active = false;

View file

@ -26,7 +26,8 @@ enum VIF_STALL
STALL_IBIT = 1,
STALL_MSKPATH3 = 2,
STALL_STOP = 4,
STALL_DIRECT = 8
STALL_DIRECT = 8,
STALL_FORCEBREAK = 16
};
struct MPG_Command
@ -76,7 +77,7 @@ class VectorInterface
uint8_t vif_stalled;
uint8_t vif_cmd_status;
bool vif_interrupt;
bool vif_stop;
bool vif_stop, vif_forcebreak;
bool fifo_reverse;
bool wait_for_VU;

View file

@ -4,7 +4,7 @@
#define VER_MAJOR 0
#define VER_MINOR 0
#define VER_REV 48
#define VER_REV 49
using namespace std;
@ -775,6 +775,7 @@ void VectorInterface::load_state(ifstream &state)
state.read((char*)&vif_interrupt, sizeof(vif_interrupt));
state.read((char*)&vif_stalled, sizeof(vif_stalled));
state.read((char*)&vif_stop, sizeof(vif_stop));
state.read((char*)&vif_forcebreak, sizeof(vif_forcebreak));
state.read((char*)&vif_cmd_status, sizeof(vif_cmd_status));
state.read((char*)&internal_WL, sizeof(internal_WL));
@ -837,6 +838,7 @@ void VectorInterface::save_state(ofstream &state)
state.write((char*)&vif_interrupt, sizeof(vif_interrupt));
state.write((char*)&vif_stalled, sizeof(vif_stalled));
state.write((char*)&vif_stop, sizeof(vif_stop));
state.write((char*)&vif_forcebreak, sizeof(vif_forcebreak));
state.write((char*)&vif_cmd_status, sizeof(vif_cmd_status));
state.write((char*)&internal_WL, sizeof(internal_WL));