Exemple #1
0
upd_fdc *
upd_fdc_alloc_fdc( upd_type_t type, upd_clock_t clock )
{
  int i;
  
  upd_fdc *f = libspectrum_new( upd_fdc, 1 );

  f->type = type != UPD765B ? UPD765A : UPD765B;
  f->clock = clock != UPD_CLOCK_4MHZ ? UPD_CLOCK_8MHZ : UPD_CLOCK_4MHZ;
  for( i = 0; i < 4; i++ )
    f->drive[i] = NULL;
  f->current_drive = NULL;
  f->speedlock = 0;
  upd_fdc_master_reset( f );
  return f;
}
Exemple #2
0
upd_fdc *
upd_fdc_alloc_fdc( upd_type_t type, upd_clock_t clock )
{
  int i;
  
  upd_fdc *f = malloc( sizeof( *f ) );
  if( !f ) return NULL;

  f->type = type != UPD765B ? UPD765A : UPD765B;
  f->clock = clock != UPD_CLOCK_4MHZ ? UPD_CLOCK_8MHZ : UPD_CLOCK_4MHZ;
  for( i = 0; i < 4; i++ )
    f->drive[i] = NULL;
  f->current_drive = NULL;
  f->speedlock = 0;
  upd_fdc_master_reset( f );
  return f;
}