Previous 15994 Revisions Next

r5194 Thursday 9th July, 2009 at 21:04:36 UTC by Curt Coder
[PROF80] Refactored to use new I8255A device.
[I8255A] Fixed mode 2 port read.
[src/mess/drivers]prof80.c
[src/mess/machine]i8255a.c

src/mess/machine/i8255a.c
r5193r5194
353353   /* clear input buffer full flag */
354354   set_ibf(i8255a, PORT_A, 0);
355355
356   /* clear interrupt */
357   set_intr(i8255a, PORT_A, 0);
358
356359   return data;
357360}
358361
src/mess/drivers/prof80.c
r5193r5194
1313
1414   TODO:
1515
16   - PROF<>GRIP interface fails if IBFA is cleared after reading PA
1617   - keyboard
1718   - NE555 timeout is 10x too high
1819   - GRIP does not send keys back to PROF-80
r5193r5194
3334#include "cpu/z80/z80daisy.h"
3435#include "devices/basicdsk.h"
3536#include "video/mc6845.h"
36#include "machine/8255ppi.h"
37#include "machine/i8255a.h"
3738#include "machine/nec765.h"
3839#include "machine/upd1990a.h"
3940#include "machine/z80sti.h"
r5193r5194
126127               state->keydata = keydata;
127128
128129               /* trigger GRIP 8255 port C bit 2 (_STBB) */
129               ppi8255_set_port_c(state->ppi8255, 0x54);
130               ppi8255_set_port_c(state->ppi8255, 0x50);
131               ppi8255_set_port_c(state->ppi8255, 0x54);
130               i8255a_pc2_w(state->ppi8255, 0);
131               i8255a_pc2_w(state->ppi8255, 1);
132132               return;
133133            }
134134         }
r5193r5194
387387   prof80_state *state = space->machine->driver_data;
388388
389389   /* trigger GRIP 8255 port C bit 6 (_ACKA) */
390   ppi8255_set_port_c(state->ppi8255, 0x54);
391   ppi8255_set_port_c(state->ppi8255, 0x14);
392   ppi8255_set_port_c(state->ppi8255, 0x54);
390   i8255a_pc6_w(state->ppi8255, 0);
391   i8255a_pc6_w(state->ppi8255, 1);
393392
394393   return state->gripd;
395394}
r5193r5194
401400   state->gripd = data;
402401
403402   /* trigger GRIP 8255 port C bit 4 (_STBA) */
404   ppi8255_set_port_c(state->ppi8255, 0x54);
405   ppi8255_set_port_c(state->ppi8255, 0x44);
406   ppi8255_set_port_c(state->ppi8255, 0x54);
403   i8255a_pc4_w(state->ppi8255, 0);
404   i8255a_pc4_w(state->ppi8255, 1);
407405}
408406
409407/* GRIP */
r5193r5194
565563   AM_RANGE(0x52, 0x52) AM_DEVWRITE(MC6845_TAG, mc6845_register_w)
566564   AM_RANGE(0x53, 0x53) AM_DEVREAD(MC6845_TAG, mc6845_register_r)
567565   AM_RANGE(0x60, 0x60) AM_DEVWRITE("centronics", centronics_data_w)
568   AM_RANGE(0x70, 0x73) AM_DEVREADWRITE(PPI8255_TAG, ppi8255_r, ppi8255_w)
566   AM_RANGE(0x70, 0x73) AM_DEVREADWRITE(PPI8255_TAG, i8255a_r, i8255a_w)
569567//   AM_RANGE(0x80, 0x80) AM_WRITE(bl2out_w)
570568//   AM_RANGE(0x90, 0x90) AM_WRITE(gr2out_w)
571569//   AM_RANGE(0xa0, 0xa0) AM_WRITE(rd2out_w)
r5193r5194
600598   AM_RANGE(0x52, 0x52) AM_DEVWRITE(MC6845_TAG, mc6845_register_w)
601599   AM_RANGE(0x53, 0x53) AM_DEVREAD(MC6845_TAG, mc6845_register_r)
602600   AM_RANGE(0x60, 0x60) AM_DEVWRITE("centronics", centronics_data_w)
603   AM_RANGE(0x70, 0x73) AM_DEVREADWRITE(PPI8255_TAG, ppi8255_r, ppi8255_w)
601   AM_RANGE(0x70, 0x73) AM_DEVREADWRITE(PPI8255_TAG, i8255a_r, i8255a_w)
604602
605603//   AM_RANGE(0x80, 0x80) AM_WRITE(xrflgs_w)
606604//   AM_RANGE(0xc0, 0xc0) AM_WRITE(xrclrg_w)
r5193r5194
10371035   z80sti_i7_w(state->z80sti, BIT(data, 3));
10381036
10391037   /* PROF-80 handshaking */
1040   state->gripc = (!BIT(data, 7) << 7) | (!BIT(data, 5) << 6) | (ppi8255_get_port_a(state->ppi8255) & 0x3f);
1038   state->gripc = (!BIT(data, 7) << 7) | (!BIT(data, 5) << 6) | (i8255a_pa_r(state->ppi8255, 0) & 0x3f);
10411039}
10421040
1043static const ppi8255_interface grip_ppi8255_interface =
1041static I8255A_INTERFACE( grip_ppi8255_interface )
10441042{
10451043   DEVCB_HANDLER(grip_ppi8255_a_r),   // Port A read
10461044   DEVCB_HANDLER(grip_ppi8255_b_r),   // Port B read
r5193r5194
12171215   /* devices */
12181216   MDRV_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, prof80_upd1990a_intf)
12191217   MDRV_NEC765A_ADD(NEC765_TAG, prof80_nec765_interface)
1220   MDRV_PPI8255_ADD(PPI8255_TAG, grip_ppi8255_interface)
1218   MDRV_I8255A_ADD(PPI8255_TAG, grip_ppi8255_interface)
12211219   MDRV_Z80STI_ADD(Z80STI_TAG, XTAL_16MHz/4, grip_z80sti_interface)
12221220
12231221   /* printer */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team