예제 #1
0
파일: lcd.cpp 프로젝트: rpheuts/artillery
void LCD::RenderStatusCPU()
{
	// blit background to buffer
	Graphics::BlitAlphaImageToImage(0, 0, _bg->imageWidth, _bg->imageHeight, _bg, 0, 0, _buffer);
	string out;
	out = "CPU: ";
	switch (scePowerGetCpuClockFrequencyInt())
	{
		case 333:
			out += "333";
			break;
		case 222:
			out += "222";
			break;
	}
	out += " MHZ   BUS: ";
	switch (scePowerGetBusClockFrequencyInt())
	{
		case 166:
			out += "166";
			break;
		case 111:
			out += "111";
			break;
	}
	out += " MHZ";
	Font::PrintImage(out.c_str(), 5, textoffsety, _buffer, _textColor, 3);
}
예제 #2
0
static int lua_setHigh(lua_State *L)
{
    if (lua_gettop(L) != 0) return luaL_error(L, "no arguments expected.");
    if (scePowerGetCpuClockFrequencyInt() != 333){
        scePowerSetClockFrequency(333,333,166);
    }
    return 0;
}
예제 #3
0
static int lua_setReg(lua_State *L)
{
    if (lua_gettop(L) != 0) return luaL_error(L, "no arguments expected.");
    if (scePowerGetCpuClockFrequencyInt() != 222){
        scePowerSetCpuClockFrequency(222);
        scePowerSetBusClockFrequency(111);
    }
    return 0;
}
예제 #4
0
void Host_Init (quakeparms_t *parms)
{

	const int cpuSpeed = scePowerGetCpuClockFrequencyInt();

	if (standard_quake)
		minimum_memory = MINIMUM_MEMORY;
	else
		minimum_memory = MINIMUM_MEMORY_LEVELPAK;

	if (COM_CheckParm ("-minmemory"))
		parms->memsize = minimum_memory;

	host_parms = *parms;

	if (parms->memsize < minimum_memory)
		Sys_Error ("Only %4.1f megs of memory available, can't execute game", parms->memsize / (float)0x100000);

	com_argc = parms->argc;
	com_argv = parms->argv;

	Memory_Init (parms->membase, parms->memsize);
	Cbuf_Init ();
	Cmd_Init ();	
	V_Init ();
	Chase_Init ();
	Host_InitVCR (parms);
	COM_Init (parms->basedir);
	Host_InitLocal ();
	W_LoadWadFile ("gfx.wad");
	Key_Init ();
	Con_Init ();	
	M_Init ();	
	PR_Init ();
	Mod_Init ();
	NET_Init ();
	SV_Init ();

	Con_Printf ("PSP DQ v%4.1f (PBP: "__TIME__" "__DATE__")\n", (float)(VERSION));
	Con_Printf ("%4.1f megabyte heap \n",parms->memsize/ (1024*1024.0));

	R_InitTextures ();		// needed even for dedicated servers

	if (cls.state != ca_dedicated)
	{
		host_basepal = (byte *)COM_LoadHunkFile ("gfx/palette.lmp");
		if (!host_basepal)
			Sys_Error ("Couldn't load gfx/palette.lmp");

		host_colormap = (byte *)COM_LoadHunkFile ("gfx/colormap.lmp");
		if (!host_colormap)
			Sys_Error ("Couldn't load gfx/colormap.lmp");

		host_q2pal = (byte *)COM_LoadHunkFile ("gfx/q2pal.lmp");
		if (!host_q2pal)
			Sys_Error ("Couldn't load gfx/q2pal.lmp");

		host_h2pal = (byte *)COM_LoadHunkFile ("gfx/h2pal.lmp");
		if (!host_h2pal)
			Sys_Error ("Couldn't load gfx/h2pal.lmp");

#ifndef WIN32 // on non win32, mouse comes before video for security reasons
		IN_Init ();
#endif
		VID_Init (host_basepal);

		Draw_Init ();
		SCR_Init ();
		R_Init ();
#ifndef	WIN32
	// on Win32, sound initialization has to come before video initialization, so we
	// can put up a popup if the sound hardware is in use
		S_Init ();
#else

#ifdef	GLQUAKE
	// FIXME: doesn't use the new one-window approach yet
		S_Init ();
#endif

#endif	// WIN32
		CDAudio_Init ();
		Sbar_Init ();
		CL_Init ();
#ifdef WIN32 // on non win32, mouse comes before video for security reasons
		IN_Init ();
#endif
	}

	Cbuf_InsertText ("exec quake.rc\n");

	Hunk_AllocName (0, "-HOST_HUNKLEVEL-");
	host_hunklevel = Hunk_LowMark ();

	host_initialized = true;
	
	Sys_Printf ("========Quake Initialized=========\n");	
}
예제 #5
0
void endTest(int testNumber)
{
	char s[1000];

	int endSystemTime = sceKernelGetSystemTimeLow();
	int durationMicros = endSystemTime - startSystemTime;
	int durationMillis = (durationMicros + 500) / 1000;
	float pspReference = pspDurationMillis[testNumber] / durationMillis;
	performanceSum += pspReference;
	performanceCount++;

	sprintf(s, "%-25s: %4d ms (%4.0f%%) @ %d MHz\n", testNames[testNumber], durationMillis, pspReference * 100, scePowerGetCpuClockFrequencyInt());
	pspDebugScreenPrintf("%s", s);
	sceIoWrite(logFd, s, strlen(s));
}
예제 #6
0
파일: psp.c 프로젝트: DSJim/genesis4iphone
int psp_get_cpu_clock(void)
{
	return scePowerGetCpuClockFrequencyInt();
}
예제 #7
0
void printResult(char *name, int durationMillis, float pspDurationMillis)
{
	char s[1000];
	sprintf(s, "%-25s: %5d ms (%5.0f%%) @ %d MHz\n", name, durationMillis, pspDurationMillis / durationMillis * 100, scePowerGetCpuClockFrequencyInt());
//	pspDebugScreenPrintf("%s", s);
	sceIoWrite(logFd, s, strlen(s));
}