MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / InternalCpuExecute

Function InternalCpuExecute

source/CPU.cpp:608–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

606//===========================================================================
607
608static uint32_t InternalCpuExecute(const uint32_t uTotalCycles, const bool bVideoUpdate)
609{
610 if (g_nAppMode == MODE_RUNNING || g_nAppMode == MODE_BENCHMARK)
611 {
612 if (!GetIsMemCacheValid())
613 {
614 _ASSERT(memshadow[0]);
615 if (GetMainCpu() == CPU_6502)
616 return Cpu6502_altRW(uTotalCycles, bVideoUpdate); // Apple //e
617 else
618 return Cpu65C02_altRW(uTotalCycles, bVideoUpdate); // Enhanced Apple //e
619 }
620
621 if (GetMainCpu() == CPU_6502)
622 return Cpu6502(uTotalCycles, bVideoUpdate); // Apple ][, ][+, //e, Clones
623 else
624 return Cpu65C02(uTotalCycles, bVideoUpdate); // Enhanced Apple //e
625 }
626 else
627 {
628 _ASSERT(g_nAppMode == MODE_STEPPING || g_nAppMode == MODE_DEBUG);
629
630 if (!GetIsMemCacheValid())
631 {
632 _ASSERT(memshadow[0]);
633 if (GetMainCpu() == CPU_6502)
634 return Cpu6502_debug_altRW(uTotalCycles, bVideoUpdate); // Apple //e
635 else
636 return Cpu65C02_debug_altRW(uTotalCycles, bVideoUpdate); // Enhanced Apple //e
637 }
638
639 if (GetMainCpu() == CPU_6502)
640 return Cpu6502_debug(uTotalCycles, bVideoUpdate); // Apple ][, ][+, //e, Clones
641 else
642 return Cpu65C02_debug(uTotalCycles, bVideoUpdate); // Enhanced Apple //e
643 }
644}
645
646//
647// ----- ALL GLOBALLY ACCESSIBLE FUNCTIONS ARE BELOW THIS LINE -----

Callers 1

CpuExecuteFunction · 0.85

Calls 4

Cpu6502Function · 0.85
Cpu65C02Function · 0.85
GetIsMemCacheValidFunction · 0.70
GetMainCpuFunction · 0.70

Tested by

no test coverage detected