basic timing support for VI_V_CURRENT_LINE_REG alternating scan fields by cxd4

This commit is contained in:
zilmar 2015-02-07 10:19:49 +11:00
parent 5267d80ce2
commit 7345ecd97e
4 changed files with 15 additions and 5 deletions

View File

@ -48,6 +48,7 @@ public:
virtual bool ValidVaddr ( DWORD VAddr ) const = 0;
virtual int MemoryFilter ( DWORD dwExptCode, void * lpExceptionPointer ) = 0;
virtual void UpdateFieldSerration ( unsigned int interlaced ) = 0;
//Protect the Memory from being written to
virtual void ProtectMemory ( DWORD StartVaddr, DWORD EndVaddr ) = 0;

View File

@ -31,6 +31,7 @@ CMipsMemoryVM::CMipsMemoryVM ( CMipsMemory_CallBack * CallBack, bool SavesReadOn
m_RomWroteValue(0),
m_HalfLine(0),
m_HalfLineCheck(false),
m_FieldSerration(0),
m_TempValue(0)
{
g_Settings->RegisterChangeCB(Game_RDRamSize,this,(CSettings::SettingChangedFunc)RdramChanged);
@ -2633,8 +2634,6 @@ void CMipsMemoryVM::UpdateHalfLine (void)
m_HalfLine = 0;
return;
}
m_HalfLine = (DWORD)(NextViTimer / g_System->ViRefreshRate());
m_HalfLine &= ~1;
int check_value = (int)(m_HalfLineCheck - NextViTimer);
if (check_value > 0 && check_value < 40)
@ -2646,11 +2645,17 @@ void CMipsMemoryVM::UpdateHalfLine (void)
}
g_SystemTimer->UpdateTimers();
NextViTimer = g_SystemTimer->GetTimer(CSystemTimer::ViTimer);
}
m_HalfLine = (DWORD)(NextViTimer / g_System->ViRefreshRate());
m_HalfLine &= ~1;
}
m_HalfLine |= m_FieldSerration;
m_HalfLineCheck = NextViTimer;
}
void CMipsMemoryVM::UpdateFieldSerration (unsigned int interlaced)
{
m_FieldSerration ^= 1;
m_FieldSerration &= interlaced;
}
void CMipsMemoryVM::ProtectMemory( DWORD StartVaddr, DWORD EndVaddr )

View File

@ -57,6 +57,7 @@ public:
BOOL SD_PAddr ( DWORD PAddr, QWORD Value );
int MemoryFilter ( DWORD dwExptCode, void * lpExceptionPointer );
void UpdateFieldSerration (unsigned int interlaced);
//Protect the Memory from being written to
void ProtectMemory ( DWORD StartVaddr, DWORD EndVaddr );
@ -156,6 +157,7 @@ private:
void UpdateHalfLine ( void );
DWORD m_HalfLine;
DWORD m_HalfLineCheck;
DWORD m_FieldSerration;
DWORD m_TempValue;
//Initilizing and reseting information about the memory system

View File

@ -1797,6 +1797,8 @@ void CN64System::RefreshScreen ( void ) {
WriteTrace(TraceError,__FUNCTION__ ": Exception caught");
}
g_MMU->UpdateFieldSerration((m_Reg.VI_STATUS_REG & 0x40) != 0);
if ((bBasicMode() || bLimitFPS() ) && !bSyncToAudio()) {
if (bShowCPUPer()) { m_CPU_Usage.StartTimer(Timer_Idel); }
DWORD FrameRate;