Previous 15994 Revisions Next

r5650 Tuesday 8th September, 2009 at 17:16:25 UTC by Angelo Salese
[X1]: Basic ctc hook-up, adds sound in Space Harrier
[src/mess/drivers]x1.c

src/mess/drivers/x1.c
r5649r5650
536536   return ret;
537537}
538538
539static UINT8 x1_irq_vector;
540//static UINT8 ctc_irq_vector; //always 0x5e?
539541static UINT8 key_irq_vector;
540542static UINT8 cmt_current_cmd;
541543static UINT8 cmt_test;
r5649r5650
10311033{
10321034   io_bank_mode = 0; //any read disables the extended mode.
10331035
1034   if(offset >= 0x0704 && offset <= 0x0707)         { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x0704); }
1035   else if(offset == 0x0e03)                       { return x1_rom_r(space, 0); }
1036   //if(offset >= 0x0704 && offset <= 0x0707)      { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x0704); }
1037   if(offset == 0x0e03)                          { return x1_rom_r(space, 0); }
10361038   else if(offset >= 0x0ff8 && offset <= 0x0fff)   { return x1_fdc_r(space, offset-0xff8); }
10371039   else if(offset >= 0x1400 && offset <= 0x17ff)   { return x1_pcg_r(space, offset-0x1400); }
10381040   else if(offset >= 0x1900 && offset <= 0x19ff)   { return sub_io_r(space, 0); }
r5649r5650
10561058static WRITE8_HANDLER( x1_io_w )
10571059{
10581060   if(io_bank_mode == 1)                           { x1_ex_gfxram_w(space, offset, data); }
1059   else if(offset >= 0x0704 && offset <= 0x0707)   { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x0704,data); }
1061//   else if(offset >= 0x0704 && offset <= 0x0707)   { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x0704,data); }
10601062//   else if(offset >= 0x0c00 && offset <= 0x0cff)   { x1_rs232c_w(space->machine, 0, data); }
10611063   else if(offset >= 0x0e00 && offset <= 0x0e02)     { x1_rom_w(space, offset-0xe00,data); }
10621064//   else if(offset >= 0x0e80 && offset <= 0x0e82)   { x1_kanji_w(space->machine, offset-0xe80,data); }
r5649r5650
12131215
12141216//   if(cassette_get_state(devtag_get_device(device->machine,"cass")) & CASSETTE_MOTOR_DISABLED)
12151217//      dat &= ~0x02;  // is zero if not playing
1216     
1218
12171219   if(cmt_test != 0)
12181220   {
12191221      dat |= 0x01;
r5649r5650
16631665
16641666static void ctc0_interrupt(const device_config *device, int state)
16651667{
1666   //cputag_set_input_line(device->machine, "maincpu", 0, state);
1668   x1_irq_vector = 0x5e;
1669   cputag_set_input_line(device->machine, "maincpu", 0, state);
16671670}
16681671
16691672
r5649r5650
16711674{
16721675   0,               // timer disables
16731676   ctc0_interrupt,      // interrupt handler
1674   0,               // ZC/TO0 callback
1675   0,               // ZC/TO1 callback
1676   0,               // ZC/TO2 callback
1677   z80ctc_trg0_w,      // ZC/TO0 callback
1678   z80ctc_trg1_w,      // ZC/TO1 callback
1679   z80ctc_trg2_w,      // ZC/TO2 callback
16771680};
16781681
16791682/*************************************
r5649r5650
17021705
17031706static INTERRUPT_GEN( x1_vbl )
17041707{
1705//   pcg_reset = 1;
1708   //...
17061709}
17071710
17081711static IRQ_CALLBACK(x1_irq_callback)
17091712{
17101713   cpu_set_input_line(device, 0, CLEAR_LINE);
1711   return key_irq_vector;
1714   return x1_irq_vector;
17121715}
17131716
17141717static TIMER_CALLBACK(keyboard_callback)
r5649r5650
17261729      {
17271730         // generate keyboard IRQ
17281731         sub_io_w(space,0,0xe6);
1732         x1_irq_vector = key_irq_vector;
17291733         cputag_set_input_line(machine,"maincpu",0,ASSERT_LINE);
17301734         old_key1 = key1;
17311735         old_key2 = key2;
r5649r5650
18541858   MDRV_CPU_MODIFY("maincpu")
18551859   MDRV_CPU_IO_MAP(x1turbo_io)
18561860
1857   MDRV_SOUND_ADD("ym", YM2151, XTAL_4MHz/4) //unknown clock / divider
1861   MDRV_SOUND_ADD("ym", YM2151, XTAL_4MHz) //unknown clock / divider
18581862//   MDRV_SOUND_CONFIG(ay8910_config)
18591863   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
18601864MACHINE_DRIVER_END
r5649r5650
18711875      TRACKS([40])
18721876      SECTORS([16])
18731877      SECTOR_LENGTH([256])
1874      FIRST_SECTOR_ID([1]))   
1878      FIRST_SECTOR_ID([1]))
18751879FLOPPY_OPTIONS_END
18761880
18771881

Previous 15994 Revisions Next


© 1998-2018 The MESS Team