Previous 15994 Revisions Next

r5200 Friday 10th July, 2009 at 08:50:30 UTC by Curt Coder
[SG1000] Refactored to use new I8255A device.
[src/mess/drivers]sg1000.c

src/mess/drivers/sg1000.c
r5199r5200
7373#include "machine/ctronics.h"
7474#include "includes/serial.h"
7575#include "machine/msm8251.h"
76#include "machine/8255ppi.h"
76#include "machine/i8255a.h"
7777#include "machine/nec765.h"
7878#include "sound/sn76496.h"
7979#include "video/tms9928a.h"
r5199r5200
168168   AM_RANGE(0x7f, 0x7f) AM_DEVWRITE(SN76489A_TAG, sn76496_w)
169169   AM_RANGE(0xbe, 0xbe) AM_READWRITE(TMS9928A_vram_r, TMS9928A_vram_w)
170170   AM_RANGE(0xbf, 0xbf) AM_READWRITE(TMS9928A_register_r, TMS9928A_register_w)
171   AM_RANGE(0xdc, 0xdf) AM_DEVREADWRITE("ppi8255", ppi8255_r, ppi8255_w)
171   AM_RANGE(0xdc, 0xdf) AM_DEVREADWRITE("ppi8255", i8255a_r, i8255a_w)
172172ADDRESS_MAP_END
173173
174174/* This is how the I/O ports are really mapped, but MAME does not support overlapping ranges
175175static ADDRESS_MAP_START( sc3000_io_map, ADDRESS_SPACE_IO, 8 )
176176   ADDRESS_MAP_GLOBAL_MASK(0xff)
177   AM_RANGE(0x00, 0x00) AM_MIRROR(0xdf) AM_DEVREADWRITE("ppi8255", ppi8255_r, ppi8255_w)
177   AM_RANGE(0x00, 0x00) AM_MIRROR(0xdf) AM_DEVREADWRITE("ppi8255", i8255a_r, i8255a_w)
178178   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7f) AM_WRITE(sn76496_0_w)
179179   AM_RANGE(0x00, 0x00) AM_MIRROR(0xae) AM_READWRITE(TMS9928A_vram_r, TMS9928A_vram_w)
180180   AM_RANGE(0x01, 0x01) AM_MIRROR(0xae) AM_READWRITE(TMS9928A_register_r, TMS9928A_register_w)
r5199r5200
194194   AM_RANGE(0x7f, 0x7f) AM_DEVWRITE(SN76489A_TAG, sn76496_w)
195195   AM_RANGE(0xbe, 0xbe) AM_READWRITE(TMS9928A_vram_r, TMS9928A_vram_w)
196196   AM_RANGE(0xbf, 0xbf) AM_READWRITE(TMS9928A_register_r, TMS9928A_register_w)
197   AM_RANGE(0xdc, 0xdf) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w)
197   AM_RANGE(0xdc, 0xdf) AM_DEVREADWRITE("ppi8255_0", i8255a_r, i8255a_w)
198198   AM_RANGE(0xe0, 0xe0) AM_DEVREAD(NEC765_TAG, nec765_status_r)
199199   AM_RANGE(0xe1, 0xe1) AM_DEVREADWRITE(NEC765_TAG, nec765_data_r, nec765_data_w)
200   AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w)
200   AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("ppi8255_1", i8255a_r, i8255a_w)
201201   AM_RANGE(0xe8, 0xe8) AM_DEVREADWRITE("uart", msm8251_data_r, msm8251_data_w)
202202   AM_RANGE(0xe9, 0xe9) AM_DEVREADWRITE("uart", msm8251_status_r, msm8251_control_w)
203203ADDRESS_MAP_END
r5199r5200
567567   /* printer */
568568}
569569
570static const ppi8255_interface sc3000_ppi8255_intf =
570static I8255A_INTERFACE( sc3000_ppi8255_intf )
571571{
572572   DEVCB_HANDLER(sc3000_ppi8255_a_r),   // Port A read
573573   DEVCB_HANDLER(sc3000_ppi8255_b_r),   // Port B read
r5199r5200
657657   centronics_strobe_w(printer, BIT(data, 7));
658658}
659659
660static const ppi8255_interface sf7000_ppi8255_intf[2] =
660static const i8255a_interface sf7000_ppi8255_intf[2] =
661661{
662662   {
663663      DEVCB_HANDLER(sc3000_ppi8255_a_r),      // Port A read
r5199r5200
880880
881881   MDRV_MACHINE_START( sc3000 )
882882
883   MDRV_PPI8255_ADD( "ppi8255", sc3000_ppi8255_intf ) // uPD9255AC-2
883   MDRV_I8255A_ADD( "ppi8255", sc3000_ppi8255_intf ) // uPD9255AC-2
884884
885885    /* video hardware */
886886   MDRV_IMPORT_FROM(tms9928a)
r5199r5200
918918   MDRV_MACHINE_START( sf7000 )
919919   MDRV_MACHINE_RESET( sf7000 )
920920
921   MDRV_PPI8255_ADD("ppi8255_0", sf7000_ppi8255_intf[0])
922   MDRV_PPI8255_ADD("ppi8255_1", sf7000_ppi8255_intf[1])
921   MDRV_I8255A_ADD("ppi8255_0", sf7000_ppi8255_intf[0])
922   MDRV_I8255A_ADD("ppi8255_1", sf7000_ppi8255_intf[1])
923923
924924    /* video hardware */
925925   MDRV_IMPORT_FROM(tms9928a)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team