xbox.cpp: use the gamepad only in the console and not the arcade (nw)

This commit is contained in:
yz70s 2016-07-11 23:14:25 +02:00
parent c1fabe4843
commit 4023b5c631
2 changed files with 9 additions and 6 deletions

View File

@ -164,6 +164,8 @@ void xbox_state::hack_usb()
void xbox_state::machine_start()
{
ohci_game_controller_device *usb_device;
xbox_base_state::machine_start();
xbox_devs.ide = machine().device<bus_master_ide_controller_device>("ide");
usbhack_index = -1;
@ -173,6 +175,11 @@ void xbox_state::machine_start()
break;
}*/
usbhack_counter = 0;
usb_device = machine().device<ohci_game_controller_device>("ohci_gamepad");
if (usb_device != nullptr) {
usb_device->initialize(machine(), ohci_usb);
ohci_usb->usb_ohci_plug(3, usb_device); // connect to root hub port 3, chihiro needs to use 1 and 2
}
// savestates
save_item(NAME(usbhack_counter));
}
@ -213,6 +220,8 @@ static MACHINE_CONFIG_DERIVED_CLASS(xbox, xbox_base, xbox_state)
MCFG_SPEAKER_STANDARD_MONO("mono")
// MCFG_SOUND_ADD("aysnd", AY8910, MAIN_CLOCK/4)
// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
MCFG_DEVICE_ADD("ohci_gamepad", OHCI_GAME_CONTROLLER, 0)
MACHINE_CONFIG_END

View File

@ -1105,8 +1105,6 @@ ADDRESS_MAP_END
void xbox_base_state::machine_start()
{
ohci_game_controller_device *usb_device;
nvidia_nv2a = std::make_unique<nv2a_renderer>(machine());
memset(pic16lc_buffer, 0, sizeof(pic16lc_buffer));
pic16lc_buffer[0] = 'B';
@ -1139,9 +1137,6 @@ void xbox_base_state::machine_start()
pic16lc_buffer[0x1f] = 0x0f;
// usb
ohci_usb = machine().device<ohci_usb_controller>("ohci_usb");
usb_device = machine().device<ohci_game_controller_device>("ohci_gamepad");
usb_device->initialize(machine(), ohci_usb);
ohci_usb->usb_ohci_plug(3, usb_device); // connect to root hub port 3, chihiro needs to use 1 and 2
// super-io
memset(&superiost, 0, sizeof(superiost));
superiost.configuration_mode = false;
@ -1202,7 +1197,6 @@ MACHINE_CONFIG_START(xbox_base, xbox_base_state)
// next line is temporary
MCFG_OHCI_USB_CONTROLLER_ADD("ohci_usb")
MCFG_OHCI_USB_CONTROLLER_INTERRUPT_HANDLER(WRITELINE(xbox_base_state, xbox_ohci_usb_interrupt_changed))
MCFG_DEVICE_ADD("ohci_gamepad", OHCI_GAME_CONTROLLER, 0)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)