コード例 #1
0
ファイル: usbdevice.c プロジェクト: sseary/procfw-chn
static int _sceUsbStart(const char *driverName, int size, void *args)
{
    int ret;
    u32 k1;

    k1 = pspSdkSetK1(0);

    if (0 == strcmp(driverName, "USBStor_Driver")) {
        if(conf.usbdevice > 0 && conf.usbdevice <= 5) {
            if (g_usbdevice_modid < 0) {
                g_usbdevice_modid = load_start_usbdevice();
            }

            if (g_usbdevice_modid >= 0) {
                ret = pspUsbDeviceSetDevice(conf.usbdevice - 1, conf.flashprot, 0);
                printk("%s: pspUsbDeviceSetDevice %d %d -> 0x%08X\n", __func__,
                       conf.usbdevice-1, conf.flashprot, ret);
            }
        }
    }

    pspSdkSetK1(k1);
    ret = (*sceUsbStartOrig)(driverName, size, args);

    return ret;
}
コード例 #2
0
ファイル: usb.c プロジェクト: nicolai92/Crossover-Experience
/**
 * Connects a device through usb
 * @param device The usbdevice to connect to
 */
void ConnectUSB(u32 device)
{
	LoadStartModule("flash0:/kd/semawm.prx");
	LoadStartModule("flash0:/kd/usbstor.prx");
    LoadStartModule("flash0:/kd/usbstormgr.prx");
    LoadStartModule("flash0:/kd/usbstorms.prx");
    LoadStartModule("flash0:/kd/usbstorboot.prx");
	LoadStartModule("flash0:/kd/usbdevice.prx");

	pspUsbDeviceSetDevice(device, 0, 0);
	sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
	sceUsbStart(PSP_USBSTOR_DRIVERNAME, 0, 0);
	sceUsbstorBootSetCapacity(0x800000);
	
	sceUsbActivate(0x1c8);

	usb_mode = vlfGuiAddTextF(200, 120, "USB Mode");
	vlfGuiBottomDialog(VLF_DI_BACK, -1, 1, 230, 580, BackToUsb);
}