VideoInterface: Change a global into a translation-unit local variable

This commit is contained in:
Lioncash 2016-01-21 00:27:54 -05:00
commit f45e1bff37
5 changed files with 13 additions and 11 deletions

View file

@ -49,7 +49,7 @@ static UVIBorderBlankRegister m_BorderHBlank;
// 0xcc002076 - 0xcc00207f is full of 0x00FF: unknown
// 0xcc002080 - 0xcc002100 even more unknown
u32 TargetRefreshRate = 0;
u32 s_target_refresh_rate = 0;
static u32 s_clock_freqs[2] =
{
@ -94,7 +94,7 @@ void DoState(PointerWrap &p)
p.Do(m_DTVStatus);
p.Do(m_FBWidth);
p.Do(m_BorderHBlank);
p.Do(TargetRefreshRate);
p.Do(s_target_refresh_rate);
p.Do(s_ticks_last_line_start);
p.Do(s_half_line_count);
p.Do(s_half_line_of_next_si_poll);
@ -609,7 +609,12 @@ void UpdateParameters()
s_even_field_last_hl = s_even_field_first_hl + m_VerticalTimingRegister.ACV * 2;
s_odd_field_last_hl = s_odd_field_first_hl + m_VerticalTimingRegister.ACV * 2;
TargetRefreshRate = lround(2.0 * SystemTimers::GetTicksPerSecond() / (GetTicksPerEvenField() + GetTicksPerOddField()));
s_target_refresh_rate = lround(2.0 * SystemTimers::GetTicksPerSecond() / (GetTicksPerEvenField() + GetTicksPerOddField()));
}
u32 GetTargetRefreshRate()
{
return s_target_refresh_rate;
}
u32 GetTicksPerSample()
@ -622,7 +627,6 @@ u32 GetTicksPerHalfLine()
return GetTicksPerSample() * m_HTiming0.HLW;
}
u32 GetTicksPerField()
{
return GetTicksPerEvenField();

View file

@ -305,9 +305,6 @@ union UVIHorizontalStepping
};
};
// urgh, ugly externs.
extern u32 TargetRefreshRate;
// For BS2 HLE
void Preset(bool _bNTSC);
@ -330,6 +327,7 @@ union UVIHorizontalStepping
// Change values pertaining to video mode
void UpdateParameters();
u32 GetTargetRefreshRate();
u32 GetTicksPerSample();
u32 GetTicksPerHalfLine();
u32 GetTicksPerField();