Skip to content

Commit

Permalink
Work on REU
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed Sep 5, 2024
1 parent 81af67c commit 29faf04
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion Emulator/Components/C64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,9 @@ alwaysinline void C64::executeCycle()
cpu.execute<MOS_6510>();
if constexpr (enable8) { if (drive8.needsEmulation) drive8.execute(durationOfOneCycle); }
if constexpr (enable9) { if (drive9.needsEmulation) drive9.execute(durationOfOneCycle); }

// Experimental (REU)
if (isDue<SLOT_EXP>(cycle)) { expansionport.processEvent(eventid[SLOT_EXP]); }
}

template <bool enable8, bool enable9> void
Expand Down Expand Up @@ -1145,7 +1148,7 @@ C64::processEvents(Cycle cycle)
// Check tertiary slots
//
if (isDue<SLOT_EXP>(cycle)) {
expansionport.processEvent(eventid[SLOT_EXP]);
// expansionport.processEvent(eventid[SLOT_EXP]);
}
if (isDue<SLOT_TXD>(cycle)) {
userPort.rs232.processTxdEvent();
Expand Down
12 changes: 8 additions & 4 deletions Emulator/Media/Cartridges/CustomCartridges/Reu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Reu::_didReset(bool hard)
cr = 0x10;

// Initialize the length register
tlengthLatched = 0xFFFF;
tlength = tlengthLatched = 0xFFFF;

// Experimental
bus = 0x00; // 0xFF;
Expand Down Expand Up @@ -421,6 +421,9 @@ Reu::prepareDma()

// Schedule the first event
c64.scheduleRel<SLOT_EXP>(1, EXP_REU_PREPARE);

// Freeze the CPU
cpu.pullDownRdyLine(INTSRC_EXP);
}

bool
Expand Down Expand Up @@ -518,8 +521,9 @@ Reu::processEvent(EventID id)

cpu.pullDownRdyLine(INTSRC_EXP);

c64.scheduleRel<SLOT_EXP>(1, EXP_REU_PREPARE2);
return;
id = EXP_REU_PREPARE2;
// c64.scheduleRel<SLOT_EXP>(1, EXP_REU_PREPARE2);
// return;
}

if (id == EXP_REU_PREPARE2) {
Expand All @@ -537,7 +541,7 @@ Reu::processEvent(EventID id)
}

// Only proceed if the bus is available
if (vic.baLine.delayed()) {
if (vic.baLine.readWithDelay(1)) {

c64.scheduleRel<SLOT_EXP>(1, id);
return;
Expand Down
2 changes: 1 addition & 1 deletion Emulator/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ debugflag USR_DEBUG = 0;

// Other components
debugflag REC_DEBUG = 0;
debugflag REU_DEBUG = 1;
debugflag REU_DEBUG = 0;
debugflag SCK_DEBUG = 0;
debugflag SRV_DEBUG = 0;

Expand Down

0 comments on commit 29faf04

Please sign in to comment.