Previous 15994 Revisions Next

r10980 Tuesday 29th March, 2011 at 21:16:56 UTC by Angelo Salese
[X1]: Changed z80sio to z80dart, in preparation of adding mouse support
[src/mess/drivers]x1.c

src/mess/drivers/x1.c
r10979r10980
209209#include "cpu/z80/z80.h"
210210#include "cpu/z80/z80daisy.h"
211211#include "machine/z80ctc.h"
212#include "machine/z80sio.h"
212//#include "machine/z80sio.h"
213#include "machine/z80dart.h"
213214#include "machine/i8255a.h"
214215#include "machine/z80dma.h"
215216#include "sound/ay8910.h"
r10979r10980
225226#include "formats/x1_tap.h"
226227#include "imagedev/cartslot.h"
227228#include "includes/x1.h"
228//#include <ctype.h>
229229
230230#define MAIN_CLOCK XTAL_16MHz
231231#define VDP_CLOCK  XTAL_42_9545MHz
r10979r10980
17681768   else if(offset >= 0x1a00 && offset <= 0x1aff)   { return i8255a_r(space->machine->device("ppi8255_0"), (offset-0x1a00) & 3); }
17691769   else if(offset >= 0x1b00 && offset <= 0x1bff)   { return ay8910_r(space->machine->device("ay"), 0); }
17701770   else if(offset >= 0x1f80 && offset <= 0x1f8f)   { return z80dma_r(space->machine->device("dma"), 0); }
1771   else if(offset >= 0x1f90 && offset <= 0x1f91)   { return z80sio_c_r(space->machine->device("sio"), (offset-0x1f90) & 1); }
1772   else if(offset >= 0x1f92 && offset <= 0x1f93)   { return z80sio_d_r(space->machine->device("sio"), (offset-0x1f92) & 1); }
1771   else if(offset >= 0x1f90 && offset <= 0x1f93)   { return z80dart_ba_cd_r(space->machine->device("sio"), (offset-0x1f90) & 3); }
17731772   else if(offset >= 0x1f98 && offset <= 0x1f9f)   { printf("Extended SIO/CTC read %04x\n",offset); return 0xff; }
17741773   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { return z80ctc_r(space->machine->device("ctc"), offset-0x1fa0); }
17751774   else if(offset >= 0x1fa8 && offset <= 0x1fab)   { return z80ctc_r(space->machine->device("ctc"), offset-0x1fa8); }
r10979r10980
18241823   else if(offset >= 0x1d00 && offset <= 0x1dff)   { rom_bank_1_w(space,0,data); }
18251824   else if(offset >= 0x1e00 && offset <= 0x1eff)   { rom_bank_0_w(space,0,data); }
18261825   else if(offset >= 0x1f80 && offset <= 0x1f8f)   { z80dma_w(space->machine->device("dma"), 0,data); }
1827   else if(offset >= 0x1f90 && offset <= 0x1f91)   { z80sio_c_w(space->machine->device("sio"), (offset-0x1f90) & 1,data); }
1828   else if(offset >= 0x1f92 && offset <= 0x1f93)   { z80sio_d_w(space->machine->device("sio"), (offset-0x1f92) & 1,data); }
1826   else if(offset >= 0x1f90 && offset <= 0x1f93)   { z80dart_ba_cd_w(space->machine->device("sio"), (offset-0x1f90) & 3,data); }
18291827   else if(offset >= 0x1f98 && offset <= 0x1f9f)   { printf("Extended SIO/CTC write %04x %02x\n",offset,data); }
18301828   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { z80ctc_w(space->machine->device("ctc"), offset-0x1fa0,data); }
18311829   else if(offset >= 0x1fa8 && offset <= 0x1fab)   { z80ctc_w(space->machine->device("ctc"), offset-0x1fa8,data); }
r10979r10980
23642362   DEVCB_LINE(z80ctc_trg2_w),      // ZC/TO2 callback
23652363};
23662364
2365#if 0
23672366static const z80sio_interface sio_intf =
23682367{
23692368   0,               /* interrupt handler */
r10979r10980
23732372   0,               /* transmit handler */
23742373   0               /* receive handler */
23752374};
2375#endif
23762376
2377
2378static Z80DART_INTERFACE( sio_intf )
2379{
2380   0, 0, 0, 0,
2381
2382   DEVCB_NULL,
2383   DEVCB_NULL,
2384   DEVCB_NULL,
2385   DEVCB_NULL,
2386   DEVCB_NULL,
2387   DEVCB_NULL,
2388
2389   DEVCB_NULL,
2390   DEVCB_NULL,
2391   DEVCB_NULL,
2392   DEVCB_NULL,
2393   DEVCB_NULL,
2394   DEVCB_NULL,
2395
2396   DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0)
2397};
2398
23772399static const z80_daisy_config x1_daisy[] =
23782400{
23792401    { "x1kb" },
r10979r10980
23862408    { "x1kb" },
23872409   { "ctc" },
23882410   { "dma" },
2389//  { "sio" },
2411   { "sio" },
23902412   { NULL }
23912413};
23922414
r10979r10980
26822704
26832705   MCFG_MACHINE_RESET(x1turbo)
26842706
2685   MCFG_Z80SIO_ADD( "sio", MAIN_CLOCK/4 , sio_intf )
2707//   MCFG_Z80SIO_ADD( "sio", MAIN_CLOCK/4 , sio_intf )
2708   MCFG_Z80SIO0_ADD("sio", MAIN_CLOCK/4 , sio_intf )
26862709   MCFG_Z80DMA_ADD( "dma", MAIN_CLOCK/4 , x1_dma )
26872710
26882711   MCFG_DEVICE_REMOVE("fdc")

Previous 15994 Revisions Next


© 1998-2018 The MESS Team