summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine
diff options
context:
space:
mode:
author yz70s <yz70s@users.noreply.github.com>2019-11-24 17:43:17 +0100
committer yz70s <yz70s@users.noreply.github.com>2019-11-24 17:49:51 +0100
commit4ce85e28caac8d1893aa5890efbc8e6adfce6e10 (patch)
tree295434bfbb473afdde2c2de7856fc336a53da9b9 /src/mame/machine
parentffc1b9a49fcf37ab833cfa4634f56dfffdfa7cae (diff)
xbox_usb.cpp: remove some problems (nw)
Diffstat (limited to 'src/mame/machine')
-rw-r--r--src/mame/machine/xbox_usb.cpp13
1 files changed, 10 insertions, 3 deletions
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;
}