Beispiel #1
0
int LPP_UtilsBrowserInit(int memorysize, const char *url)
{
    sceHttpInit(0x25800);

    memset(&lpp_UtilsBrowserParams, 0, sizeof(lpp_UtilsBrowserParams));

    lpp_UtilsBrowserParams.base.size = sizeof(lpp_UtilsBrowserParams);
    sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_LANGUAGE, &lpp_UtilsBrowserParams.base.language);
    sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_UNKNOWN, &lpp_UtilsBrowserParams.base.buttonSwap);

    lpp_UtilsBrowserParams.base.graphicsThread = 17;
    lpp_UtilsBrowserParams.base.accessThread = 19;
    lpp_UtilsBrowserParams.base.fontThread = 18;
    lpp_UtilsBrowserParams.base.soundThread = 16;

    lpp_UtilsBrowserParams.memsize = memorysize;
    lpp_UtilsBrowserParams.initialurl = (char *)url;
    lpp_UtilsBrowserParams.numtabs = 3;
    lpp_UtilsBrowserParams.textsize = PSP_UTILITY_HTMLVIEWER_TEXTSIZE_SMALL;
    lpp_UtilsBrowserParams.connectmode = PSP_UTILITY_HTMLVIEWER_CONNECTMODE_MANUAL_ALL;
    lpp_UtilsBrowserParams.textsize = PSP_UTILITY_HTMLVIEWER_TEXTSIZE_NORMAL;
    lpp_UtilsBrowserParams.interfacemode = PSP_UTILITY_HTMLVIEWER_INTERFACEMODE_FULL;
    lpp_UtilsBrowserParams.displaymode = PSP_UTILITY_HTMLVIEWER_DISPLAYMODE_SMART_FIT;

    lpp_UtilsBrowserParams.memaddr = malloc(memorysize);
    if(!lpp_UtilsBrowserParams.memaddr) return -1;

    int res = sceUtilityHtmlViewerInitStart(&lpp_UtilsBrowserParams);
    if(res == 0) return 1;

    return res;
}
Beispiel #2
0
void htmlViewerInit(char *url)
{
	int res;
	
	vpl = sceKernelCreateVpl("BrowserVpl", PSP_MEMORY_PARTITION_USER, 0, BROWSER_MEMORY + 256, NULL);
	
	if (vpl < 0) 
		throwError(6000, "Error 0x%08X creating vpl.\n", vpl);

	memset(&params, 0, sizeof(pspUtilityHtmlViewerParam));
	
	params.base.size = sizeof(pspUtilityHtmlViewerParam);
	
	sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_LANGUAGE, &params.base.language);
	sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_UNKNOWN, &params.base.buttonSwap);
	
	params.base.graphicsThread = 17;
	params.base.accessThread = 19;
	params.base.fontThread = 18;
	params.base.soundThread = 16;	
	params.memsize = BROWSER_MEMORY;
	params.initialurl = url;
	params.numtabs = 1;
	params.cookiemode = PSP_UTILITY_HTMLVIEWER_COOKIEMODE_DEFAULT;
	params.homeurl = url;
	params.textsize = PSP_UTILITY_HTMLVIEWER_TEXTSIZE_NORMAL;
	params.displaymode = PSP_UTILITY_HTMLVIEWER_DISPLAYMODE_SMART_FIT;
	params.options = PSP_UTILITY_HTMLVIEWER_DISABLE_STARTUP_LIMITS|PSP_UTILITY_HTMLVIEWER_ENABLE_FLASH;
	params.interfacemode = PSP_UTILITY_HTMLVIEWER_INTERFACEMODE_FULL;
	params.connectmode = PSP_UTILITY_HTMLVIEWER_CONNECTMODE_MANUAL_ALL;
	
	// Note the lack of 'ms0:' on the paths	
	params.dldirname = "/PSP/PHOTO";
	
	res = sceKernelAllocateVpl(vpl, params.memsize, &params.memaddr, NULL);
	
	if (res < 0) 
		throwError(6000, "Error 0x%08X allocating browser memory.\n", res);

	res = sceUtilityHtmlViewerInitStart(&params);
	
	if (res < 0)
		throwError(6000, "Error 0x%08X initing browser.\n", res);
}