diff --git a/src/mame/includes/xbox.h b/src/mame/includes/xbox.h index 41cf01835fd..b16866057ae 100644 --- a/src/mame/includes/xbox.h +++ b/src/mame/includes/xbox.h @@ -478,6 +478,8 @@ public: DECLARE_WRITE32_MEMBER(audio_ac93_w); DECLARE_READ32_MEMBER(dummy_r); DECLARE_WRITE32_MEMBER(dummy_w); + DECLARE_READ32_MEMBER(ohci_usb_r); + DECLARE_WRITE32_MEMBER(ohci_usb_w); void smbus_register_device(int address, int(*handler)(xbox_base_state &chs, int command, int rw, int data)); int smbus_pic16lc(int command, int rw, int data); diff --git a/src/mame/machine/xbox.cpp b/src/mame/machine/xbox.cpp index 3698688ea2f..0c58e591fa6 100644 --- a/src/mame/machine/xbox.cpp +++ b/src/mame/machine/xbox.cpp @@ -567,11 +567,6 @@ READ32_MEMBER(ohci_usb_controller::read) logerror("usb controller 0 register %s read\n", usbregnames[offset]); #endif ret = ohcist.hc_regs[offset]; - if (offset == 0) { /* hacks needed until usb (and jvs) is implemented */ -#ifndef USB_HACK_ENABLED - hack_usb(); -#endif - } return ret; } @@ -2522,11 +2517,33 @@ WRITE8_MEMBER(xbox_base_state::superiors232_write) } } +READ32_MEMBER(xbox_base_state::ohci_usb_r) +{ +#ifdef USB_HACK_ENABLED + if (offset == 0) { /* hacks needed until usb (and jvs) is implemented */ + hack_usb(); + } +#endif + return ohci_usb->read(space, offset, mem_mask); +} + +WRITE32_MEMBER(xbox_base_state::ohci_usb_w) +{ +#ifndef USB_HACK_ENABLED + ohci_usb->write(space, offset, mem_mask); +#endif +} + + ADDRESS_MAP_START(xbox_base_map, AS_PROGRAM, 32, xbox_base_state) AM_RANGE(0x00000000, 0x07ffffff) AM_RAM AM_SHARE("nv2a_share") // 128 megabytes AM_RANGE(0xf0000000, 0xf7ffffff) AM_RAM AM_SHARE("nv2a_share") // 3d accelerator wants this AM_RANGE(0xfd000000, 0xfdffffff) AM_RAM AM_READWRITE(geforce_r, geforce_w) +#ifdef USB_HACK_ENABLED + AM_RANGE(0xfed00000, 0xfed003ff) AM_READWRITE(ohci_usb_r, ohci_usb_w) +#else AM_RANGE(0xfed00000, 0xfed003ff) AM_DEVREADWRITE("ohci_usb", ohci_usb_controller, read, write) +#endif AM_RANGE(0xfe800000, 0xfe85ffff) AM_READWRITE(audio_apu_r, audio_apu_w) AM_RANGE(0xfec00000, 0xfec001ff) AM_READWRITE(audio_ac93_r, audio_ac93_w) AM_RANGE(0xff000000, 0xff0fffff) AM_ROM AM_REGION("bios", 0) AM_MIRROR(0x00f80000)