Guest User

Untitled

a guest
Aug 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.68 KB | None | 0 0
  1. Index: Source/Core/Core/Src/Core.cpp
  2. ===================================================================
  3. --- Source/Core/Core/Src/Core.cpp (revision 6502)
  4. +++ Source/Core/Core/Src/Core.cpp (working copy)
  5. @@ -330,6 +330,7 @@
  6. VideoInitialize.pRegisterEvent = CoreTiming::RegisterEvent;
  7. VideoInitialize.pScheduleEvent_Threadsafe = CoreTiming::ScheduleEvent_Threadsafe;
  8. VideoInitialize.pRemoveEvent = CoreTiming::RemoveAllEvents;
  9. + VideoInitialize.pProcessFifoEvents = CoreTiming::ProcessFifoWaitEvents;
  10. // This is first the m_Panel handle, then it is updated to have the new window handle
  11. VideoInitialize.pWindowHandle = _CoreParameter.hMainWindow;
  12. VideoInitialize.pLog = Callback_VideoLog;
  13. Index: Source/Core/VideoCommon/Src/CommandProcessor.cpp
  14. ===================================================================
  15. --- Source/Core/VideoCommon/Src/CommandProcessor.cpp (revision 6503)
  16. +++ Source/Core/VideoCommon/Src/CommandProcessor.cpp (working copy)
  17. @@ -380,6 +380,8 @@
  18. {
  19. while (fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance)
  20. s_fifoIdleEvent.Wait();
  21. + g_VideoInitialize.pProcessFifoEvents();
  22. +
  23. }
  24. else
  25. {
  26. @@ -411,7 +413,9 @@
  27.  
  28. if (tmpCtrl.FifoOverflowIntEnable)
  29. m_CPStatusReg.OverflowHiWatermark = false;
  30. -
  31. +
  32. + if (g_VideoInitialize.bOnThread)
  33. + g_VideoInitialize.pRemoveEvent(et_UpdateInterrupts);
  34. UpdateInterrupts();
  35.  
  36. // If the new fifo is being attached We make sure there wont be SetFinish event pending.
  37. @@ -426,9 +430,9 @@
  38. fifo.bFF_BPEnable = tmpCtrl.BPEnable;
  39. if(tmpFifoGPReadEnable == fifo.bFF_GPReadEnable)
  40. {
  41. - fifo.bFF_GPReadEnable = tmpCtrl.GPReadEnable;
  42. -
  43. - if (fifo.bFF_GPReadEnable && (fifo.CPReadWriteDistance >= fifo.CPHiWatermark))
  44. + fifo.bFF_GPReadEnable = tmpCtrl.GPReadEnable;
  45. +
  46. + if (g_VideoInitialize.bOnThread && fifo.bFF_GPReadEnable && (fifo.CPReadWriteDistance >= fifo.CPHiWatermark))
  47. {
  48. // A little trick to prevent FIFO from overflown in dual core mode
  49. while (fifo.bFF_GPReadEnable && (fifo.CPReadWriteDistance >= fifo.CPHiWatermark))
  50. @@ -460,6 +464,9 @@
  51. m_CPStatusReg.OverflowHiWatermark = false;
  52. if (tmpCtrl.ClearFifoUnderflow)
  53. Common::AtomicStore(fifo.CPReadIdle, false);
  54. +
  55. + if (g_VideoInitialize.bOnThread)
  56. + g_VideoInitialize.pRemoveEvent(et_UpdateInterrupts);
  57. UpdateInterrupts();
  58. DEBUG_LOG(COMMANDPROCESSOR,"\t write to CLEAR_REGISTER : %04x", _Value);
  59. }
  60. @@ -560,7 +567,13 @@
  61. }
  62.  
  63. if (!g_VideoInitialize.bOnThread)
  64. + {
  65. CatchUpGPU();
  66. + }
  67. + else
  68. + {
  69. + g_VideoInitialize.pProcessFifoEvents();
  70. + }
  71. }
  72.  
  73. void Read32(u32& _rReturnValue, const u32 _Address)
  74. @@ -604,6 +617,8 @@
  75. {
  76. if (!g_VideoInitialize.bOnThread)
  77. CatchUpGPU();
  78. + else
  79. + g_VideoInitialize.pProcessFifoEvents();
  80.  
  81. return;
  82. }
  83. @@ -628,8 +643,12 @@
  84. if (!m_CPStatusReg.OverflowHiWatermark)
  85. {
  86. m_CPStatusReg.OverflowHiWatermark = true;
  87. +
  88. if (m_CPCtrlReg.FifoOverflowIntEnable)
  89. + {
  90. + g_VideoInitialize.pRemoveEvent(et_UpdateInterrupts);
  91. UpdateInterrupts();
  92. + }
  93. }
  94.  
  95. }
  96. @@ -638,11 +657,15 @@
  97. else
  98. {
  99. CatchUpGPU();
  100. + g_VideoInitialize.pProcessFifoEvents();
  101. if (!m_CPStatusReg.OverflowHiWatermark && fifo.CPReadWriteDistance >= fifo.CPHiWatermark)
  102. {
  103. m_CPStatusReg.OverflowHiWatermark = true;
  104. if (m_CPCtrlReg.FifoOverflowIntEnable)
  105. + {
  106. + g_VideoInitialize.pRemoveEvent(et_UpdateInterrupts);
  107. UpdateInterrupts();
  108. + }
  109. }
  110. }
  111.  
  112. Index: Source/PluginSpecs/pluginspecs_video.h
  113. ===================================================================
  114. --- Source/PluginSpecs/pluginspecs_video.h (revision 6502)
  115. +++ Source/PluginSpecs/pluginspecs_video.h (working copy)
  116. @@ -15,6 +15,7 @@
  117. typedef int (*TRegisterEvent)(const char *name, TimedCallback callback);
  118. typedef void (*TScheduleEvent_Threadsafe)(int cyclesIntoFuture, int event_type, u64 userdata, bool fifoWait);
  119. typedef void (*TRemoveEvent)(int event_type);
  120. +typedef void (*TProcessFifoEvents)(void);
  121. typedef unsigned char* (*TGetMemoryPointer)(const unsigned int _iAddress);
  122. typedef void (*TVideoLog)(const char* _pMessage, int _bBreak);
  123. typedef void (*TSysMessage)(const char *fmt, ...);
  124. @@ -76,6 +77,7 @@
  125. TRegisterEvent pRegisterEvent;
  126. TScheduleEvent_Threadsafe pScheduleEvent_Threadsafe;
  127. TRemoveEvent pRemoveEvent;
  128. + TProcessFifoEvents pProcessFifoEvents;
  129. TGetMemoryPointer pGetMemoryPointer;
  130. TVideoLog pLog;
  131. TSysMessage pSysMessage;
  132. @@ -191,5 +193,6 @@
  133.  
  134. EXPORT void CALL Video_AbortFrame(void);
  135.  
  136. +
  137. #include "ExportEpilog.h"
  138. #endif
Add Comment
Please, Sign In to add comment