Example #1
0
static unsigned short int
check_card (void)
{
  unsigned short int id;

  eep_reset ();
  id = ttt_get_id ();
  if (id != 0xb0d0)
    {
      fprintf (stderr, "ERROR: PCE-PRO flash card (programmer) not detected (ID: 0x%02hx)\n", id);
      return 0;
    }
  else
    return id;
}
Example #2
0
unsigned short int
check_card (void)
{
  unsigned short int id;

  eep_reset ();
  id = ttt_get_id ();
  if ((id != 0xb0d0) && (id != 0x8916) && (id != 0x8917)) // Sharp 32M, Intel 64J3
    {
      fprintf (stderr, "ERROR: MD-PRO flash card (programmer) not detected (ID: 0x%02hx)\n", id);
      return 0;
    }
  else
    return id;
}
Example #3
0
int
smsgg_write_rom (const char *filename, unsigned int parport)
{
  FILE *file;
  unsigned char buffer[0x4000];
  int size, address = 0, bytesread, bytessend = 0;
  time_t starttime;
  void (*write_block) (int *, unsigned char *) = write_rom_by_page; // write_rom_by_byte
  (void) write_rom_by_byte;

  if ((file = fopen (filename, "rb")) == NULL)
    {
      fprintf (stderr, ucon64_msg[OPEN_READ_ERROR], filename);
      exit (1);
    }
  ttt_init_io (parport);

  size = fsizeof (filename);
  printf ("Send: %d Bytes (%.4f Mb)\n\n", size, (float) size / MBIT);

  eep_reset ();
  if (ttt_get_id () != 0xb0d0)
    {
      fputs ("ERROR: SMS-PRO/GG-PRO flash card (programmer) not detected\n", stderr);
      fclose (file);
      ttt_deinit_io ();
      exit (1);
    }

  starttime = time (NULL);
  eep_reset ();
  while ((bytesread = fread (buffer, 1, 0x4000, file)))
    {
      if ((address & 0xffff) == 0)
        ttt_erase_block (address);
      write_block (&address, buffer);
      bytessend += bytesread;
      ucon64_gauge (starttime, bytessend, size);
    }

  fclose (file);
  ttt_deinit_io ();

  return 0;
}