Example #1
0
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);
}
Example #2
0
void
Datasette::pressPlay()
{
    if (!hasTape())
        return;
    
    debug("Datasette::pressPlay\n");
    playKey = true;

    // Schedule first pulse
    uint64_t length = pulseLength();
    nextRisingEdge = length / 2;
    nextFallingEdge = length;
}
Example #3
0
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);
}
Example #4
0
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);
}
Example #5
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();
    }
}