コード例 #1
0
ファイル: main.c プロジェクト: libcg/XtreamLua-Player
int main(int argc, char** argv)
{
	pspDebugScreenInit();
	pspDebugScreenEnableBackColor(0);
	
	SetupCallbacks();
	
	char* scriptFilename = "script.lua";
	
	lua_State *L;
	L = lua_open();
	luaL_openlibs(L);
	
	Aalib_init(L);
	Color_init(L);
	g2D_init(L);
	intraFont_init(L);
	Ctrl_init(L);
	Power_init(L);
	Time_init(L);
	Timer_init(L);
	Savedata_init(L);
	sceIo_init(L);
	Utility_init(L);
	USB_init(L);
	Xtream_init(L);
	
	
	SceCtrlData keys, oldkeys;
	int status = 0, i;
	
	while (1)
	{
	status = luaL_loadfile(L, scriptFilename);
		
	if (status == 0) 
		status = lua_pcall(L, 0, LUA_MULTRET, 0);
	

		if (status != 0) //If an error has occured
		{
		sceCtrlReadBufferPositive(&oldkeys, 1);
		
		pspDebugScreenInit();
		pspDebugScreenEnableBackColor(1);
		
			while (1)
			{			
				sceCtrlReadBufferPositive(&keys, 1);
			
				pspDebugScreenSetXY(0,0);
				printf("Lua Error:\n%s\n", lua_tostring(L, -1));
				printf("Press Start to reset.\n");
				
				if ((keys.Buttons &PSP_CTRL_START) && !(oldkeys.Buttons &PSP_CTRL_START))
					break;
				
				oldkeys = keys;
				
				for (i = 0; i < 10; i++)
					sceDisplayWaitVblankStart();
			}
			
		pspDebugScreenInit();
		pspDebugScreenEnableBackColor(0);
		
		lua_pop(L, 1);
		}
	}
		
	lua_close(L);

	intraFontShutdown();
	g2dTerm();
	cleanUSBDrivers();

	sceKernelExitGame();

	return 0;
}
コード例 #2
0
LoadingWindow_PSP::LoadingWindow_PSP()
{
	pspDebugScreenInitEx( NULL, PSP_DISPLAY_PIXEL_FORMAT_4444, 1 );
	pspDebugScreenEnableBackColor( 0 );
	text[0] = '\0';
}