mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-03-06 14:27:44 +00:00
System: Periodically flush GPU
Needs real timings...
This commit is contained in:
parent
03bd135060
commit
77b15d156d
|
@ -178,6 +178,12 @@ void GPU::DMAWrite(u32 value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GPU::Flush()
|
||||||
|
{
|
||||||
|
FlushRender();
|
||||||
|
UpdateDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
u32 GPU::ReadGPUREAD()
|
u32 GPU::ReadGPUREAD()
|
||||||
{
|
{
|
||||||
if (m_GPUREAD_buffer.empty())
|
if (m_GPUREAD_buffer.empty())
|
||||||
|
@ -312,6 +318,14 @@ void GPU::WriteGP1(u32 value)
|
||||||
const u32 param = value & UINT32_C(0x00FFFFFF);
|
const u32 param = value & UINT32_C(0x00FFFFFF);
|
||||||
switch (command)
|
switch (command)
|
||||||
{
|
{
|
||||||
|
case 0x01: // Clear FIFO
|
||||||
|
{
|
||||||
|
m_GP0_command.clear();
|
||||||
|
Log_DebugPrintf("GP1 clear FIFO");
|
||||||
|
UpdateGPUSTAT();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 0x04: // DMA Direction
|
case 0x04: // DMA Direction
|
||||||
{
|
{
|
||||||
m_GPUSTAT.dma_direction = static_cast<DMADirection>(param);
|
m_GPUSTAT.dma_direction = static_cast<DMADirection>(param);
|
||||||
|
@ -409,8 +423,6 @@ bool GPU::HandleRenderCommand()
|
||||||
ZeroExtend32(words_per_vertex));
|
ZeroExtend32(words_per_vertex));
|
||||||
|
|
||||||
DispatchRenderCommand(rc, num_vertices);
|
DispatchRenderCommand(rc, num_vertices);
|
||||||
//FlushRender();
|
|
||||||
//UpdateDisplay();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@ public:
|
||||||
// gpu_hw_opengl.cpp
|
// gpu_hw_opengl.cpp
|
||||||
static std::unique_ptr<GPU> CreateHardwareOpenGLRenderer();
|
static std::unique_ptr<GPU> CreateHardwareOpenGLRenderer();
|
||||||
|
|
||||||
|
void Flush();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static constexpr u32 VRAM_WIDTH = 1024;
|
static constexpr u32 VRAM_WIDTH = 1024;
|
||||||
static constexpr u32 VRAM_HEIGHT = 512;
|
static constexpr u32 VRAM_HEIGHT = 512;
|
||||||
|
|
|
@ -75,8 +75,14 @@ bool System::SaveState(ByteStream* state)
|
||||||
void System::RunFrame()
|
void System::RunFrame()
|
||||||
{
|
{
|
||||||
u32 current_frame_number = m_frame_number;
|
u32 current_frame_number = m_frame_number;
|
||||||
while (current_frame_number == m_frame_number)
|
u32 ticks = 0;
|
||||||
|
while (current_frame_number == m_frame_number && ticks < (44100 * 300))
|
||||||
|
{
|
||||||
m_cpu->Execute();
|
m_cpu->Execute();
|
||||||
|
ticks++;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_gpu->Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool System::LoadEXE(const char* filename)
|
bool System::LoadEXE(const char* filename)
|
||||||
|
|
Loading…
Reference in a new issue