Previous 15994 Revisions Next

r11034 Friday 1st April, 2011 at 20:27:09 UTC by Curt Coder
[PROF80] Modernized driver.
[src/mess/drivers]prof80.c
[src/mess/includes]prof80.h

src/mess/includes/prof80.h
r11033r11034
33#ifndef __PROF80__
44#define __PROF80__
55
6#define ADDRESS_MAP_MODERN
7
68#include "emu.h"
79#include "cpu/z80/z80.h"
810#include "cpu/z80/z80daisy.h"
9#include "video/mc6845.h"
1011#include "formats/basicdsk.h"
1112#include "imagedev/flopdrv.h"
13#include "machine/ctronics.h"
14#include "machine/i8255a.h"
1215#include "machine/ram.h"
13#include "machine/i8255a.h"
16#include "machine/rescap.h"
17#include "machine/terminal.h"
18#include "machine/upd1990a.h"
1419#include "machine/upd765.h"
15#include "machine/upd1990a.h"
1620#include "machine/z80sti.h"
17#include "machine/ctronics.h"
18#include "machine/rescap.h"
1921#include "sound/speaker.h"
22#include "video/mc6845.h"
2023
2124#define Z80_TAG               "z1"
2225#define UPD765_TAG            "z38"
r11033r11034
4952   prof80_state(running_machine &machine, const driver_device_config_base &config)
5053      : driver_device(machine, config),
5154        m_maincpu(*this, Z80_TAG),
55        m_ppi(*this, I8255A_TAG),
5256        m_rtc(*this, UPD1990A_TAG),
53        m_fdc(*this, UPD765_TAG)
57        m_fdc(*this, UPD765_TAG),
58        m_ram(*this, RAM_TAG),
59        m_floppy0(*this, FLOPPY_0),
60        m_floppy1(*this, FLOPPY_1),
61        m_terminal(*this, TERMINAL_TAG)
5462   { }
5563
5664   required_device<cpu_device> m_maincpu;
65   optional_device<device_t> m_ppi;
5766   required_device<upd1990a_device> m_rtc;
5867   required_device<device_t> m_fdc;
68   required_device<device_t> m_ram;
69   required_device<device_t> m_floppy0;
70   required_device<device_t> m_floppy1;
71   optional_device<device_t> m_terminal;
5972
73   virtual void machine_start();
74   virtual void machine_reset();
75
76   WRITE8_MEMBER( flr_w );
77   READ8_MEMBER( status_r );
78   READ8_MEMBER( status2_r );
79   WRITE8_MEMBER( par_w );
80   READ8_MEMBER( gripc_r );
81   READ8_MEMBER( gripd_r );
82   WRITE8_MEMBER( gripd_w );
83   WRITE8_MEMBER( unio_ctrl_w );
84
85   void bankswitch();
86   void ls259_w(int fa, int sa, int fb, int sb);
87   void floppy_motor_off();
88
6089   /* memory state */
6190   UINT8 m_mmu[16];         /* MMU block register */
6291   int m_init;            /* MMU enable */
r11033r11034
77106   /* timers */
78107   emu_timer   *m_floppy_motor_off_timer;
79108
80/* ------------------------------------------------------------------------ */
109};
81110
111class grip_state : public prof80_state
112{
113public:
114   grip_state(running_machine &machine, const driver_device_config_base &config)
115      : prof80_state(machine, config),
116        m_crtc(*this, MC6845_TAG),
117        m_sti(*this, Z80STI_TAG),
118        m_centronics(*this, CENTRONICS_TAG),
119        m_speaker(*this, SPEAKER_TAG)
120   { }
121
122   required_device<device_t> m_crtc;
123   required_device<device_t> m_sti;
124   required_device<device_t> m_centronics;
125   required_device<device_t> m_speaker;
126
127   virtual void machine_start();
128
129   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
130
131   WRITE8_MEMBER( vol0_w );
132   WRITE8_MEMBER( vol1_w );
133   WRITE8_MEMBER( flash_w );
134   WRITE8_MEMBER( page_w );
135   READ8_MEMBER( stat_r );
136   READ8_MEMBER( lrs_r );
137   WRITE8_MEMBER( lrs_w );
138   READ8_MEMBER( cxstb_r );
139   WRITE8_MEMBER( cxstb_w );
140   READ8_MEMBER( ppi_pa_r );
141   WRITE8_MEMBER( ppi_pa_w );
142   READ8_MEMBER( ppi_pb_r );
143   WRITE8_MEMBER( ppi_pc_w );
144   READ8_MEMBER( sti_gpio_r );
145   WRITE_LINE_MEMBER( speaker_w );
146
147   void scan_keyboard();
148
82149   /* sound state */
83150   int m_vol0;
84151   int m_vol1;
r11033r11034
92159   int m_lps;            /* light pen sense */
93160   int m_page;            /* video page */
94161   int m_flash;            /* flash */
95
96   /* devices */
97   device_t *m_mc6845;
98   device_t *m_ppi8255;
99   device_t *m_z80sti;
100   device_t *m_centronics;
101162};
102163
103164#endif
src/mess/drivers/prof80.c
r11033r11034
1313
1414    TODO:
1515
16    - prof80 crashes because of no video
1716    - GRIP does not ack display bytes sent by PROF
1817    - keyboard
1918    - NE555 timeout is 10x too high
r11033r11034
3029
3130/* Keyboard HACK */
3231
33static const UINT8 prof80_keycodes[3][9][8] =
32static const UINT8 KEYCODES[3][9][8] =
3433{
3534   /* unshifted */
3635   {
r11033r11034
7271   }
7372};
7473
75static void prof80_keyboard_scan(running_machine &machine)
74void grip_state::scan_keyboard()
7675{
77   prof80_state *state = machine.driver_data<prof80_state>();
78
7976   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8" };
8077   int table = 0, row, col;
8178   int keydata = -1;
8279
83   if (input_port_read(machine, "ROW9") & 0x07)
80   if (input_port_read(m_machine, "ROW9") & 0x07)
8481   {
8582      /* shift, upper case */
8683      table = 1;
8784   }
8885
89   if (input_port_read(machine, "ROW9") & 0x18)
86   if (input_port_read(m_machine, "ROW9") & 0x18)
9087   {
9188      /* ctrl */
9289      table = 2;
r11033r11034
9592   /* scan keyboard */
9693   for (row = 0; row < 9; row++)
9794   {
98      UINT8 data = input_port_read(machine, keynames[row]);
95      UINT8 data = input_port_read(m_machine, keynames[row]);
9996
10097      for (col = 0; col < 8; col++)
10198      {
10299         if (!BIT(data, col))
103100         {
104101            /* latch key data */
105            keydata = prof80_keycodes[table][row][col];
102            keydata = KEYCODES[table][row][col];
106103
107            if (state->m_keydata != keydata)
104            if (m_keydata != keydata)
108105            {
109               state->m_keydata = keydata;
106               m_keydata = keydata;
110107
111108               /* trigger GRIP 8255 port C bit 2 (_STBB) */
112               i8255a_pc2_w(state->m_ppi8255, 0);
113               i8255a_pc2_w(state->m_ppi8255, 1);
109               i8255a_pc2_w(m_ppi, 0);
110               i8255a_pc2_w(m_ppi, 1);
114111               return;
115112            }
116113         }
117114      }
118115   }
119116
120   state->m_keydata = keydata;
117   m_keydata = keydata;
121118}
122119
123120static TIMER_DEVICE_CALLBACK( keyboard_tick )
124121{
125   prof80_state *state = timer.machine().driver_data<prof80_state>();
122   grip_state *state = timer.machine().driver_data<grip_state>();
126123
127   if (!state->m_kbf) prof80_keyboard_scan(timer.machine());
124   if (!state->m_kbf) state->scan_keyboard();
128125}
129126
130127/* PROF-80 */
r11033r11034
135132#define BLK_RAM4   0x02
136133#define BLK_EPROM   0x00
137134
138static void prof80_bankswitch(running_machine &machine)
135void prof80_state::bankswitch()
139136{
140   prof80_state *state = machine.driver_data<prof80_state>();
141   address_space *program = machine.device(Z80_TAG)->memory().space(AS_PROGRAM);
142   UINT8 *ram = ram_get_ptr(machine.device(RAM_TAG));
143   UINT8 *rom = machine.region(Z80_TAG)->base();
137   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
138   UINT8 *ram = ram_get_ptr(m_ram);
139   UINT8 *rom = m_machine.region(Z80_TAG)->base();
144140   int bank;
145141
146142   for (bank = 0; bank < 16; bank++)
147143   {
148144      UINT16 start_addr = bank * 0x1000;
149145      UINT16 end_addr = start_addr + 0xfff;
150      int block = state->m_init ? state->m_mmu[bank] : BLK_EPROM;
146      int block = m_init ? m_mmu[bank] : BLK_EPROM;
151147
152148      switch (block)
153149      {
r11033r11034
179175   }
180176}
181177
182static TIMER_CALLBACK( floppy_motor_off_tick )
178void prof80_state::floppy_motor_off()
183179{
184   prof80_state *state = machine.driver_data<prof80_state>();
180   floppy_mon_w(m_floppy0, 1);
181   floppy_mon_w(m_floppy1, 1);
182   floppy_drive_set_ready_state(m_floppy0, 0, 1);
183   floppy_drive_set_ready_state(m_floppy1, 0, 1);
185184
186   floppy_mon_w(floppy_get_device(machine, 0), ASSERT_LINE);
187   floppy_mon_w(floppy_get_device(machine, 1), ASSERT_LINE);
188   floppy_drive_set_ready_state(floppy_get_device(machine, 0), 0, 1);
189   floppy_drive_set_ready_state(floppy_get_device(machine, 1), 0, 1);
190
191   state->m_motor = 0;
185   m_motor = 0;
192186}
193187
194static void ls259_w(running_machine &machine, int fa, int sa, int fb, int sb)
188static TIMER_CALLBACK( floppy_motor_off_tick )
195189{
196190   prof80_state *state = machine.driver_data<prof80_state>();
191   
192   state->floppy_motor_off();
193}
197194
195void prof80_state::ls259_w(int fa, int sa, int fb, int sb)
196{
198197   switch (sa)
199198   {
200199   case 0: /* C0/TDI */
201      state->m_rtc->data_in_w(fa);
202      state->m_rtc->c0_w(fa);
203      state->m_c0 = fa;
200      m_rtc->data_in_w(fa);
201      m_rtc->c0_w(fa);
202      m_c0 = fa;
204203      break;
205204
206205   case 1: /* C1 */
207      state->m_rtc->c1_w(fa);
208      state->m_c1 = fa;
206      m_rtc->c1_w(fa);
207      m_c1 = fa;
209208      break;
210209
211210   case 2: /* C2 */
212      state->m_rtc->c2_w(fa);
213      state->m_c2 = fa;
211      m_rtc->c2_w(fa);
212      m_c2 = fa;
214213      break;
215214
216215   case 3:   /* READY */
217216      break;
218217
219218   case 4: /* TCK */
220      state->m_rtc->clk_w(fa);
219      m_rtc->clk_w(fa);
221220      break;
222221
223222   case 5:   /* IN USE */
r11033r11034
230229         /* trigger floppy motor off NE555 timer */
231230         int t = 110 * RES_M(10) * CAP_U(6.8); // t = 1.1 * R8 * C6
232231
233         state->m_floppy_motor_off_timer->adjust(attotime::from_msec(t));
232         m_floppy_motor_off_timer->adjust(attotime::from_msec(t));
234233      }
235234      else
236235      {
237236         /* turn on floppy motor */
238         floppy_mon_w(floppy_get_device(machine, 0), CLEAR_LINE);
239         floppy_mon_w(floppy_get_device(machine, 1), CLEAR_LINE);
240         floppy_drive_set_ready_state(floppy_get_device(machine, 0), 1, 1);
241         floppy_drive_set_ready_state(floppy_get_device(machine, 1), 1, 1);
237         floppy_mon_w(m_floppy0, 0);
238         floppy_mon_w(m_floppy1, 0);
239         floppy_drive_set_ready_state(m_floppy0, 1, 1);
240         floppy_drive_set_ready_state(m_floppy1, 1, 1);
242241
243         state->m_motor = 1;
242         m_motor = 1;
244243
245244         /* reset floppy motor off NE555 timer */
246         state->m_floppy_motor_off_timer->enable(0);
245         m_floppy_motor_off_timer->enable(0);
247246      }
248247      break;
249248
r11033r11034
254253   switch (sb)
255254   {
256255   case 0: /* RESF */
257      if (fb) upd765_reset(state->m_fdc, 0);
256      if (fb) upd765_reset(m_fdc, 0);
258257      break;
259258
260259   case 1: /* MINI */
r11033r11034
264263      break;
265264
266265   case 3: /* TX */
266      if (m_terminal) terminal_serial_w(m_terminal, fb);
267267      break;
268268
269269   case 4: /* _MSTOP */
270270      if (!fb)
271271      {
272272         /* immediately turn off floppy motor */
273         state->m_floppy_motor_off_timer->adjust(attotime::zero);
273         m_floppy_motor_off_timer->adjust(attotime::zero);
274274      }
275275      break;
276276
r11033r11034
278278      break;
279279
280280   case 6: /* TSTB */
281      state->m_rtc->stb_w(fb);
281      m_rtc->stb_w(fb);
282282      break;
283283
284284   case 7: /* MME */
285285      //logerror("INIT %u\n", fb);
286      state->m_init = fb;
287      prof80_bankswitch(machine);
286      m_init = fb;
287      bankswitch();
288288      break;
289289   }
290290}
291291
292static WRITE8_HANDLER( flr_w )
292WRITE8_MEMBER( prof80_state::flr_w )
293293{
294294   /*
295295
r11033r11034
312312   int fb = BIT(data, 0);
313313   int sb = (data >> 1) & 0x07;
314314
315   ls259_w(space->machine(), fa, sa, fb, sb);
315   ls259_w(fa, sa, fb, sb);
316316}
317317
318static READ8_HANDLER( status_r )
318READ8_MEMBER( prof80_state::status_r )
319319{
320320   /*
321321
r11033r11034
332332
333333    */
334334
335   prof80_state *state = space->machine().driver_data<prof80_state>();
335   UINT8 data = 0;
336336
337   return (state->m_fdc_index << 5) | 0x01;
337   // serial receive
338   if (m_terminal) data |= terminal_serial_r(m_terminal);
339
340   // clear to send
341   data |= 0x10;
342
343   // floppy index
344   data |= (m_fdc_index << 5);
345
346   return data;
338347}
339348
340static READ8_HANDLER( status2_r )
349READ8_MEMBER( prof80_state::status2_r )
341350{
342351   /*
343352
r11033r11034
354363
355364    */
356365
357   prof80_state *state = space->machine().driver_data<prof80_state>();
358366   UINT8 data = 0;
359367   int js4 = 0, js5 = 0;
360368
361369   /* floppy motor */
362   data |= !state->m_motor;
370   data |= !m_motor;
363371
364372   /* JS4 */
365   switch (input_port_read(space->machine(), "J4"))
373   switch (input_port_read(m_machine, "J4"))
366374   {
367375   case 0: js4 = 0; break;
368376   case 1: js4 = 1; break;
369   case 2: js4 = !state->m_c0; break;
370   case 3: js4 = !state->m_c1; break;
371   case 4: js4 = !state->m_c2; break;
377   case 2: js4 = !m_c0; break;
378   case 3: js4 = !m_c1; break;
379   case 4: js4 = !m_c2; break;
372380   }
373381
374382   data |= js4 << 4;
375383
376384   /* JS5 */
377   switch (input_port_read(space->machine(), "J5"))
385   switch (input_port_read(m_machine, "J5"))
378386   {
379387   case 0: js5 = 0; break;
380388   case 1: js5 = 1; break;
381   case 2: js5 = !state->m_c0; break;
382   case 3: js5 = !state->m_c1; break;
383   case 4: js5 = !state->m_c2; break;
389   case 2: js5 = !m_c0; break;
390   case 3: js5 = !m_c1; break;
391   case 4: js5 = !m_c2; break;
384392   }
385393
386394   data |= js5 << 4;
387395
388396   /* RTC data */
389   data |= !state->m_rtc->data_out_r() << 7;
397   data |= !m_rtc->data_out_r() << 7;
390398
391399   return data;
392400}
393401
394static WRITE8_HANDLER( par_w )
402WRITE8_MEMBER( prof80_state::par_w )
395403{
396   prof80_state *state = space->machine().driver_data<prof80_state>();
397
398404   int bank = offset >> 12;
399405
400   state->m_mmu[bank] = data & 0x0f;
406   m_mmu[bank] = data & 0x0f;
401407
402408   //logerror("MMU bank %u block %u\n", bank, data & 0x0f);
403409
404   prof80_bankswitch(space->machine());
410   bankswitch();
405411}
406412
407static READ8_HANDLER( gripc_r )
413READ8_MEMBER( prof80_state::gripc_r )
408414{
409   prof80_state *state = space->machine().driver_data<prof80_state>();
415   //logerror("GRIP status read %02x\n", m_gripc);
410416
411   //logerror("GRIP status read %02x\n", state->m_gripc);
412
413   return state->m_gripc;
417   return m_gripc;
414418}
415419
416static READ8_HANDLER( gripd_r )
420READ8_MEMBER( prof80_state::gripd_r )
417421{
418   prof80_state *state = space->machine().driver_data<prof80_state>();
422   //logerror("GRIP data read %02x\n", m_gripd);
419423
420   //logerror("GRIP data read %02x\n", state->m_gripd);
421
422424   /* trigger GRIP 8255 port C bit 6 (_ACKA) */
423   i8255a_pc6_w(state->m_ppi8255, 0);
424   i8255a_pc6_w(state->m_ppi8255, 1);
425   i8255a_pc6_w(m_ppi, 0);
426   i8255a_pc6_w(m_ppi, 1);
425427
426   return state->m_gripd;
428   return m_gripd;
427429}
428430
429static WRITE8_HANDLER( gripd_w )
431WRITE8_MEMBER( prof80_state::gripd_w )
430432{
431   prof80_state *state = space->machine().driver_data<prof80_state>();
432
433   state->m_gripd = data;
433   m_gripd = data;
434434   //logerror("GRIP data write %02x\n", data);
435435
436436   /* trigger GRIP 8255 port C bit 4 (_STBA) */
437   i8255a_pc4_w(state->m_ppi8255, 0);
438   i8255a_pc4_w(state->m_ppi8255, 1);
437   i8255a_pc4_w(m_ppi, 0);
438   i8255a_pc4_w(m_ppi, 1);
439439}
440440
441441/* GRIP */
442442
443static WRITE8_HANDLER( vol0_w )
443WRITE8_MEMBER( grip_state::vol0_w )
444444{
445   prof80_state *state = space->machine().driver_data<prof80_state>();
446
447   state->m_vol0 = BIT(data, 7);
445   m_vol0 = BIT(data, 7);
448446}
449447
450static WRITE8_HANDLER( vol1_w )
448WRITE8_MEMBER( grip_state::vol1_w )
451449{
452   prof80_state *state = space->machine().driver_data<prof80_state>();
453
454   state->m_vol1 = BIT(data, 7);
450   m_vol1 = BIT(data, 7);
455451}
456452
457static WRITE8_HANDLER( flash_w )
453WRITE8_MEMBER( grip_state::flash_w )
458454{
459   prof80_state *state = space->machine().driver_data<prof80_state>();
460
461   state->m_flash = BIT(data, 7);
455   m_flash = BIT(data, 7);
462456}
463457
464static WRITE8_HANDLER( page_w )
458WRITE8_MEMBER( grip_state::page_w )
465459{
466   prof80_state *state = space->machine().driver_data<prof80_state>();
460   m_page = BIT(data, 7);
467461
468   state->m_page = BIT(data, 7);
469
470   memory_set_bank(space->machine(), "videoram", state->m_page);
462   memory_set_bank(m_machine, "videoram", m_page);
471463}
472464
473static READ8_HANDLER( stat_r )
465READ8_MEMBER( grip_state::stat_r )
474466{
475467   /*
476468
r11033r11034
487479
488480    */
489481
490   prof80_state *state = space->machine().driver_data<prof80_state>();
491482   UINT8 data = 0;
492483   int js0 = 0, js1 = 0;
493484
494485   /* JS0 */
495   switch (input_port_read(space->machine(), "GRIP-J3A"))
486   switch (input_port_read(m_machine, "GRIP-J3A"))
496487   {
497488   case 0: js0 = 0; break;
498489   case 1: js0 = 1; break;
499   case 2: js0 = state->m_vol0; break;
500   case 3: js0 = state->m_vol1; break;
501   case 4: js0 = state->m_page; break;
490   case 2: js0 = m_vol0; break;
491   case 3: js0 = m_vol1; break;
492   case 4: js0 = m_page; break;
502493   }
503494
504495   data |= js0 << 4;
505496
506497   /* JS1 */
507   switch (input_port_read(space->machine(), "GRIP-J3B"))
498   switch (input_port_read(m_machine, "GRIP-J3B"))
508499   {
509500   case 0: js1 = 0; break;
510501   case 1: js1 = 1; break;
511   case 2: js1 = state->m_vol0; break;
512   case 3: js1 = state->m_vol1; break;
513   case 4: js1 = state->m_page; break;
502   case 2: js1 = m_vol0; break;
503   case 3: js1 = m_vol1; break;
504   case 4: js1 = m_page; break;
514505   }
515506
516507   data |= js1 << 5;
517508
518509   /* centronics fault */
519   data |= centronics_fault_r(state->m_centronics) << 6;
510   data |= centronics_fault_r(m_centronics) << 6;
520511
521512   /* light pen strobe */
522   data |= state->m_lps << 7;
513   data |= m_lps << 7;
523514
524515   return data;
525516}
526517
527static READ8_HANDLER( lrs_r )
518READ8_MEMBER( grip_state::lrs_r )
528519{
529   prof80_state *state = space->machine().driver_data<prof80_state>();
520   m_lps = 0;
530521
531   state->m_lps = 0;
532
533522   return 0;
534523}
535524
536static WRITE8_HANDLER( lrs_w )
525WRITE8_MEMBER( grip_state::lrs_w )
537526{
538   prof80_state *state = space->machine().driver_data<prof80_state>();
539
540   state->m_lps = 0;
527   m_lps = 0;
541528}
542529
543static READ8_HANDLER( cxstb_r )
530READ8_MEMBER( grip_state::cxstb_r )
544531{
545   prof80_state *state = space->machine().driver_data<prof80_state>();
532   centronics_strobe_w(m_centronics, 0);
533   centronics_strobe_w(m_centronics, 1);
546534
547   centronics_strobe_w(state->m_centronics, 0);
548   centronics_strobe_w(state->m_centronics, 1);
549
550535   return 0;
551536}
552537
553static WRITE8_HANDLER( cxstb_w )
538WRITE8_MEMBER( grip_state::cxstb_w )
554539{
555   prof80_state *state = space->machine().driver_data<prof80_state>();
556
557   centronics_strobe_w(state->m_centronics, 0);
558   centronics_strobe_w(state->m_centronics, 1);
540   centronics_strobe_w(m_centronics, 0);
541   centronics_strobe_w(m_centronics, 1);
559542}
560543
561544/* UNIO */
562545
563static WRITE8_HANDLER( unio_ctrl_w )
546WRITE8_MEMBER( prof80_state::unio_ctrl_w )
564547{
565//  prof80_state *state = space->machine().driver_data<prof80_state>();
566
567548//  int flag = BIT(data, 0);
568549   int flad = (data >> 1) & 0x07;
569550
r11033r11034
583564
584565/* Memory Maps */
585566
586static ADDRESS_MAP_START( prof80_mem, AS_PROGRAM, 8 )
567static ADDRESS_MAP_START( prof80_mem, AS_PROGRAM, 8, prof80_state )
587568ADDRESS_MAP_END
588569
589static ADDRESS_MAP_START( prof80_io, AS_IO, 8 )
590//  AM_RANGE(0x80, 0x8f) AM_MIRROR(0xff00) AM_DEVREADWRITE(UNIO_Z80STI_TAG, z80sti_r, z80sti_w)
591//  AM_RANGE(0x94, 0x95) AM_MIRROR(0xff00) AM_DEVREADWRITE(UNIO_Z80SIO_TAG, z80sio_d_r, z80sio_d_w)
592//  AM_RANGE(0x96, 0x97) AM_MIRROR(0xff00) AM_DEVREADWRITE(UNIO_Z80SIO_TAG, z80sio_c_r, z80sio_c_w)
570static ADDRESS_MAP_START( prof80_io, AS_IO, 8, prof80_state )
571//  AM_RANGE(0x80, 0x8f) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(UNIO_Z80STI_TAG, z80sti_r, z80sti_w)
572//  AM_RANGE(0x94, 0x95) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(UNIO_Z80SIO_TAG, z80sio_d_r, z80sio_d_w)
573//  AM_RANGE(0x96, 0x97) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(UNIO_Z80SIO_TAG, z80sio_c_r, z80sio_c_w)
593574   AM_RANGE(0x9e, 0x9e) AM_MIRROR(0xff00) AM_WRITE(unio_ctrl_w)
594//  AM_RANGE(0x9c, 0x9c) AM_MIRROR(0xff00) AM_DEVWRITE(UNIO_CENTRONICS1_TAG, centronics_data_w)
595//  AM_RANGE(0x9d, 0x9d) AM_MIRROR(0xff00) AM_DEVWRITE(UNIO_CENTRONICS1_TAG, centronics_data_w)
575//  AM_RANGE(0x9c, 0x9c) AM_MIRROR(0xff00) AM_DEVWRITE_LEGACY(UNIO_CENTRONICS1_TAG, centronics_data_w)
576//  AM_RANGE(0x9d, 0x9d) AM_MIRROR(0xff00) AM_DEVWRITE_LEGACY(UNIO_CENTRONICS1_TAG, centronics_data_w)
596577//  AM_RANGE(0xc0, 0xc0) AM_MIRROR(0xff00) AM_READ(gripc_r)
597578//  AM_RANGE(0xc1, 0xc1) AM_MIRROR(0xff00) AM_READWRITE(gripd_r, gripd_w)
598579   AM_RANGE(0xd8, 0xd8) AM_MIRROR(0xff00) AM_WRITE(flr_w)
599580   AM_RANGE(0xda, 0xda) AM_MIRROR(0xff00) AM_READ(status_r)
600581   AM_RANGE(0xdb, 0xdb) AM_MIRROR(0xff00) AM_READ(status2_r)
601   AM_RANGE(0xdc, 0xdc) AM_MIRROR(0xff00) AM_DEVREAD(UPD765_TAG, upd765_status_r)
602   AM_RANGE(0xdd, 0xdd) AM_MIRROR(0xff00) AM_DEVREADWRITE(UPD765_TAG, upd765_data_r, upd765_data_w)
582   AM_RANGE(0xdc, 0xdc) AM_MIRROR(0xff00) AM_DEVREAD_LEGACY(UPD765_TAG, upd765_status_r)
583   AM_RANGE(0xdd, 0xdd) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(UPD765_TAG, upd765_data_r, upd765_data_w)
603584   AM_RANGE(0xde, 0xde) AM_MIRROR(0xff01) AM_MASK(0xff00) AM_WRITE(par_w)
604585ADDRESS_MAP_END
605586
606587
607static ADDRESS_MAP_START( prof80_grip_io, AS_IO, 8 )
608//  AM_RANGE(0x80, 0x8f) AM_MIRROR(0xff00) AM_DEVREADWRITE(UNIO_Z80STI_TAG, z80sti_r, z80sti_w)
609//  AM_RANGE(0x94, 0x95) AM_MIRROR(0xff00) AM_DEVREADWRITE(UNIO_Z80SIO_TAG, z80sio_d_r, z80sio_d_w)
610//  AM_RANGE(0x96, 0x97) AM_MIRROR(0xff00) AM_DEVREADWRITE(UNIO_Z80SIO_TAG, z80sio_c_r, z80sio_c_w)
588static ADDRESS_MAP_START( prof80_grip_io, AS_IO, 8, prof80_state )
589//  AM_RANGE(0x80, 0x8f) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(UNIO_Z80STI_TAG, z80sti_r, z80sti_w)
590//  AM_RANGE(0x94, 0x95) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(UNIO_Z80SIO_TAG, z80sio_d_r, z80sio_d_w)
591//  AM_RANGE(0x96, 0x97) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(UNIO_Z80SIO_TAG, z80sio_c_r, z80sio_c_w)
611592   AM_RANGE(0x9e, 0x9e) AM_MIRROR(0xff00) AM_WRITE(unio_ctrl_w)
612//  AM_RANGE(0x9c, 0x9c) AM_MIRROR(0xff00) AM_DEVWRITE(UNIO_CENTRONICS1_TAG, centronics_data_w)
613//  AM_RANGE(0x9d, 0x9d) AM_MIRROR(0xff00) AM_DEVWRITE(UNIO_CENTRONICS1_TAG, centronics_data_w)
593//  AM_RANGE(0x9c, 0x9c) AM_MIRROR(0xff00) AM_DEVWRITE_LEGACY(UNIO_CENTRONICS1_TAG, centronics_data_w)
594//  AM_RANGE(0x9d, 0x9d) AM_MIRROR(0xff00) AM_DEVWRITE_LEGACY(UNIO_CENTRONICS1_TAG, centronics_data_w)
614595   AM_RANGE(0xc0, 0xc0) AM_MIRROR(0xff00) AM_READ(gripc_r)
615596   AM_RANGE(0xc1, 0xc1) AM_MIRROR(0xff00) AM_READWRITE(gripd_r, gripd_w)
616597   AM_RANGE(0xd8, 0xd8) AM_MIRROR(0xff00) AM_WRITE(flr_w)
617598   AM_RANGE(0xda, 0xda) AM_MIRROR(0xff00) AM_READ(status_r)
618599   AM_RANGE(0xdb, 0xdb) AM_MIRROR(0xff00) AM_READ(status2_r)
619   AM_RANGE(0xdc, 0xdc) AM_MIRROR(0xff00) AM_DEVREAD(UPD765_TAG, upd765_status_r)
620   AM_RANGE(0xdd, 0xdd) AM_MIRROR(0xff00) AM_DEVREADWRITE(UPD765_TAG, upd765_data_r, upd765_data_w)
600   AM_RANGE(0xdc, 0xdc) AM_MIRROR(0xff00) AM_DEVREAD_LEGACY(UPD765_TAG, upd765_status_r)
601   AM_RANGE(0xdd, 0xdd) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(UPD765_TAG, upd765_data_r, upd765_data_w)
621602   AM_RANGE(0xde, 0xde) AM_MIRROR(0xff01) AM_MASK(0xff00) AM_WRITE(par_w)
622603ADDRESS_MAP_END
623604
624static ADDRESS_MAP_START( grip_mem, AS_PROGRAM, 8 )
605static ADDRESS_MAP_START( grip_mem, AS_PROGRAM, 8, grip_state )
625606    AM_RANGE(0x0000, 0x3fff) AM_ROM
626607    AM_RANGE(0x4000, 0x47ff) AM_RAM
627608    AM_RANGE(0x8000, 0xffff) AM_RAMBANK("videoram")
628609ADDRESS_MAP_END
629610
630static ADDRESS_MAP_START( grip_io, AS_IO, 8 )
611static ADDRESS_MAP_START( grip_io, AS_IO, 8, grip_state )
631612   ADDRESS_MAP_GLOBAL_MASK(0xff)
632613   AM_RANGE(0x00, 0x00) AM_READWRITE(cxstb_r, cxstb_w)
633614//  AM_RANGE(0x10, 0x10) AM_WRITE(ccon_w)
r11033r11034
638619//  AM_RANGE(0x15, 0x15) AM_WRITE(cc2_w)
639620   AM_RANGE(0x16, 0x16) AM_WRITE(flash_w)
640621   AM_RANGE(0x17, 0x17) AM_WRITE(vol1_w)
641   AM_RANGE(0x20, 0x2f) AM_DEVREADWRITE(Z80STI_TAG, z80sti_r, z80sti_w)
622   AM_RANGE(0x20, 0x2f) AM_DEVREADWRITE_LEGACY(Z80STI_TAG, z80sti_r, z80sti_w)
642623   AM_RANGE(0x30, 0x30) AM_READWRITE(lrs_r, lrs_w)
643624   AM_RANGE(0x40, 0x40) AM_READ(stat_r)
644   AM_RANGE(0x50, 0x50) AM_DEVWRITE(MC6845_TAG, mc6845_address_w)
645   AM_RANGE(0x52, 0x52) AM_DEVWRITE(MC6845_TAG, mc6845_register_w)
646   AM_RANGE(0x53, 0x53) AM_DEVREAD(MC6845_TAG, mc6845_register_r)
647   AM_RANGE(0x60, 0x60) AM_DEVWRITE(CENTRONICS_TAG, centronics_data_w)
648   AM_RANGE(0x70, 0x73) AM_DEVREADWRITE(I8255A_TAG, i8255a_r, i8255a_w)
625   AM_RANGE(0x50, 0x50) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_address_w)
626   AM_RANGE(0x52, 0x52) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_register_w)
627   AM_RANGE(0x53, 0x53) AM_DEVREAD_LEGACY(MC6845_TAG, mc6845_register_r)
628   AM_RANGE(0x60, 0x60) AM_DEVWRITE_LEGACY(CENTRONICS_TAG, centronics_data_w)
629   AM_RANGE(0x70, 0x73) AM_DEVREADWRITE_LEGACY(I8255A_TAG, i8255a_r, i8255a_w)
649630//  AM_RANGE(0x80, 0x80) AM_WRITE(bl2out_w)
650631//  AM_RANGE(0x90, 0x90) AM_WRITE(gr2out_w)
651632//  AM_RANGE(0xa0, 0xa0) AM_WRITE(rd2out_w)
r11033r11034
656637//  AM_RANGE(0xf0, 0xf0) AM_WRITE(clrg1_w)
657638ADDRESS_MAP_END
658639
659static ADDRESS_MAP_START( grip5_io, AS_IO, 8 )
640static ADDRESS_MAP_START( grip5_io, AS_IO, 8, grip_state )
660641   ADDRESS_MAP_GLOBAL_MASK(0xff)
661642   AM_RANGE(0x00, 0x00) AM_READWRITE(cxstb_r, cxstb_w)
662643//  AM_RANGE(0x10, 0x10) AM_WRITE(eprom_w)
r11033r11034
667648//  AM_RANGE(0x15, 0x15) AM_WRITE(intl_w)
668649//  AM_RANGE(0x16, 0x16) AM_WRITE(dpage_w)
669650//  AM_RANGE(0x17, 0x17) AM_WRITE(vol1_w)
670   AM_RANGE(0x20, 0x2f) AM_DEVREADWRITE(Z80STI_TAG, z80sti_r, z80sti_w)
651   AM_RANGE(0x20, 0x2f) AM_DEVREADWRITE_LEGACY(Z80STI_TAG, z80sti_r, z80sti_w)
671652   AM_RANGE(0x30, 0x30) AM_READWRITE(lrs_r, lrs_w)
672653   AM_RANGE(0x40, 0x40) AM_READ(stat_r)
673   AM_RANGE(0x50, 0x50) AM_DEVWRITE(MC6845_TAG, mc6845_address_w)
674   AM_RANGE(0x52, 0x52) AM_DEVWRITE(MC6845_TAG, mc6845_register_w)
675   AM_RANGE(0x53, 0x53) AM_DEVREAD(MC6845_TAG, mc6845_register_r)
676   AM_RANGE(0x60, 0x60) AM_DEVWRITE(CENTRONICS_TAG, centronics_data_w)
677   AM_RANGE(0x70, 0x73) AM_DEVREADWRITE(I8255A_TAG, i8255a_r, i8255a_w)
654   AM_RANGE(0x50, 0x50) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_address_w)
655   AM_RANGE(0x52, 0x52) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_register_w)
656   AM_RANGE(0x53, 0x53) AM_DEVREAD_LEGACY(MC6845_TAG, mc6845_register_r)
657   AM_RANGE(0x60, 0x60) AM_DEVWRITE_LEGACY(CENTRONICS_TAG, centronics_data_w)
658   AM_RANGE(0x70, 0x73) AM_DEVREADWRITE_LEGACY(I8255A_TAG, i8255a_r, i8255a_w)
678659
679660//  AM_RANGE(0x80, 0x80) AM_WRITE(xrflgs_w)
680661//  AM_RANGE(0xc0, 0xc0) AM_WRITE(xrclrg_w)
r11033r11034
930911
931912static MC6845_UPDATE_ROW( grip_update_row )
932913{
933   prof80_state *state = device->machine().driver_data<prof80_state>();
914   grip_state *state = device->machine().driver_data<grip_state>();
934915   int column, bit;
935916
936917   for (column = 0; column < x_count; column++)
r11033r11034
948929   }
949930}
950931
951static const mc6845_interface grip_mc6845_interface =
932static const mc6845_interface crtc_intf =
952933{
953934   SCREEN_TAG,
954935   8,
r11033r11034
962943   NULL
963944};
964945
965static VIDEO_START( grip )
946bool grip_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
966947{
967}
948   mc6845_update(m_crtc, &bitmap, &cliprect);
968949
969static SCREEN_UPDATE( grip )
970{
971   prof80_state *state = screen->machine().driver_data<prof80_state>();
972
973   mc6845_update(state->m_mc6845, bitmap, cliprect);
974
975950   return 0;
976951}
977952
r11033r11034
1003978
1004979/* PPI8255 Interface */
1005980
1006static READ8_DEVICE_HANDLER( grip_ppi8255_a_r )
981READ8_MEMBER( grip_state::ppi_pa_r )
1007982{
1008983   /*
1009984
r11033r11034
1020995
1021996    */
1022997
1023   prof80_state *state = device->machine().driver_data<prof80_state>();
1024
1025   return state->m_gripd;
998   return m_gripd;
1026999}
10271000
1028static WRITE8_DEVICE_HANDLER( grip_ppi8255_a_w )
1001WRITE8_MEMBER( grip_state::ppi_pa_w )
10291002{
10301003   /*
10311004
r11033r11034
10421015
10431016    */
10441017
1045   prof80_state *state = device->machine().driver_data<prof80_state>();
1046
1047   state->m_gripd = data;
1018   m_gripd = data;
10481019}
10491020
1050static READ8_DEVICE_HANDLER( grip_ppi8255_b_r )
1021READ8_MEMBER( grip_state::ppi_pb_r )
10511022{
10521023   /*
10531024
r11033r11034
10641035
10651036    */
10661037
1067   prof80_state *state = device->machine().driver_data<prof80_state>();
1068
1069   return state->m_keydata;
1038   return m_keydata;
10701039}
10711040
1072static WRITE8_DEVICE_HANDLER( grip_ppi8255_c_w )
1041WRITE8_MEMBER( grip_state::ppi_pc_w )
10731042{
10741043   /*
10751044
r11033r11034
10861055
10871056    */
10881057
1089   prof80_state *state = device->machine().driver_data<prof80_state>();
1090
10911058   /* keyboard interrupt */
1092   z80sti_i4_w(state->m_z80sti, BIT(data, 0));
1059   z80sti_i4_w(m_sti, BIT(data, 0));
10931060
10941061   /* keyboard buffer full */
1095   state->m_kbf = BIT(data, 1);
1062   m_kbf = BIT(data, 1);
10961063
10971064   /* PROF-80 interrupt */
1098   z80sti_i7_w(state->m_z80sti, BIT(data, 3));
1065   z80sti_i7_w(m_sti, BIT(data, 3));
10991066
11001067   /* PROF-80 handshaking */
1101   state->m_gripc = (!BIT(data, 7) << 7) | (!BIT(data, 5) << 6) | (i8255a_pa_r(state->m_ppi8255, 0) & 0x3f);
1068   m_gripc = (!BIT(data, 7) << 7) | (!BIT(data, 5) << 6) | (i8255a_pa_r(m_ppi, 0) & 0x3f);
11021069}
11031070
1104static I8255A_INTERFACE( grip_ppi8255_interface )
1071static I8255A_INTERFACE( ppi_intf )
11051072{
1106   DEVCB_HANDLER(grip_ppi8255_a_r),   // Port A read
1107   DEVCB_HANDLER(grip_ppi8255_b_r),   // Port B read
1073   DEVCB_DRIVER_MEMBER(grip_state, ppi_pa_r),   // Port A read
1074   DEVCB_DRIVER_MEMBER(grip_state, ppi_pb_r),   // Port B read
11081075   DEVCB_NULL,                     // Port C read
1109   DEVCB_HANDLER(grip_ppi8255_a_w),   // Port A write
1076   DEVCB_DRIVER_MEMBER(grip_state, ppi_pa_w),   // Port A write
11101077   DEVCB_NULL,                     // Port B write
1111   DEVCB_HANDLER(grip_ppi8255_c_w)      // Port C write
1078   DEVCB_DRIVER_MEMBER(grip_state, ppi_pc_w)      // Port C write
11121079};
11131080
11141081/* Z80-STI Interface */
11151082
1116static READ8_DEVICE_HANDLER( grip_z80sti_gpio_r )
1083READ8_MEMBER( grip_state::sti_gpio_r )
11171084{
11181085   /*
11191086
r11033r11034
11301097
11311098    */
11321099
1133   prof80_state *state = device->machine().driver_data<prof80_state>();
1134
1135   return centronics_busy_r(state->m_centronics) << 3;
1100   return centronics_busy_r(m_centronics) << 3;
11361101}
11371102
1138static WRITE_LINE_DEVICE_HANDLER( grip_speaker_w )
1103WRITE_LINE_MEMBER( grip_state::speaker_w )
11391104{
1140   prof80_state *driver_state = device->machine().driver_data<prof80_state>();
1141   int level = state && ((driver_state->m_vol1 << 1) | driver_state->m_vol0);
1105   int level = state && ((m_vol1 << 1) | m_vol0);
11421106
1143   speaker_level_w(device, level);
1107   speaker_level_w(m_speaker, level);
11441108}
11451109
1146static Z80STI_INTERFACE( grip_z80sti_interface )
1110static Z80STI_INTERFACE( sti_intf )
11471111{
11481112   0,                                          /* serial receive clock */
11491113   0,                                          /* serial transmit clock */
11501114   DEVCB_CPU_INPUT_LINE(GRIP_Z80_TAG, INPUT_LINE_IRQ0),   /* interrupt */
1151   DEVCB_DEVICE_HANDLER(Z80STI_TAG, grip_z80sti_gpio_r),   /* GPIO read */
1115   DEVCB_DRIVER_MEMBER(grip_state, sti_gpio_r),         /* GPIO read */
11521116   DEVCB_NULL,                                    /* GPIO write */
11531117   DEVCB_NULL,                                    /* serial input */
11541118   DEVCB_NULL,                                    /* serial output */
11551119   DEVCB_NULL,                                    /* timer A output */
1156   DEVCB_DEVICE_LINE(SPEAKER_TAG, grip_speaker_w),         /* timer B output */
1120   DEVCB_DRIVER_LINE_MEMBER(grip_state, speaker_w),      /* timer B output */
11571121   DEVCB_LINE(z80sti_tc_w),                        /* timer C output */
11581122   DEVCB_LINE(z80sti_rc_w)                           /* timer D output */
11591123};
r11033r11034
11681132
11691133/* Machine Initialization */
11701134
1171static MACHINE_START( prof80 )
1135void prof80_state::machine_start()
11721136{
1173   prof80_state *state = machine.driver_data<prof80_state>();
1174
11751137   /* initialize RTC */
1176   state->m_rtc->cs_w(1);
1177   state->m_rtc->oe_w(1);
1138   m_rtc->cs_w(1);
1139   m_rtc->oe_w(1);
11781140
11791141   /* configure FDC */
1180   floppy_drive_set_index_pulse_callback(floppy_get_device(machine, 0), prof80_fdc_index_callback);
1142   floppy_drive_set_index_pulse_callback(m_floppy0, prof80_fdc_index_callback);
11811143
11821144   /* allocate floppy motor off timer */
1183   state->m_floppy_motor_off_timer = machine.scheduler().timer_alloc(FUNC(floppy_motor_off_tick));
1145   m_floppy_motor_off_timer = m_machine.scheduler().timer_alloc(FUNC(floppy_motor_off_tick));
11841146
11851147   /* bank switch */
1186   prof80_bankswitch(machine);
1148   bankswitch();
11871149
11881150   /* register for state saving */
1189   state->save_item(NAME(state->m_c0));
1190   state->save_item(NAME(state->m_c1));
1191   state->save_item(NAME(state->m_c2));
1192   state->save_item(NAME(state->m_mmu));
1193   state->save_item(NAME(state->m_init));
1194   state->save_item(NAME(state->m_fdc_index));
1195   state->save_item(NAME(state->m_gripd));
1196   state->save_item(NAME(state->m_gripc));
1151   save_item(NAME(m_c0));
1152   save_item(NAME(m_c1));
1153   save_item(NAME(m_c2));
1154   save_item(NAME(m_mmu));
1155   save_item(NAME(m_init));
1156   save_item(NAME(m_fdc_index));
1157   save_item(NAME(m_gripd));
1158   save_item(NAME(m_gripc));
11971159}
11981160
1199static MACHINE_RESET( prof80 )
1161void prof80_state::machine_reset()
12001162{
1201   prof80_state *state = machine.driver_data<prof80_state>();
1202
12031163   int i;
12041164
12051165   for (i = 0; i < 8; i++)
12061166   {
1207      ls259_w(machine, 0, i, 0, i);
1167      ls259_w(0, i, 0, i);
12081168   }
12091169
1210   state->m_gripc = 0x40;
1170   m_gripc = 0x40;
12111171}
12121172
1213static MACHINE_START( grip )
1173void grip_state::machine_start()
12141174{
1215   prof80_state *state = machine.driver_data<prof80_state>();
1175   prof80_state::machine_start();
12161176
1217   MACHINE_START_CALL(prof80);
1218
1219   /* find devices */
1220   state->m_mc6845 = machine.device(MC6845_TAG);
1221   state->m_ppi8255 = machine.device(I8255A_TAG);
1222   state->m_z80sti = machine.device(Z80STI_TAG);
1223   state->m_centronics = machine.device(CENTRONICS_TAG);
1224
12251177   /* allocate video RAM */
1226   state->m_video_ram = auto_alloc_array(machine, UINT8, GRIP_VIDEORAM_SIZE);
1178   m_video_ram = auto_alloc_array(m_machine, UINT8, GRIP_VIDEORAM_SIZE);
12271179
12281180   /* setup GRIP memory banking */
1229   memory_configure_bank(machine, "videoram", 0, 2, state->m_video_ram, 0x8000);
1230   memory_set_bank(machine, "videoram", 0);
1181   memory_configure_bank(m_machine, "videoram", 0, 2, m_video_ram, 0x8000);
1182   memory_set_bank(m_machine, "videoram", 0);
12311183
12321184   /* register for state saving */
1233   state->save_item(NAME(state->m_vol0));
1234   state->save_item(NAME(state->m_vol1));
1235   state->save_item(NAME(state->m_keydata));
1236   state->save_item(NAME(state->m_kbf));
1237   state->save_pointer(NAME(state->m_video_ram), GRIP_VIDEORAM_SIZE);
1238   state->save_item(NAME(state->m_lps));
1239   state->save_item(NAME(state->m_page));
1240   state->save_item(NAME(state->m_flash));
1185   save_item(NAME(m_vol0));
1186   save_item(NAME(m_vol1));
1187   save_item(NAME(m_keydata));
1188   save_item(NAME(m_kbf));
1189   save_pointer(NAME(m_video_ram), GRIP_VIDEORAM_SIZE);
1190   save_item(NAME(m_lps));
1191   save_item(NAME(m_page));
1192   save_item(NAME(m_flash));
12411193}
12421194
12431195static const floppy_config prof80_floppy_config =
r11033r11034
12521204   NULL
12531205};
12541206
1255static const INT16 speaker_levels[] = {-32768, 0, 32767, 0};
1207static const INT16 speaker_levels[] = { -32768, 0, 32767, 0 };
12561208
1257static const speaker_interface grip_speaker_interface =
1209static const speaker_interface speaker_intf =
12581210{
12591211   4,
12601212   speaker_levels
12611213};
12621214
1215static GENERIC_TERMINAL_INTERFACE( xor100_terminal_intf )
1216{
1217   DEVCB_NULL
1218};
1219
12631220/* Machine Drivers */
12641221
1265static MACHINE_CONFIG_START( prof80, prof80_state )
1222static MACHINE_CONFIG_START( common, prof80_state )
12661223    /* basic machine hardware */
12671224    MCFG_CPU_ADD(Z80_TAG, Z80, XTAL_6MHz)
12681225    MCFG_CPU_PROGRAM_MAP(prof80_mem)
12691226    MCFG_CPU_IO_MAP(prof80_io)
12701227
1271   MCFG_MACHINE_START(prof80)
1272   MCFG_MACHINE_RESET(prof80)
1273
12741228    /* video hardware */
12751229    MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
12761230    MCFG_SCREEN_REFRESH_RATE(50)
r11033r11034
12911245   MCFG_RAM_DEFAULT_SIZE("128K")
12921246MACHINE_CONFIG_END
12931247
1294static MACHINE_CONFIG_DERIVED( grip, prof80 )
1248static MACHINE_CONFIG_DERIVED( prof80, common )
1249   MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, xor100_terminal_intf)
1250MACHINE_CONFIG_END
1251
1252static MACHINE_CONFIG_DERIVED_CLASS( grip, common, grip_state )
12951253    /* basic machine hardware */
12961254    MCFG_CPU_MODIFY(Z80_TAG)
12971255    MCFG_CPU_IO_MAP(prof80_grip_io)
r11033r11034
13011259    MCFG_CPU_PROGRAM_MAP(grip_mem)
13021260    MCFG_CPU_IO_MAP(grip_io)
13031261
1304   MCFG_MACHINE_START(grip)
1305
13061262   /* keyboard hack */
13071263   MCFG_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, attotime::from_hz(50))
13081264
1309
1310    MCFG_VIDEO_START(grip)
1311   MCFG_SCREEN_MODIFY("screen")
1312    MCFG_SCREEN_UPDATE(grip)
1313
1314   MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_16MHz/4, grip_mc6845_interface)
1315
13161265   /* sound hardware */
13171266   MCFG_SPEAKER_STANDARD_MONO("mono")
13181267   MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0)
1319   MCFG_SOUND_CONFIG(grip_speaker_interface)
1268   MCFG_SOUND_CONFIG(speaker_intf)
13201269   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
13211270
13221271   /* devices */
1272   MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_16MHz/4, crtc_intf)
1273   MCFG_I8255A_ADD(I8255A_TAG, ppi_intf)
1274   MCFG_Z80STI_ADD(Z80STI_TAG, XTAL_16MHz/4, sti_intf)
13231275   MCFG_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics)
1324   MCFG_I8255A_ADD(I8255A_TAG, grip_ppi8255_interface)
1325   MCFG_Z80STI_ADD(Z80STI_TAG, XTAL_16MHz/4, grip_z80sti_interface)
13261276MACHINE_CONFIG_END
13271277
13281278static MACHINE_CONFIG_DERIVED( grip2, grip )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team