示例#1
0
文件: main.c 项目: AlanDrake/ags
int kernel_sceKernelRegisterSysEventHandler(PspSysEventHandler *handler)
{
	u32 k1;
	k1 = pspSdkSetK1(0);
	
	int result = sceKernelRegisterSysEventHandler(handler);
	
	pspSdkSetK1(k1);
	return result;
}
示例#2
0
void ResetME(int devkitVersion){
	unsigned int k1 = pspSdkSetK1(0);
	int *meStarted;
	int ret;
	if (devkitVersion < 0x03070000){
		meStarted = (int*)(mod->text_addr+0x00002C5C);//352
		*meStarted = 0;
		ret = sceMeBootStart(2);
	}
	else if (devkitVersion < 0x03080000){
		meStarted = (int*)(mod->text_addr+0x00002BCC);//371
		*meStarted = 0;
		ret = sceMeBootStart371(2);
	}
	else if (devkitVersion < 0x03090500){
		meStarted = (int*)(mod->text_addr+0x00002C2C);//380
		*meStarted = 0;
		ret = sceMeBootStart380(2);
	}
	else if (devkitVersion < 0x05000000){
//		*(int*)0xUNKNOWN3 = 0;//390
		ret = sceMeBootStart395(2);
	}
	else if (devkitVersion < 0x06000000){
		meStarted = (int*)(mod->text_addr+0x00002B9C);//500,550
		*meStarted = 0;
		ret = sceMeBootStart500(2);
	}
	else if (devkitVersion < 0x06020000){
		meStarted = (int*)(mod->text_addr+0x00002C5C);//600
		*meStarted = 0;
		ret = sceMeBootStart620(2);
	}
	else if (devkitVersion < 0x06030500){
		meStarted = (int*)(mod->text_addr+0x00002C4C);//620
		*meStarted = 0;
		ret = sceMeBootStart620(2);
	}
	else if (devkitVersion < 0x06060000){
		meStarted = (int*)(mod->text_addr+0x00002C4C);//635,638,639,660
		*meStarted = 0;
		ret = sceMeBootStart635(2);
	}//0x06030910
	else{
		meStarted = (int*)(mod->text_addr+0x00002C4C);//660
		*meStarted = 0;
		ret = sceMeBootStart660(2);
	}
	
	if (handler){
		sceKernelRegisterSysEventHandler(handler);
	}
	pspSdkSetK1(k1);

}
示例#3
0
文件: main.c 项目: joel16/utopia
int sceHibariInit()
{
	Kprintf("Hibari Display Driver Clone v 0.1\n");
	Kprintf("Copyright (C) 2007, Dark_AleX\n");
	
	int tachyon = sceSysregGetTachyonVersion();

	Kprintf("Tachyon version = 0x%08X.\n", tachyon);

	if (tachyon < 0x00500000)
		return 0x80000004;

	_Init();

	hibari_struct[0] = 0;
	st2.ptr = NULL;
	st2.unk1 = 0;	
	sceKernelRegisterSysEventHandler(&event_handler);
	
	return 0;
}
示例#4
0
文件: lcdc.c 项目: Kaegell/uofw
// 75F0
int sceLcdcInit()
{
    SceLcdcHwController *hwCtl = (SceLcdcHwController*)(0xBE140000);
    memset(&g_lcdc, 0, sizeof(g_lcdc));
    g_lcdc.v3_0 = 1;
    int v = sub_0768();
    sub_0A80();
    int model = sceSysreg_driver_E2A5D1EE();
    g_lcdc.mobo = model;
    // patch for newer versions
    if (model > 0x4FFFFF)
    {
        // 76B0
        if (model > 0x7FFFFF)
        {
            // 7720
            hwCtl = (SceLcdcHwController*)(0xBE140100);
            if (v == 0) {
                *(int*)(0xBE140000) = 0;
                *(int*)(0xBE140200) = 1;
            }
            // 7740
            g_lcdcDispModeList[8].clk[1] = 2;
            g_lcdc.v3_8 = 1;
            g_lcdcDispModeList[3].id = -1;
            g_lcdcDispModeList[6].clk[1] = 4;
            g_lcdc.scale = 1;
            g_lcdcDispModeList[1].clk[0] = 2;
            g_lcdcDispModeList[1].clk[1] = 2;
            g_lcdcDispModeList[2].id = -1;
            g_lcdcDispModeList[4].clk[0] = 2;
            g_lcdcDispModeList[4].clk[1] = 4;
            g_lcdcDispModeList[5].clk[0] = 2;
            g_lcdcDispModeList[5].clk[1] = 4;
            g_lcdcDispModeList[6].clk[0] = 2;
            *(int*)(0xBE140170) = 1;
        }
        else
        {
            hwCtl = (SceLcdcHwController*)(0xBE140000);
            g_lcdc.scale = 3;
            g_lcdc.v3_8 = 1;
            g_lcdcDispModeList[3].id    = -1;
            g_lcdcDispModeList[8].clk[1] = 1;
            *(int*)(0xBE140070) = 1;
            g_lcdcDispModeList[0].clk[1] = 1;
            g_lcdcDispModeList[1].clk[0] = 1;
            g_lcdcDispModeList[1].clk[1] = 1;
            g_lcdcDispModeList[2].id    = -1;
            g_lcdcDispModeList[4].clk[0] = 1;
            g_lcdcDispModeList[4].clk[1] = 1;
            g_lcdcDispModeList[5].clk[0] = 1;
            g_lcdcDispModeList[5].clk[1] = 1;
            g_lcdcDispModeList[6].clk[0] = 1;
            g_lcdcDispModeList[6].clk[1] = 1;
            g_lcdcDispModeList[7].clk[1] = 1;
            g_lcdcDispModeList[8].clk[0] = 1;
        }
    }
    else
        g_lcdc.scale = 1;
    // 766C
    g_lcdc.hwCtl = hwCtl;
    sceLcdc_driver_901B9073();
    g_lcdc.hwCtl->v2_0 |= 3;
    sceKernelRegisterSysEventHandler(&lcdcEvent);
    return 0;
}