Ejemplo n.º 1
0
bool LV2::init(U32 entry) {
    // Load and start liblv2.sprx module
    S32 moduleId = sys_prx_load_module("/dev_flash/sys/external/liblv2.sprx", 0, 0);
    if (moduleId <= CELL_OK) {
        logger.error(LOG_HLE, "You need to provide the /dev_flash/sys/external/ firmware files.");
        return false;
    }
    sys_prx_start_module_option_t startFunc;
    sys_prx_start_module(moduleId, 0, &startFunc);

    BE<U64> thread_id;
    sys_ppu_thread_attr_t attr;
    attr.entry = startFunc.entry.ToLE();
    attr.tls_addr = 0;
    sys_ppu_thread_create(&thread_id, &attr, 0, 0, 500/*TODO*/, 0x10000, 0, "main"/*TODO*/);

    // Set sys_initialize_tls arguments for liblv2.sprx's start function
    auto* state = objects.get<sys_ppu_thread_t>(thread_id)->thread->state.get();
    state->r[7] = 0x0; // TODO
    state->r[8] = 0x0; // TODO
    state->r[9] = 0x0; // TODO
    state->r[10] = 0x90;
    state->r[11] = entry;

    sys_ppu_thread_start(thread_id);
    return true;
}
Ejemplo n.º 2
0
bool LV2::init()
{
    initialized = true;

    // Load and start liblv2.sprx module
    s32 moduleId = sys_prx_load_module("/dev_flash/sys/external/liblv2.sprx", 0, 0);
    if (moduleId <= CELL_OK) {
        nucleus.log.error(LOG_HLE, "You need to provide the /dev_flash/sys/external/ firmware files.");
        return false;
    }
    sys_prx_start_module_option_t startFunc;
    sys_prx_start_module(moduleId, 0, &startFunc);
    Callback{(u32)startFunc.entry}.call();
    return true;
}