mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2026-10-12 02:13:28 +00:00
[Core/CD] minor Main-CPU/Sub-CPU synchronization optimization
This commit is contained in:
+6
-4
@@ -504,14 +504,16 @@ static void s68k_poll_sync(unsigned int reg_mask)
|
||||
|
||||
static void m68k_sync(void)
|
||||
{
|
||||
/* check MAIN-CPU is still running */
|
||||
if (!m68k.stopped)
|
||||
{
|
||||
/* relative MAIN-CPU cycle counter */
|
||||
unsigned int cycles = (s68k.cycles * MCYCLES_PER_LINE) / SCYCLES_PER_LINE;
|
||||
|
||||
/* sync MAIN-CPU with SUB-CPU (only if MAIN-CPU execution frame is finished, to prevent recursive execution) */
|
||||
/* check MAIN-CPU execution frame is finished (to prevent recursive execution) */
|
||||
if (!m68k.cycle_end)
|
||||
{
|
||||
/* relative MAIN-CPU cycle counter */
|
||||
unsigned int cycles = (s68k.cycles * MCYCLES_PER_LINE) / SCYCLES_PER_LINE;
|
||||
|
||||
/* sync MAIN-CPU with SUB-CPU */
|
||||
m68k_run(cycles);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-4
@@ -302,14 +302,16 @@ static void m68k_poll_sync(unsigned int reg_mask)
|
||||
|
||||
static void s68k_sync(void)
|
||||
{
|
||||
/* check SUB-CPU is still running */
|
||||
if (!s68k.stopped)
|
||||
{
|
||||
/* relative SUB-CPU cycle counter */
|
||||
unsigned int cycles = (m68k.cycles * SCYCLES_PER_LINE) / MCYCLES_PER_LINE;
|
||||
|
||||
/* sync SUB-CPU with MAIN-CPU (only if SUB-CPU execution frame is finished, to prevent recursive execution) */
|
||||
/* check SUB-CPU execution frame is finished (to prevent recursive execution) */
|
||||
if (!s68k.cycle_end)
|
||||
{
|
||||
/* relative SUB-CPU cycle counter */
|
||||
unsigned int cycles = (m68k.cycles * SCYCLES_PER_LINE) / MCYCLES_PER_LINE;
|
||||
|
||||
/* sync SUB-CPU with MAIN-CPU */
|
||||
s68k_run(cycles);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user