Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed Jan 23, 2024
1 parent 3e8fcc6 commit bfcf746
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 46 deletions.
47 changes: 4 additions & 43 deletions Emulator/Components/C64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ void
C64::executeOneLine()
{
isize lastCycle = vic.getCyclesPerLine();

while (1) {

Cycle cycle = ++cpu.clock;
Expand Down Expand Up @@ -1432,48 +1432,9 @@ C64::executeOneLine()
void
C64::executeOneCycle()
{
_executeOneCycle(vic.getCyclesPerLine());
}

void
C64::_executeOneCycle(isize lastCycle)
{
Cycle cycle = ++cpu.clock;

// <---------- o2 low phase ----------->|<- o2 high phase ->|
// | |
// ,-- C64 ------------------------------|-------------------|--,
// | ,-----, ,-----, ,-----, | ,-----, | |
// | | | | | | | | | | | |
// '-->| VIC | --> | CIA | --> | CIA | --|--> | CPU | -------|--'
// | | | 1 | | 2 | | | | |
// '-----' '-----' '-----' | '-----' |
// ,---------, |
// | IEC bus | |
// '---------' |
// | ,--------, |
// | | | |
// ,-- Drive ----------------------------|--> | VC1541 | ----|--,
// | | | | | |
// | | '--------' | |
// '-------------------------------------|-------------------|--'

// First clock phase (o2 low)
(vic.*vic.vicfunc[rasterCycle])();
if (cycle >= cia1.wakeUpCycle) cia1.executeOneCycle();
if (cycle >= cia2.wakeUpCycle) cia2.executeOneCycle();
if (iec.isDirtyC64Side) iec.updateIecLinesC64Side();

// Process pending events
if (nextTrigger <= cycle) processEvents(cycle);

// Second clock phase (o2 high)
cpu.execute<MOS_6510>();
if (drive8.needsEmulation) drive8.execute(durationOfOneCycle);
if (drive9.needsEmulation) drive9.execute(durationOfOneCycle);

// rasterCycle++;
if (rasterCycle++ == lastCycle) endScanline();
setFlag(RL::STOP);
executeOneLine();
clearFlag(RL::STOP);
}

void
Expand Down
3 changes: 0 additions & 3 deletions Emulator/Components/C64.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,6 @@ class C64 : public Thread {
// Executes a single clock cycle
void executeOneCycle();

// DEPRECATED
void _executeOneCycle(isize lastCycle);

/* Finishes the current instruction. This function is called when the
* emulator threads terminates in order to reach a clean state. It emulates
* the CPU until the next fetch cycle is reached.
Expand Down

0 comments on commit bfcf746

Please sign in to comment.