mirror of https://github.com/PCSX2/pcsx2.git
VU: Improve VU0/Mbit sync with VU Interpreter. Improve Kickstart.
This commit is contained in:
parent
2e2d6ba35d
commit
e19b0bce57
|
@ -65,7 +65,7 @@ __fi void _vu0run(bool breakOnMbit, bool addCycles) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 startcycle = VU0.cycle;
|
u32 startcycle = cpuRegs.cycle;
|
||||||
u32 runCycles = 0x7fffffff;
|
u32 runCycles = 0x7fffffff;
|
||||||
|
|
||||||
do { // Run VU until it finishes or M-Bit
|
do { // Run VU until it finishes or M-Bit
|
||||||
|
@ -77,7 +77,6 @@ __fi void _vu0run(bool breakOnMbit, bool addCycles) {
|
||||||
if (addCycles)
|
if (addCycles)
|
||||||
{
|
{
|
||||||
cpuRegs.cycle += (VU0.cycle - startcycle);
|
cpuRegs.cycle += (VU0.cycle - startcycle);
|
||||||
VU0.cycle = cpuRegs.cycle;
|
|
||||||
CpuVU1->ExecuteBlock(0); // Catch up VU1 as it's likely fallen behind
|
CpuVU1->ExecuteBlock(0); // Catch up VU1 as it's likely fallen behind
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,8 +154,6 @@ static void _vu0Exec(VURegs* VU)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_vuAddUpperStalls(VU, &uregs);
|
_vuAddUpperStalls(VU, &uregs);
|
||||||
|
|
||||||
if (!(ptr[1] & 0x80000000))
|
|
||||||
_vuAddLowerStalls(VU, &lregs);
|
_vuAddLowerStalls(VU, &lregs);
|
||||||
|
|
||||||
if (VU->branch > 0) {
|
if (VU->branch > 0) {
|
||||||
|
@ -222,7 +220,8 @@ void InterpVU0::Execute(u32 cycles)
|
||||||
|
|
||||||
VU0.VI[REG_TPC].UL <<= 3;
|
VU0.VI[REG_TPC].UL <<= 3;
|
||||||
VU0.flags &= ~VUFLAG_MFLAGSET;
|
VU0.flags &= ~VUFLAG_MFLAGSET;
|
||||||
for (int i = (int)cycles; i > 0; i--) {
|
u32 startcycles = VU0.cycle;
|
||||||
|
while((VU0.cycle - startcycles) < cycles) {
|
||||||
if (!(VU0.VI[REG_VPU_STAT].UL & 0x1) || (VU0.flags & VUFLAG_MFLAGSET)) {
|
if (!(VU0.VI[REG_VPU_STAT].UL & 0x1) || (VU0.flags & VUFLAG_MFLAGSET)) {
|
||||||
if (VU0.branch || VU0.ebit) {
|
if (VU0.branch || VU0.ebit) {
|
||||||
vu0Exec(&VU0); // run branch delay slot?
|
vu0Exec(&VU0); // run branch delay slot?
|
||||||
|
|
|
@ -297,7 +297,8 @@ void InterpVU1::Execute(u32 cycles)
|
||||||
fesetround(g_sseVUMXCSR.RoundingControl << 8);
|
fesetround(g_sseVUMXCSR.RoundingControl << 8);
|
||||||
|
|
||||||
VU1.VI[REG_TPC].UL <<= 3;
|
VU1.VI[REG_TPC].UL <<= 3;
|
||||||
for (int i = (int)cycles; i > 0; i--)
|
u32 startcycles = VU1.cycle;
|
||||||
|
while ((VU1.cycle - startcycles) < cycles)
|
||||||
{
|
{
|
||||||
if (!(VU0.VI[REG_VPU_STAT].UL & 0x100))
|
if (!(VU0.VI[REG_VPU_STAT].UL & 0x100))
|
||||||
{
|
{
|
||||||
|
|
|
@ -87,12 +87,12 @@ void BaseVUmicroCPU::ExecuteBlock(bool startUp)
|
||||||
// I don't like doing this, but Crash Twinsanity seems to be upset without it
|
// I don't like doing this, but Crash Twinsanity seems to be upset without it
|
||||||
if (stat & test)
|
if (stat & test)
|
||||||
{
|
{
|
||||||
cpuSetNextEventDelta(s);
|
|
||||||
|
|
||||||
if (m_Idx)
|
if (m_Idx)
|
||||||
VU1.cycle = cpuRegs.cycle;
|
cpuRegs.cycle = VU1.cycle;
|
||||||
else
|
else
|
||||||
VU0.cycle = cpuRegs.cycle;
|
cpuRegs.cycle = VU0.cycle;
|
||||||
|
|
||||||
|
cpuSetNextEventDelta(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Continue Executing
|
else // Continue Executing
|
||||||
|
|
|
@ -263,7 +263,7 @@ void _vuFlushAll(VURegs* VU)
|
||||||
|
|
||||||
__fi void _vuTestPipes(VURegs * VU) {
|
__fi void _vuTestPipes(VURegs * VU) {
|
||||||
bool flushed;
|
bool flushed;
|
||||||
u32 startcycle = VU->cycle;
|
|
||||||
do {
|
do {
|
||||||
flushed = false;
|
flushed = false;
|
||||||
flushed |= _vuFMACflush(VU);
|
flushed |= _vuFMACflush(VU);
|
||||||
|
|
Loading…
Reference in New Issue