Previous 15994 Revisions Next

r5056 Sunday 21st June, 2009 at 00:33:56 UTC by Robbbert
[Z80ONE and WD17XX] Fixed timing issue.
[src/mess/drivers]z80ne.c
[src/mess/includes]z80ne.h
[src/mess/machine]wd17xx.c z80ne.c

src/mess/includes/z80ne.h
r5055r5056
5656MACHINE_START(z80netb);
5757MACHINE_START(z80netf);
5858
59extern const wd17xx_interface z80ne_wd17xx_interface;
6059DEVICE_IMAGE_LOAD( z80ne_floppy );
6160
6261INPUT_CHANGED(z80ne_reset);
src/mess/machine/wd17xx.c
r5055r5056
4242        - Added simulation of head loaded feedback from drive
4343        - Bugfix: busy flag was cleared too early
4444
45    2009-June-21 Robbbert:
46   - The Bugfix above, while valid, caused the Osborne1 to fail. This
47     is because the delay must not exceed 14usec (found by extensive testing).
48   - The minimum delay is 1usec, need by z80netf while formatting a disk.
49   - http://www.bannister.org/forums/ubbthreads.php?ubb=showflat&Number=50889#Post50889
50     explains the problems, testing done, and the test procedure for the z80netf.
51   - Thus, the delay is set to 10usec, and all the disks I have (not many)
52     seem to work.
53   - Note to anyone who wants to change something: Make sure that the
54     Osborne1 boots up! It is extremely sensitive to timing!
55   - For testing only: The osborne1 rom can be patched to make it much
56     more stable, by changing the byte at 0x0da7 from 0x28 to 0x18.
57
4558    TODO:
4659        - Multiple record write
4760        - What happens if a track is read that doesn't have any id's on it?
r5055r5056
859872
860873   w->hld_count = 2;
861874
875#if 0
862876   /* clear busy bit */
863877   /* RL - removed, busy bit must be on until wd17xx_misc_timer_callback() is fired */
864   /* Robbbert - put back in, it broke too many systems */
878   /* Robbbert - adjusted delay value (see notes above) to fix the osborne1 */
865879   w->status &= ~STA_2_BUSY;
866880
867881   usecs = floppy_drive_get_datarate_in_us(w->density);
868882   usecs *= delay;
883#endif
869884
885   usecs = 10;
886
870887   /* set new timer */
871888   timer_adjust_oneshot(w->timer, ATTOTIME_IN_USEC(usecs), MISCCALLBACK_COMMAND);
872889}
src/mess/machine/z80ne.c
r5055r5056
741741 *  1    1     0       x
742742 *
743743 */
744static WD17XX_CALLBACK( z80ne_fdc_callback )
745{
746   switch (state)
747   {
748      case WD17XX_IRQ_CLR:
749         wd17xx_state.intrq = FALSE;
750         break;
751      case WD17XX_IRQ_SET:
752         wd17xx_state.intrq = TRUE;
753         output_set_value("drv0", 0);
754         output_set_value("drv1", 0);
755         break;
756      case WD17XX_DRQ_CLR:
757         wd17xx_state.drq = FALSE;
758         break;
759      case WD17XX_DRQ_SET:
760         wd17xx_state.drq = TRUE;
761         break;
762   }
763}
764744
765const wd17xx_interface z80ne_wd17xx_interface = { z80ne_fdc_callback, NULL };
766
767745WRITE8_DEVICE_HANDLER(lx390_motor_w)
768746{
769747   /* Selection of drive and parameters
r5055r5056
848826      LOG(("lx390_fdc_r, WD17xx sector: %02x\n", d));
849827      break;
850828   case 3:
851      if(!wd17xx_state.drq && !wd17xx_state.intrq)
852      {
853         d = wd17xx_data_r(device, 0);
854         LOG(("lx390_fdc_r, WD17xx data3, ready:  %02x\n", d));
855      }
856      else
857      {
858         d = 0xff;
859         LOG(("lx390_fdc_r, WD17xx data3,  busy: intrq %01x drq %01x \n", wd17xx_state.intrq, wd17xx_state.drq));
860      }
829      d = wd17xx_data_r(device, 0);
830      LOG(("lx390_fdc_r, WD17xx data3:  %02x\n", d));
861831      break;
862832   case 6:
863833      d = 0xff;
r5055r5056
897867      wd17xx_sector_w(device, offset, d);
898868      break;
899869   case 3:
900      if(!wd17xx_state.drq && !wd17xx_state.intrq)
901      {
902         LOG(("lx390_fdc_w, WD17xx data3, ready:   %02x\n", d));
903         wd17xx_data_w(device, 0, d);
904      }
905      else
906      {
907         LOG(("lx390_fdc_w, WD17xx data3,  busy:   %02x\n", d));
908      }
870      wd17xx_data_w(device, 0, d);
871      LOG(("lx390_fdc_w, WD17xx data3:   %02x\n", d));
909872      break;
910873   case 6:
911874      LOG(("lx390_fdc_w, motor_w:   %02x\n", d));
src/mess/drivers/z80ne.c
r5055r5056
510510   MDRV_SCREEN_SIZE(320, 25+192+26)
511511   MDRV_SCREEN_VISIBLE_AREA(0, 319, 1, 239)
512512
513   MDRV_WD1771_ADD("wd1771", z80ne_wd17xx_interface)
513   MDRV_WD1771_ADD("wd1771", default_wd17xx_interface)
514514
515515   MDRV_DEFAULT_LAYOUT(layout_z80netf)
516516MACHINE_DRIVER_END

Previous 15994 Revisions Next


© 1998-2018 The MESS Team