void Datasette::ping() { debug(3, "Pinging Datasette...\n"); c64->putMessage(MSG_VC1530_TAPE, hasTape() ? 1 : 0); // c64->putMessage(MSG_VC1530_MOTOR, motor ? 1 : 0); // c64->putMessage(MSG_VC1530_PLAY, playKey ? 1 : 0); c64->putMessage(MSG_VC1530_PROGRESS, headInSeconds); }
void Datasette::pressPlay() { if (!hasTape()) return; debug("Datasette::pressPlay\n"); playKey = true; // Schedule first pulse uint64_t length = pulseLength(); nextRisingEdge = length / 2; nextFallingEdge = length; }
void Datasette::pressPlay() { if (!hasTape()) return; debug("Datasette::pressPlay\n"); // nextFallingEdge = 0.5 * PAL_CYCLES_PER_SECOND; /* kick off in 0.5 seconds */ // nextRisingEdge = -1; // Schedule first pulse uint64_t length = pulseLength(); nextRisingEdge = length / 2; nextFallingEdge = length; playKey = true; // c64->putMessage(MSG_VC1530_PLAY, true); }
void Datasette::ejectTape() { debug(2, "Ejecting tape\n"); if (!hasTape()) return; pressStop(); assert(data != NULL); free(data); data = NULL; size = 0; type = 0; durationInCycles = 0; head = -1; c64->putMessage(MSG_VC1530_TAPE, 0); }
void Datasette::_execute() { if (!hasTape() || !playKey || !motor) return; nextRisingEdge--; nextFallingEdge--; if (nextRisingEdge == 0) { _executeRising(); return; } if (nextFallingEdge == 0 && head < size) { _executeFalling(); return; } if (head >= size) { pressStop(); } }