Exemplo n.º 1
0
void updateSystemLanguage(void)
{
	cfguInit();

	Result ret;
	u8 language = 0;

	ret = CFGU_GetConfigInfoBlk2(1, 0xA0002, &language);
	
	if (R_SUCCEEDED(ret))
	{
		switch (language)
		{
			case CFG_LANGUAGE_JP: userlang = LANGUAGE_JP; break;
			case CFG_LANGUAGE_FR: userlang = LANGUAGE_FR; break;
			case CFG_LANGUAGE_IT: userlang = LANGUAGE_IT; break;
			case CFG_LANGUAGE_DE: userlang = LANGUAGE_DE; break;
			case CFG_LANGUAGE_ES: userlang = LANGUAGE_ES; break;
			case CFG_LANGUAGE_KO: userlang = LANGUAGE_KR; break;
			default:              userlang = LANGUAGE_EN;
		}
	}

	cfguExit();
}
Exemplo n.º 2
0
Result udsGenerateNodeInfo(udsNodeInfo *nodeinfo, const char *username)
{
	Result ret=0;
	ssize_t units=0;
	size_t len;
	u8 tmp[0x1c];

	memset(nodeinfo, 0, sizeof(udsNodeInfo));
	memset(tmp, 0, sizeof(tmp));

	ret = cfguInit();
	if (R_FAILED(ret))return ret;

	ret = CFGU_GetConfigInfoBlk2(sizeof(nodeinfo->uds_friendcodeseed), 0x00090000, (u8*)&nodeinfo->uds_friendcodeseed);
	if (R_FAILED(ret))
	{
		cfguExit();
		return ret;
	}

	ret = CFGU_GetConfigInfoBlk2(sizeof(tmp), 0x000A0000, tmp);
	if (R_FAILED(ret))
	{
		cfguExit();
		return ret;
	}

	memcpy(nodeinfo->usercfg, tmp, sizeof(nodeinfo->usercfg));

	if(username)
	{
		len = 10;

		memset(nodeinfo->username, 0, sizeof(nodeinfo->username));

		units = utf8_to_utf16((uint16_t*)nodeinfo->username, (uint8_t*)username, len);

		if(units < 0 || units > len)ret = -2;
	}

	cfguExit();

	return ret;
}
Exemplo n.º 3
0
Result ndspInit(void)
{
	Result rc = 0;
	if (AtomicPostIncrement(&ndspRefCount)) return 0;

	if (!componentBin && !ndspFindAndLoadComponent())
	{
		rc = MAKERESULT(RL_PERMANENT, RS_NOTFOUND, 41, RD_NOT_FOUND);
		goto _fail0;
	}

	LightLock_Init(&ndspMutex);
	ndspInitMaster();
	ndspiInitChn();

	rc = cfguInit();
	if (R_SUCCEEDED(rc))
	{
		u8 outMode;
		rc = CFGU_GetConfigInfoBlk2(sizeof(outMode), 0x70001, &outMode);
		if (R_SUCCEEDED(rc))
			ndspMaster.outputMode = outMode;
		cfguExit();
	}

	rc = dspInit();
	if (R_FAILED(rc)) return rc;

	rc = ndspInitialize(false);
	if (R_FAILED(rc)) goto _fail1;

	rc = svcCreateEvent(&sleepEvent, 0);
	if (R_FAILED(rc)) goto _fail2;

	ndspThread = threadCreate(ndspThreadMain, 0x0, NDSP_THREAD_STACK_SIZE, 0x18, -2, true);
	if (!ndspThread) goto _fail3;

	aptHook(&aptCookie, ndspAptHook, NULL);
	return 0;

_fail3:
	svcCloseHandle(sleepEvent);
_fail2:
	ndspFinalize(false);
_fail1:
	dspExit();
	if (componentFree)
	{
		free((void*)componentBin);
		componentBin = NULL;
	}
_fail0:
	AtomicDecrement(&ndspRefCount);
	return rc;
}
Exemplo n.º 4
0
Result CFGU_GetSystemLanguage(u8* language)
{
	return CFGU_GetConfigInfoBlk2(1, 0xA0002, language);
}