void directTransmit(u16 dstShortAddr, u8 * packet, u8 sfdPtrOffset)
{
  TxQueueType * headPkt;
  
  headPkt = &txDirectQ[txDirectQHead];
  if(headPkt->inUse) {
    printf("txDirectQ is full!  Dropping new TX packet.\r\n");
    return;
  }
  
  //Place new packet into the Q
  headPkt->sendNow=TRUE;
  headPkt->dstShortAddr=dstShortAddr;
  memcpy(headPkt->packet, packet, packet[0]+1);
  if(sfdPtrOffset > 0) {
    headPkt->sfdPtr=headPkt->packet+sfdPtrOffset;
  } else {
    headPkt->sfdPtr=NULL;
  }
  
  //Mark the new packet ready to be sent.
  headPkt->inUse=TRUE;
  
  //Make room for another packet in the Q.
  advanceHead();
}
Beispiel #2
0
void
Datasette::setHeadInCycles(uint64_t value)
{
    printf("Fast forwarding to cycle %lld (duration %lld)\n", value, durationInCycles);
    rewind();
    while (headInCycles <= value && head < size)
        advanceHead(true);
    printf("Head is %u (max %d)\n", head, size);
}
Beispiel #3
0
void
Datasette::_executeFalling()
{
    c64->cia1.triggerFallingEdgeOnFlagPin();
    
    // Schedule next pulse
    advanceHead();
    uint64_t length = pulseLength();
    nextRisingEdge = length / 2;
    nextFallingEdge = length;
}
Beispiel #4
0
void Multipath::newPoint(int32_t x, int32_t y, int32_t z) 
{
    //xprintf("newPoint(%d,%d,%d)", x, y, z);

    queue[head].loc.moveto(x,y,z);
    if (head == tail) {
        newPath = TRUE;
    }

    advanceHead();

    //if (needUpdate) nextSegment(Point(x,y,z));
}
Beispiel #5
0
void
Datasette::insertTape(TAPArchive *a)
{
    size = a->getSize();
    type = a->TAPversion();
    
    debug(2, "Inserting tape (size = %d, type = %d)...\n", size, type);
    
    // Copy data
    data = (uint8_t *)malloc(size);
    memcpy(data, a->getData(), size);

    // Determine tape length (by fast forwarding)
    rewind();
    while (head < size)
        advanceHead(true /* Don't send tape progress messages */);

    durationInCycles = headInCycles;
    rewind();
    
    c64->putMessage(MSG_VC1530_TAPE, 1);
}