mirror of
https://github.com/holub/mame
synced 2025-05-05 22:04:43 +03:00
xbox: some renaming (nw)
This commit is contained in:
parent
94776accf5
commit
fdaca135ee
@ -398,8 +398,6 @@ extern const device_type JVS_MASTER;
|
||||
class jvs_master : public jvs_host
|
||||
{
|
||||
public:
|
||||
//friend class mie_device;
|
||||
|
||||
// construction/destruction
|
||||
jvs_master(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
int get_sense_line();
|
||||
@ -452,7 +450,7 @@ int jvs_master::received_packet(uint8_t *buffer)
|
||||
|
||||
extern const device_type OHCI_HLEAN2131QC;
|
||||
|
||||
class ohci_hlean2131qc_device : public device_t, public ohci_function_device
|
||||
class ohci_hlean2131qc_device : public device_t, public ohci_function
|
||||
{
|
||||
public:
|
||||
ohci_hlean2131qc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
@ -499,7 +497,7 @@ const device_type OHCI_HLEAN2131QC = device_creator<ohci_hlean2131qc_device>;
|
||||
|
||||
extern const device_type OHCI_HLEAN2131SC;
|
||||
|
||||
class ohci_hlean2131sc_device : public device_t, public ohci_function_device
|
||||
class ohci_hlean2131sc_device : public device_t, public ohci_function
|
||||
{
|
||||
public:
|
||||
ohci_hlean2131sc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
@ -786,7 +784,7 @@ const uint8_t ohci_hlean2131qc_device::strdesc2[] = { 0x0E,0x03,0x42,0x00,0x41,0
|
||||
|
||||
ohci_hlean2131qc_device::ohci_hlean2131qc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, OHCI_HLEAN2131QC, "OHCI Hlean2131qc", tag, owner, clock, "ohci_hlean2131qc", __FILE__),
|
||||
ohci_function_device()
|
||||
ohci_function()
|
||||
{
|
||||
maximum_send = 0;
|
||||
region = nullptr;
|
||||
@ -798,7 +796,7 @@ ohci_hlean2131qc_device::ohci_hlean2131qc_device(const machine_config &mconfig,
|
||||
|
||||
void ohci_hlean2131qc_device::initialize(running_machine &machine, ohci_usb_controller *usb_bus_manager)
|
||||
{
|
||||
ohci_function_device::initialize(machine, usb_bus_manager);
|
||||
ohci_function::initialize(machine, usb_bus_manager);
|
||||
add_device_descriptor(devdesc);
|
||||
add_configuration_descriptor(condesc);
|
||||
add_interface_descriptor(intdesc);
|
||||
@ -1104,7 +1102,7 @@ const uint8_t ohci_hlean2131sc_device::strdesc2[] = { 0x0E,0x03,0x42,0x00,0x41,0
|
||||
|
||||
ohci_hlean2131sc_device::ohci_hlean2131sc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, OHCI_HLEAN2131SC, "OHCI Hlean2131sc", tag, owner, clock, "ohci_hlean2131sc", __FILE__),
|
||||
ohci_function_device()
|
||||
ohci_function()
|
||||
{
|
||||
region = nullptr;
|
||||
midi_rs232 = 0;
|
||||
@ -1119,7 +1117,7 @@ void ohci_hlean2131sc_device::set_region_base(uint8_t *data)
|
||||
|
||||
void ohci_hlean2131sc_device::initialize(running_machine &machine, ohci_usb_controller *usb_bus_manager)
|
||||
{
|
||||
ohci_function_device::initialize(machine, usb_bus_manager);
|
||||
ohci_function::initialize(machine, usb_bus_manager);
|
||||
add_device_descriptor(devdesc);
|
||||
add_configuration_descriptor(condesc);
|
||||
add_interface_descriptor(intdesc);
|
||||
|
@ -130,11 +130,11 @@ void xbox_state::hack_eeprom()
|
||||
|
||||
void xbox_state::machine_start()
|
||||
{
|
||||
ohci_game_controller_device *usb_device;
|
||||
ohci_game_controller *usb_device;
|
||||
|
||||
xbox_base_state::machine_start();
|
||||
xbox_devs.ide = machine().device<bus_master_ide_controller_device>("ide");
|
||||
usb_device = machine().device<ohci_game_controller_device>("ohci_gamepad");
|
||||
usb_device = machine().device<ohci_game_controller>("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
|
||||
|
@ -314,7 +314,7 @@ struct usb_device_string
|
||||
int size;
|
||||
};
|
||||
|
||||
struct usb_device_interface_alternate
|
||||
struct usb_device_interfac_alternate
|
||||
{
|
||||
uint8_t *position;
|
||||
int size;
|
||||
@ -322,11 +322,11 @@ struct usb_device_interface_alternate
|
||||
std::forward_list<USBStandardEndpointDescriptor> endpoint_descriptors;
|
||||
};
|
||||
|
||||
struct usb_device_interface
|
||||
struct usb_device_interfac
|
||||
{
|
||||
uint8_t *position;
|
||||
int size;
|
||||
std::forward_list<usb_device_interface_alternate *> alternate_settings;
|
||||
std::forward_list<usb_device_interfac_alternate *> alternate_settings;
|
||||
int selected_alternate;
|
||||
};
|
||||
|
||||
@ -335,17 +335,17 @@ struct usb_device_configuration
|
||||
USBStandardConfigurationDescriptor configuration_descriptor;
|
||||
uint8_t *position;
|
||||
int size;
|
||||
std::forward_list<usb_device_interface *> interfaces;
|
||||
std::forward_list<usb_device_interfac *> interfaces;
|
||||
};
|
||||
|
||||
class ohci_function_device; // forward declaration
|
||||
class ohci_function; // forward declaration
|
||||
|
||||
class ohci_usb_controller
|
||||
{
|
||||
public:
|
||||
ohci_usb_controller();
|
||||
~ohci_usb_controller() {}
|
||||
void usb_ohci_plug(int port, ohci_function_device *function);
|
||||
void usb_ohci_plug(int port, ohci_function *function);
|
||||
void usb_ohci_device_address_changed(int old_address, int new_address);
|
||||
void set_cpu(cpu_device *cpu) { m_maincpu = cpu; }
|
||||
void set_timer(emu_timer *timer) { ohcist.timer = timer; }
|
||||
@ -371,13 +371,13 @@ private:
|
||||
struct {
|
||||
uint32_t hc_regs[256];
|
||||
struct {
|
||||
ohci_function_device *function;
|
||||
ohci_function *function;
|
||||
int address;
|
||||
int delay;
|
||||
} ports[4 + 1];
|
||||
struct
|
||||
{
|
||||
ohci_function_device *function;
|
||||
ohci_function *function;
|
||||
int port;
|
||||
} address[256];
|
||||
emu_timer *timer;
|
||||
@ -395,9 +395,9 @@ private:
|
||||
} ohcist;
|
||||
};
|
||||
|
||||
class ohci_function_device {
|
||||
class ohci_function {
|
||||
public:
|
||||
ohci_function_device();
|
||||
ohci_function();
|
||||
virtual void initialize(running_machine &machine, ohci_usb_controller *usb_bus_manager);
|
||||
virtual void execute_reset();
|
||||
virtual void execute_connect() {};
|
||||
@ -448,16 +448,16 @@ protected:
|
||||
std::forward_list<usb_device_configuration *> configurations;
|
||||
std::forward_list<usb_device_string *> device_strings;
|
||||
usb_device_configuration *latest_configuration;
|
||||
usb_device_interface_alternate *latest_alternate;
|
||||
usb_device_interfac_alternate *latest_alternate;
|
||||
usb_device_configuration *selected_configuration;
|
||||
};
|
||||
|
||||
extern const device_type OHCI_GAME_CONTROLLER;
|
||||
|
||||
class ohci_game_controller_device : public device_t, public ohci_function_device
|
||||
class ohci_game_controller : public device_t, public ohci_function
|
||||
{
|
||||
public:
|
||||
ohci_game_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
ohci_game_controller(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
void initialize(running_machine &machine, ohci_usb_controller *usb_bus_manager) override;
|
||||
int handle_nonstandard_request(int endpoint, USBSetupPacket *setup) override;
|
||||
int handle_interrupt_pid(int endpoint, int pid, uint8_t *buffer, int size) override;
|
||||
|
@ -703,7 +703,7 @@ void ohci_usb_controller::timer(emu_timer &timer, device_timer_id id, int param,
|
||||
usb_ohci_interrupts();
|
||||
}
|
||||
|
||||
void ohci_usb_controller::usb_ohci_plug(int port, ohci_function_device *function)
|
||||
void ohci_usb_controller::usb_ohci_plug(int port, ohci_function *function)
|
||||
{
|
||||
if ((port > 0) && (port <= 4)) {
|
||||
ohcist.ports[port].function = function;
|
||||
@ -852,11 +852,11 @@ void ohci_usb_controller::usb_ohci_device_address_changed(int old_address, int n
|
||||
* ohci device base class
|
||||
*/
|
||||
|
||||
ohci_function_device::ohci_function_device()
|
||||
ohci_function::ohci_function()
|
||||
{
|
||||
}
|
||||
|
||||
void ohci_function_device::initialize(running_machine &machine, ohci_usb_controller *usb_bus_manager)
|
||||
void ohci_function::initialize(running_machine &machine, ohci_usb_controller *usb_bus_manager)
|
||||
{
|
||||
busmanager = usb_bus_manager;
|
||||
state = DefaultState;
|
||||
@ -881,7 +881,7 @@ void ohci_function_device::initialize(running_machine &machine, ohci_usb_control
|
||||
latest_alternate = nullptr;
|
||||
}
|
||||
|
||||
void ohci_function_device::add_device_descriptor(const USBStandardDeviceDescriptor &descriptor)
|
||||
void ohci_function::add_device_descriptor(const USBStandardDeviceDescriptor &descriptor)
|
||||
{
|
||||
uint8_t *p = descriptors + descriptors_pos;
|
||||
|
||||
@ -907,7 +907,7 @@ void ohci_function_device::add_device_descriptor(const USBStandardDeviceDescript
|
||||
memcpy(&device_descriptor, &descriptor, sizeof(USBStandardDeviceDescriptor));
|
||||
}
|
||||
|
||||
void ohci_function_device::add_configuration_descriptor(const USBStandardConfigurationDescriptor &descriptor)
|
||||
void ohci_function::add_configuration_descriptor(const USBStandardConfigurationDescriptor &descriptor)
|
||||
{
|
||||
usb_device_configuration *c = new usb_device_configuration;
|
||||
uint8_t *p = descriptors + descriptors_pos;
|
||||
@ -930,10 +930,10 @@ void ohci_function_device::add_configuration_descriptor(const USBStandardConfigu
|
||||
latest_alternate = nullptr;
|
||||
}
|
||||
|
||||
void ohci_function_device::add_interface_descriptor(const USBStandardInterfaceDescriptor &descriptor)
|
||||
void ohci_function::add_interface_descriptor(const USBStandardInterfaceDescriptor &descriptor)
|
||||
{
|
||||
usb_device_interface *ii;
|
||||
usb_device_interface_alternate *aa;
|
||||
usb_device_interfac *ii;
|
||||
usb_device_interfac_alternate *aa;
|
||||
uint8_t *p = descriptors + descriptors_pos;
|
||||
|
||||
if (latest_configuration == nullptr)
|
||||
@ -955,7 +955,7 @@ void ohci_function_device::add_interface_descriptor(const USBStandardInterfaceDe
|
||||
{
|
||||
(*i)->size += descriptor.bLength;
|
||||
latest_configuration->interfaces.front()->size += descriptor.bLength;
|
||||
aa = new usb_device_interface_alternate;
|
||||
aa = new usb_device_interfac_alternate;
|
||||
memcpy(&aa->interface_descriptor, &descriptor, sizeof(USBStandardInterfaceDescriptor));
|
||||
aa->position = p;
|
||||
aa->size = descriptor.bLength;
|
||||
@ -964,8 +964,8 @@ void ohci_function_device::add_interface_descriptor(const USBStandardInterfaceDe
|
||||
return;
|
||||
}
|
||||
}
|
||||
ii = new usb_device_interface;
|
||||
aa = new usb_device_interface_alternate;
|
||||
ii = new usb_device_interfac;
|
||||
aa = new usb_device_interfac_alternate;
|
||||
memcpy(&aa->interface_descriptor, &descriptor, sizeof(USBStandardInterfaceDescriptor));
|
||||
aa->position = p;
|
||||
aa->size = descriptor.bLength;
|
||||
@ -977,7 +977,7 @@ void ohci_function_device::add_interface_descriptor(const USBStandardInterfaceDe
|
||||
latest_configuration->interfaces.push_front(ii);
|
||||
}
|
||||
|
||||
void ohci_function_device::add_endpoint_descriptor(const USBStandardEndpointDescriptor &descriptor)
|
||||
void ohci_function::add_endpoint_descriptor(const USBStandardEndpointDescriptor &descriptor)
|
||||
{
|
||||
uint8_t *p = descriptors + descriptors_pos;
|
||||
|
||||
@ -997,7 +997,7 @@ void ohci_function_device::add_endpoint_descriptor(const USBStandardEndpointDesc
|
||||
latest_configuration->size += descriptor.bLength;
|
||||
}
|
||||
|
||||
void ohci_function_device::add_string_descriptor(const uint8_t *descriptor)
|
||||
void ohci_function::add_string_descriptor(const uint8_t *descriptor)
|
||||
{
|
||||
usb_device_string *ss;
|
||||
int len = descriptor[0];
|
||||
@ -1013,7 +1013,7 @@ void ohci_function_device::add_string_descriptor(const uint8_t *descriptor)
|
||||
//latest_configuration->size += len;
|
||||
}
|
||||
|
||||
void ohci_function_device::select_configuration(int index)
|
||||
void ohci_function::select_configuration(int index)
|
||||
{
|
||||
configurationvalue = index;
|
||||
for (auto c = configurations.begin(); c != configurations.end(); ++c)
|
||||
@ -1044,7 +1044,7 @@ void ohci_function_device::select_configuration(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void ohci_function_device::select_alternate(int interfacei, int index)
|
||||
void ohci_function::select_alternate(int interfacei, int index)
|
||||
{
|
||||
// among all the interfaces in the currently selected configuration, consider interface interfacei
|
||||
for (auto i = selected_configuration->interfaces.begin(); i != selected_configuration->interfaces.end(); ++i)
|
||||
@ -1078,7 +1078,7 @@ void ohci_function_device::select_alternate(int interfacei, int index)
|
||||
}
|
||||
}
|
||||
|
||||
int ohci_function_device::find_alternate(int interfacei)
|
||||
int ohci_function::find_alternate(int interfacei)
|
||||
{
|
||||
// find the active alternate setting for interface inteerfacei
|
||||
for (auto i = selected_configuration->interfaces.begin(); i != selected_configuration->interfaces.end(); ++i)
|
||||
@ -1094,13 +1094,13 @@ int ohci_function_device::find_alternate(int interfacei)
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t *ohci_function_device::position_device_descriptor(int &size)
|
||||
uint8_t *ohci_function::position_device_descriptor(int &size)
|
||||
{
|
||||
size = descriptors_pos; // descriptors[0];
|
||||
return descriptors;
|
||||
}
|
||||
|
||||
uint8_t *ohci_function_device::position_configuration_descriptor(int index, int &size)
|
||||
uint8_t *ohci_function::position_configuration_descriptor(int index, int &size)
|
||||
{
|
||||
for (auto c = configurations.begin(); c != configurations.end(); ++c)
|
||||
{
|
||||
@ -1114,7 +1114,7 @@ uint8_t *ohci_function_device::position_configuration_descriptor(int index, int
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint8_t *ohci_function_device::position_string_descriptor(int index, int &size)
|
||||
uint8_t *ohci_function::position_string_descriptor(int index, int &size)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@ -1131,13 +1131,13 @@ uint8_t *ohci_function_device::position_string_descriptor(int index, int &size)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ohci_function_device::execute_reset()
|
||||
void ohci_function::execute_reset()
|
||||
{
|
||||
address = 0;
|
||||
newaddress = 0;
|
||||
}
|
||||
|
||||
int ohci_function_device::execute_transfer(int endpoint, int pid, uint8_t *buffer, int size)
|
||||
int ohci_function::execute_transfer(int endpoint, int pid, uint8_t *buffer, int size)
|
||||
{
|
||||
int descriptortype, descriptorindex;
|
||||
|
||||
@ -1375,17 +1375,17 @@ INPUT_PORTS_START(xbox_controller)
|
||||
PORT_CODE_DEC(KEYCODE_H) PORT_CODE_INC(KEYCODE_Y)
|
||||
INPUT_PORTS_END
|
||||
|
||||
const USBStandardDeviceDescriptor ohci_game_controller_device::devdesc = { 18,1,0x110,0x00,0x00,0x00,64,0x45e,0x202,0x100,0,0,0,1 };
|
||||
const USBStandardConfigurationDescriptor ohci_game_controller_device::condesc = { 9,2,0x20,1,1,0,0x80,50 };
|
||||
const USBStandardInterfaceDescriptor ohci_game_controller_device::intdesc = { 9,4,0,0,2,0x58,0x42,0,0 };
|
||||
const USBStandardEndpointDescriptor ohci_game_controller_device::enddesc82 = { 7,5,0x82,3,0x20,4 };
|
||||
const USBStandardEndpointDescriptor ohci_game_controller_device::enddesc02 = { 7,5,0x02,3,0x20,4 };
|
||||
const USBStandardDeviceDescriptor ohci_game_controller::devdesc = { 18,1,0x110,0x00,0x00,0x00,64,0x45e,0x202,0x100,0,0,0,1 };
|
||||
const USBStandardConfigurationDescriptor ohci_game_controller::condesc = { 9,2,0x20,1,1,0,0x80,50 };
|
||||
const USBStandardInterfaceDescriptor ohci_game_controller::intdesc = { 9,4,0,0,2,0x58,0x42,0,0 };
|
||||
const USBStandardEndpointDescriptor ohci_game_controller::enddesc82 = { 7,5,0x82,3,0x20,4 };
|
||||
const USBStandardEndpointDescriptor ohci_game_controller::enddesc02 = { 7,5,0x02,3,0x20,4 };
|
||||
|
||||
const device_type OHCI_GAME_CONTROLLER = device_creator<ohci_game_controller_device>;
|
||||
const device_type OHCI_GAME_CONTROLLER = device_creator<ohci_game_controller>;
|
||||
|
||||
ohci_game_controller_device::ohci_game_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
ohci_game_controller::ohci_game_controller(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, OHCI_GAME_CONTROLLER, "OHCI Game Controller", tag, owner, clock, "ohci_gc", __FILE__),
|
||||
ohci_function_device(),
|
||||
ohci_function(),
|
||||
m_ThumbstickLh(*this, "ThumbstickLh"),
|
||||
m_ThumbstickLv(*this, "ThumbstickLv"),
|
||||
m_ThumbstickRh(*this, "ThumbstickRh"),
|
||||
@ -1403,9 +1403,9 @@ ohci_game_controller_device::ohci_game_controller_device(const machine_config &m
|
||||
{
|
||||
}
|
||||
|
||||
void ohci_game_controller_device::initialize(running_machine &machine, ohci_usb_controller *usb_bus_manager)
|
||||
void ohci_game_controller::initialize(running_machine &machine, ohci_usb_controller *usb_bus_manager)
|
||||
{
|
||||
ohci_function_device::initialize(machine, usb_bus_manager);
|
||||
ohci_function::initialize(machine, usb_bus_manager);
|
||||
add_device_descriptor(devdesc);
|
||||
add_configuration_descriptor(condesc);
|
||||
add_interface_descriptor(intdesc);
|
||||
@ -1413,7 +1413,7 @@ void ohci_game_controller_device::initialize(running_machine &machine, ohci_usb_
|
||||
add_endpoint_descriptor(enddesc02);
|
||||
}
|
||||
|
||||
int ohci_game_controller_device::handle_nonstandard_request(int endpoint, USBSetupPacket *setup)
|
||||
int ohci_game_controller::handle_nonstandard_request(int endpoint, USBSetupPacket *setup)
|
||||
{
|
||||
// >=8 ==42 !=0 !=0 1,3 2<20 <=20
|
||||
static const uint8_t reportinfo[16] = { 0x10,0x42 ,0x32,0x43,1 ,0x65,0x14,0x20,0x98,0xa9,0xba,0xcb,0xdc,0xed,0xfe };
|
||||
@ -1466,7 +1466,7 @@ int ohci_game_controller_device::handle_nonstandard_request(int endpoint, USBSet
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ohci_game_controller_device::handle_interrupt_pid(int endpoint, int pid, uint8_t *buffer, int size)
|
||||
int ohci_game_controller::handle_interrupt_pid(int endpoint, int pid, uint8_t *buffer, int size)
|
||||
{
|
||||
if ((endpoint == 2) && (pid == InPid)) {
|
||||
int v;
|
||||
@ -1506,11 +1506,11 @@ int ohci_game_controller_device::handle_interrupt_pid(int endpoint, int pid, uin
|
||||
return -1;
|
||||
}
|
||||
|
||||
void ohci_game_controller_device::device_start()
|
||||
void ohci_game_controller::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
ioport_constructor ohci_game_controller_device::device_input_ports() const
|
||||
ioport_constructor ohci_game_controller::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME(xbox_controller);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user