Previous 15994 Revisions Next

r2504 Tuesday 29th April, 2008 at 17:18:30 UTC by Wilbert Pol
[IBMPCJR] Enabled diskette drive.
[src/mess/machine]pc.c pc_fdc.c

src/mess/machine/pc_fdc.c
r2503r2504
4545   /* stored int state */
4646   int int_state;
4747
48   /* PCJR watchdog timer */
49   emu_timer   *watchdog;
50
4851   struct pc_fdc_interface fdc_interface;
4952};
5053
5154static struct pc_fdc *fdc;
5255
56/* Prototypes */
57
58static TIMER_CALLBACK( watchdog_timeout );
5359static void pc_fdc_hw_interrupt(int state);
5460static void pc_fdc_hw_dma_drq(int,int);
5561static const device_config *pc_fdc_get_image(int floppy_index);
r2503r2504
94100   /* setup nec765 interface */
95101   nec765_init(&pc_fdc_nec765_interface, iface->nec765_type, iface->nec765_rdy_pin);
96102
103   fdc->watchdog = timer_alloc( watchdog_timeout, NULL );
104
97105   pc_fdc_reset();
98106
99107   for (i = 0; i < device_count(Machine, IO_FLOPPY); i++)
r2503r2504
319327    | | | | | `------- Reserved
320328    | | | | `--------- Reserved
321329    | | | `----------- Reserved
322    | | `------------- Watchdog Timer Enable ( 0 = watchdog enabled, 1 = watchdog disabled )
330    | | `------------- Watchdog Timer Enable ( 0 = watchdog disabled, 1 = watchdog enabled )
323331    | `--------------- Watchdog Timer Trigger ( on a 1->0 transition to strobe the trigger )
324332    `----------------- FDC Reset ( 0 = hold reset, 1 = release reset )
325333 */
326334
335static TIMER_CALLBACK( watchdog_timeout )
336{
337   /* Trigger a watchdog timeout signal */
338   if ( fdc->fdc_interface.pc_fdc_interrupt )
339   {
340      fdc->fdc_interface.pc_fdc_interrupt( 1 );
341      fdc->fdc_interface.pc_fdc_interrupt( 0 );
342   }
343}
344
327345static void pcjr_fdc_dor_w(running_machine *machine, UINT8 data)
328346{
329347   int floppy_count;
r2503r2504
340358         floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1, 0);
341359   }
342360
361   /* Is the watchdog timer disabled */
362   if ( ! ( data & 0x20 ) )
363   {
364      timer_adjust_oneshot( fdc->watchdog, attotime_never, 0 );
365   } else {
366      /* Check for 1->0 watchdog trigger */
367      if ( ( fdc->digital_output_register & 0x40 ) && ! ( data & 0x40 ) )
368      {
369         /* Start watchdog timer here */
370         timer_adjust_oneshot( fdc->watchdog, ATTOTIME_IN_SEC(3), 0 );
371      }
372   }
373
343374   /* reset? */
344375   if ( ! (data & 0x80) )
345376   {
src/mess/machine/pc.c
r2503r2504
438438
439439static TIMER_CALLBACK( pcjr_keyb_signal_callback )
440440{
441      pcjr_keyb.raw_keyb_data = pcjr_keyb.raw_keyb_data >> 1;
442      pcjr_keyb.signal_count--;
441   pcjr_keyb.raw_keyb_data = pcjr_keyb.raw_keyb_data >> 1;
442   pcjr_keyb.signal_count--;
443443
444      if ( pcjr_keyb.signal_count <= 0 )
445      {
446         timer_adjust_periodic( pcjr_keyb.keyb_signal_timer, attotime_never, 0, attotime_never );
447         pcjr_keyb.transferring = 0;
448      }
444   if ( pcjr_keyb.signal_count <= 0 )
445   {
446      timer_adjust_periodic( pcjr_keyb.keyb_signal_timer, attotime_never, 0, attotime_never );
447      pcjr_keyb.transferring = 0;
448   }
449449}
450450
451451
r2503r2504
691691   int data=0xff;
692692
693693   data&=~0x80;
694   data &= ~0x04;      /* floppy drive installed */
694695   data = ( data & ~0x01 ) | ( pcjr_keyb.latch ? 0x01: 0x00 );
695696   if ( ! ( pc_ppi.portb & 0x08 ) )
696697   {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team