trunk/src/mess/machine/md_rom.c
| r22521 | r22522 | |
| 527 | 527 | READ16_MEMBER(md_rom_mcpirate_device::read) |
| 528 | 528 | { |
| 529 | 529 | if (offset < 0x400000/2) |
| 530 | | { |
| 531 | | return m_rom[offset + (m_bank * 0x10000)/2]; |
| 532 | | } |
| 530 | return m_rom[(((m_bank * 0x10000) + (offset << 1)) & (m_rom_size - 1))/2]; |
| 533 | 531 | else |
| 534 | | { |
| 535 | 532 | return read(space, offset - 0x400000/2, 0xffff); |
| 536 | | } |
| 537 | 533 | } |
| 538 | 534 | |
| 539 | 535 | WRITE16_MEMBER(md_rom_mcpirate_device::write_a13) |
| r22521 | r22522 | |
| 623 | 619 | } |
| 624 | 620 | return 0; |
| 625 | 621 | } |
| 626 | | |
| 627 | | return m_rom[offset & 0x1fffff/2]; |
| 622 | |
| 623 | // non-protection accesses |
| 624 | if (offset < 0x400000/2) |
| 625 | return m_rom[MD_ADDR(offset)]; |
| 626 | else |
| 627 | return 0xffff; |
| 628 | 628 | } |
| 629 | 629 | |
| 630 | 630 | WRITE16_MEMBER(md_rom_chinf3_device::write) |
| r22521 | r22522 | |
| 650 | 650 | |
| 651 | 651 | READ16_MEMBER(md_rom_elfwor_device::read) |
| 652 | 652 | { |
| 653 | | /* It returns (0x55 @ 0x400000 OR 0xc9 @ 0x400004) AND (0x0f @ 0x400002 OR 0x18 @ 0x400006). |
| 654 | | It is probably best to add handlers for all 4 addresses. */ |
| 653 | // It returns (0x55 @ 0x400000 OR 0xc9 @ 0x400004) AND (0x0f @ 0x400002 OR 0x18 @ 0x400006). |
| 654 | // It is probably best to add handlers for all 4 addresses |
| 655 | 655 | if (offset == 0x400000/2) return 0x5500; |
| 656 | 656 | if (offset == 0x400002/2) return 0x0f00; |
| 657 | 657 | if (offset == 0x400004/2) return 0xc900; |
| 658 | 658 | if (offset == 0x400006/2) return 0x1800; |
| 659 | | return m_rom[MD_ADDR(offset)]; |
| 659 | |
| 660 | // non-protection accesses |
| 661 | if (offset < 0x400000/2) |
| 662 | return m_rom[MD_ADDR(offset)]; |
| 663 | else |
| 664 | return 0xffff; |
| 660 | 665 | } |
| 661 | 666 | |
| 662 | 667 | /*------------------------------------------------- |
| r22521 | r22522 | |
| 669 | 674 | if (offset == 0x400002/2) return 0x0f00; |
| 670 | 675 | if (offset == 0x400004/2) return 0xaa00; |
| 671 | 676 | if (offset == 0x400006/2) return 0xf000; |
| 672 | | return m_rom[MD_ADDR(offset)]; |
| 677 | |
| 678 | // non-protection accesses |
| 679 | if (offset < 0x400000/2) |
| 680 | return m_rom[MD_ADDR(offset)]; |
| 681 | else |
| 682 | return 0xffff; |
| 673 | 683 | } |
| 674 | 684 | |
| 675 | 685 | /*------------------------------------------------- |
| r22521 | r22522 | |
| 682 | 692 | if (offset == 0x400002/2) return 0x9800; |
| 683 | 693 | if (offset == 0x400004/2) return 0xc900; |
| 684 | 694 | if (offset == 0x400006/2) return 0x1800; |
| 685 | | return m_rom[MD_ADDR(offset)]; |
| 695 | |
| 696 | // non-protection accesses |
| 697 | if (offset < 0x400000/2) |
| 698 | return m_rom[MD_ADDR(offset)]; |
| 699 | else |
| 700 | return 0xffff; |
| 686 | 701 | } |
| 687 | 702 | |
| 688 | 703 | /*------------------------------------------------- |
| r22521 | r22522 | |
| 697 | 712 | if (offset == 0x488880/2) return 0xaa00; |
| 698 | 713 | if (offset == 0x4a8820/2) return 0x0a00; |
| 699 | 714 | if (offset == 0x4f8820/2) return 0x0000; |
| 700 | | return m_rom[MD_ADDR(offset)]; |
| 715 | |
| 716 | // non-protection accesses |
| 717 | if (offset < 0x400000/2) |
| 718 | return m_rom[MD_ADDR(offset)]; |
| 719 | else |
| 720 | return 0xffff; |
| 701 | 721 | } |
| 702 | 722 | |
| 703 | 723 | /*------------------------------------------------- |
| r22521 | r22522 | |
| 720 | 740 | { |
| 721 | 741 | if (offset == 0x400002/2) return m_prot1_data; |
| 722 | 742 | if (offset == 0x400006/2) return m_prot2_data; |
| 723 | | return m_rom[MD_ADDR(offset)]; |
| 743 | |
| 744 | // non-protection accesses |
| 745 | if (offset < 0x400000/2) |
| 746 | return m_rom[MD_ADDR(offset)]; |
| 747 | else |
| 748 | return 0xffff; |
| 724 | 749 | } |
| 725 | 750 | |
| 726 | 751 | WRITE16_MEMBER(md_rom_lion2_device::write) |
| r22521 | r22522 | |
| 756 | 781 | return 0; |
| 757 | 782 | } |
| 758 | 783 | |
| 759 | | return m_rom[MD_ADDR(offset)]; |
| 784 | if (offset < 0x400000/2) |
| 785 | return m_rom[MD_ADDR(offset)]; |
| 786 | else |
| 787 | return 0xffff; |
| 760 | 788 | } |
| 761 | 789 | |
| 762 | 790 | WRITE16_MEMBER(md_rom_lion3_device::write) |
| r22521 | r22522 | |
| 815 | 843 | { |
| 816 | 844 | if (offset == 0x400000/2) return 0x9000; |
| 817 | 845 | if (offset == 0x401000/2) return 0xd300; |
| 818 | | return m_rom[MD_ADDR(offset)]; |
| 846 | |
| 847 | // non-protection accesses |
| 848 | if (offset < 0x400000/2) |
| 849 | return m_rom[MD_ADDR(offset)]; |
| 850 | else |
| 851 | return 0xffff; |
| 819 | 852 | } |
| 820 | 853 | |
| 821 | 854 | |
| r22521 | r22522 | |
| 827 | 860 | { |
| 828 | 861 | if (offset == 0x400000/2) return 0x5500; |
| 829 | 862 | if (offset == 0x400002/2) return 0x0f00; |
| 830 | | return m_rom[MD_ADDR(offset)]; |
| 863 | |
| 864 | // non-protection accesses |
| 865 | if (offset < 0x400000/2) |
| 866 | return m_rom[MD_ADDR(offset)]; |
| 867 | else |
| 868 | return 0xffff; |
| 831 | 869 | } |
| 832 | 870 | |
| 833 | 871 | /*------------------------------------------------- |
| r22521 | r22522 | |
| 839 | 877 | if (offset == 0x400002/2) return 0x9800; |
| 840 | 878 | if (offset == 0x400004/2) return 0xc900; |
| 841 | 879 | if (offset == 0x400006/2) return 0xf000; |
| 842 | | return m_rom[MD_ADDR(offset)]; |
| 880 | |
| 881 | // non-protection accesses |
| 882 | if (offset < 0x400000/2) |
| 883 | return m_rom[MD_ADDR(offset)]; |
| 884 | else |
| 885 | return 0xffff; |
| 843 | 886 | } |
| 844 | 887 | |
| 845 | 888 | /*------------------------------------------------- |
| r22521 | r22522 | |
| 852 | 895 | { |
| 853 | 896 | if (offset < 0x100000/2) |
| 854 | 897 | return m_rom[MD_POKESTAD_ADDR(offset)]; |
| 855 | | return m_rom[MD_ADDR(offset)]; |
| 898 | |
| 899 | // non-protection accesses |
| 900 | if (offset < 0x400000/2) |
| 901 | return m_rom[MD_ADDR(offset)]; |
| 902 | else |
| 903 | return 0xffff; |
| 856 | 904 | } |
| 857 | 905 | |
| 858 | 906 | WRITE16_MEMBER(md_rom_pokestad_device::write) |
| r22521 | r22522 | |
| 880 | 928 | READ16_MEMBER(md_rom_realtec_device::read) |
| 881 | 929 | { |
| 882 | 930 | if (offset < (m_bank_size * 0x20000)) // two banks of same (variable) size at the bottom of the rom |
| 883 | | return m_rom[offset + (m_bank_addr * 0x20000)/2]; |
| 884 | | return m_rom[(offset & 0x1fff/2) + 0x7e000/2]; // otherwise it accesses the final 8k of the image |
| 931 | return m_rom[MD_ADDR(offset + (m_bank_addr * 0x20000)/2)]; |
| 932 | return m_rom[MD_ADDR((offset & 0x1fff/2) + 0x7e000/2)]; // otherwise it accesses the final 8k of the image |
| 885 | 933 | } |
| 886 | 934 | |
| 887 | 935 | WRITE16_MEMBER(md_rom_realtec_device::write) |
| r22521 | r22522 | |
| 911 | 959 | { |
| 912 | 960 | if (offset == 0x400000/2) return 0x55 << 8; |
| 913 | 961 | if (offset == 0x400004/2) return -0x56 << 8; |
| 914 | | return m_rom[MD_ADDR(offset)]; |
| 962 | |
| 963 | // non-protection accesses |
| 964 | if (offset < 0x400000/2) |
| 965 | return m_rom[MD_ADDR(offset)]; |
| 966 | else |
| 967 | return 0xffff; |
| 915 | 968 | } |
| 916 | 969 | |
| 917 | 970 | /*------------------------------------------------- |
| r22521 | r22522 | |
| 934 | 987 | { |
| 935 | 988 | if ((offset >= 0x400000/2) && (offset < 0x400008/2)) |
| 936 | 989 | return m_latch; |
| 937 | | return m_rom[MD_ADDR(offset)]; |
| 990 | |
| 991 | // non-protection accesses |
| 992 | if (offset < 0x400000/2) |
| 993 | return m_rom[MD_ADDR(offset)]; |
| 994 | else |
| 995 | return 0xffff; |
| 938 | 996 | } |
| 939 | 997 | |
| 940 | 998 | WRITE16_MEMBER(md_rom_squir_device::write) |
| r22521 | r22522 | |
| 1133 | 1191 | if (offset >= 0x60000/2 && offset < 0x68000/2) |
| 1134 | 1192 | return m_rom[offset + (m_bank[2] * 0x110000)/2]; |
| 1135 | 1193 | |
| 1136 | | return m_rom[offset]; |
| 1194 | // non-protection accesses |
| 1195 | if (offset < 0x400000/2) |
| 1196 | return m_rom[MD_ADDR(offset)]; |
| 1197 | else |
| 1198 | return 0xffff; |
| 1137 | 1199 | } |
| 1138 | 1200 | |
| 1139 | 1201 | WRITE16_MEMBER(md_rom_topf_device::write) |
| r22521 | r22522 | |
| 1163 | 1225 | |
| 1164 | 1226 | READ16_MEMBER(md_rom_radica_device::read) |
| 1165 | 1227 | { |
| 1166 | | return m_rom[m_bank * 0x10000/2 + offset]; |
| 1228 | return m_rom[(((m_bank * 0x10000) + (offset << 1)) & (m_rom_size - 1))/2]; |
| 1167 | 1229 | } |
| 1168 | 1230 | |
| 1169 | 1231 | READ16_MEMBER(md_rom_radica_device::read_a13) |