示例#1
0
文件: m33boot.c 项目: azuwis/xreader
static int lanuch_api(void)
{
	memset(&param, 0, sizeof(param));
	param.size = sizeof(param);
	param.args = strlen(program) + 1;
	param.argp = (char *) program;
	param.key = mode;

	dbg_printf(d, "%s: program %s", __func__, program);

	return sctrlKernelLoadExecVSHWithApitype(apitype, program, &param);
}
示例#2
0
int vpbp_loadexec(char * file, struct SceKernelLoadExecVSHParam * param)
{
    int ret;
    SEConfig config;
    VirtualPBP *vpbp;
    int apitype;
    const char *loadexec_file;

    lock();
    vpbp = get_vpbp_by_path(file);

    if (vpbp == NULL) {
        printk("%s: Unknown file %s in vpbp list\n", __func__, file);
        unlock();

        return -31;
    }

    sctrlSEGetConfig(&config);

    if(config.chn_iso) {
        get_ISO_shortname(vpbp->name, sizeof(vpbp->name), vpbp->name);
    }

    //set iso file for reboot
    sctrlSESetUmdFile(vpbp->name);

    //set iso mode for reboot
    sctrlSESetBootConfFileIndex(config.umdmode);
    sctrlSESetDiscType(PSP_UMD_TYPE_GAME);

    //enable high memory on demand
    if(config.retail_high_memory) sctrlHENSetMemory(55, 0);

    printk("%s: ISO %s, UMD mode %d\n", __func__, vpbp->name, config.umdmode);

    //reset and configure reboot parameter
    memset(param, 0, sizeof(param));
    param->size = sizeof(param);

    if (has_prometheus_module(vpbp)) {
        printk("%s: prometheus module detected, use EBOOT.OLD\n", __func__);
        param->argp = "disc0:/PSP_GAME/SYSDIR/EBOOT.OLD";
    } else {
        param->argp = "disc0:/PSP_GAME/SYSDIR/EBOOT.BIN";
    }

    param->args = strlen(param->argp) + 1;

    if (psp_model == PSP_GO) {
        char devicename[20];

        ret = get_device_name(devicename, sizeof(devicename), vpbp->name);

        if(ret == 0 && 0 == stricmp(devicename, "ef0:")) {
            apitype = 0x125;
        } else {
            apitype = 0x123;
        }

        param->key = "umdemu";
        loadexec_file = vpbp->name;
    } else {
        if(config.umdmode == MODE_MARCH33) {
            param->key = "game";
        } else {
            param->key = "umdemu";
        }

        apitype = 0x120;
        loadexec_file = param->argp;
    }

    //start game image
    return sctrlKernelLoadExecVSHWithApitype(apitype, loadexec_file, param);

    unlock();

    return ret;
}