Previous 15994 Revisions Next

r7210 Sunday 31st January, 2010 at 17:04:57 UTC by Phill Harvey-Smith
Fixes in wd17xx to allow the Dragon Alpha to boot.
[src/mess/drivers]coco.c
[src/mess/includes]coco.h
[src/mess/machine]coco.c wd17xx.c wd17xx.h

src/mess/includes/coco.h
r7209r7210
9090MACHINE_START( dragon64 );
9191MACHINE_START( tanodr64 );
9292MACHINE_START( dgnalpha );
93MACHINE_RESET( dgnalpha );
9394MACHINE_START( coco );
9495MACHINE_START( coco2 );
9596MACHINE_START( coco3 );
src/mess/machine/coco.c
r7209r7210
17471747      {
17481748         if (pia6821_get_output_ca2_z(cstate->pia_2))
17491749            cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
1750      }
1750        }
17511751   }
17521752   else
1753   {
17541753      cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
1755   }
17561754}
17571755
17581756/* The DRQ line goes through pia2 cb1, in exactly the same way as DRQ from DragonDos does */
r7209r7210
18051803         wd17xx_track_w(fdc, 0, data);
18061804         break;
18071805      case 3:
1808         wd17xx_command_w(fdc, 0, data);
1806            wd17xx_command_w(fdc, 0, data);
18091807
18101808         /* disk head is encoded in the command byte */
18111809         wd17xx_set_side(fdc,(data & 0x02) ? 1 : 0);
r7209r7210
28952893   init.printer_out_      = printer_out_dragon;
28962894
28972895   generic_coco12_dragon_init(machine, &init);
2896}
28982897
2899   /* dgnalpha_just_reset, is here to flag that we should ignore the first irq generated */
2898MACHINE_RESET( dgnalpha )
2899{
2900   running_device *fdc = devtag_get_device(machine, "wd2797");
2901   wd17xx_set_complete_command_delay(fdc,20);
2902 
2903    /* dgnalpha_just_reset, is here to flag that we should ignore the first irq generated */
29002904   /* by the WD2797, it is reset to 0 after the first inurrupt */
29012905   dgnalpha_just_reset=1;
29022906}
src/mess/machine/wd17xx.c
r7209r7210
108108    - Modified what status flags are returned after a Forced Interrupt,
109109      to allow Microbee to boot CP/M.
110110
111    2010-Jan-31 Phill Harvey-Smith
112    - The above bugfixes for the Kaypro/Osborne1 have borked the booting on the Dragon
113      Alpha. The Alpha it seems needs a delay of ay least 17us or the NMI generated by
114      INTRQ happens too early and doen't break out of the read/write bytes loops.
115     
116      I have made the delay settable by calling wd17xx_set_complete_command_delay, and
117      let it default to 12us, as required above, so that the Dragon Alpha works again.
118      This hopefully should not break the other machines.
119     
120      This should probably be considdered a minor hack but it does seem to work !
121
111122    TODO:
112123        - Multiple record write
113124        - What happens if a track is read that doesn't have any id's on it?
r7209r7210
325336
326337   /* pause time when writing/reading sector */
327338   int pause_time;
339   
340    /* complete command delay */
341    int complete_command_delay;
328342
329343   /* Pointer to interface */
330344   const wd17xx_interface *intf;
r7209r7210
912926   usecs *= delay;
913927#endif
914928
915   usecs = 12;
929   //usecs = 12;
930    usecs   = w->complete_command_delay;
916931
917932   /* set new timer */
918933   timer_adjust_oneshot(w->timer_cmd, ATTOTIME_IN_USEC(usecs), 0);
r7209r7210
11561171   w->pause_time = usec;
11571172}
11581173
1174void wd17xx_set_complete_command_delay(running_device *device, int usec)
1175{
1176   wd1770_state *w = get_safe_token(device);
1177    w->complete_command_delay=usec;
1178}
11591179
1180
11601181/***************************************************************************
11611182    DEVICE HANDLERS
11621183***************************************************************************/
r7209r7210
18071828   w->status = STA_1_TRACK0;
18081829   w->density = DEN_MFM_LO;
18091830   w->pause_time = 40;
1831    w->complete_command_delay = 12;
18101832
18111833   /* allocate timers */
18121834   w->timer_cmd = timer_alloc(device->machine, wd17xx_command_callback, (void *)device);
src/mess/machine/wd17xx.h
r7209r7210
7373void wd17xx_set_side(running_device *device, UINT8);      /* set side wd179x is accessing */
7474void wd17xx_set_density(running_device *device, DENSITY);   /* set density */
7575
76void wd17xx_set_pause_time(running_device *device, int usec); /* default is 40 usec if not set */
76void wd17xx_set_pause_time(running_device *device, int usec);       /* default is 40 usec if not set */
77void wd17xx_set_complete_command_delay(running_device *device, int usec);   /* default is 12 usec if not set */
7778
7879READ8_DEVICE_HANDLER( wd17xx_status_r );
7980READ8_DEVICE_HANDLER( wd17xx_track_r );
src/mess/drivers/coco.c
r7209r7210
270270   AM_RANGE(0xff00, 0xff03) AM_DEVREADWRITE("pia_0", pia6821_r, pia6821_w)
271271   AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE("acia", acia_6551_r, acia_6551_w)
272272   AM_RANGE(0xff20, 0xff23) AM_DEVREADWRITE("pia_1", pia6821_r, coco_pia_1_w)
273   AM_RANGE(0xff24, 0xff27) AM_DEVREADWRITE("pia_2", pia6821_r, pia6821_w)    /* Third PIA on Dragon Alpha */
273   AM_RANGE(0xff24, 0xff27) AM_DEVREADWRITE("pia_2", pia6821_r, pia6821_w)        /* Third PIA on Dragon Alpha */
274274   AM_RANGE(0Xff28, 0xff2b) AM_READWRITE(dgnalpha_modem_r, dgnalpha_modem_w)      /* Modem, dummy to stop eror log ! */
275   AM_RANGE(0xff2c, 0xff2f) AM_READWRITE(dgnalpha_wd2797_r, dgnalpha_wd2797_w)            /* Alpha onboard disk interface */
275   AM_RANGE(0xff2c, 0xff2f) AM_READWRITE(dgnalpha_wd2797_r, dgnalpha_wd2797_w)   /* Alpha onboard disk interface */
276276   AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE("coco_cartslot", coco_cartridge_r, coco_cartridge_w)
277277   AM_RANGE(0xff90, 0xffbf) AM_NOP
278278   AM_RANGE(0xffc0, 0xffdf) AM_DEVWRITE("sam", sam6883_w)
r7209r7210
928928
929929   MDRV_MACHINE_START( dgnalpha )
930930   MDRV_DRIVER_DATA( coco_state )
931    MDRV_MACHINE_RESET( dgnalpha )
931932
932933   /* video hardware */
933934   MDRV_SCREEN_ADD("screen", RASTER)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team