Previous 15994 Revisions Next

r12870 Friday 16th September, 2011 at 18:01:49 UTC by Olivier Galibert
wd1772: Fix livelock when there no floppy in the reader [O. Galibert]
[src/mess/machine]wd1772.c

src/mess/machine/wd1772.c
r12869r12870
369369void wd1772_t::do_generic()
370370{
371371   switch(sub_state) {
372   case IDLE:
373   case SCAN_ID:
374   case SECTOR_READ:
375      break;
376
372377   case SEEK_WAIT_STEP_TIME:
373378      sub_state = SEEK_WAIT_STEP_TIME_DONE;
374379      break;
r12869r12870
697702   if(cur_live.state == IDLE || cur_live.next_state != -1)
698703      return;
699704
700   if(limit == attotime::never)
705   if(limit == attotime::never) {
701706      limit = floppy->time_next_index();
707      if(limit == attotime::never) {
708         // Happens when there's no disk, hence no index pulse
709         // Force a sync from time to time in that case, so that
710         // the main cpu timeout isn't too painful.  Avoid looping
711         // into infinity looking for data too.
702712
713         limit = machine().time() + attotime::from_msec(1);
714         t_gen->adjust(attotime::from_msec(1));
715      }
716   }         
717   
703718   //   fprintf(stderr, "%s: live_run(%s)\n", ttsn().cstr(), tts(limit).cstr());
704719
705720   for(;;) {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team