src/mess/machine/adam.c
| r3639 | r3640 | |
| 687 | 687 | switch (adam_upper_memory) |
| 688 | 688 | { |
| 689 | 689 | case 0: /* Internal RAM */ |
| 690 | | memory_region(machine, "main")[0x08000+offset] = data; |
| 691 | | if (offset>=(adam_pcb-0x08000)) master6801_behaviour(machine, offset+0x08000, data); |
| 690 | memory_region(space->machine, "main")[0x08000+offset] = data; |
| 691 | if (offset>=(adam_pcb-0x08000)) master6801_behaviour(space->machine, offset+0x08000, data); |
| 692 | 692 | break; |
| 693 | 693 | case 1: /* ROM Expansion */ |
| 694 | 694 | break; |
| 695 | 695 | case 2: /* RAM Expansion */ |
| 696 | | memory_region(machine, "main")[0x18000+offset] = data; |
| 696 | memory_region(space->machine, "main")[0x18000+offset] = data; |
| 697 | 697 | break; |
| 698 | 698 | case 3: /* Cartridge ROM */ |
| 699 | 699 | break; |
| r3639 | r3640 | |
| 713 | 713 | if data bit1 is 1 -> Lower 32k = EOS otherwise Lower 32k = SmartWriter |
| 714 | 714 | */ |
| 715 | 715 | UINT8 *BankBase; |
| 716 | | BankBase = &memory_region(machine, "main")[0x00000]; |
| 716 | BankBase = &memory_region(space->machine, "main")[0x00000]; |
| 717 | 717 | |
| 718 | 718 | if (data==0x0F) |
| 719 | | adam_reset_pcb(machine); |
| 719 | adam_reset_pcb(space->machine); |
| 720 | 720 | if ( (adam_lower_memory==0) && ((data&0x02)!=(adam_net_data&0x02)) ) |
| 721 | 721 | { |
| 722 | 722 | if (data&0x02) |
| 723 | 723 | { |
| 724 | | memory_set_bankptr(machine, 1, BankBase+0x32000); /* No data here */ |
| 725 | | memory_set_bankptr(machine, 2, BankBase+0x34000); /* No data here */ |
| 726 | | memory_set_bankptr(machine, 3, BankBase+0x36000); /* No data here */ |
| 727 | | memory_set_bankptr(machine, 4, BankBase+0x38000); /* EOS ROM */ |
| 724 | memory_set_bankptr(space->machine, 1, BankBase+0x32000); /* No data here */ |
| 725 | memory_set_bankptr(space->machine, 2, BankBase+0x34000); /* No data here */ |
| 726 | memory_set_bankptr(space->machine, 3, BankBase+0x36000); /* No data here */ |
| 727 | memory_set_bankptr(space->machine, 4, BankBase+0x38000); /* EOS ROM */ |
| 728 | 728 | |
| 729 | | memory_set_bankptr(machine, 6, BankBase+0x3A000); /* Write protecting ROM */ |
| 730 | | memory_set_bankptr(machine, 7, BankBase+0x3A000); /* Write protecting ROM */ |
| 731 | | memory_set_bankptr(machine, 8, BankBase+0x3A000); /* Write protecting ROM */ |
| 732 | | memory_set_bankptr(machine, 9, BankBase+0x3A000); /* Write protecting ROM */ |
| 729 | memory_set_bankptr(space->machine, 6, BankBase+0x3A000); /* Write protecting ROM */ |
| 730 | memory_set_bankptr(space->machine, 7, BankBase+0x3A000); /* Write protecting ROM */ |
| 731 | memory_set_bankptr(space->machine, 8, BankBase+0x3A000); /* Write protecting ROM */ |
| 732 | memory_set_bankptr(space->machine, 9, BankBase+0x3A000); /* Write protecting ROM */ |
| 733 | 733 | } |
| 734 | 734 | else |
| 735 | 735 | { |
| 736 | | memory_set_bankptr(machine, 1, BankBase+0x20000); /* SmartWriter ROM */ |
| 737 | | memory_set_bankptr(machine, 2, BankBase+0x22000); |
| 738 | | memory_set_bankptr(machine, 3, BankBase+0x24000); |
| 739 | | memory_set_bankptr(machine, 4, BankBase+0x26000); |
| 736 | memory_set_bankptr(space->machine, 1, BankBase+0x20000); /* SmartWriter ROM */ |
| 737 | memory_set_bankptr(space->machine, 2, BankBase+0x22000); |
| 738 | memory_set_bankptr(space->machine, 3, BankBase+0x24000); |
| 739 | memory_set_bankptr(space->machine, 4, BankBase+0x26000); |
| 740 | 740 | |
| 741 | | memory_set_bankptr(machine, 6, BankBase+0x3A000); /* Write protecting ROM */ |
| 742 | | memory_set_bankptr(machine, 7, BankBase+0x3A000); /* Write protecting ROM */ |
| 743 | | memory_set_bankptr(machine, 8, BankBase+0x3A000); /* Write protecting ROM */ |
| 744 | | memory_set_bankptr(machine, 9, BankBase+0x3A000); /* Write protecting ROM */ |
| 741 | memory_set_bankptr(space->machine, 6, BankBase+0x3A000); /* Write protecting ROM */ |
| 742 | memory_set_bankptr(space->machine, 7, BankBase+0x3A000); /* Write protecting ROM */ |
| 743 | memory_set_bankptr(space->machine, 8, BankBase+0x3A000); /* Write protecting ROM */ |
| 744 | memory_set_bankptr(space->machine, 9, BankBase+0x3A000); /* Write protecting ROM */ |
| 745 | 745 | } |
| 746 | 746 | } |
| 747 | 747 | adam_net_data = data; |
| 748 | 748 | } |
| 749 | 749 | |
| 750 | | READ8_HANDLER( adam_memory_map_controller_r ) |
| 750 | READ8_HANDLER( adam_memory_map_controller_r ) |
| 751 | 751 | { |
| 752 | 752 | return (adam_upper_memory << 2) + adam_lower_memory; |
| 753 | 753 | } |
| r3639 | r3640 | |
| 775 | 775 | |
| 776 | 776 | adam_lower_memory = (data & 0x03); |
| 777 | 777 | adam_upper_memory = (data & 0x0C)>>2; |
| 778 | | adam_set_memory_banks(machine); |
| 778 | adam_set_memory_banks(space->machine); |
| 779 | 779 | //logerror("Configurando la memoria, L:%02xh, U:%02xh\n", adam_lower_memory, adam_upper_memory); |
| 780 | 780 | } |
| 781 | 781 | |
| 782 | 782 | READ8_HANDLER(adam_video_r) |
| 783 | 783 | { |
| 784 | | return ((offset&0x01) ? TMS9928A_register_r(machine, 1) : TMS9928A_vram_r(machine, 0)); |
| 784 | return ((offset&0x01) ? TMS9928A_register_r(space, 1) : TMS9928A_vram_r(space, 0)); |
| 785 | 785 | } |
| 786 | 786 | |
| 787 | 787 | WRITE8_HANDLER(adam_video_w) |
| 788 | 788 | { |
| 789 | | (offset&0x01) ? TMS9928A_register_w(machine, 1, data) : TMS9928A_vram_w(machine, 0, data); |
| 789 | (offset&0x01) ? TMS9928A_register_w(space, 1, data) : TMS9928A_vram_w(space, 0, data); |
| 790 | 790 | } |
| 791 | 791 | |
| 792 | | READ8_HANDLER( master6801_ram_r ) |
| 792 | READ8_HANDLER( master6801_ram_r ) |
| 793 | 793 | { |
| 794 | 794 | /*logerror("Offset %04Xh = %02Xh\n",offset ,memory_region(machine, "main")[offset]);*/ |
| 795 | | return memory_region(machine, "main")[offset+0x4000]; |
| 795 | return memory_region(space->machine, "main")[offset+0x4000]; |
| 796 | 796 | } |
| 797 | 797 | |
| 798 | 798 | WRITE8_HANDLER( master6801_ram_w ) |
| 799 | 799 | { |
| 800 | | memory_region(machine, "main")[offset+0x4000] = data; |
| 800 | memory_region(space->machine, "main")[offset+0x4000] = data; |
| 801 | 801 | } |
| 802 | 802 | |
| 803 | | READ8_HANDLER ( adam_paddle_r ) |
| 803 | READ8_HANDLER ( adam_paddle_r ) |
| 804 | 804 | { |
| 805 | 805 | |
| 806 | | if (!(input_port_read(machine, "controllers") & 0x0F)) return (0xFF); /* If no controllers enabled */ |
| 806 | if (!(input_port_read(space->machine, "controllers") & 0x0F)) return (0xFF); /* If no controllers enabled */ |
| 807 | 807 | /* Player 1 */ |
| 808 | 808 | if ((offset & 0x02)==0) |
| 809 | 809 | { |
| r3639 | r3640 | |
| 812 | 812 | { |
| 813 | 813 | int inport0,inport1,inport6,data; |
| 814 | 814 | |
| 815 | | inport0 = input_port_read(machine, "controller1_keypad1"); |
| 816 | | inport1 = input_port_read(machine, "controller1_keypad2"); |
| 817 | | inport6 = input_port_read(machine, "controllers"); |
| 815 | inport0 = input_port_read(space->machine, "controller1_keypad1"); |
| 816 | inport1 = input_port_read(space->machine, "controller1_keypad2"); |
| 817 | inport6 = input_port_read(space->machine, "controllers"); |
| 818 | 818 | |
| 819 | 819 | /* Numeric pad buttons are not independent on a real ColecoVision, if you push more |
| 820 | 820 | than one, a real ColecoVision think that it is a third button, so we are going to emulate |
| r3639 | r3640 | |
| 841 | 841 | /* Joystick and fire 2 (SAC Red Button) */ |
| 842 | 842 | else |
| 843 | 843 | { |
| 844 | | int data = input_port_read(machine, "controller1_joystick") & 0xCF; |
| 845 | | int inport6 = input_port_read(machine, "controllers"); |
| 844 | int data = input_port_read(space->machine, "controller1_joystick") & 0xCF; |
| 845 | int inport6 = input_port_read(space->machine, "controllers"); |
| 846 | 846 | |
| 847 | 847 | if (inport6&0x07) /* If Extra Contollers enabled */ |
| 848 | 848 | { |
| r3639 | r3640 | |
| 862 | 862 | { |
| 863 | 863 | int inport3,inport4,data; |
| 864 | 864 | |
| 865 | | inport3 = input_port_read(machine, "controller2_keypad1"); |
| 866 | | inport4 = input_port_read(machine, "controller2_keypad2"); |
| 865 | inport3 = input_port_read(space->machine, "controller2_keypad1"); |
| 866 | inport4 = input_port_read(space->machine, "controller2_keypad2"); |
| 867 | 867 | |
| 868 | 868 | /* Numeric pad buttons are not independent on a real ColecoVision, if you push more |
| 869 | 869 | than one, a real ColecoVision think that it is a third button, so we are going to emulate |
| r3639 | r3640 | |
| 888 | 888 | /* Joystick and fire 2*/ |
| 889 | 889 | else |
| 890 | 890 | { |
| 891 | | int data = input_port_read(machine, "controller2_joystick") & 0xCF; |
| 892 | | int inport6 = input_port_read(machine, "controllers"); |
| 891 | int data = input_port_read(space->machine, "controller2_joystick") & 0xCF; |
| 892 | int inport6 = input_port_read(space->machine, "controllers"); |
| 893 | 893 | |
| 894 | 894 | if (inport6&0x02) /* If Roller Controller enabled */ |
| 895 | 895 | { |
src/mess/drivers/coleco.c
| r3639 | r3640 | |
| 74 | 74 | |
| 75 | 75 | static READ8_HANDLER( paddle_1_r ) |
| 76 | 76 | { |
| 77 | | UINT8 inport6 = input_port_read_safe(machine, "IN6", 0); |
| 77 | UINT8 inport6 = input_port_read_safe(space->machine, "IN6", 0); |
| 78 | 78 | |
| 79 | 79 | /* Keypad and fire 1 (SAC Yellow Button) */ |
| 80 | 80 | if (joy_mode==0) |
| 81 | 81 | { |
| 82 | | UINT8 inport0 = input_port_read(machine, "IN0"); |
| 83 | | UINT8 inport1 = input_port_read(machine, "IN1"); |
| 82 | UINT8 inport0 = input_port_read(space->machine, "IN0"); |
| 83 | UINT8 inport1 = input_port_read(space->machine, "IN1"); |
| 84 | 84 | |
| 85 | 85 | /* Numeric pad buttons are not independent on a real ColecoVision, if you push more |
| 86 | 86 | than one, a real ColecoVision think that it is a third button, so we are going to emulate |
| r3639 | r3640 | |
| 108 | 108 | /* Joystick and fire 2 (SAC Red Button) */ |
| 109 | 109 | else |
| 110 | 110 | { |
| 111 | | UINT8 data = input_port_read(machine, "IN2") & 0xCF; |
| 111 | UINT8 data = input_port_read(space->machine, "IN2") & 0xCF; |
| 112 | 112 | |
| 113 | 113 | if (inport6 & 0x07) /* If Extra Contollers enabled */ |
| 114 | 114 | { |
| r3639 | r3640 | |
| 125 | 125 | /* Keypad and fire 1 */ |
| 126 | 126 | if (joy_mode == 0) |
| 127 | 127 | { |
| 128 | | UINT8 inport3 = input_port_read(machine, "IN3"); |
| 129 | | UINT8 inport4 = input_port_read(machine, "IN4"); |
| 128 | UINT8 inport3 = input_port_read(space->machine, "IN3"); |
| 129 | UINT8 inport4 = input_port_read(space->machine, "IN4"); |
| 130 | 130 | |
| 131 | 131 | /* Numeric pad buttons are not independent on a real ColecoVision, if you push more |
| 132 | 132 | than one, a real ColecoVision think that it is a third button, so we are going to emulate |
| r3639 | r3640 | |
| 152 | 152 | /* Joystick and fire 2*/ |
| 153 | 153 | else |
| 154 | 154 | { |
| 155 | | UINT8 data = input_port_read(machine, "IN5") & 0xCF; |
| 156 | | UINT8 inport6 = input_port_read_safe(machine, "IN6", 0); |
| 155 | UINT8 data = input_port_read(space->machine, "IN5") & 0xCF; |
| 156 | UINT8 inport6 = input_port_read_safe(space->machine, "IN6", 0); |
| 157 | 157 | |
| 158 | 158 | if (inport6 & 0x02) /* If Roller Controller enabled */ |
| 159 | 159 | { |
| r3639 | r3640 | |
| 344 | 344 | |
| 345 | 345 | static INTERRUPT_GEN( coleco_interrupt ) |
| 346 | 346 | { |
| 347 | | TMS9928A_interrupt(machine); |
| 347 | TMS9928A_interrupt(device->machine); |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | static void coleco_vdp_interrupt(running_machine *machine, int state) |