Previous 15994 Revisions Next

r11833 Sunday 5th June, 2011 at 20:22:03 UTC by Curt Coder
[SUPER6] Fixed terminal input and interrupts. (nw)
[src/mess/drivers]super6.c
[src/mess/includes]super6.h

src/mess/includes/super6.h
r11832r11833
6767   DECLARE_WRITE8_MEMBER( bank1_w );
6868   DECLARE_WRITE8_MEMBER( baud_w );
6969   DECLARE_WRITE_LINE_MEMBER( fr_w );
70   DECLARE_WRITE_LINE_MEMBER( intrq_w );
71   DECLARE_WRITE_LINE_MEMBER( drq_w );
7072   
7173   void bankswitch();
7274   
r11832r11833
7476   UINT8 m_s100;
7577   UINT8 m_bank0;
7678   UINT8 m_bank1;
77
78   // floppy state
79   UINT8 m_fdc_data;
8079};
8180
8281#endif
src/mess/drivers/super6.c
r11832r11833
1010   
1111   TODO:
1212   
13   - floppy (cannot be implemented currently since this is another case of halting the cpu mid-instruction)
1314   - interrupts
14   - terminal input
15   - floppy cold boot error
1615   - DMA
1716   - peripheral interfaces
1817   
r11832r11833
183182
184183READ8_MEMBER( super6_state::fdc_r )
185184{
186   return m_fdc_data;
185   /*
186     
187      bit      description
188     
189      0     
190      1     
191      2     
192      3     
193      4     
194      5     
195      6     
196      7      FDC INTRQ
197
198   */
199   
200   // TODO reading this port should halt the CPU until an INTRQ or DRQ from the FDC
201
202   return !wd17xx_intrq_r(m_fdc) << 7;
187203}
188204
189205
r11832r11833
208224
209225   */
210226
211   m_fdc_data = data;
212
213227   // disk drive select
214228   wd17xx_set_drive(m_fdc, data & 0x03);
215229   floppy_mon_w(m_floppy0, 0);
r11832r11833
335349//  Z80CTC_INTERFACE( ctc_intf )
336350//-------------------------------------------------
337351
352static TIMER_DEVICE_CALLBACK( ctc_tick )
353{
354   super6_state *state = timer.machine().driver_data<super6_state>();
355
356   z80ctc_trg0_w(state->m_ctc, 1);
357   z80ctc_trg0_w(state->m_ctc, 0);
358}
359
338360static Z80CTC_INTERFACE( ctc_intf )
339361{
340362   0,
r11832r11833
381403static Z80DMA_INTERFACE( dma_intf )
382404{
383405   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_HALT),
384   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),
406   DEVCB_DEVICE_LINE(Z80CTC_TAG, z80ctc_trg2_w),
385407   DEVCB_NULL,
386408   DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_read_byte),
387409   DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_write_byte),
r11832r11833
414436{
415437   z80dart_rxca_w(m_dart, state);
416438   z80dart_txca_w(m_dart, state);
439   
440   z80ctc_trg1_w(m_ctc, state);
417441}
418442
419443static COM8116_INTERFACE( brg_intf )
r11832r11833
447471//  wd17xx_interface fdc_intf
448472//-------------------------------------------------
449473
474WRITE_LINE_MEMBER( super6_state::intrq_w )
475{
476   // TODO allow CPU to continue reading port 14
477
478   z80ctc_trg3_w(m_ctc, !state);
479}
480
481WRITE_LINE_MEMBER( super6_state::drq_w )
482{
483   // TODO allow CPU to continue reading port 14
484   
485   m_dma->rdy_w(state);
486}
487
450488static const wd17xx_interface fdc_intf =
451489{
452490   DEVCB_NULL,
453   DEVCB_NULL,
454   DEVCB_DEVICE_LINE_MEMBER(Z80DMA_TAG, z80dma_device, rdy_w),
491   DEVCB_DRIVER_LINE_MEMBER(super6_state, intrq_w),
492   DEVCB_DRIVER_LINE_MEMBER(super6_state, drq_w),
455493   { FLOPPY_0, FLOPPY_1, NULL, NULL }
456494};
457495
458496
459497//-------------------------------------------------
460//  Z80PIO_INTERFACE( pio_intf )
498//  z80_daisy_config super6_daisy_chain
461499//-------------------------------------------------
462500
463501static const z80_daisy_config super6_daisy_chain[] =
464502{
503   { Z80CTC_TAG },
504   { Z80DART_TAG },
505   { Z80PIO_TAG },
465506   { NULL }
466507};
467508
r11832r11833
470511//  GENERIC_TERMINAL_INTERFACE( terminal_intf )
471512//-------------------------------------------------
472513
514static WRITE8_DEVICE_HANDLER( dummy_w )
515{
516   // handled in Z80DART_INTERFACE
517}
518
473519static GENERIC_TERMINAL_INTERFACE( terminal_intf )
474520{
475   DEVCB_NULL
521   DEVCB_HANDLER(dummy_w)
476522};
477523
478524
r11832r11833
487533
488534void super6_state::machine_start()
489535{
536   // state saving
537   save_item(NAME(m_s100));
538   save_item(NAME(m_bank0));
539   save_item(NAME(m_bank1));
490540}
491541
492542
r11832r11833
523573   
524574   // devices
525575   MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_24MHz/4, ctc_intf)
576   MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_24MHz/16))
526577   MCFG_Z80DART_ADD(Z80DART_TAG, XTAL_24MHz/4, dart_intf)
527578   MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_24MHz/6, dma_intf)
528579   MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_24MHz/4, pio_intf)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team