diff options
author | 2019-11-24 17:43:17 +0100 | |
---|---|---|
committer | 2019-11-24 17:49:51 +0100 | |
commit | 4ce85e28caac8d1893aa5890efbc8e6adfce6e10 (patch) | |
tree | 295434bfbb473afdde2c2de7856fc336a53da9b9 | |
parent | ffc1b9a49fcf37ab833cfa4634f56dfffdfa7cae (diff) |
xbox_usb.cpp: remove some problems (nw)
-rw-r--r-- | src/mame/includes/xbox_usb.h | 2 | ||||
-rw-r--r-- | src/mame/machine/xbox_usb.cpp | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/mame/includes/xbox_usb.h b/src/mame/includes/xbox_usb.h index 1e363823a0a..35f0d7782e7 100644 --- a/src/mame/includes/xbox_usb.h +++ b/src/mame/includes/xbox_usb.h @@ -355,7 +355,7 @@ public: 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; } - void set_irq_callbaclk(std::function<void(int state)> callback) { irq_callback = callback; } + void set_irq_callback(std::function<void(int state)> callback) { irq_callback = callback; } void start(); void reset(); diff --git a/src/mame/machine/xbox_usb.cpp b/src/mame/machine/xbox_usb.cpp index 995c3acc0f9..c272b3ded71 100644 --- a/src/mame/machine/xbox_usb.cpp +++ b/src/mame/machine/xbox_usb.cpp @@ -124,9 +124,12 @@ WRITE32_MEMBER(ohci_usb_controller::write) ohcist.state = hcfs; } if (offset == HcCommandStatus) { + ohcist.hc_regs[HcCommandStatus] |= data; if (data & 1) // HostControllerReset + { ohcist.hc_regs[HcControl] |= 3 << 6; - ohcist.hc_regs[HcCommandStatus] |= data; + ohcist.hc_regs[HcCommandStatus] &= ~1; + } return; } if (offset == HcInterruptStatus) { @@ -231,7 +234,8 @@ void ohci_usb_controller::timer(emu_timer &timer, device_timer_id id, int param, if (ohcist.state == UsbOperational) { // increment frame number ohcist.framenumber = (ohcist.framenumber + 1) & 0xffff; - ohcist.space->write_dword(hcca + 0x80, ohcist.framenumber); + if (hcca) + ohcist.space->write_dword(hcca + 0x80, ohcist.framenumber); ohcist.hc_regs[HcFmNumber] = ohcist.framenumber; } // port reset delay @@ -682,6 +686,8 @@ void ohci_usb_controller::timer(emu_timer &timer, device_timer_id id, int param, else list = 0; // if no control or bulk lists, go to periodic list } + else + list = 0; } } if (ohcist.framenumber == 0) @@ -695,7 +701,8 @@ void ohci_usb_controller::timer(emu_timer &timer, device_timer_id id, int param, if ((ohcist.hc_regs[HcInterruptStatus] & ohcist.hc_regs[HcInterruptEnable]) != WritebackDoneHead) b = 1; ohcist.hc_regs[HcInterruptStatus] |= WritebackDoneHead; - ohcist.space->write_dword(hcca + 0x84, ohcist.hc_regs[HcDoneHead] | b); + if (hcca) + ohcist.space->write_dword(hcca + 0x84, ohcist.hc_regs[HcDoneHead] | b); ohcist.hc_regs[HcDoneHead] = 0; ohcist.writebackdonehadcounter = 7; } |