Ejemplo n.º 1
0
int main()
{
	int ret;
	ret=debugNetInit(ip_server,port_server,DEBUG);
	debugNetPrintf(DEBUG,"Test debug level %d\n",ret);
	debugNetPrintf(ERROR,"Test error level %d\n",ret);
	debugNetPrintf(INFO,"Test info level %d\n",ret);	
	debugNetFinish();
	sceKernelExitProcess(0);
	return 0;
}
Ejemplo n.º 2
0
int main()
{
    lua_State *lua = luaL_newstate();
    lua_atpanic(lua, panic);

    // Net init
    sceSysmoduleLoadModule(SCE_SYSMODULE_NET);
    SceNetInitParam netInitParam;
    int size = 1024 * 512;
    netInitParam.memory = malloc(size);
    netInitParam.size = size;
    netInitParam.flags = 0;
    sceNetInit(&netInitParam);

    sceSysmoduleLoadModule(SCE_SYSMODULE_HTTP);
#ifdef DEBUGGER_IP
    debugNetInit(DEBUGGER_IP, DEBUGGER_PORT, DEBUG);
#endif
    sceHttpInit(1024 * 50);

    // Init libs
    debugf("Init libs....\n");
    debugf("vita2d...\n");
    vita2d_init();
    debugf("physfs\n");
    PHYSFS_init(NULL);
    debugf("lualibs\n");
    luaL_openlibs(lua);
    debugf("ffi\n");
    open_ffi(lua);

    lua_pushcfunction(lua, print);
    lua_setglobal(lua, "print");

    /*
    // Display splash
    unsigned int goal = 2*60;
    unsigned int counter = 0;
    vita2d_texture *tex = vita2d_load_PNG_buffer(splash_data);
    SceCtrlData pad;
    memset(&pad, 0, sizeof(pad));
    for (;;) {
        ++counter;
        if (counter >= goal)
            break;
        sceCtrlPeekBufferPositive(0, &pad, 1);
        if (pad.buttons & SCE_CTRL_ANY)
            break;
        vita2d_start_drawing();
        vita2d_clear_screen();
        vita2d_draw_texture(tex, 0, 0);
        vita2d_end_drawing();
        vita2d_swap_buffers();
    }
    */

    debugf("[Lua] Loading app0:/lib/init.lua ...\n");
    if(luaL_loadfile(lua, "app0:/lib/init.lua") == 0)
    {
        if(lua_pcall(lua, 0, 0, 0) != 0)
        {
            debugf("[Lua] init error: %s\n", lua_tostring(lua, -1));
            lua_pop(lua, 1);
        }
    }

    /*debugf("[Lua] Loading app0:/boot.lua ...\n");
    if(luaL_loadfile(lua, "app0:/boot.lua") == 0)
    {
        if(lua_pcall(lua, 0, 0, 0) != 0)
        {
            debugf("[Lua] bootscript err: %s\n", lua_tostring(lua, -1));
            lua_pop(lua, 1);
        }
    }
    else
    {
    debugf("[Lua] bootscript load err: %s\n", lua_tostring(lua, -1));
        lua_pop(lua, 1);
    }*/

    debugf("Deinit. Goodbye.\n");
    sceHttpTerm();
    PHYSFS_deinit();
    vita2d_fini();
    //vita2d_free_texture(tex);

    sceKernelExitProcess(0);
    return 0;
}
Ejemplo n.º 3
0
int main(int argc, char** argv)
{
#ifdef USE_DEBUGNET
    int ret = debugNetInit("255.255.255.255", 18194, DEBUG);
    printf("debugNetInit: %d", ret);
#endif

    printf("DOOM started\n");

    setbuf(stdout, NULL);

    int res = scePowerSetArmClockFrequency(50);
    if (res != 0x0)
    {
        printf("scePowerSetArmClockFrequency failed! (0x%08x) (Normal if not using PSM Unity 1.06. No clock speed change for you.)\n", res);
    }

    myargc = 0;
    myargv = 0;

    doomwaddir = PSP2_DIR("Documents/");
    strcpy_s(doomwaddir2, 256, doomwaddir);
    strcat(doomwaddir2, "WADS/");

    printf("WAD folder: %s\n", doomwaddir2);

	//pspAudioInit();
	//pspAudioSetChannelCallback(0, (void *)&sound_callback);

	//_DisableFPUExceptions();
//	pspDebugScreenInit();

	//sceCtrlSetSamplingCycle(0);

	//int result = sceCtrlSetSamplingMode(PSP2_CTRL_MODE_ANALOG);
 //   if (result < 0)
 //   {
 //       printf("sceCtrlSetSamplingMode : 0x%x", result);
 //   }

	//SetupCallbacks();
        pgInit();
        pgScreenFrame(2,0);
        pgFillvram(0);

    Get_DirList(doomwaddir2);
    dlist_start  = 0;
    dlist_curpos = 0;
    now_depth    = 0;

while(1) {
    Draw_All();
switch(Control()) {
		case 1:
			Get_DirList(doomwaddir2);
			break;
		case 2:
                        pgFillvram(0);
                        strcpy_s(target, 264, doomwaddir2);
                        strcat(target, dlist[dlist_curpos].name);

                        pgScreenFlipV();
                        //pspDebugScreenInit();

    D_DoomMain (); 
        }
    }    

    return 0;

}