mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Core: Skip duplicate frames when using frame advance
It used to be the case that frame advance skipped duplicate frames
(i.e. it would take 30 frame advances to get through one second
of emulated time in a 30 fps game), but this broke in 9c5c3c0
.
Skipping duplicate frames making TASing less annoying.
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
#include "Core/HW/ProcessorInterface.h"
|
||||
#include "Core/HW/SI/SI.h"
|
||||
#include "Core/HW/SystemTimers.h"
|
||||
#include "Core/Movie.h"
|
||||
|
||||
#include "DiscIO/Enums.h"
|
||||
|
||||
@ -816,8 +817,34 @@ static void EndField()
|
||||
// Run when: When a frame is scanned (progressive/interlace)
|
||||
void Update(u64 ticks)
|
||||
{
|
||||
// If this half-line is at a field boundary, potentially deal with frame-stepping
|
||||
// and/or update movie state before dealing with anything else
|
||||
// Movie's frame counter should be updated before actually rendering the frame,
|
||||
// in case frame counter display is enabled
|
||||
|
||||
Movie::FrameUpdate();
|
||||
|
||||
// If this half-line is at some boundary of the "active video lines" in either field, we either
|
||||
// need to (a) send a request to the GPU thread to actually render the XFB, or (b) increment
|
||||
// the number of frames we've actually drawn
|
||||
|
||||
if (s_half_line_count == s_even_field_first_hl)
|
||||
{
|
||||
BeginField(FieldType::Even, ticks);
|
||||
}
|
||||
else if (s_half_line_count == s_odd_field_first_hl)
|
||||
{
|
||||
BeginField(FieldType::Odd, ticks);
|
||||
}
|
||||
else if (s_half_line_count == s_even_field_last_hl)
|
||||
{
|
||||
EndField();
|
||||
}
|
||||
else if (s_half_line_count == s_odd_field_last_hl)
|
||||
{
|
||||
EndField();
|
||||
}
|
||||
|
||||
// If this half-line is at a field boundary, deal with updating movie state before potentially
|
||||
// dealing with SI polls, but after potentially sending a swap request to the GPU thread
|
||||
|
||||
if (s_half_line_count == 0 || s_half_line_count == GetHalfLinesPerEvenField())
|
||||
Core::Callback_NewField();
|
||||
@ -843,27 +870,6 @@ void Update(u64 ticks)
|
||||
s_half_line_of_next_si_poll = GetHalfLinesPerEvenField() + num_half_lines_for_si_poll;
|
||||
}
|
||||
|
||||
// If this half-line is at some boundary of the "active video lines" in either field, we either
|
||||
// need to (a) send a request to the GPU thread to actually render the XFB, or (b) increment
|
||||
// the number of frames we've actually drawn
|
||||
|
||||
if (s_half_line_count == s_even_field_first_hl)
|
||||
{
|
||||
BeginField(FieldType::Even, ticks);
|
||||
}
|
||||
else if (s_half_line_count == s_odd_field_first_hl)
|
||||
{
|
||||
BeginField(FieldType::Odd, ticks);
|
||||
}
|
||||
else if (s_half_line_count == s_even_field_last_hl)
|
||||
{
|
||||
EndField();
|
||||
}
|
||||
else if (s_half_line_count == s_odd_field_last_hl)
|
||||
{
|
||||
EndField();
|
||||
}
|
||||
|
||||
// Move to the next half-line and potentially roll-over the count to zero. If we've reached
|
||||
// the beginning of a new full-line, update the timer
|
||||
|
||||
|
Reference in New Issue
Block a user