trunk/src/mame/drivers/vlc.c
| r23634 | r23635 | |
| 131 | 131 | |
| 132 | 132 | #include "emu.h" |
| 133 | 133 | #include "cpu/m68000/m68000.h" |
| 134 | | #include "machine/68681.h" |
| 134 | #include "machine/n68681.h" |
| 135 | 135 | #include "video/mc6845.h" |
| 136 | 136 | #include "sound/ay8910.h" |
| 137 | 137 | #include "machine/msm6242.h" |
| r23634 | r23635 | |
| 150 | 150 | public: |
| 151 | 151 | nevada_state(const machine_config &mconfig, device_type type, const char *tag) |
| 152 | 152 | : driver_device(mconfig, type, tag), |
| 153 | m_duart18_68681(*this, "duart18_68681"), |
| 154 | m_duart39_68681(*this, "duart39_68681"), |
| 155 | m_duart40_68681(*this, "duart40_68681"), |
| 153 | 156 | m_maincpu(*this,"maincpu"), |
| 154 | 157 | m_microtouch(*this,"microtouch"), |
| 155 | 158 | m_nvram(*this, "nvram"), |
| 156 | 159 | m_backup(*this, "backup") |
| 157 | 160 | { } |
| 158 | 161 | |
| 159 | | DECLARE_WRITE8_MEMBER(microtouch_tx); |
| 160 | | device_t *m_duart18_68681; |
| 161 | | device_t *m_duart39_68681; |
| 162 | | device_t *m_duart40_68681; |
| 162 | required_device<duartn68681_device> m_duart18_68681; |
| 163 | required_device<duartn68681_device> m_duart39_68681; |
| 164 | required_device<duartn68681_device> m_duart40_68681; |
| 163 | 165 | |
| 164 | 166 | required_device<cpu_device> m_maincpu; |
| 165 | | optional_device<microtouch_device> m_microtouch; |
| 167 | optional_device<microtouch_serial_device> m_microtouch; |
| 166 | 168 | |
| 167 | 169 | required_shared_ptr<UINT16> m_nvram; |
| 168 | 170 | required_shared_ptr<UINT16> m_backup; |
| r23634 | r23635 | |
| 178 | 180 | UINT32 screen_update_nevada(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 179 | 181 | virtual void palette_init(); |
| 180 | 182 | |
| 183 | DECLARE_WRITE_LINE_MEMBER(duart18_irq_handler); |
| 184 | DECLARE_WRITE_LINE_MEMBER(duart39_irq_handler); |
| 185 | DECLARE_WRITE_LINE_MEMBER(duart40_irq_handler); |
| 181 | 186 | DECLARE_WRITE_LINE_MEMBER(nevada_rtc_irq); |
| 182 | 187 | DECLARE_READ16_MEMBER(io_board_r); |
| 183 | 188 | DECLARE_WRITE16_MEMBER(io_board_w); |
| r23634 | r23635 | |
| 339 | 344 | Interrupt 4 |
| 340 | 345 | ***************************************************************************/ |
| 341 | 346 | |
| 342 | | static void duart18_irq_handler(device_t *device, int state, UINT8 vector ) |
| 347 | WRITE_LINE_MEMBER(nevada_state::duart18_irq_handler) |
| 343 | 348 | { |
| 344 | | nevada_state *drvstate = device->machine().driver_data<nevada_state>(); |
| 345 | | drvstate->m_maincpu->set_input_line_and_vector(4, state, vector); |
| 349 | m_maincpu->set_input_line_and_vector(4, state, m_duart18_68681->get_irq_vector()); |
| 346 | 350 | }; |
| 347 | 351 | |
| 348 | 352 | /***************************************************************************/ |
| 349 | | static void duart18_tx(device_t *device, int channel, UINT8 data) |
| 350 | | { |
| 351 | | // nevada_state *state = device->machine().driver_data<nevada_state>(); |
| 352 | | /* Todo , just for sample */ |
| 353 | | if ( channel == 0 ) |
| 354 | | { |
| 355 | | // Modem 1200 Baud |
| 356 | | } |
| 357 | | }; |
| 358 | | |
| 359 | 353 | /***************************************************************************/ |
| 360 | | static UINT8 duart18_input( device_t *device ) |
| 361 | | { |
| 362 | | return device->machine().root_device().ioport("DSW1")->read(); |
| 363 | | } |
| 364 | | |
| 365 | 354 | /***************************************************************************/ |
| 366 | | /***************************************************************************/ |
| 367 | | /***************************************************************************/ |
| 368 | 355 | /*************************************************************************** |
| 369 | 356 | |
| 370 | 357 | U39 MC68681 RS232 UART SIDEA = Printer J3 (rs232) |
| r23634 | r23635 | |
| 372 | 359 | Interrupt 3 |
| 373 | 360 | ***************************************************************************/ |
| 374 | 361 | |
| 375 | | static void duart39_irq_handler( device_t *device, int state, UINT8 vector ) |
| 362 | WRITE_LINE_MEMBER(nevada_state::duart39_irq_handler) |
| 376 | 363 | { |
| 377 | | nevada_state *drvstate = device->machine().driver_data<nevada_state>(); |
| 378 | | drvstate->m_maincpu->set_input_line_and_vector(3, state, vector); |
| 364 | m_maincpu->set_input_line_and_vector(3, state, m_duart39_68681->get_irq_vector()); |
| 379 | 365 | }; |
| 380 | 366 | |
| 381 | 367 | /***************************************************************************/ |
| 382 | | static void duart39_tx(device_t *device, int channel, UINT8 data) |
| 383 | | { |
| 384 | | // nevada_state *state = device->machine().driver_data<nevada_state>(); |
| 385 | | /* Todo , just for sample */ |
| 386 | | if ( channel == 0 ) |
| 387 | | { |
| 388 | | // Printer |
| 389 | | } |
| 390 | | else |
| 391 | | { |
| 392 | | // Player Tracking Interface J2 (not used) |
| 393 | | } |
| 394 | | |
| 395 | | }; |
| 396 | | |
| 397 | 368 | /***************************************************************************/ |
| 398 | | static UINT8 duart39_input( device_t *device ) |
| 399 | | { |
| 400 | | return device->machine().root_device().ioport("DSW2")->read(); |
| 401 | | } |
| 402 | | |
| 403 | 369 | /***************************************************************************/ |
| 404 | | /***************************************************************************/ |
| 405 | | /***************************************************************************/ |
| 406 | 370 | /*************************************************************************** |
| 407 | 371 | |
| 408 | 372 | 68681 DUART <-> Microtouch touch screen controller communication |
| r23634 | r23635 | |
| 411 | 375 | Interrupt 5 |
| 412 | 376 | ***************************************************************************/ |
| 413 | 377 | |
| 414 | | static void duart40_irq_handler( device_t *device, int state, UINT8 vector ) |
| 378 | WRITE_LINE_MEMBER(nevada_state::duart40_irq_handler) |
| 415 | 379 | { |
| 416 | | /* Todo , just for sample */ |
| 417 | | nevada_state *drvstate = device->machine().driver_data<nevada_state>(); |
| 418 | | drvstate->m_maincpu->set_input_line_and_vector(5, state, vector); |
| 380 | m_maincpu->set_input_line_and_vector(5, state, m_duart40_68681->get_irq_vector()); |
| 419 | 381 | }; |
| 420 | 382 | |
| 421 | 383 | /***************************************************************************/ |
| 422 | | static void duart40_tx( device_t *device, int channel, UINT8 data ) |
| 423 | | { |
| 424 | | /* Todo , just for sample */ |
| 425 | | nevada_state *state = device->machine().driver_data<nevada_state>(); |
| 426 | | if ( channel == 0 ) |
| 427 | | { |
| 428 | | state->m_microtouch->rx(state->generic_space(), 0, data); |
| 429 | | } |
| 430 | | else |
| 431 | | { |
| 432 | | // JCM Bill Acceptor |
| 433 | | } |
| 434 | | }; |
| 435 | | /***************************************************************************/ |
| 436 | | WRITE8_MEMBER( nevada_state::microtouch_tx ) |
| 437 | | { |
| 438 | | /* Todo , just for sample */ |
| 439 | | duart68681_rx_data(m_duart40_68681, 0, data); |
| 440 | | } |
| 441 | | |
| 442 | | /***************************************************************************/ |
| 443 | | static UINT8 duart40_input( device_t *device ) |
| 444 | | { |
| 445 | | return device->machine().root_device().ioport("DSW3")->read(); |
| 446 | | } |
| 447 | | |
| 448 | | |
| 449 | | /***************************************************************************/ |
| 450 | 384 | /********************* RTC SECTION ********************************/ |
| 451 | 385 | /***************************************************************************/ |
| 452 | 386 | WRITE_LINE_MEMBER(nevada_state::nevada_rtc_irq) |
| r23634 | r23635 | |
| 608 | 542 | AM_RANGE(0x00a40000, 0x00A40001) AM_READWRITE( nevada_sec_r, nevada_sec_w) |
| 609 | 543 | //AM_RANGE(0x00b00000, 0x00b01fff) AM_RAM_WRITE(nevada_videoram_w) AM_BASE_MEMBER(nevada_state, m_videoram) |
| 610 | 544 | AM_RANGE(0x00b00000, 0x00b01fff) AM_RAM // Video |
| 611 | | AM_RANGE(0x00b10000, 0x00b100ff) AM_DEVREADWRITE8_LEGACY( "duart40_68681", duart68681_r, duart68681_w, 0x00ff ) // Lower byte |
| 612 | | AM_RANGE(0x00b20000, 0x00b200ff) AM_DEVREADWRITE8_LEGACY( "duart39_68681", duart68681_r, duart68681_w, 0x00ff ) // Lower byte |
| 613 | | AM_RANGE(0x00e00000, 0x00e000ff) AM_DEVREADWRITE8_LEGACY( "duart18_68681", duart68681_r, duart68681_w, 0xff00 ) // Upper byte |
| 545 | AM_RANGE(0x00b10000, 0x00b100ff) AM_DEVREADWRITE8( "duart40_68681", duartn68681_device, read, write, 0x00ff ) // Lower byte |
| 546 | AM_RANGE(0x00b20000, 0x00b200ff) AM_DEVREADWRITE8( "duart39_68681", duartn68681_device, read, write, 0x00ff ) // Lower byte |
| 547 | AM_RANGE(0x00e00000, 0x00e000ff) AM_DEVREADWRITE8( "duart18_68681", duartn68681_device, read, write, 0xff00 ) // Upper byte |
| 614 | 548 | AM_RANGE(0x00fa0000, 0x00fbffff) AM_RAM // not used |
| 615 | 549 | AM_RANGE(0x00fc0000, 0x00ffffff) AM_ROM // ROM ext + ROM boot |
| 616 | 550 | ADDRESS_MAP_END |
| r23634 | r23635 | |
| 662 | 596 | INPUT_PORTS_END |
| 663 | 597 | |
| 664 | 598 | /***************************************************************************/ |
| 665 | | static const duart68681_config nevada_duart18_68681_config = |
| 599 | static const duartn68681_config nevada_duart18_68681_config = |
| 666 | 600 | { |
| 667 | | duart18_irq_handler, |
| 668 | | duart18_tx, |
| 669 | | duart18_input, |
| 670 | | NULL |
| 601 | DEVCB_DRIVER_LINE_MEMBER(nevada_state, duart18_irq_handler), |
| 602 | DEVCB_NULL, |
| 603 | DEVCB_NULL, |
| 604 | DEVCB_INPUT_PORT("DSW1"), |
| 605 | DEVCB_NULL |
| 671 | 606 | }; |
| 672 | 607 | /***************************************************************************/ |
| 673 | | static const duart68681_config nevada_duart39_68681_config = |
| 608 | static const duartn68681_config nevada_duart39_68681_config = |
| 674 | 609 | { |
| 675 | | duart39_irq_handler, |
| 676 | | duart39_tx, |
| 677 | | duart39_input, |
| 678 | | NULL |
| 610 | DEVCB_DRIVER_LINE_MEMBER(nevada_state, duart39_irq_handler), |
| 611 | DEVCB_NULL, |
| 612 | DEVCB_NULL, |
| 613 | DEVCB_INPUT_PORT("DSW2"), |
| 614 | DEVCB_NULL |
| 679 | 615 | }; |
| 680 | 616 | /***************************************************************************/ |
| 681 | | static const duart68681_config nevada_duart40_68681_config = |
| 617 | static const duartn68681_config nevada_duart40_68681_config = |
| 682 | 618 | { |
| 683 | | duart40_irq_handler, |
| 684 | | duart40_tx, |
| 685 | | duart40_input, |
| 686 | | NULL |
| 619 | DEVCB_DRIVER_LINE_MEMBER(nevada_state, duart40_irq_handler), |
| 620 | DEVCB_DEVICE_LINE_MEMBER("microtouch", microtouch_serial_device, rx), |
| 621 | DEVCB_NULL, |
| 622 | DEVCB_INPUT_PORT("DSW3"), |
| 623 | DEVCB_NULL |
| 687 | 624 | }; |
| 688 | 625 | |
| 689 | 626 | /***************************************************************************/ |
| r23634 | r23635 | |
| 693 | 630 | |
| 694 | 631 | void nevada_state::machine_reset() |
| 695 | 632 | { |
| 696 | | m_duart18_68681 = machine().device( "duart18_68681" ); |
| 697 | | m_duart39_68681 = machine().device( "duart39_68681" ); |
| 698 | | m_duart40_68681 = machine().device( "duart40_68681" ); |
| 699 | 633 | } |
| 700 | 634 | /***************************************************************************/ |
| 701 | 635 | |
| r23634 | r23635 | |
| 733 | 667 | MCFG_SOUND_ADD("aysnd", AY8912, SOUND_CLOCK) |
| 734 | 668 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 735 | 669 | |
| 736 | | MCFG_DUART68681_ADD( "duart18_68681", XTAL_3_6864MHz , nevada_duart18_68681_config ) // UARTA = Modem 1200Baud |
| 737 | | MCFG_DUART68681_ADD( "duart39_68681", XTAL_3_6864MHz , nevada_duart39_68681_config ) // UARTA = Printer |
| 738 | | MCFG_DUART68681_ADD( "duart40_68681", XTAL_3_6864MHz , nevada_duart40_68681_config ) // UARTA = Touch , UARTB = Bill Acceptor |
| 739 | | MCFG_MICROTOUCH_ADD( "microtouch", WRITE8(nevada_state, microtouch_tx) ) |
| 670 | MCFG_DUARTN68681_ADD( "duart18_68681", XTAL_3_6864MHz , nevada_duart18_68681_config ) // UARTA = Modem 1200Baud |
| 671 | MCFG_DUARTN68681_ADD( "duart39_68681", XTAL_3_6864MHz , nevada_duart39_68681_config ) // UARTA = Printer |
| 672 | MCFG_DUARTN68681_ADD( "duart40_68681", XTAL_3_6864MHz , nevada_duart40_68681_config ) // UARTA = Touch , UARTB = Bill Acceptor |
| 673 | MCFG_MICROTOUCH_SERIAL_ADD( "microtouch", 9600, DEVWRITELINE("duart40_68681", duartn68681_device, rx_a_w) ) |
| 740 | 674 | /* devices */ |
| 741 | 675 | MCFG_MSM6242_ADD("rtc", nevada_rtc_intf) |
| 742 | 676 | |
trunk/src/mame/drivers/tmaster.c
| r23634 | r23635 | |
| 106 | 106 | #include "sound/okim6295.h" |
| 107 | 107 | #include "machine/eeprom.h" |
| 108 | 108 | #include "machine/microtch.h" |
| 109 | | #include "machine/68681.h" |
| 109 | #include "machine/n68681.h" |
| 110 | 110 | #include "machine/nvram.h" |
| 111 | 111 | |
| 112 | 112 | /*************************************************************************** |
| r23634 | r23635 | |
| 125 | 125 | m_microtouch(*this,"microtouch"), |
| 126 | 126 | m_regs(*this, "regs"), |
| 127 | 127 | m_galgames_ram(*this, "galgames_ram"), |
| 128 | | m_oki(*this, "oki"){ } |
| 128 | m_oki(*this, "oki"), |
| 129 | m_duart(*this, "duart68681"){ } |
| 129 | 130 | |
| 130 | 131 | required_device<cpu_device> m_maincpu; |
| 131 | | optional_device<microtouch_device> m_microtouch; |
| 132 | optional_device<microtouch_serial_device> m_microtouch; |
| 132 | 133 | required_shared_ptr<UINT16> m_regs; |
| 133 | 134 | optional_shared_ptr<UINT16> m_galgames_ram; |
| 134 | 135 | required_device<okim6295_device> m_oki; |
| 136 | optional_device<duartn68681_device> m_duart; |
| 135 | 137 | |
| 136 | 138 | int m_okibank; |
| 137 | 139 | UINT8 m_rtc_ram[8]; |
| r23634 | r23635 | |
| 145 | 147 | UINT32 m_palette_offset; |
| 146 | 148 | UINT8 m_palette_index; |
| 147 | 149 | UINT8 m_palette_data[3]; |
| 148 | | device_t *m_duart68681; |
| 149 | 150 | |
| 150 | | DECLARE_WRITE8_MEMBER(microtouch_tx); |
| 151 | DECLARE_WRITE_LINE_MEMBER(duart_irq_handler); |
| 151 | 152 | DECLARE_READ16_MEMBER(rtc_r); |
| 152 | 153 | DECLARE_WRITE16_MEMBER(rtc_w); |
| 153 | 154 | DECLARE_WRITE16_MEMBER(tmaster_color_w); |
| r23634 | r23635 | |
| 222 | 223 | |
| 223 | 224 | ***************************************************************************/ |
| 224 | 225 | |
| 225 | | static void duart_irq_handler(device_t *device, int state, UINT8 vector) |
| 226 | WRITE_LINE_MEMBER(tmaster_state::duart_irq_handler) |
| 226 | 227 | { |
| 227 | | tmaster_state *drvstate = device->machine().driver_data<tmaster_state>(); |
| 228 | | drvstate->m_maincpu->set_input_line_and_vector(4, state, vector); |
| 228 | m_maincpu->set_input_line_and_vector(4, state, m_duart->get_irq_vector()); |
| 229 | 229 | }; |
| 230 | 230 | |
| 231 | | static void duart_tx(device_t *device, int channel, UINT8 data) |
| 232 | | { |
| 233 | | tmaster_state *state = device->machine().driver_data<tmaster_state>(); |
| 234 | | if ( channel == 0 ) |
| 235 | | { |
| 236 | | state->m_microtouch->rx(device->machine().driver_data()->generic_space(), 0, data); |
| 237 | | } |
| 238 | | }; |
| 239 | | |
| 240 | | WRITE8_MEMBER( tmaster_state::microtouch_tx ) |
| 241 | | { |
| 242 | | duart68681_rx_data(m_duart68681, 0, data); |
| 243 | | } |
| 244 | | |
| 245 | 231 | /*************************************************************************** |
| 246 | 232 | |
| 247 | 233 | DS1644 RTC |
| r23634 | r23635 | |
| 545 | 531 | |
| 546 | 532 | AM_RANGE( 0x300010, 0x300011 ) AM_READ(tmaster_coins_r ) |
| 547 | 533 | |
| 548 | | AM_RANGE( 0x300020, 0x30003f ) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0xff ) |
| 534 | AM_RANGE( 0x300020, 0x30003f ) AM_DEVREADWRITE8("duart68681", duartn68681_device, read, write, 0xff ) |
| 549 | 535 | |
| 550 | 536 | AM_RANGE( 0x300040, 0x300041 ) AM_WRITE(tmaster_oki_bank_w ) |
| 551 | 537 | |
| r23634 | r23635 | |
| 899 | 885 | m_gfx_offs = 0; |
| 900 | 886 | m_gfx_size = memregion("blitter")->bytes(); |
| 901 | 887 | |
| 902 | | m_duart68681 = machine().device( "duart68681" ); |
| 903 | 888 | } |
| 904 | 889 | |
| 905 | 890 | TIMER_DEVICE_CALLBACK_MEMBER(tmaster_state::tm3k_interrupt) |
| r23634 | r23635 | |
| 914 | 899 | // lev 2 triggered at the end of the blit |
| 915 | 900 | } |
| 916 | 901 | |
| 917 | | static const duart68681_config tmaster_duart68681_config = |
| 902 | static const duartn68681_config tmaster_duart68681_config = |
| 918 | 903 | { |
| 919 | | duart_irq_handler, |
| 920 | | duart_tx, |
| 921 | | NULL, |
| 922 | | NULL |
| 904 | DEVCB_DRIVER_LINE_MEMBER(tmaster_state, duart_irq_handler), |
| 905 | DEVCB_DEVICE_LINE_MEMBER("microtouch", microtouch_serial_device, rx), |
| 906 | DEVCB_NULL, |
| 907 | DEVCB_NULL, |
| 908 | DEVCB_NULL |
| 923 | 909 | }; |
| 924 | 910 | |
| 925 | 911 | static MACHINE_CONFIG_START( tm3k, tmaster_state ) |
| r23634 | r23635 | |
| 929 | 915 | |
| 930 | 916 | MCFG_MACHINE_RESET_OVERRIDE(tmaster_state,tmaster) |
| 931 | 917 | |
| 932 | | MCFG_DUART68681_ADD( "duart68681", XTAL_8_664MHz / 2 /*??*/, tmaster_duart68681_config ) |
| 933 | | MCFG_MICROTOUCH_ADD( "microtouch", WRITE8(tmaster_state, microtouch_tx) ) |
| 918 | MCFG_DUARTN68681_ADD( "duart68681", XTAL_8_664MHz / 2 /*??*/, tmaster_duart68681_config ) |
| 919 | MCFG_MICROTOUCH_SERIAL_ADD( "microtouch", 9600, DEVWRITELINE("duart68681", duartn68681_device, rx_a_w) ) |
| 934 | 920 | |
| 935 | 921 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 936 | 922 | |
trunk/src/mame/drivers/adp.c
| r23634 | r23635 | |
| 150 | 150 | #include "sound/ay8910.h" |
| 151 | 151 | #include "video/h63484.h" |
| 152 | 152 | #include "machine/microtch.h" |
| 153 | | #include "machine/68681.h" |
| 153 | #include "machine/n68681.h" |
| 154 | 154 | |
| 155 | 155 | class adp_state : public driver_device |
| 156 | 156 | { |
| r23634 | r23635 | |
| 159 | 159 | : driver_device(mconfig, type, tag), |
| 160 | 160 | m_h63484(*this, "h63484"), |
| 161 | 161 | m_microtouch(*this, "microtouch"), |
| 162 | | m_maincpu(*this, "maincpu") |
| 162 | m_maincpu(*this, "maincpu"), |
| 163 | m_duart(*this, "duart68681") |
| 163 | 164 | { } |
| 164 | 165 | |
| 165 | 166 | required_device<h63484_device> m_h63484; |
| 166 | | required_device<microtouch_device> m_microtouch; |
| 167 | required_device<microtouch_serial_device> m_microtouch; |
| 168 | required_device<cpu_device> m_maincpu; |
| 169 | required_device<duartn68681_device> m_duart; |
| 167 | 170 | |
| 168 | | DECLARE_WRITE8_MEMBER(microtouch_tx); |
| 169 | 171 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 170 | 172 | |
| 171 | 173 | /* misc */ |
| r23634 | r23635 | |
| 174 | 176 | struct { int r,g,b,offs,offs_internal; } m_pal; |
| 175 | 177 | |
| 176 | 178 | /* devices */ |
| 177 | | required_device<cpu_device> m_maincpu; |
| 178 | | device_t *m_duart; |
| 179 | 179 | DECLARE_READ16_MEMBER(test_r); |
| 180 | 180 | DECLARE_WRITE16_MEMBER(wh2_w); |
| 181 | 181 | DECLARE_WRITE8_MEMBER(ramdac_io_w); |
| r23634 | r23635 | |
| 184 | 184 | DECLARE_MACHINE_START(skattv); |
| 185 | 185 | DECLARE_MACHINE_RESET(skattv); |
| 186 | 186 | DECLARE_PALETTE_INIT(adp); |
| 187 | DECLARE_WRITE_LINE_MEMBER(duart_irq_handler); |
| 187 | 188 | UINT32 screen_update_adp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 188 | 189 | //INTERRUPT_GEN_MEMBER(adp_int); |
| 189 | 190 | }; |
| r23634 | r23635 | |
| 269 | 270 | |
| 270 | 271 | ***************************************************************************/ |
| 271 | 272 | |
| 272 | | static void duart_irq_handler( device_t *device, int state, UINT8 vector ) |
| 273 | WRITE_LINE_MEMBER(adp_state::duart_irq_handler) |
| 273 | 274 | { |
| 274 | | adp_state *adp = device->machine().driver_data<adp_state>(); |
| 275 | | adp->m_maincpu->set_input_line_and_vector(4, state, vector); |
| 275 | m_maincpu->set_input_line_and_vector(4, state, m_duart->get_irq_vector()); |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | | static void duart_tx( device_t *device, int channel, UINT8 data ) |
| 279 | | { |
| 280 | | adp_state *state = device->machine().driver_data<adp_state>(); |
| 281 | | if (channel == 0) |
| 282 | | { |
| 283 | | state->m_microtouch->rx(device->machine().driver_data()->generic_space(), 0, data); |
| 284 | | } |
| 285 | | } |
| 286 | | |
| 287 | | WRITE8_MEMBER( adp_state::microtouch_tx ) |
| 288 | | { |
| 289 | | duart68681_rx_data(m_duart, 0, data); |
| 290 | | } |
| 291 | | |
| 292 | | static UINT8 duart_input( device_t *device ) |
| 293 | | { |
| 294 | | return device->machine().root_device().ioport("DSW1")->read(); |
| 295 | | } |
| 296 | | |
| 297 | 278 | MACHINE_START_MEMBER(adp_state,skattv) |
| 298 | 279 | { |
| 299 | | m_duart = machine().device("duart68681"); |
| 300 | 280 | //m_h63484 = machine().device("h63484"); |
| 301 | 281 | |
| 302 | 282 | save_item(NAME(m_mux_data)); |
| r23634 | r23635 | |
| 336 | 316 | m_register_active = 0; |
| 337 | 317 | } |
| 338 | 318 | |
| 339 | | static const duart68681_config skattv_duart68681_config = |
| 319 | static const duartn68681_config skattv_duart68681_config = |
| 340 | 320 | { |
| 341 | | duart_irq_handler, |
| 342 | | duart_tx, |
| 343 | | duart_input, |
| 344 | | NULL |
| 321 | DEVCB_DRIVER_LINE_MEMBER(adp_state, duart_irq_handler), |
| 322 | DEVCB_DEVICE_LINE_MEMBER("microtouch", microtouch_serial_device, rx), |
| 323 | DEVCB_NULL, |
| 324 | DEVCB_INPUT_PORT("DSW1"), |
| 325 | DEVCB_NULL |
| 345 | 326 | }; |
| 346 | 327 | |
| 347 | 328 | PALETTE_INIT_MEMBER(adp_state,adp) |
| r23634 | r23635 | |
| 444 | 425 | AM_RANGE(0x800082, 0x800083) AM_DEVREADWRITE("h63484", h63484_device, data_r, data_w) |
| 445 | 426 | AM_RANGE(0x800100, 0x800101) AM_READWRITE(test_r,wh2_w) //related to input |
| 446 | 427 | AM_RANGE(0x800140, 0x800143) AM_DEVREADWRITE8("aysnd", ay8910_device, data_r, address_data_w, 0x00ff) //18b too |
| 447 | | AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0xff ) |
| 428 | AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8("duart68681", duartn68681_device, read, write, 0xff ) |
| 448 | 429 | AM_RANGE(0xffc000, 0xffffff) AM_RAM |
| 449 | 430 | ADDRESS_MAP_END |
| 450 | 431 | |
| r23634 | r23635 | |
| 454 | 435 | AM_RANGE(0x800080, 0x800081) AM_DEVREADWRITE("h63484", h63484_device, status_r, address_w) // bad |
| 455 | 436 | AM_RANGE(0x800082, 0x800083) AM_DEVREADWRITE("h63484", h63484_device, data_r, data_w) // bad |
| 456 | 437 | AM_RANGE(0x800140, 0x800143) AM_DEVREADWRITE8("aysnd", ay8910_device, data_r, address_data_w, 0x00ff) //18b too |
| 457 | | AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0xff ) |
| 438 | AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8("duart68681", duartn68681_device, read, write, 0xff ) |
| 458 | 439 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| 459 | 440 | ADDRESS_MAP_END |
| 460 | 441 | |
| r23634 | r23635 | |
| 462 | 443 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 463 | 444 | AM_RANGE(0x100000, 0x10003f) AM_RAM |
| 464 | 445 | AM_RANGE(0x200000, 0x20003f) AM_RAM |
| 465 | | AM_RANGE(0x400000, 0x40001f) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0xff ) |
| 446 | AM_RANGE(0x400000, 0x40001f) AM_DEVREADWRITE8("duart68681", duartn68681_device, read, write, 0xff ) |
| 466 | 447 | AM_RANGE(0x500000, 0x503fff) AM_RAM //work RAM |
| 467 | 448 | AM_RANGE(0x600006, 0x600007) AM_NOP //(r) is discarded (watchdog?) |
| 468 | 449 | ADDRESS_MAP_END |
| r23634 | r23635 | |
| 509 | 490 | AM_RANGE(0x800088, 0x80008d) AM_WRITE8(ramdac_io_w, 0x00ff) |
| 510 | 491 | AM_RANGE(0x800100, 0x800101) AM_RAM //??? |
| 511 | 492 | AM_RANGE(0x800140, 0x800143) AM_DEVREADWRITE8("aysnd", ay8910_device, data_r, address_data_w, 0x00ff) //18b too |
| 512 | | AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0xff ) |
| 493 | AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8("duart68681", duartn68681_device, read, write, 0xff ) |
| 513 | 494 | AM_RANGE(0xfc0000, 0xffffff) AM_RAM |
| 514 | 495 | ADDRESS_MAP_END |
| 515 | 496 | |
| r23634 | r23635 | |
| 520 | 501 | AM_RANGE(0x800082, 0x800083) AM_DEVREADWRITE("h63484", h63484_device, data_r, data_w) |
| 521 | 502 | AM_RANGE(0x800100, 0x800101) AM_RAM //??? |
| 522 | 503 | AM_RANGE(0x800140, 0x800143) AM_DEVREADWRITE8("aysnd", ay8910_device, data_r, address_data_w, 0x00ff) //18b too |
| 523 | | AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0xff ) |
| 504 | AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8("duart68681", duartn68681_device, read, write, 0xff ) |
| 524 | 505 | AM_RANGE(0xfc0000, 0xffffff) AM_RAM |
| 525 | 506 | ADDRESS_MAP_END |
| 526 | 507 | |
| r23634 | r23635 | |
| 660 | 641 | MCFG_MACHINE_START_OVERRIDE(adp_state,skattv) |
| 661 | 642 | MCFG_MACHINE_RESET_OVERRIDE(adp_state,skattv) |
| 662 | 643 | |
| 663 | | MCFG_DUART68681_ADD( "duart68681", XTAL_8_664MHz / 2, skattv_duart68681_config ) |
| 664 | | MCFG_MICROTOUCH_ADD( "microtouch", WRITE8(adp_state, microtouch_tx) ) |
| 644 | MCFG_DUARTN68681_ADD( "duart68681", XTAL_8_664MHz / 2, skattv_duart68681_config ) |
| 645 | MCFG_MICROTOUCH_SERIAL_ADD( "microtouch", 9600, DEVWRITELINE("duart68681", duartn68681_device, rx_a_w) ) |
| 665 | 646 | |
| 666 | 647 | MCFG_SCREEN_ADD("screen", RASTER) |
| 667 | 648 | MCFG_SCREEN_REFRESH_RATE(60) |
| r23634 | r23635 | |
| 692 | 673 | MCFG_MACHINE_START_OVERRIDE(adp_state,skattv) |
| 693 | 674 | MCFG_MACHINE_RESET_OVERRIDE(adp_state,skattv) |
| 694 | 675 | |
| 695 | | MCFG_DUART68681_ADD( "duart68681", XTAL_8_664MHz / 2, skattv_duart68681_config ) |
| 696 | | MCFG_MICROTOUCH_ADD( "microtouch", WRITE8(adp_state, microtouch_tx) ) |
| 676 | MCFG_DUARTN68681_ADD( "duart68681", XTAL_8_664MHz / 2, skattv_duart68681_config ) |
| 677 | MCFG_MICROTOUCH_SERIAL_ADD( "microtouch", 9600, DEVWRITELINE("duart68681", duartn68681_device, rx_a_w) ) |
| 697 | 678 | |
| 698 | 679 | MCFG_SCREEN_ADD("screen", RASTER) |
| 699 | 680 | MCFG_SCREEN_REFRESH_RATE(60) |
| r23634 | r23635 | |
| 720 | 701 | MCFG_CPU_ADD("maincpu", M68000, 8000000) |
| 721 | 702 | MCFG_CPU_PROGRAM_MAP(backgamn_mem) |
| 722 | 703 | |
| 723 | | MCFG_DUART68681_ADD( "duart68681", XTAL_8_664MHz / 2, skattv_duart68681_config ) |
| 724 | | MCFG_MICROTOUCH_ADD( "microtouch", WRITE8(adp_state, microtouch_tx) ) |
| 704 | MCFG_DUARTN68681_ADD( "duart68681", XTAL_8_664MHz / 2, skattv_duart68681_config ) |
| 705 | MCFG_MICROTOUCH_SERIAL_ADD( "microtouch", 9600, DEVWRITELINE("duart68681", duartn68681_device, rx_a_w) ) |
| 725 | 706 | |
| 726 | 707 | MCFG_MACHINE_START_OVERRIDE(adp_state,skattv) |
| 727 | 708 | MCFG_MACHINE_RESET_OVERRIDE(adp_state,skattv) |