diff --git a/src/xenia/gpu/d3d11/d3d11_graphics_system.cc b/src/xenia/gpu/d3d11/d3d11_graphics_system.cc index 2e8993429..68db9311b 100644 --- a/src/xenia/gpu/d3d11/d3d11_graphics_system.cc +++ b/src/xenia/gpu/d3d11/d3d11_graphics_system.cc @@ -22,7 +22,7 @@ using namespace xe::gpu::d3d11; namespace { void __stdcall D3D11GraphicsSystemVsyncCallback(D3D11GraphicsSystem* gs, BOOLEAN) { - gs->DispatchInterruptCallback(); + gs->DispatchInterruptCallback(0); } } @@ -135,7 +135,7 @@ void D3D11GraphicsSystem::Initialize() { driver_ = new D3D11GraphicsDriver(memory_, device_); // Initial vsync kick. - DispatchInterruptCallback(); + DispatchInterruptCallback(0); } void D3D11GraphicsSystem::Pump() { @@ -145,10 +145,12 @@ void D3D11GraphicsSystem::Pump() { // Swap window. // If we are set to vsync this will block. window_->Swap(); + + DispatchInterruptCallback(0); } else { // If we have gone too long without an interrupt, fire one. if (xe_pal_now() - last_interrupt_time_ > 16 / 1000.0) { - DispatchInterruptCallback(); + DispatchInterruptCallback(0); } } } diff --git a/src/xenia/gpu/graphics_system.cc b/src/xenia/gpu/graphics_system.cc index d16634b8e..a3787eb31 100644 --- a/src/xenia/gpu/graphics_system.cc +++ b/src/xenia/gpu/graphics_system.cc @@ -160,7 +160,8 @@ void GraphicsSystem::WriteRegister(uint32_t r, uint64_t value) { regs->values[r].u32 = (uint32_t)value; } -void GraphicsSystem::DispatchInterruptCallback(uint32_t cpu) { +void GraphicsSystem::DispatchInterruptCallback( + uint32_t source, uint32_t cpu) { // Pick a CPU, if needed. We're going to guess 2. Because. if (cpu == 0xFFFFFFFF) { cpu = 2; @@ -172,5 +173,5 @@ void GraphicsSystem::DispatchInterruptCallback(uint32_t cpu) { return; } processor_->ExecuteInterrupt( - cpu, interrupt_callback_, 1, interrupt_callback_data_); + cpu, interrupt_callback_, source, interrupt_callback_data_); } diff --git a/src/xenia/gpu/graphics_system.h b/src/xenia/gpu/graphics_system.h index 47cce8211..b24ca995a 100644 --- a/src/xenia/gpu/graphics_system.h +++ b/src/xenia/gpu/graphics_system.h @@ -52,7 +52,7 @@ public: virtual uint64_t ReadRegister(uint32_t r); virtual void WriteRegister(uint32_t r, uint64_t value); - void DispatchInterruptCallback(uint32_t cpu = 0xFFFFFFFF); + void DispatchInterruptCallback(uint32_t source, uint32_t cpu = 0xFFFFFFFF); bool swap_pending() const { return swap_pending_; } void set_swap_pending(bool value) { swap_pending_ = value; } diff --git a/src/xenia/gpu/nop/nop_graphics_system.cc b/src/xenia/gpu/nop/nop_graphics_system.cc index b96ab2bd3..ba34ce898 100644 --- a/src/xenia/gpu/nop/nop_graphics_system.cc +++ b/src/xenia/gpu/nop/nop_graphics_system.cc @@ -21,7 +21,7 @@ using namespace xe::gpu::nop; namespace { void __stdcall NopGraphicsSystemVsyncCallback(NopGraphicsSystem* gs, BOOLEAN) { - gs->DispatchInterruptCallback(); + gs->DispatchInterruptCallback(0); } } diff --git a/src/xenia/gpu/ring_buffer_worker.cc b/src/xenia/gpu/ring_buffer_worker.cc index 470ca06b1..5f7c6e19a 100644 --- a/src/xenia/gpu/ring_buffer_worker.cc +++ b/src/xenia/gpu/ring_buffer_worker.cc @@ -289,7 +289,7 @@ uint32_t RingBufferWorker::ExecutePacket(PacketArgs& args) { uint32_t cpu_mask = READ_AND_ADVANCE_PTR(); for (int n = 0; n < 6; n++) { if (cpu_mask & (1 << n)) { - graphics_system_->DispatchInterruptCallback(n); + graphics_system_->DispatchInterruptCallback(1, n); } } }