Previous 15994 Revisions Next

r10347 Wednesday 9th February, 2011 at 10:49:12 UTC by Curt Coder
[ABC80X] Fixed "dynamic_cast<_Dest>(src) == src" assert.
[src/mess/drivers]abc80x.c
[src/mess/includes]abc80x.h
[src/mess/video]abc802.c abc806.c

src/mess/video/abc802.c
r10346r10347
190190   }
191191
192192   // signal _DEW to DART
193   z80dart_rib_w(m_dart, !state);
193   m_dart->ri_w(1, !state);
194194}
195195
196196
src/mess/video/abc806.c
r10346r10347
392392      if (m_d_vsync != vsync)
393393      {
394394         // signal _DEW to DART
395         z80dart_rib_w(m_dart, !vsync);
395         m_dart->ri_w(1, !vsync);
396396      }
397397
398398      m_d_vsync = vsync;
src/mess/includes/abc80x.h
r10346r10347
6868
6969   required_device<cpu_device> m_maincpu;
7070   required_device<device_t> m_ctc;
71   required_device<device_t> m_dart;
71   required_device<z80dart_device> m_dart;
7272   required_device<device_t> m_sio;
7373   required_device<device_t> m_discrete;
7474   required_device<device_t> m_ram;
r10346r10347
112112   // serial state
113113   int m_sio_rxcb;
114114   int m_sio_txcb;
115   int keylatch;
116115};
117116
118117class abc800m_state : public abc800_state
r10346r10347
164163
165164   required_device<cpu_device> m_maincpu;
166165   required_device<device_t> m_ctc;
167   required_device<device_t> m_dart;
166   required_device<z80dart_device> m_dart;
168167   required_device<device_t> m_sio;
169168   required_device<device_t> m_crtc;
170169   optional_device<device_t> abc77;
r10346r10347
197196
198197   // sound state
199198   int m_pling;            // pling
199
200   // fake keyboard state
201   int m_keylatch;
200202};
201203
202204
r10346r10347
219221
220222   required_device<cpu_device> m_maincpu;
221223   required_device<device_t> m_ctc;
222   required_device<device_t> m_dart;
224   required_device<z80dart_device> m_dart;
223225   required_device<device_t> m_sio;
224226   required_device<device_t> m_crtc;
225227   required_device<device_t> m_rtc;
r10346r10347
278280   UINT32 m_vsync_shift;      // vertical sync shift register
279281   int m_vsync;            // vertical sync
280282   int m_d_vsync;            // delayed vertical sync
283
284   // fake keyboard state
285   int m_keylatch;
281286};
282287
283288
src/mess/drivers/abc80x.c
r10346r10347
381381   { 0x5f, 0x09, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00 }
382382};
383383
384static void scan_keyboard(running_machine *machine)
384static void scan_keyboard(running_machine *machine, z80dart_device *dart, int *keylatch)
385385{
386   abc800_state *state = machine->driver_data<abc800_state>();
387386   UINT8 keycode = 0;
388387   UINT8 data;
389388   int table = 0, row, col;
r10346r10347
419418
420419   if (keycode)
421420   {
422      if (keycode != state->keylatch)
421      if (keycode != *keylatch)
423422      {
424         z80dart_device *m_dart = machine->device<z80dart_device>(Z80DART_TAG);
423         dart->dcd_w(1, 0);
424         dart->receive_data(1, keycode);
425425
426         z80dart_dcdb_w(m_dart, 0);
427         m_dart->receive_data(1, keycode);
428
429         state->keylatch = keycode;
426         *keylatch = keycode;
430427      }
431428   }
432429   else
433430   {
434      if (state->keylatch)
431      if (*keylatch)
435432      {
436         z80dart_device *m_dart = machine->device<z80dart_device>(Z80DART_TAG);
433         dart->dcd_w(1, 1);
434         dart->receive_data(1, 0);
437435
438         z80dart_dcdb_w(m_dart, 1);
439         m_dart->receive_data(1, 0);
440
441         state->keylatch = 0;
436         *keylatch = 0;
442437      }
443438   }
444439}
445440
446static TIMER_DEVICE_CALLBACK( keyboard_tick )
441
442static TIMER_DEVICE_CALLBACK( abc802_keyboard_tick )
447443{
448   scan_keyboard(timer.machine);
444   abc802_state *state = timer.machine->driver_data<abc802_state>();
445
446   scan_keyboard(timer.machine, state->m_dart, &state->m_keylatch);
449447}
450448
451449
450static TIMER_DEVICE_CALLBACK( abc806_keyboard_tick )
451{
452   abc806_state *state = timer.machine->driver_data<abc806_state>();
452453
454   scan_keyboard(timer.machine, state->m_dart, &state->m_keylatch);
455}
456
457
458
453459//**************************************************************************
454460//   SOUND
455461//**************************************************************************
r10346r10347
827833   m_kb_txd = !BIT(data, 4);
828834
829835   // keydown
830   z80dart_dcdb_w(m_dart, !BIT(data, 5));
836   m_dart->dcd_w(1, !BIT(data, 5));
831837
832838   // strobe
833839   m_kb_stb = BIT(data, 6);
r10346r10347
12401246   abc800_state *drvstate = device->machine->driver_data<abc800_state>();
12411247   device_t *sio = device->machine->device(Z80SIO_TAG);
12421248
1243
12441249   UINT8 sb = input_port_read(device->machine, "SB");
12451250
12461251   if (BIT(sb, 2))
r10346r10347
12811286
12821287static WRITE_LINE_DEVICE_HANDLER( ctc_z2_w )
12831288{
1284   device_t *m_dart = device->machine->device(Z80DART_TAG);
1285
12861289   // connected to DART channel A clock inputs
1287   z80dart_rxca_w(m_dart, state);
1288   z80dart_txca_w(m_dart, state);
1290   z80dart_rxca_w(device, state);
1291   z80dart_txca_w(device, state);
12891292}
12901293
12911294static Z80CTC_INTERFACE( ctc_intf )
r10346r10347
12941297   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),   // interrupt handler
12951298   DEVCB_LINE(ctc_z0_w),                     // ZC/TO0 callback
12961299   DEVCB_LINE(ctc_z1_w),                     // ZC/TO1 callback
1297   DEVCB_LINE(ctc_z2_w)                      // ZC/TO2 callback
1300   DEVCB_DEVICE_LINE(Z80DART_TAG, ctc_z2_w)       // ZC/TO2 callback
12981301};
12991302
13001303
r10346r10347
15081511   m_fetch_charram = 0;
15091512   bankswitch();
15101513
1511   z80dart_ria_w(m_dart, 1);
1514   m_dart->ri_w(0, 1);
15121515
15131516   // 50/60 Hz
1514   z80dart_ctsb_w(m_dart, 0); // 0 = 50Hz, 1 = 60Hz
1517   m_dart->cts_w(1, 0); // 0 = 50Hz, 1 = 60Hz
15151518}
15161519
15171520
r10346r10347
15241527   // register for state saving
15251528   state_save_register_global(machine, m_lrs);
15261529   state_save_register_global(machine, m_pling);
1530   state_save_register_global(machine, m_keylatch);
15271531}
15281532
15291533
r10346r10347
15461550   z80dart_ctsb_w(m_sio, BIT(config, 1));
15471551
15481552   // 40/80 char (S3)
1549   z80dart_ria_w(m_dart, BIT(config, 2)); // 0 = 40, 1 = 80
1553   m_dart->ri_w(0, BIT(config, 2)); // 0 = 40, 1 = 80
15501554
15511555   // 50/60 Hz
1552   z80dart_ctsb_w(m_dart, BIT(config, 3)); // 0 = 50Hz, 1 = 60Hz
1556   m_dart->cts_w(1, BIT(config, 3)); // 0 = 50Hz, 1 = 60Hz
15531557}
15541558
15551559
r10346r10347
15801584   state_save_register_global(machine, m_eme);
15811585   state_save_register_global(machine, m_fetch_charram);
15821586   state_save_register_global_array(machine, m_map);
1587   state_save_register_global(machine, m_keylatch);
15831588}
15841589
15851590
r10346r10347
16101615   e0516_clk_w(m_rtc, 1);
16111616   e0516_dio_w(m_rtc, 1);
16121617
1613   z80dart_ria_w(m_dart, 1);
1618   m_dart->ri_w(0, 1);
16141619
16151620   // 50/60 Hz
1616   z80dart_ctsb_w(m_dart, 0); // 0 = 50Hz, 1 = 60Hz
1621   m_dart->cts_w(1, 0); // 0 = 50Hz, 1 = 60Hz
16171622}
16181623
16191624
r10346r10347
17421747   MCFG_ABC834_ADD("luxor_55_21046", ABCBUS_TAG)
17431748
17441749   // fake keyboard
1745   MCFG_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, attotime::from_usec(2500))
1750   MCFG_TIMER_ADD_PERIODIC("keyboard", abc802_keyboard_tick, attotime::from_usec(2500))
17461751
17471752   // internal ram
17481753   MCFG_RAM_ADD(RAM_TAG)
r10346r10347
17821787   MCFG_ABC832_ADD("luxor_55_21046", ABCBUS_TAG, DRIVE_TEAC_FD55F)
17831788
17841789   // fake keyboard
1785   MCFG_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, attotime::from_usec(2500))
1790   MCFG_TIMER_ADD_PERIODIC("keyboard", abc806_keyboard_tick, attotime::from_usec(2500))
17861791
17871792   // internal ram
17881793   MCFG_RAM_ADD(RAM_TAG)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team