Skip to content

Commit

Permalink
ggpo: move end of frame back to original renderer location, fixes scr…
Browse files Browse the repository at this point in the history
…een flashing on rollback for naomi 2
  • Loading branch information
blueminder committed Feb 2, 2023
1 parent 199d5be commit 4768631
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 9 additions & 1 deletion core/hw/pvr/Renderer_if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,15 @@ void rend_start_render()
ctx->rend.fog_clamp_min = FOG_CLAMP_MIN;
ctx->rend.fog_clamp_max = FOG_CLAMP_MAX;

bool present = !config::DelayFrameSwapping && !ctx->rend.isRTT && !config::EmulateFramebuffer;
if (present)
ggpo::endOfFrame();
if (QueueRender(ctx))
{
palette_update();
pend_rend = true;
pvrQueue.enqueue(PvrMessageQueue::Render);
if (!config::DelayFrameSwapping && !ctx->rend.isRTT && !config::EmulateFramebuffer)
if (present)
pvrQueue.enqueue(PvrMessageQueue::Present);
}
}
Expand Down Expand Up @@ -437,6 +440,7 @@ void rend_vblank()
fbInfo.update();
pvrQueue.enqueue(PvrMessageQueue::RenderFramebuffer, fbInfo);
pvrQueue.enqueue(PvrMessageQueue::Present);
ggpo::endOfFrame();
if (!config::EmulateFramebuffer)
DEBUG_LOG(PVR, "Direct framebuffer write detected");
}
Expand Down Expand Up @@ -479,7 +483,11 @@ void rend_set_fb_write_addr(u32 fb_w_sof1)
void rend_swap_frame(u32 fb_r_sof)
{
if (!config::EmulateFramebuffer && fb_r_sof == fb_w_cur && rend_is_enabled())
{
pvrQueue.enqueue(PvrMessageQueue::Present);
if (config::DelayFrameSwapping)
ggpo::endOfFrame();
}
}

void rend_disable_rollback()
Expand Down
2 changes: 0 additions & 2 deletions core/hw/pvr/spg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "oslib/oslib.h"
#include "hw/maple/maple_if.h"
#include "serialize.h"
#include "network/ggpo.h"
#include "hw/pvr/Renderer_if.h"

#ifdef TEST_AUTOMATION
Expand Down Expand Up @@ -113,7 +112,6 @@ static int spg_line_sched(int tag, int cycles, int jitter)
SB_MDST = 0;
}
asic_RaiseInterrupt(holly_SCANINT1);
ggpo::endOfFrame();
}

if (SPG_VBLANK_INT.vblank_out_interrupt_line_number == prv_cur_scanline)
Expand Down

0 comments on commit 4768631

Please sign in to comment.