Exemplo n.º 1
0
Arquivo: main.c Projeto: joel16/utopia
int sceHibariUnk10()
{
	sceSysregSpiIoDisable(1);
	sceSysregSpiClkDisable(1);
	sceGpioSetPortMode(0, 2);

	return 0;
}
Exemplo n.º 2
0
Arquivo: main.c Projeto: joel16/utopia
static void _Init()
{
	sceSysregSpiClkSelect(1, 3);
	sceSysregSpiClkEnable(1);
	sceSysregSpiIoEnable(1);

	*(volatile u32 *)0xbe5c0000 = 0xF;
	*(volatile u32 *)0xbe5c0004 = 0;
	*(volatile u32 *)0xbe5c0010 = 2;
	*(volatile u32 *)0xbe5c0014 = 0;
	*(volatile u32 *)0xbe5c0024 = 0;
	asm("sync\n");

	sceSysregSpiClkDisable(1);
	sceGpioSetPortMode(0, 0);

	hibari_struct[1] = hibari_struct[2] = hibari_struct[3] = -1;
}
Exemplo n.º 3
0
Arquivo: main.c Projeto: joel16/utopia
static int SysEventHandler(int ev_id, char* ev_name, void* param, int* result)
{
	switch (ev_id)
	{
		case 0x4008: // going to sleep mode
			sceSysregSpiIoDisable(1);
			sceSysregSpiClkDisable(1);
			sceGpioSetPortMode(0, 2);
		break;

		case 0x10008: // returning from sleep mode
			_Init();
		break;

		case  0x402: 
			if (sceHibariUnk1(1) != 0)
				return 0x80000021;
		break;
	}
	
	return 0;
}
Exemplo n.º 4
0
Arquivo: led.c Projeto: esxgx/uofw
int sceLedInit(void)
{    
    int i;
    memset(&leds, 0, 0xF0);
    g_00000F40 = 2;
    leds[LED_TYPE_MS].gpioPort = 6;
    leds[LED_TYPE_MS].unk2 = 0;
    leds[LED_TYPE_WLAN].gpioPort = 7;
    leds[LED_TYPE_WLAN].unk2 = 1;
    
    int model = sceKernelGetModel();
    if((model - 1 < 2) || model == 4)
    {
        leds[LED_TYPE_WLAN].unk1 = 1;
    }
    if(((model - 4) < 2) || model == 7 || model == 9)
    {
        //loc_0000022C
        leds[LED_TYPE_BT].gpioPort = 24;
        leds[LED_TYPE_BT].unk2 = 3;
        if(model == 4)
            leds[LED_TYPE_BT].unk1 = 1;
        g_00000F40 = 3;
    }

    if(g_00000F40 >= 0)
    {
        for(i = 0; i < g_00000F40; i++)
        {
            //loc_000000D4
            if(sceGpioGetPortMode(leds[i].gpioPort) == 2)
            {
                //loc_00000210
                sceGpioSetPortMode(leds[i].gpioPort, 0);
                if(leds[i].unk1 == 0)
                {
                    //loc_000001AC
                    sceGpioPortClear(1 << leds[i].gpioPort);
                    continue;
                }
            }
            else if(i == LED_TYPE_BT)
            {
                //loc_000001BC
                int gpioPort = sceGpioPortRead();
                int btStatus = sceSysconGetBtPowerStatus();
                
                if(((btStatus == 0) ? 0 : (((gpioPort >> leds[i].gpioPort) & 1) ^ leds[i].unk1)) != 0)
                {
                    //loc_000001FC
                    sceLedSetMode(2, 1, 0);
                    continue;
                }
                else
                {
                    if(leds[i].unk1 == 0)
                    {
                        //loc_000001AC
                         sceGpioPortClear(1 << leds[i].gpioPort); //since i is 2 then this is 160, but I wanted it to be uniform
                         continue;
                    }
                }
            }
            else
            {
                if(leds[i].unk1 == 0)