libusb -> WinUSB bridge (c) 2010 JJS
------------------------------------

What this is:

This is a replacement for the libusb0.dll file that comes with such PSP software
as PSPLINK and RemoteJoy (Lite). It redirects the libusb calls to WinUSB
so that these programs can be run on 64 bit versions of Windows Vista and Windows 7
without disabling the driver signature check enforcement.


What this is NOT:

This is not a generic replacement for libusb. It implements only a small subset of
libusb functionality and important values such as the USB device IDs are hardcoded.



Known issues:

You can only use ONE device at a time. There is no support for multiple connected PSPs
at all (and I only have one, so I am not sure what will happen, but most likely it will 
be a crash or malfunction of some sort).

Also, there is no way in WinUSB to reset an usb device. This means the libusb function
usb_reset() is not implemented, causing the following problems:

- PSPLINK: The PSP has be restarted when the PC application gets closed without proper
  shutdown of the PSP connection (i.e. by clicking "X" in the title bar instead of
  typing "exit").
  
- RemoteJoy Lite: Similar situation as in PSPLINK. If you close the RemoteJoy application
  on the PC, you have to unplug and replug the USB cord if you want to start using
  RemoteJoy again. If you don't, the PC app will be stuck at displaying "WAITING".
  Sometimes it might be necessary to reboot the PSP.



How to use:

The file "libusb0.dll" in the "bin" directory has to be copied to the directory of the
application you want to run (e.g. same directory as "usbhostfs_pc.exe"). There is probably
already a file called "libusb0.dll" there, you should make a backup of this file 
before replacing it.

From now on the application will use the "spoofed" file. To revert to the original, delete
the file "libusb0.dll" and restore the original from the backup you made.

Now you have to change the PSP game or plugin in a way that it reports to the PC as a 
"PSP Type C" (ProductId = 0x01CA) device.



PSPLINK instructions:

As described above, place the file "libusb0.dll" in the directory containing "usbhostfs_pc.exe"
and "pspsh.exe". You don't have to do anything else on the PC side, especially the pid
must not be changed from the default value.

On the PSP, go into the "ms0:/SEPLUGINS" directory and change the file "psplink.ini" to use
a different pid (USB product ID). Replace the line:

# pid=0x1C9

with

pid=0x1CA

Do the same in the "psplink.ini" file in the game folder on your memory stick.



RemoteJoy Lite instructions:

Place the file "libusb0.dll" in the directory containing "RemoteJoyLite.exe".

Unfortunately the source code for the plugin is not available. Therefore you have to 
hexedit the prx. Open the file "RemoteJoyLite.prx" with a hex editor and search for the 
hexvalue "C901", this is the little endian representation of 0x01C9, which is the 
"PSP Type B" USB product ID.

In version 0.20a you will find this exactly 4 times. Replace all instances with "CA01", the
"PSP Type C" product ID.



Driver installation:

Start the PSP game or plugin you configured above and connect your PSP to your PC.

Windows should detect a new device "PSP Type C" and ask you for the device driver location.
If not you have to go into device manager and manually install the driver for the 
"PSP Type C" device.
Point the driver installer to the "driver_usb_type_c_winusb" directory and Windows should
be able to find and install the driver.

If you have PSPdisp v0.4+ installed, the driver is already present on your system.

You can also preinstall the driver by downloading and running the PSPdisp v0.4 setup program
and unchecking every installer option except for "Usb driver (WinUSB)". After that, Windows
will be able to install the driver automatically when the PSP is plugged in.
