Пример #1
0
/* DolphinDOS parallel byte transfer - A866 */
uint8_t dolphin_putc(uint8_t data, uint8_t with_eoi) {
  set_clock(1);

  /* wait until DATA is high */
  while (!IEC_DATA)   // A870
    if (iec_check_atn())
      return -1;

  if (with_eoi) {
    /* signal EOI by waiting for a pulse on DATA */
    while (IEC_DATA)  // A87C
      if (iec_check_atn())
        return -1;

    while (!IEC_DATA) // A883
      if (iec_check_atn())
        return -1;
  }

  /* send byte - A88A */
  parallel_write(data);
  parallel_send_handshake();
  set_clock(0);

  /* wait until DATA is low */
  while (IEC_DATA)    // A89A
    if (iec_check_atn())
      return -1;

  return 0;
}
void f77_parallel_write(char *filename, int *fnamelen, long *size,
			 long long *offset, void *buffer) {
#elif defined ADD2US
void f77_parallel_write__(char *filename, int *fnamelen, long *size,
			 long long *offset, void *buffer) {
#else
void f77_parallel_write_(char *filename, int *fnamelen, long *size,
			 long long *offset, void *buffer) {
#endif

  int stat;
  filename[*fnamelen]='\0';
  stat = parallel_write(filename,*size,*offset,buffer);
  if (stat !=0) fprintf(stderr,"Failure to write with parallel_read\n");
}
Пример #3
0
/* send a byte with hardware handshaking */
static void dolphin_write_hs(uint8_t value) {
  parallel_write(value);
  parallel_clear_rxflag();
  parallel_send_handshake();
  while (!parallel_rxflag) ;
}