src/mess/drivers/x68k.c
| r4635 | r4636 | |
| 814 | 814 | return 0xff; |
| 815 | 815 | } |
| 816 | 816 | |
| 817 | // XPD-1LR dual D-pad controller. |
| 818 | // Sold with Video Game Anthology Vol 4: Libble Rabble. |
| 819 | // Also compatible with Video Game Anthology Vol 5: Crazy Climber 1 & 2 |
| 820 | // Uses the same input multiplexer hardware as Megadrive controllers |
| 821 | // Output is the same as for standard controllers, but when ctl is high, |
| 822 | // the directions refer to the right D-pad, and when low, the left D-pad |
| 823 | // The buttons are read the same as normal, regardless of ctl. |
| 824 | static UINT8 xpd1lr_r(const device_config* device, int port) |
| 825 | { |
| 826 | if(port == 1) |
| 827 | { |
| 828 | UINT8 porta = input_port_read(device->machine,"xpd1lr") & 0xff; |
| 829 | UINT8 portb = (input_port_read(device->machine,"xpd1lr") >> 8) & 0xff; |
| 830 | if(x68k_sys.mdctrl.mux1 & 0x10) |
| 831 | { |
| 832 | return porta; |
| 833 | } |
| 834 | else |
| 835 | { |
| 836 | return portb | (porta & 0x60); |
| 837 | } |
| 838 | } |
| 839 | if(port == 2) |
| 840 | { |
| 841 | UINT8 porta = (input_port_read(device->machine,"xpd1lr") >> 16) & 0xff; |
| 842 | UINT8 portb = (input_port_read(device->machine,"xpd1lr") >> 24) & 0xff; |
| 843 | if(x68k_sys.mdctrl.mux2 & 0x20) |
| 844 | { |
| 845 | return porta; |
| 846 | } |
| 847 | else |
| 848 | { |
| 849 | return portb | (porta & 0x60); |
| 850 | } |
| 851 | } |
| 852 | return 0xff; |
| 853 | } |
| 854 | |
| 817 | 855 | // Judging from the XM6 source code, PPI ports A and B are joystick inputs |
| 818 | 856 | static READ8_DEVICE_HANDLER( ppi_port_a_r ) |
| 819 | 857 | { |
| r4635 | r4636 | |
| 830 | 868 | return md_3button_r(device,1); |
| 831 | 869 | case 0x02: // 6-button Megadrive gamepad |
| 832 | 870 | return md_6button_r(device,1); |
| 871 | case 0x03: // XPD-1LR |
| 872 | return xpd1lr_r(device,1); |
| 833 | 873 | } |
| 834 | 874 | |
| 835 | 875 | return 0xff; |
| r4635 | r4636 | |
| 850 | 890 | return md_3button_r(device,2); |
| 851 | 891 | case 0x20: // 6-button Megadrive gamepad |
| 852 | 892 | return md_6button_r(device,2); |
| 893 | case 0x30: // XPD-1LR |
| 894 | return xpd1lr_r(device,2); |
| 853 | 895 | } |
| 854 | 896 | |
| 855 | 897 | return 0xff; |
| r4635 | r4636 | |
| 1884 | 1926 | PORT_CATEGORY_ITEM(0x00,"Standard 2-button MSX/FM-Towns joystick",10) |
| 1885 | 1927 | PORT_CATEGORY_ITEM(0x01,"3-button Megadrive gamepad",11) |
| 1886 | 1928 | PORT_CATEGORY_ITEM(0x02,"6-button Megadrive gamepad",12) |
| 1929 | PORT_CATEGORY_ITEM(0x03,"XPD-1LR dual D-pad gamepad",13) |
| 1887 | 1930 | PORT_CATEGORY_CLASS(0xf0,0x00,"Joystick Port 2") |
| 1888 | 1931 | PORT_CATEGORY_ITEM(0x00,"Standard 2-button MSX/FM-Towns joystick",20) |
| 1889 | 1932 | PORT_CATEGORY_ITEM(0x10,"3-button Megadrive gamepad",21) |
| 1890 | 1933 | PORT_CATEGORY_ITEM(0x20,"6-button Megadrive gamepad",22) |
| 1891 | | // TODO: XPD-1LR (Dual D-pad) support |
| 1934 | PORT_CATEGORY_ITEM(0x30,"XPD-1LR dual D-pad gamepad",23) |
| 1892 | 1935 | // TODO: Sharp Cyber Stick (CZ-8NJ2) support |
| 1893 | 1936 | |
| 1894 | 1937 | PORT_START( "joy1" ) |
| r4635 | r4636 | |
| 2144 | 2187 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 X Button") PORT_CATEGORY(22) |
| 2145 | 2188 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 Mode Button") PORT_CATEGORY(22) |
| 2146 | 2189 | |
| 2190 | // Dempa/Micomsoft XPD-1LR (dual D-pad gamepad sold with Libble Rabble) |
| 2191 | PORT_START("xpd1lr") |
| 2192 | PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_NAME("XPD Pad 1 Left/Up") PORT_8WAY PORT_PLAYER(1) PORT_CATEGORY(13) |
| 2193 | PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_NAME("XPD Pad 1 Left/Down") PORT_8WAY PORT_PLAYER(1) PORT_CATEGORY(13) |
| 2194 | PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_NAME("XPD Pad 1 Left/Left") PORT_8WAY PORT_PLAYER(1) PORT_CATEGORY(13) |
| 2195 | PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_NAME("XPD Pad 1 Left/Right") PORT_8WAY PORT_PLAYER(1) PORT_CATEGORY(13) |
| 2196 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CATEGORY(13) |
| 2197 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("XPD Pad 1 B Button") PORT_CATEGORY(13) |
| 2198 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("XPD Pad 1 A Button") PORT_CATEGORY(13) |
| 2199 | PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CATEGORY(13) |
| 2200 | |
| 2201 | PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_NAME("XPD Pad 1 Right/Up") PORT_8WAY PORT_PLAYER(1) PORT_CATEGORY(13) |
| 2202 | PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_NAME("XPD Pad 1 Right/Down") PORT_8WAY PORT_PLAYER(1) PORT_CATEGORY(13) |
| 2203 | PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_NAME("XPD Pad 1 Right/Left") PORT_8WAY PORT_PLAYER(1) PORT_CATEGORY(13) |
| 2204 | PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_NAME("XPD Pad 1 Right/Right") PORT_8WAY PORT_PLAYER(1) PORT_CATEGORY(13) |
| 2205 | PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CATEGORY(13) |
| 2206 | PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CATEGORY(13) |
| 2207 | PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CATEGORY(13) |
| 2208 | PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CATEGORY(13) |
| 2209 | |
| 2210 | PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_NAME("XPD Pad 2 Left/Up") PORT_8WAY PORT_PLAYER(2) PORT_CATEGORY(23) |
| 2211 | PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_NAME("XPD Pad 2 Left/Down") PORT_8WAY PORT_PLAYER(2) PORT_CATEGORY(23) |
| 2212 | PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_NAME("XPD Pad 2 Left/Left") PORT_8WAY PORT_PLAYER(2) PORT_CATEGORY(23) |
| 2213 | PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_NAME("XPD Pad 2 Left/Right") PORT_8WAY PORT_PLAYER(2) PORT_CATEGORY(23) |
| 2214 | PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CATEGORY(23) |
| 2215 | PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("XPD Pad 2 B Button") PORT_CATEGORY(23) |
| 2216 | PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("XPD Pad 2 A Button") PORT_CATEGORY(23) |
| 2217 | PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CATEGORY(23) |
| 2218 | |
| 2219 | PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_NAME("XPD Pad 2 Right/Up") PORT_8WAY PORT_PLAYER(2) PORT_CATEGORY(23) |
| 2220 | PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_NAME("XPD Pad 2 Right/Down") PORT_8WAY PORT_PLAYER(2) PORT_CATEGORY(23) |
| 2221 | PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_NAME("XPD Pad 2 Right/Left") PORT_8WAY PORT_PLAYER(2) PORT_CATEGORY(23) |
| 2222 | PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_NAME("XPD Pad 2 Right/Right") PORT_8WAY PORT_PLAYER(2) PORT_CATEGORY(23) |
| 2223 | PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CATEGORY(23) |
| 2224 | PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CATEGORY(23) |
| 2225 | PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CATEGORY(23) |
| 2226 | PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CATEGORY(23) |
| 2227 | |
| 2147 | 2228 | INPUT_PORTS_END |
| 2148 | 2229 | |
| 2149 | 2230 | static void dimdsk_set_geometry(const device_config* image) |