Previous 15994 Revisions Next

r5652 Tuesday 8th September, 2009 at 21:57:32 UTC by Angelo Salese
[X1]: Reverted last commit since it breaks some games booting
[src/mess/drivers]x1.c

src/mess/drivers/x1.c
r5651r5652
139139#include "driver.h"
140140#include "cpu/z80/z80.h"
141141#include "machine/z80ctc.h"
142#include "machine/z80sio.h"
142143#include "machine/8255ppi.h"
143144#include "sound/ay8910.h"
144145#include "video/mc6845.h"
r5651r5652
10401041   else if(offset >= 0x1900 && offset <= 0x19ff)   { return sub_io_r(space, 0); }
10411042   else if(offset >= 0x1a00 && offset <= 0x1aff)   { return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), (offset-0x1a00) & 3); }
10421043   else if(offset >= 0x1b00 && offset <= 0x1bff)   { return ay8910_r(devtag_get_device(space->machine, "ay"), 0); }
1043//   else if(offset >= 0x1f90 && offset <= 0x1f93)   { return x1_sio_r(space,(offset-0x1f90) & 3); }
1044   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa3); }
1044   else if(offset >= 0x1f90 && offset <= 0x1f91)   { return z80sio_c_r(devtag_get_device(space->machine, "sio"), (offset-0x1f90) & 1); }
1045   else if(offset >= 0x1f92 && offset <= 0x1f93)   { return z80sio_d_r(devtag_get_device(space->machine, "sio"), (offset-0x1f92) & 1); }
1046   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa0); }
10451047   else if(offset >= 0x1fa8 && offset <= 0x1fab)   { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa8); }
10461048//   else if(offset >= 0x1fd0 && offset <= 0x1fdf)   { return x1_scrn_r(space,offset-0x1fd0); }
10471049   else if(offset == 0x1fe0)                  { return x1_blackclip_r(space,0); }
r5651r5652
10761078   else if(offset >= 0x1d00 && offset <= 0x1dff)   { rom_bank_1_w(space,0,data); }
10771079   else if(offset >= 0x1e00 && offset <= 0x1eff)   { rom_bank_0_w(space,0,data); }
10781080   else if(offset >= 0x1f80 && offset <= 0x1f8f)   { x1_dma_w(space,offset-0x1f80,data); }
1079//   else if(offset >= 0x1f90 && offset <= 0x1f93)   { x1_sio_w(space->machine,(offset-0x1f90) & 3),data; }
1080   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa3,data); }
1081   else if(offset >= 0x1f90 && offset <= 0x1f91)   { z80sio_c_w(devtag_get_device(space->machine, "sio"), (offset-0x1f90) & 1,data); }
1082   else if(offset >= 0x1f92 && offset <= 0x1f93)   { z80sio_d_w(devtag_get_device(space->machine, "sio"), (offset-0x1f92) & 1,data); }
1083   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa0,data); }
10811084   else if(offset >= 0x1fa8 && offset <= 0x1fab)   { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa8,data); }
10821085   else if(offset == 0x1fb0)                  { x1turbo_pal_w(space,0,data); }
10831086   else if(offset >= 0x1fb9 && offset <= 0x1fbf)   { x1turbo_txpal_w(space,offset-0x1fb9,data); }
r5651r5652
11061109   else if(offset >= 0x1900 && offset <= 0x19ff)   { return sub_io_r(space, 0); }
11071110   else if(offset >= 0x1a00 && offset <= 0x1aff)   { return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), (offset-0x1a00) & 3); }
11081111   else if(offset >= 0x1b00 && offset <= 0x1bff)   { return ay8910_r(devtag_get_device(space->machine, "ay"), 0); }
1109//   else if(offset >= 0x1f90 && offset <= 0x1f93)   { return x1_sio_r(space,(offset-0x1f90) & 3); }
1110   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa3); }
1112   else if(offset >= 0x1f90 && offset <= 0x1f91)   { return z80sio_c_r(devtag_get_device(space->machine, "sio"), (offset-0x1f90) & 1); }
1113   else if(offset >= 0x1f92 && offset <= 0x1f93)   { return z80sio_d_r(devtag_get_device(space->machine, "sio"), (offset-0x1f92) & 1); }
1114   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa0); }
11111115   else if(offset >= 0x1fa8 && offset <= 0x1fab)   { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa8); }
11121116//   else if(offset >= 0x1fd0 && offset <= 0x1fdf)   { return x1_scrn_r(space,offset-0x1fd0); }
11131117   else if(offset == 0x1fe0)                  { return x1_blackclip_r(space,0); }
r5651r5652
11431147   else if(offset >= 0x1d00 && offset <= 0x1dff)   { rom_bank_1_w(space,0,data); }
11441148   else if(offset >= 0x1e00 && offset <= 0x1eff)   { rom_bank_0_w(space,0,data); }
11451149   else if(offset >= 0x1f80 && offset <= 0x1f8f)   { x1_dma_w(space,offset-0x1f80,data); }
1146//   else if(offset >= 0x1f90 && offset <= 0x1f93)   { x1_sio_w(space->machine,(offset-0x1f90) & 3),data; }
1147   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa3,data); }
1150   else if(offset >= 0x1f90 && offset <= 0x1f91)   { z80sio_c_w(devtag_get_device(space->machine, "sio"), (offset-0x1f90) & 1,data); }
1151   else if(offset >= 0x1f92 && offset <= 0x1f93)   { z80sio_d_w(devtag_get_device(space->machine, "sio"), (offset-0x1f92) & 1,data); }
1152   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa0,data); }
11481153   else if(offset >= 0x1fa8 && offset <= 0x1fab)   { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa8,data); }
11491154   else if(offset == 0x1fb0)                  { x1turbo_pal_w(space,0,data); }
11501155   else if(offset >= 0x1fb9 && offset <= 0x1fbf)   { x1turbo_txpal_w(space,offset-0x1fb9,data); }
r5651r5652
16651670
16661671static void ctc0_interrupt(const device_config *device, int state)
16671672{
1668   x1_irq_vector = 0x5e;
1669   cputag_set_input_line(device->machine, "maincpu", 0, state);
1673   //x1_irq_vector = 0x5e;
1674   //cputag_set_input_line(device->machine, "maincpu", 0, state);
16701675}
16711676
16721677
r5651r5652
16791684   z80ctc_trg2_w,      // ZC/TO2 callback
16801685};
16811686
1687static const z80sio_interface sio_intf =
1688{
1689   0,               /* interrupt handler */
1690   0,               /* DTR changed handler */
1691   0,               /* RTS changed handler */
1692   0,               /* BREAK changed handler */
1693   0,               /* transmit handler */
1694   0               /* receive handler */
1695};
1696
1697
16821698/*************************************
16831699 *
16841700 *  Sound HW Config
r5651r5652
18161832   MDRV_CPU_VBLANK_INT("screen", x1_vbl)
18171833
18181834   MDRV_Z80CTC_ADD( "ctc", XTAL_4MHz , ctc_intf )
1835   MDRV_Z80SIO_ADD( "sio", XTAL_4MHz , sio_intf )
18191836
1837   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf )
1838
18201839   MDRV_MACHINE_RESET(x1)
18211840
1822   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf )
1823
18241841   /* video hardware */
18251842   MDRV_SCREEN_ADD("screen", RASTER)
18261843   MDRV_SCREEN_REFRESH_RATE(60)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team