Previous 15994 Revisions Next

r4944 Friday 5th June, 2009 at 08:58:30 UTC by Curt Coder
[PROF80] Added PROF-GRIP communications and video drawing.
[src/mess/drivers]prof80.c
[src/mess/includes]prof80.h

src/mess/includes/prof80.h
r4943r4944
2424   UINT8 *video_ram;      /* video RAM */
2525   int vsync;            /* vertical sync */
2626   int lps;            /* light pen sense */
27   int page;            /* video page */
2728
2829   /* clock state */
2930   int rtc_data;         /* RTC data output */
r4943r4944
3132   /* floppy state */
3233   int   fdc_index;         /* floppy index hole sensor */
3334
35   /* ECB bus state */
36   UINT8 ecb_data;         /* ECB bus data */
37   UINT8 ecb_status;      /* ECB bus status */
38
3439   /* devices */
3540   const device_config *nec765;
3641   const device_config *upd1990a;
3742   const device_config *mc6845;
43   const device_config *ppi8255;
3844   const device_config *centronics;
3945};
4046
src/mess/drivers/prof80.c
r4943r4944
11/*
22
33   PROF-80 (Prozessor RAM-Floppy Kontroller)
4   GRIP-1/2/3 (Grafik-Interface-Prozessor)
4   GRIP-1/2/3/5 (Grafik-Interface-Prozessor)
55
66   http://www.prof80.de/
77   http://oldcomputers.dyndns.org/public/pub/rechner/conitec/info.html
r4943r4944
1313   TODO:
1414
1515   - Z80 STI
16   - everything
17
16   - PROF-GRIP communications
17   - UNIO card (Z80-STI, Z80-SIO, 2x centronics)
18   - GRIP-COLOR (192kB color RAM)
19   - GRIP 1/2/3/5 selection
20   
1821*/
1922
2023#include "driver.h"
r4943r4944
227230
228231static WRITE8_HANDLER( fdc_w )
229232{
233   prof80_state *state = space->machine->driver_data;
234
235   nec765_data_w(state->nec765, 0, data);
230236}
231237
232238static READ8_HANDLER( fdc_r )
233239{
234   return 0;
240   prof80_state *state = space->machine->driver_data;
241
242   UINT8 data = nec765_data_r(state->nec765, 0);
243   data = nec765_status_r(state->nec765, 0); // TODO how to choose which read?
244
245   return data;
235246}
236247
237248static WRITE8_HANDLER( mmu_w )
r4943r4944
251262
252263static WRITE8_HANDLER( page_w )
253264{
254   memory_set_bank(space->machine, 17, BIT(data, 7));
265   prof80_state *state = space->machine->driver_data;
266
267   state->page = BIT(data, 7);
268
269   memory_set_bank(space->machine, 17, state->page);
255270}
256271
257272static READ8_HANDLER( grip_status_r )
r4943r4944
310325   centronics_strobe_w(state->centronics, 1);
311326}
312327
328static READ8_HANDLER( gripc_r )
329{
330   prof80_state *state = space->machine->driver_data;
331
332   return state->ecb_status;
333}
334
335static READ8_HANDLER( gripd_r )
336{
337   prof80_state *state = space->machine->driver_data;
338
339   /* trigger GRIP 8255 port C */
340   ppi8255_set_port_c(state->ppi8255, 0x44);
341
342   return state->ecb_data;
343}
344
345static WRITE8_HANDLER( gripd_w )
346{
347   prof80_state *state = space->machine->driver_data;
348
349   state->ecb_data = data;
350
351   /* trigger GRIP 8255 port C */
352   ppi8255_set_port_c(state->ppi8255, 0x14);
353}
354
313355/* Memory Maps */
314356
315357static ADDRESS_MAP_START( prof80_mem, ADDRESS_SPACE_PROGRAM, 8 )
r4943r4944
332374ADDRESS_MAP_END
333375
334376static ADDRESS_MAP_START( prof80_io, ADDRESS_SPACE_IO, 8 )
377//   AM_RANGE(0x80, 0x8f) AM_MIRROR(0xff00) AM_DEVREADWRITE(Z80STI_TAG, z80sti_r, z80sti_w)
378//   AM_RANGE(0x94, 0x95) AM_MIRROR(0xff00) AM_DEVREADWRITE(Z80SIO_TAG, z80sio_d_r, z80sio_d_w)
379//   AM_RANGE(0x96, 0x97) AM_MIRROR(0xff00) AM_DEVREADWRITE(Z80SIO_TAG, z80sio_c_r, z80sio_c_w)
380//   AM_RANGE(0x9e, 0x9e) AM_MIRROR(0xff00) AM_WRITE(unio_w) (4=_STB1, 6=_STB2, 8=INIT)
381//   AM_RANGE(0x9c, 0x9c) AM_MIRROR(0xff00) AM_DEVWRITE("centronics1", centronics_data_w)
382//   AM_RANGE(0x9d, 0x9d) AM_MIRROR(0xff00) AM_DEVWRITE("centronics2", centronics_data_w)
383   AM_RANGE(0xc0, 0xc0) AM_MIRROR(0xff00) AM_READ(gripc_r)
384   AM_RANGE(0xc1, 0xc1) AM_MIRROR(0xff00) AM_READWRITE(gripd_r, gripd_w)
335385   AM_RANGE(0xd8, 0xd8) AM_MIRROR(0xff00) AM_WRITE(flr_w)
336386   AM_RANGE(0xda, 0xda) AM_MIRROR(0xff00) AM_READ(status_r)
337387   AM_RANGE(0xdb, 0xdb) AM_MIRROR(0xff00) AM_READ(status2_r)
r4943r4944
347397ADDRESS_MAP_END
348398
349399static ADDRESS_MAP_START( grip_io, ADDRESS_SPACE_IO, 8 )
400   ADDRESS_MAP_GLOBAL_MASK(0xff)
350401   AM_RANGE(0x00, 0x00) AM_READWRITE(stb_r, stb_w)
351402//   AM_RANGE(0x10, 0x10) AM_WRITE(cc3_w)
352403//   AM_RANGE(0x11, 0x11) AM_WRITE(vol0_w)
r4943r4944
375426
376427static MC6845_UPDATE_ROW( grip_update_row )
377428{
429   prof80_state *state = device->machine->driver_data;
430   int column, bit;
431
432   for (column = 0; column < x_count; column++)
433   {
434      UINT16 address = (state->page << 12) | ((ma + column) << 3) | (ra & 0x07);
435      UINT8 data = state->video_ram[address];
436
437      for (bit = 0; bit < 8; bit++)
438      {
439         int x = (column * 8) + bit;
440         *BITMAP_ADDR16(bitmap, y, x) = BIT(data, 7);
441         data <<= 1;
442      }
443   }
378444}
379445
380446static MC6845_ON_VSYNC_CHANGED( grip_vsync_changed )
r4943r4944
443509
444510/* PPI8255 Interface */
445511
512static READ8_DEVICE_HANDLER( grip_ppi8255_a_r )
513{
514   /*
515
516        bit      description
517
518        PA0     ECB bus
519        PA1     ECB bus
520        PA2     ECB bus
521        PA3     ECB bus
522        PA4     ECB bus
523        PA5     ECB bus
524        PA6     ECB bus
525        PA7     ECB bus
526   
527   */
528
529   prof80_state *state = device->machine->driver_data;
530
531   return state->ecb_data;
532}
533
534static WRITE8_DEVICE_HANDLER( grip_ppi8255_a_w )
535{
536   /*
537
538        bit      description
539
540        PA0     ECB bus
541        PA1     ECB bus
542        PA2     ECB bus
543        PA3     ECB bus
544        PA4     ECB bus
545        PA5     ECB bus
546        PA6     ECB bus
547        PA7     ECB bus
548   
549   */
550
551   prof80_state *state = device->machine->driver_data;
552
553   state->ecb_data = data;
554}
555
556static READ8_DEVICE_HANDLER( grip_ppi8255_b_r )
557{
558   /*
559
560        bit      description
561
562        PB0     Keyboard input
563        PB1     Keyboard input
564        PB2     Keyboard input
565        PB3     Keyboard input
566        PB4     Keyboard input
567        PB5     Keyboard input
568        PB6     Keyboard input
569        PB7     Keyboard input
570   
571   */
572
573   return 0;
574}
575
576static READ8_DEVICE_HANDLER( grip_ppi8255_c_r )
577{
578   /*
579
580        bit      signal      description
581
582        PC0     STI I4
583        PC1     KBF
584        PC2     _KBSTB
585        PC3     STI I7
586        PC4               1 when PROF-80 reads port 0xc0
587        PC5     PA6
588        PC6               1 when PROF-80 writes port 0xc0
589        PC7     PA7
590   
591   */
592
593   return 0x04;
594}
595
596static WRITE8_DEVICE_HANDLER( grip_ppi8255_c_w )
597{
598   /*
599
600        bit      signal      description
601
602        PC0     STI I4
603        PC1     KBF
604        PC2     _KBSTB
605        PC3     STI I7
606        PC4               1 when PROF-80 reads port 0xc0
607        PC5     PA6
608        PC6               1 when PROF-80 writes port 0xc0
609        PC7     PA7
610   
611   */
612
613   prof80_state *state = device->machine->driver_data;
614
615   state->ecb_status = (BIT(data, 7) << 7) | (BIT(data, 5) << 6);
616}
617
446618static const ppi8255_interface grip_ppi8255_interface =
447619{
448   DEVCB_NULL,   // Port A read
449   DEVCB_NULL,   // Port B read
450   DEVCB_NULL,   // Port C read
451   DEVCB_NULL,   // Port A write
452   DEVCB_NULL,   // Port B write
453   DEVCB_NULL,   // Port C write
620   DEVCB_HANDLER(grip_ppi8255_a_r),   // Port A read
621   DEVCB_HANDLER(grip_ppi8255_b_r),   // Port B read
622   DEVCB_HANDLER(grip_ppi8255_c_r),   // Port C read
623   DEVCB_HANDLER(grip_ppi8255_a_w),   // Port A write
624   DEVCB_NULL,                     // Port B write
625   DEVCB_HANDLER(grip_ppi8255_c_w)      // Port C write
454626};
455627
456628/* Machine Initialization */
r4943r4944
464636   state->nec765 = devtag_get_device(machine, NEC765_TAG);
465637   state->upd1990a = devtag_get_device(machine, UPD1990A_TAG);
466638   state->mc6845 = devtag_get_device(machine, MC6845_TAG);
639   state->ppi8255 = devtag_get_device(machine, PPI8255_TAG);
467640   state->centronics = devtag_get_device(machine, "centronics");
468641
469642   /* initialize RTC */
r4943r4944
535708    MDRV_SCREEN_SIZE(640, 480)
536709    MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 479)
537710    MDRV_PALETTE_LENGTH(2)
711    MDRV_PALETTE_INIT(black_and_white)
538712 
539713    MDRV_VIDEO_START(prof80)
540714    MDRV_VIDEO_UPDATE(prof80)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team