trunk/src/mame/drivers/taitogn.c
r17558 | r17559 | |
422 | 422 | |
423 | 423 | WRITE32_MEMBER(taitogn_state::rf5c296_io_w) |
424 | 424 | { |
425 | | |
426 | 425 | if(offset < 2) { |
427 | 426 | ide_controller32_pcmcia_w(machine().device(":card"), offset, data, mem_mask); |
428 | 427 | return; |
r17558 | r17559 | |
438 | 437 | |
439 | 438 | READ32_MEMBER(taitogn_state::rf5c296_io_r) |
440 | 439 | { |
441 | | |
442 | 440 | if(offset < 2) |
443 | 441 | return ide_controller32_pcmcia_r(machine().device(":card"), offset, mem_mask); |
444 | 442 | |
r17558 | r17559 | |
460 | 458 | |
461 | 459 | READ32_MEMBER(taitogn_state::rf5c296_mem_r) |
462 | 460 | { |
463 | | |
464 | 461 | if(offset < 0x80) |
465 | 462 | return (m_cis[offset*2+1] << 16) | m_cis[offset*2]; |
466 | 463 | |
r17558 | r17559 | |
475 | 472 | |
476 | 473 | WRITE32_MEMBER(taitogn_state::rf5c296_mem_w) |
477 | 474 | { |
478 | | |
479 | 475 | if(offset >= 0x140 && offset <= 0x144) { |
480 | | dynamic_buffer key; |
| 476 | dynamic_buffer key(get_disk_handle(machine(), ":drive_0")->hunk_bytes()); |
481 | 477 | |
482 | 478 | int pos = (offset - 0x140)*2; |
483 | 479 | UINT8 v, k; |
r17558 | r17559 | |
524 | 520 | |
525 | 521 | READ32_MEMBER(taitogn_state::flash_subbios_r) |
526 | 522 | { |
527 | | |
528 | 523 | return gen_flash_r(m_biosflash, offset, mem_mask); |
529 | 524 | } |
530 | 525 | |
531 | 526 | WRITE32_MEMBER(taitogn_state::flash_subbios_w) |
532 | 527 | { |
533 | | |
534 | 528 | gen_flash_w(m_biosflash, offset, data, mem_mask); |
535 | 529 | } |
536 | 530 | |
537 | 531 | READ32_MEMBER(taitogn_state::flash_mn102_r) |
538 | 532 | { |
539 | | |
540 | 533 | return gen_flash_r(m_pgmflash, offset, mem_mask); |
541 | 534 | } |
542 | 535 | |
543 | 536 | WRITE32_MEMBER(taitogn_state::flash_mn102_w) |
544 | 537 | { |
545 | | |
546 | 538 | gen_flash_w(m_pgmflash, offset, data, mem_mask); |
547 | 539 | } |
548 | 540 | |
549 | 541 | READ32_MEMBER(taitogn_state::flash_s1_r) |
550 | 542 | { |
551 | | |
552 | 543 | return gen_flash_r(m_sndflash[0], offset, mem_mask); |
553 | 544 | } |
554 | 545 | |
555 | 546 | WRITE32_MEMBER(taitogn_state::flash_s1_w) |
556 | 547 | { |
557 | | |
558 | 548 | gen_flash_w(m_sndflash[0], offset, data, mem_mask); |
559 | 549 | } |
560 | 550 | |
561 | 551 | READ32_MEMBER(taitogn_state::flash_s2_r) |
562 | 552 | { |
563 | | |
564 | 553 | return gen_flash_r(m_sndflash[1], offset, mem_mask); |
565 | 554 | } |
566 | 555 | |
567 | 556 | WRITE32_MEMBER(taitogn_state::flash_s2_w) |
568 | 557 | { |
569 | | |
570 | 558 | gen_flash_w(m_sndflash[1], offset, data, mem_mask); |
571 | 559 | } |
572 | 560 | |
573 | 561 | READ32_MEMBER(taitogn_state::flash_s3_r) |
574 | 562 | { |
575 | | |
576 | 563 | return gen_flash_r(m_sndflash[2], offset, mem_mask); |
577 | 564 | } |
578 | 565 | |
579 | 566 | WRITE32_MEMBER(taitogn_state::flash_s3_w) |
580 | 567 | { |
581 | | |
582 | 568 | gen_flash_w(m_sndflash[2], offset, data, mem_mask); |
583 | 569 | } |
584 | 570 | |
r17558 | r17559 | |
605 | 591 | |
606 | 592 | READ32_MEMBER(taitogn_state::control_r) |
607 | 593 | { |
608 | | |
609 | 594 | // fprintf(stderr, "gn_r %08x @ %08x (%s)\n", 0x1fb00000+4*offset, mem_mask, machine().describe_context()); |
610 | 595 | return m_control; |
611 | 596 | } |
612 | 597 | |
613 | 598 | WRITE32_MEMBER(taitogn_state::control_w) |
614 | 599 | { |
615 | | |
616 | 600 | // 20 = watchdog |
617 | 601 | // 04 = select bank |
618 | 602 | |
r17558 | r17559 | |
645 | 629 | |
646 | 630 | WRITE32_MEMBER(taitogn_state::control2_w) |
647 | 631 | { |
648 | | |
649 | 632 | COMBINE_DATA(&m_control2); |
650 | 633 | } |
651 | 634 | |
652 | 635 | READ32_MEMBER(taitogn_state::control3_r) |
653 | 636 | { |
654 | | |
655 | 637 | return m_control3; |
656 | 638 | } |
657 | 639 | |
658 | 640 | WRITE32_MEMBER(taitogn_state::control3_w) |
659 | 641 | { |
660 | | |
661 | 642 | COMBINE_DATA(&m_control3); |
662 | 643 | } |
663 | 644 | |
r17558 | r17559 | |
681 | 662 | |
682 | 663 | READ32_MEMBER(taitogn_state::hack1_r) |
683 | 664 | { |
684 | | |
685 | 665 | m_v = m_v ^ 8; |
686 | 666 | // Probably something to do with sound |
687 | 667 | return m_v; |
r17558 | r17559 | |
696 | 676 | |
697 | 677 | READ32_MEMBER(taitogn_state::znsecsel_r) |
698 | 678 | { |
699 | | |
700 | 679 | return m_n_znsecsel; |
701 | 680 | } |
702 | 681 | |
r17558 | r17559 | |
771 | 750 | |
772 | 751 | WRITE32_MEMBER(taitogn_state::znsecsel_w) |
773 | 752 | { |
774 | | |
775 | 753 | COMBINE_DATA( &m_n_znsecsel ); |
776 | 754 | |
777 | 755 | if( ( m_n_znsecsel & 0x80 ) == 0 ) |
r17558 | r17559 | |
843 | 821 | |
844 | 822 | WRITE32_MEMBER(taitogn_state::coin_w) |
845 | 823 | { |
846 | | |
847 | 824 | /* 0x01=counter |
848 | 825 | 0x02=coin lock 1 |
849 | 826 | 0x08=?? |
r17558 | r17559 | |
855 | 832 | |
856 | 833 | READ32_MEMBER(taitogn_state::coin_r) |
857 | 834 | { |
858 | | |
859 | 835 | return m_coin_info; |
860 | 836 | } |
861 | 837 | |
862 | 838 | /* mahjong panel handler (for Usagi & Mahjong Oh) */ |
863 | 839 | READ32_MEMBER(taitogn_state::gnet_mahjong_panel_r) |
864 | 840 | { |
865 | | |
866 | 841 | m_mux_data = m_coin_info; |
867 | 842 | m_mux_data &= 0xcc; |
868 | 843 | |
r17558 | r17559 | |
882 | 857 | |
883 | 858 | DRIVER_INIT_MEMBER(taitogn_state,coh3002t) |
884 | 859 | { |
885 | | |
886 | 860 | m_biosflash = machine().device<intel_te28f160_device>("biosflash"); |
887 | 861 | m_pgmflash = machine().device<intel_e28f400_device>("pgmflash"); |
888 | 862 | m_sndflash[0] = machine().device<intel_te28f160_device>("sndflash0"); |