summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2016-04-17 14:56:53 -0700
committershuffle2 <godisgovernment@gmail.com>2016-04-17 14:56:53 -0700
commit5e4554df420ada2735d05038327e804fd4ba4e0a (patch)
treefb3b2c06303c5d82963eced84c46eeb27df7ea9a /Source/Core
parente4759bcbcb64b47c135457a46e6af35053dc5631 (diff)
parent32239f500c3169af3f4a007027225ccd8b6aa0d6 (diff)
Merge pull request #3786 from EmptyChaos/vi-uninited
VideoInterface: Fix registers not being initialized
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/HW/VideoInterface.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/Core/Core/HW/VideoInterface.cpp b/Source/Core/Core/HW/VideoInterface.cpp
index a191bd25f3..c2bea06ee4 100644
--- a/Source/Core/Core/HW/VideoInterface.cpp
+++ b/Source/Core/Core/HW/VideoInterface.cpp
@@ -108,10 +108,19 @@ void DoState(PointerWrap &p)
// Executed after Init, before game boot
void Preset(bool _bNTSC)
{
+ // NOTE: Make sure all registers are set to the correct initial state. The
+ // variables are not going to start zeroed if another game has been run
+ // previously (and mutated everything).
+
m_VerticalTimingRegister.EQU = 6;
m_VerticalTimingRegister.ACV = 0;
m_DisplayControlRegister.ENB = 1;
+ m_DisplayControlRegister.RST = 0;
+ m_DisplayControlRegister.NIN = 0;
+ m_DisplayControlRegister.DLR = 0;
+ m_DisplayControlRegister.LE0 = 0;
+ m_DisplayControlRegister.LE1 = 0;
m_DisplayControlRegister.FMT = _bNTSC ? 0 : 1;
m_HTiming0.HLW = 429;
@@ -135,6 +144,11 @@ void Preset(bool _bNTSC)
m_BurstBlankingEven.BS2 = 13;
m_BurstBlankingEven.BE2 = 519;
+ m_XFBInfoTop.Hex = 0;
+ m_XFBInfoBottom.Hex = 0;
+ m_3DFBInfoTop.Hex = 0;
+ m_3DFBInfoBottom.Hex = 0;
+
m_InterruptRegister[0].HCT = 430;
m_InterruptRegister[0].VCT = 263;
m_InterruptRegister[0].IR_MASK = 1;
@@ -143,10 +157,19 @@ void Preset(bool _bNTSC)
m_InterruptRegister[1].VCT = 1;
m_InterruptRegister[1].IR_MASK = 1;
m_InterruptRegister[1].IR_INT = 0;
+ m_InterruptRegister[2].Hex = 0;
+ m_InterruptRegister[3].Hex = 0;
+
+ m_LatchRegister[0].Hex = 0;
+ m_LatchRegister[1].Hex = 0;
m_PictureConfiguration.STD = 40;
m_PictureConfiguration.WPL = 40;
+ m_HorizontalScaling.Hex = 0;
+ m_FilterCoefTables = {};
+ m_UnkAARegister = 0;
+
// 54MHz, capable of progressive scan
m_Clock = SConfig::GetInstance().bNTSC;
@@ -154,6 +177,9 @@ void Preset(bool _bNTSC)
m_DTVStatus.component_plugged = SConfig::GetInstance().bProgressive;
m_DTVStatus.ntsc_j = SConfig::GetInstance().bForceNTSCJ;
+ m_FBWidth.Hex = 0;
+ m_BorderHBlank.Hex = 0;
+
s_ticks_last_line_start = 0;
s_half_line_count = 1;
s_half_line_of_next_si_poll = num_half_lines_for_si_poll; // first sampling starts at vsync