Пример #1
0
void Emulator_Implementation_SaveCustomControls(bool showdialog)
{
	if(Settings.ControlScheme == CONTROL_SCHEME_CUSTOM)
	{
		if(showdialog)
		{
			dialog_is_running = true;
			cellMsgDialogOpen2(CELL_MSGDIALOG_DIALOG_TYPE_NORMAL|\
			CELL_MSGDIALOG_TYPE_BG_VISIBLE|\
			CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO|\
			CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_OFF|\
			CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_YES,\
			"Do you want to save the custom controller settings?",\
			cb_save_custom_controls,NULL,NULL);
			while(dialog_is_running && Emulator_ROMRunning())
			{
				Graphics->Clear();
				Graphics->Swap();
				cellSysutilCheckCallback();	
			}
		}
		if(!showdialog || Settings.SaveCustomControlScheme)
		{
			Emulator_Implementation_ButtonMappingSettings(MAP_BUTTONS_OPTION_SETTER);
		}
	}
}
Пример #2
0
void Emulator_Start()
{
    if(need_load_rom)
    {
        LOG_DBG("need_load_rom: %d\n", need_load_rom);
        if(Emulator_Initialize())
        {
            need_load_rom = false;
        }
    }
    //bring down dbgfont
    Graphics->DeinitDbgFont();
    if (Graphics->GetCurrentResolution() == CELL_VIDEO_OUT_RESOLUTION_576)
    {
        if(Graphics->CheckResolution(CELL_VIDEO_OUT_RESOLUTION_576))
        {
            if(vdp_pal)
            {
                if(Graphics->GetPAL60Hz())
                {
                    //PAL60 is ON, turn it off for PAL
                    Graphics->SetPAL60Hz(false);
                    Settings.PS3PALTemporalMode60Hz = false;
                    Graphics->SwitchResolution(Graphics->GetCurrentResolution(), Settings.PS3PALTemporalMode60Hz);
                }
            }
            else
            {
                if(!Graphics->GetPAL60Hz())
                {
                    //PAL60 is OFF, turn it on for NTSC
                    Graphics->SetPAL60Hz(true);
                    Settings.PS3PALTemporalMode60Hz = true;
                    Graphics->SwitchResolution(Graphics->GetCurrentResolution(), Settings.PS3PALTemporalMode60Hz);
                }
            }

        }
    }
    CellAudio->unpause();
    while(emulation_running)
    {
        system_frame(0);
        Graphics->Draw(bitmap.viewport.w,bitmap.viewport.h,bitmap.data);
        Graphics->Swap();

        PlaySound();

        //check interlaced mode change
        if (bitmap.viewport.changed & 4)
        {
            //stub
            bitmap.viewport.changed &= ~4;
        }
        cellSysutilCheckCallback();
    }
    SaveSRAM();
    Graphics->InitDbgFont();
    emulation_running = true;
}
Пример #3
0
static void rmenu_ctx_ps3_swap_buffers(void)
{
   gfx_ctx_swap_buffers();
#ifdef HAVE_SYSUTILS
      cellSysutilCheckCallback();
#endif
}
Пример #4
0
volatile bool		LibESPlatform::WantToSleep			()
{
	cellSysutilCheckCallback();

	if(sleep_counter)
	{
		sleep_counter --;
	}

	return want_to_sleep || (sleep_counter != 0);
}
Пример #5
0
static void gfx_ctx_swap_buffers(void)
{
#ifdef HAVE_LIBDBGFONT
   cellDbgFontDraw();
#endif
#ifdef HAVE_PSGL
   psglSwap();
#endif
#ifdef HAVE_SYSUTILS
   cellSysutilCheckCallback();
#endif
}
Пример #6
0
void menu_loop(void)
{
	menuStack[0] = menu_filebrowser;
	menuStack[0].enum_id = FILE_BROWSER_MENU;

	menu_is_running = true;

	menu_reinit_settings();

	do
	{
		glClear(GL_COLOR_BUFFER_BIT);
		ps3graphics_draw_menu();

		switch(menuStack[menuStackindex].enum_id)
		{
			case FILE_BROWSER_MENU:
				select_rom();
				break;
			case GENERAL_VIDEO_MENU:
			case GENERAL_AUDIO_MENU:
			case EMU_GENERAL_MENU:
			case EMU_VIDEO_MENU:
			case EMU_AUDIO_MENU:
			case PATH_MENU:
			case CONTROLS_MENU:
				select_setting(&menuStack[menuStackindex]);
				break;
#ifdef HAVE_GAMEAWARE
			case GAME_AWARE_SHADER_CHOICE:
#endif
			case SHADER_CHOICE:
			case PRESET_CHOICE:
			case BORDER_CHOICE:
			case INPUT_PRESET_CHOICE:
				select_file(menuStack[menuStackindex].enum_id);
				break;
			case PATH_SAVESTATES_DIR_CHOICE:
			case PATH_DEFAULT_ROM_DIR_CHOICE:
			case PATH_CHEATS_DIR_CHOICE:
			case PATH_SRAM_DIR_CHOICE:
				select_directory(menuStack[menuStackindex].enum_id);
				break;
		}

		psglSwap();
		cell_console_poll();
		cellSysutilCheckCallback();
	}while (menu_is_running);
}
Пример #7
0
void gfx_ctx_check_window(bool *quit,
      bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
{
   gl_t *gl = driver.video_data;
   *quit = false;
   *resize = false;

#ifdef HAVE_SYSUTILS
   cellSysutilCheckCallback();
#endif

   if (gl->quitting)
      *quit = true;

   if (gl->should_resize)
      *resize = true;
}
Пример #8
0
bool CapApp::onInit(int argc, char* argv[])
{
	(void)argc;
	(void)argv;

	// ----------------------------------------------
	// FTP	
	cellSysmoduleLoadModule(CELL_SYSMODULE_NET);
	cellNetCtlInit();
	cellSysmoduleLoadModule(CELL_SYSMODULE_HTTP);
	sys_net_initialize_network();
	ftp_on();

	// Load settings...
	if(!iniRead()) {
		iniWrite(); // create settings file...
	}

	cellSysmoduleLoadModule(CELL_SYSMODULE_FS);

	cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT);
	cellScreenShotEnable();

	InputInit();

	while(!videoOutIsReady())
	{
		// ...
	}


	PSGLinitOptions options = 
	{
		enable:					PSGL_INIT_MAX_SPUS | PSGL_INIT_INITIALIZE_SPUS,
		maxSPUs:				1,
		initializeSPUs:			GL_FALSE,
		persistentMemorySize:	0,
		transientMemorySize:	0,
		errorConsole:			0,
		fifoSize:				0,  
		hostMemorySize:			128* 1024*1024,  // 128 mbs for host memory 
	};

#if CELL_SDK_VERSION < 0x340000
	options.enable |=	PSGL_INIT_HOST_MEMORY_SIZE;
#endif

	// Initialize 6 SPUs but reserve 1 SPU as a raw SPU for PSGL
	sys_spu_initialize(6, 1);
	psglInit(&options);

	const unsigned int resolutions[] = { 
		CELL_VIDEO_OUT_RESOLUTION_1080, 
		CELL_VIDEO_OUT_RESOLUTION_960x1080, 
		CELL_VIDEO_OUT_RESOLUTION_720, 
		CELL_VIDEO_OUT_RESOLUTION_480 
	};

	const int numResolutions = sizeof(resolutions) / sizeof(resolutions[0]);

	int bestResolution = chooseBestResolution(resolutions,numResolutions);

	getResolutionWidthHeight(bestResolution, deviceWidth, deviceHeight);

	if(bestResolution)
	{
		PSGLdeviceParameters params;

		params.enable				= PSGL_DEVICE_PARAMETERS_COLOR_FORMAT |
									  PSGL_DEVICE_PARAMETERS_DEPTH_FORMAT |
									  PSGL_DEVICE_PARAMETERS_MULTISAMPLING_MODE;
		params.colorFormat			= GL_ARGB_SCE;
		params.depthFormat			= GL_NONE;
		params.multisamplingMode	= GL_MULTISAMPLING_NONE_SCE;
		params.enable				|= PSGL_DEVICE_PARAMETERS_WIDTH_HEIGHT;
		params.width				= deviceWidth;
		params.height				= deviceHeight;

		device						= psglCreateDeviceExtended(&params);
		context						= psglCreateContext();

		psglMakeCurrent(context, device);
		psglResetCurrentContext();

		initGraphics();

		if( cellSysutilRegisterCallback( 0, callback_sysutil_exit, NULL ) < 0 ) {
			//...
		}

		dbgFontInit();

		fbaRL = new c_fbaRL();

		while(bRun)
		{
			onRender();
			onUpdate();
			cellSysutilCheckCallback();
		}

	} else {
		// resolution error...
	}

	ftp_off();

	onShutdown();

	return false;
}

void CapApp::onRender()
{
	if(fbaRL) { fbaRL->DlgDisplayFrame(); }

	// get render target buffer dimensions and set viewport	
	psglGetRenderBufferDimensions(device,&app.renderWidth,&app.renderHeight);

	glViewport(0, 0, app.renderWidth, app.renderHeight);

	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	if(fbaRL) { fbaRL->RenderBackground(); }
	if(fbaRL) { fbaRL->nFrameStep = 0; fbaRL->DisplayFrame(); }
	if(fbaRL) { fbaRL->nFrameStep = 1; fbaRL->DisplayFrame(); }
	dbgFontDraw();

	psglSwap();
}

bool CapApp::onUpdate()
{
	if(!mFrame) mFrame = 0;
	mFrame++;

	InputFrameStart();
	if(fbaRL) fbaRL->InputFrame();
	InputFrameEnd();	

	return true;
}

void CapApp::onShutdown()
{
	iniWrite(); // save settings

	if(context) psglDestroyContext(context);
	if(device) psglDestroyDevice(device);

	InputExit();
	psglExit();
}
Пример #9
0
//-----------------------------------------------------------------------------
// Purpose: Message pump for OS messages
//-----------------------------------------------------------------------------
void CGameEnginePS3::MessagePump()
{
	cellSysutilCheckCallback();

	// Running callbacks may have triggered shutdown, if not run input
	if ( !m_bShuttingDown )
	{
		CellPadInfo2 padInfo;
		int ret = cellPadGetInfo2( &padInfo );
		if ( ret == CELL_OK )
		{
			if ( padInfo.system_info & CELL_PAD_INFO_INTERCEPTED )
			{
				// System has taken control of controller info, we can't currently access it.
			}
			
			bool bControllerFound = false;
			m_iCurrentPadIndex = -1;
			for( int i=0; i < CELL_PAD_MAX_PORT_NUM; ++i )
			{
				if ( padInfo.port_status[i] & CELL_PAD_STATUS_ASSIGN_CHANGES )
				{
					if ( (padInfo.port_status[i] & CELL_PAD_STATUS_CONNECTED) == 0 )
					{
						char rgchBuffer[512];
						_snprintf( rgchBuffer, 512, "Gamepad %d removed\n", i );
						OutputDebugString( rgchBuffer );
					}
					else if ( (padInfo.port_status[i] & CELL_PAD_STATUS_CONNECTED) > 0 )
					{
						char rgchBuffer[512];
						_snprintf( rgchBuffer, 512, "Gamepad %d connected\n", i );
						OutputDebugString( rgchBuffer );
					}
				}

				if ( (padInfo.port_status[i] & CELL_PAD_STATUS_CONNECTED ) > 0 && padInfo.device_type[i] == CELL_PAD_DEV_TYPE_STANDARD )
				{
					bControllerFound = true;
					m_iCurrentPadIndex = i;
					break;
				}
			}

			if ( !bControllerFound )
			{
				// Definitely no appropriate controller plugged in, can't do input
				static DWORD dwLastSpewTime = 0;
				if ( GetGameTickCount() - dwLastSpewTime > 1000 || dwLastSpewTime == 0 || dwLastSpewTime > GetGameTickCount() )
				{
					dwLastSpewTime = GetGameTickCount();
					OutputDebugString( "No supported controllers are active, activate one.\n" );
				}

				// Clear all keys 
				m_SetKeysDown.clear();
			}
			else
			{
				// Get status of the first found controller now
				CellPadData padData;
				int ret = cellPadGetData( m_iCurrentPadIndex, &padData );

				// If we got data ok, and if the data is new (len != 0) then process it
				if ( ret == CELL_OK && padData.len )
				{
					if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_R2 )
					{
						m_SetKeysDown.insert( 0x57 ); // W key, thrusters, mapped to R2 on PS3
					}
					else
					{
						m_SetKeysDown.erase( 0x57 );
					}

					if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_L2 )
					{
						m_SetKeysDown.insert( 0x53 ); // S key, reverse thrusters, mapped to L2 on PS3
					}
					else
					{
						m_SetKeysDown.erase( 0x53 );
					}

					if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_CROSS )
					{
						// Mapped to both enter in menus, and fire in game
						m_SetKeysDown.insert( VK_RETURN );
						m_SetKeysDown.insert( VK_SPACE );
					}
					else
					{
						m_SetKeysDown.erase( VK_RETURN );
						m_SetKeysDown.erase( VK_SPACE );
					}

					if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_CIRCLE )
					{
						m_SetKeysDown.insert( VK_ESCAPE );
					}
					else
					{
						m_SetKeysDown.erase( VK_ESCAPE );
					}

					if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_UP || padData.button[CELL_PAD_BTN_OFFSET_ANALOG_LEFT_Y] == 0x00 )
					{
						m_SetKeysDown.insert( VK_UP );
					}
					else
					{
						m_SetKeysDown.erase( VK_UP );
					}

					if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_DOWN || padData.button[CELL_PAD_BTN_OFFSET_ANALOG_LEFT_Y] == 0xFF )
					{
						m_SetKeysDown.insert( VK_DOWN );
					}
					else
					{
						m_SetKeysDown.erase( VK_DOWN );
					}

					if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_LEFT || padData.button[CELL_PAD_BTN_OFFSET_ANALOG_LEFT_X] == 0x00 )
					{
						m_SetKeysDown.insert( 0x41 ); // A Key, mapped to left on PS3
					}
					else
					{
						m_SetKeysDown.erase( 0x41 );
					}

					if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_RIGHT || padData.button[CELL_PAD_BTN_OFFSET_ANALOG_LEFT_X] == 0xFF )
					{
						m_SetKeysDown.insert( 0x44 ); // D key, mapped to right on PS3
					}
					else
					{
						m_SetKeysDown.erase( 0x44 );
					}
				}
			}
		}
	}
}
Пример #10
0
int joystick(void)
{
	static bool key_cursorup    = false;
	static bool key_cursordown  = false;
	static bool key_cursorleft  = false;
	static bool key_cursorright = false;

	static bool warp_mode=false;

	// osk_active_bufferlen == The OSK is entering characters, don't interrupt it.
	// autostart_in_progress() == 
	// Autostart is running. Don't allow the joystick to interrupt.
	// In particular this can break the actual autostart script that tests the basic prompt due to interference

	if (osk_active_bufferlen || autostart_in_progress())
	{
		return 0;
	} 

	uint8_t pads_connected = CellInput->NumberPadsConnected();
	for (uint8_t i = 0; i < pads_connected; ++i)
	{
		int value = 0;

		// Do PS3 pads
		CellInput->UpdateDevice(i);

		// Set the joystick values

		if (CellInput->IsButtonPressed(i,CTRL_LEFT) | CellInput->IsAnalogPressedLeft(i,CTRL_LSTICK))
			value |= 4;

		if (CellInput->IsButtonPressed(i,CTRL_RIGHT) | CellInput->IsAnalogPressedRight(i,CTRL_LSTICK))
			value |= 8;

		if (CellInput->IsButtonPressed(i,CTRL_UP) | CellInput->IsAnalogPressedUp(i,CTRL_LSTICK))
			value |= 1;

		if (CellInput->IsButtonPressed(i,CTRL_DOWN) | CellInput->IsAnalogPressedDown(i,CTRL_LSTICK))
			value |= 2;


		// Process re-definable controls
		process_button (i, CTRL_CROSS, &value);
		process_button (i, CTRL_CIRCLE, &value);
		process_button (i, CTRL_SQUARE, &value);
		process_button (i, CTRL_TRIANGLE, &value);
		process_button (i, CTRL_L1, &value);
		process_button (i, CTRL_L2, &value);
		process_button (i, CTRL_R1, &value);
		process_button (i, CTRL_R2, &value);


		// Emulator cursor keys
		if (CellInput->IsAnalogPressedUp(i,CTRL_RSTICK))
		{
			if (!key_cursorup)
			{
				keyboard_key_pressed((signed long)  32850);  // Cursor Up key pressed
				key_cursorup = true;
			}
		}
		else
		{
			if (key_cursorup)
			{
				keyboard_key_released((signed long) 32850);  // Cursor Up key released
				key_cursorup = false;
			}
		}

		if (CellInput->IsAnalogPressedDown(i,CTRL_RSTICK))
		{
			if (!key_cursordown) {
				keyboard_key_pressed((signed long)  32849);  // Cursor Down key pressed
				key_cursordown = true;
			}
		}
		else
		{
			if (key_cursordown)
			{
				keyboard_key_released((signed long) 32849);  // Cursor Down key released
				key_cursordown = false;
			}
		}

		if (CellInput->IsAnalogPressedLeft(i,CTRL_RSTICK))
		{
			if (!key_cursorleft)
			{
				keyboard_key_pressed((signed long)  32848);  // Cursor Left key pressed
				key_cursorleft = true;
			}
		}
		else
		{
			if (key_cursorleft)
			{
				keyboard_key_released((signed long) 32848);  // Cursor Left key released
				key_cursorleft = false;
			}
		}

		if (CellInput->IsAnalogPressedRight(i,CTRL_RSTICK))
		{
			if (!key_cursorright)
			{
				keyboard_key_pressed((signed long)  32847);  // Cursor Right key pressed
				key_cursorright = true;
			}
		} else {
			if (key_cursorright) {
				keyboard_key_released((signed long) 32847);  // Cursor Right key released
				key_cursorright = false;
			}
		}

		if ((CellInput->IsButtonPressed(0,CTRL_R2) && CellInput->IsButtonPressed(0,CTRL_L2)) || (CellInput->IsButtonPressed(1,CTRL_R2) && CellInput->IsButtonPressed(1,CTRL_L2)))
		{
			if (!warp_mode)
			{
				// Disable sound (makes warp mode infinitely faster)
				resources_set_int("Sound", 0);

				// Enable Warp Mode
				resources_set_int("WarpMode", 1);
				warp_mode=true;
			}
		}
		else
		{
			if (warp_mode)
			{
				resources_set_int("WarpMode", 0);
				resources_set_int("Sound", 1);
				warp_mode=false;
			}
		}


		if (CellInput->IsButtonPressed(i,CTRL_L1) && CellInput->IsButtonPressed(i,CTRL_R1) && CellInput->IsButtonPressed(i,CTRL_L2) && CellInput->IsButtonPressed(i,CTRL_R2) )
			machine_trigger_reset(MACHINE_RESET_MODE_HARD);


		/*
		// Swap joysticks
		if (CellInput->WasButtonPressed(i,CTRL_SELECT)) {
		// Do nothing
		}
		// Required because keyloop kills us
		if (CellInput->WasButtonReleased(i,CTRL_SELECT)) {
		if (pads_connected == 1)
		// Only allow us to swap joystick ports if there is only one controller
		// Otherwise, multiplayer madness and much punching will ensue.
		joyswap=!joyswap;
		}
		 */

		if (CellInput->WasButtonPressed(i,CTRL_SELECT))
			InGameMenuLoop();

		if(CellInput->WasButtonPressed(i,CTRL_START))
		{
			menu(MODE_MENU);
			// Stop the clock (effectively, tells the emulator we were paused)
			vsync_suspend_speed_eval();
			// Apply any changes as necessary.
		}

		if(CellInput->WasButtonPressed(i,CTRL_L3))
		{
			// Vice OSK
			menu(MODE_OSK);
			// Stop the clock (effectively, tells the emulator we were paused)
			vsync_suspend_speed_eval();
			// Apply any changes as necessary.
		}

		if(CellInput->WasButtonPressed(i,CTRL_R3))
		{
			osk->Start(L"Characters entered here will be relayed to the emulator ", L"");

			#ifdef CELL_DEBUG
			printf("OSK started\n");
			#endif
			// Just in case. This ensures we check to see if the screen has updated, and if not.. force one
			// The OSK fails to draw if the screen doesn't update.
		}

		cellSysutilCheckCallback();

		if (sysutil_drawing)
			sysutil_callback_redraw();

		ui_callback();


		// pad 0 becomes port 2
		// pad 1 becomes port 1
		if (joyswap)
			joystick_set_value_absolute( ((i+1) % 2 ) + 1, value);  
		else
			joystick_set_value_absolute(i+1, value); 

		// pad 0 becomes port 1
		// pad 1 becomes port 2
	}

	return 0;
}
Пример #11
0
GPResult gpiProcessNp(GPConnection * connection)
{
    int i, ret=0;
    GPIConnection * iconnection = (GPIConnection*)*connection;
    npIdLookupTrans * transaction;

    // Check for uninitialized transaction darray
    //////////////////////////////////////////////
    if (!iconnection->npTransactionList)
        return GP_NO_ERROR;

    // Need to process Sysutil for the Async lookups
    /////////////////////////////////////////////////
    if (ArrayLength(iconnection->npTransactionList) > 0)
        cellSysutilCheckCallback();

    // Loop through all current transactions, check if complete
    ///////////////////////////////////////////////////////////
    for (i=0; i < ArrayLength(iconnection->npTransactionList); i++)
    {
        // Grab next transaction in the list
        /////////////////////////////////////    
        transaction = (npIdLookupTrans *)ArrayNth(iconnection->npTransactionList, i);

        if (!transaction->npLookupDone)
        {
            if (sceNpLookupPollAsync(transaction->npTransId, &ret)==0)
                transaction->npLookupDone = gsi_true;
        }
        else
        {
            if (ret<0)
            {
                gsDebugFormat(GSIDebugCat_GP, GSIDebugType_Misc, GSIDebugLevel_HotError,
                    "PS3AddToNpBlockList: sceNpLookupWaitAsync. ret = 0x%x\n", ret);
                if (ret == (int)SCE_NP_COMMUNITY_SERVER_ERROR_NO_SUCH_USER_NPID)
                {
                    gsDebugFormat(GSIDebugCat_GP, GSIDebugType_Misc, GSIDebugLevel_HotError,
                        "PS3AddToNpBlockList: Player '%s' is not an NP user.\n", 
                        transaction->npIdForAdd->handle.data);
                }
            }
            else
            {
                // Found an NpId, try to add
                /////////////////////////////                 
                ret = sceNpBasicAddBlockListEntry(transaction->npIdForAdd);
                if (ret == (int)SCE_NP_BASIC_ERROR_BUSY)
                {
                    // Oh nice, NP is too busy to help us.... keep on trying
                    /////////////////////////////////////////////////////////                         
                    gsDebugFormat(GSIDebugCat_GP, GSIDebugType_Misc, GSIDebugLevel_Comment,
                        "PS3AddToNpBlockList: SCE_NP_BASIC_ERROR_BUSY. continue trying to add to NP\n"); 
                    return GP_NO_ERROR;
                }
                else if ( ret < 0 ) 
                {
                    gsDebugFormat(GSIDebugCat_GP, GSIDebugType_Misc, GSIDebugLevel_HotError,
                        "PS3AddToNpBlockList: sceNpBasicAddBlockListEntry() failed. ret = 0x%x\n", ret); 
                }                
                else
                {
                    gsDebugFormat(GSIDebugCat_GP, GSIDebugType_Misc, GSIDebugLevel_Comment,
                        "PS3AddToNpBlockList: Player '%s' added to NP Block list.\n", 
                        transaction->npIdForAdd->handle.data); 
                }
            }

            ret = sceNpLookupDestroyTransactionCtx(transaction->npTransId);
            if (ret<0)
            {
                gsDebugFormat(GSIDebugCat_GP, GSIDebugType_Misc, GSIDebugLevel_HotError,
                    "PS3AddToNpBlockList: sceNpLookupDestroyTransactionCtx() failed. ret = 0x%x\n", ret); 
            }

            // Delete Transaction when its complete
            ////////////////////////////////////////
            ArrayDeleteAt(iconnection->npTransactionList, i);
        }
    }

    return GP_NO_ERROR;
}
Пример #12
0
bool				ESSUB_WantToSleep		()
{
	cellSysutilCheckCallback();
	return want_to_sleep;
}
Пример #13
0
bool				ESSUB_WantToDie			()
{
	cellSysutilCheckCallback();
	return want_to_die;
}
Пример #14
0
volatile bool		LibESPlatform::WantToDie			()
{
	cellSysutilCheckCallback();
	return want_to_die;
}
Пример #15
0
int main(int argc, char* argv[])
{
	init_log();

	(void)argc;
	(void)argv;
	
	// [cobralib] unmount iso / eject
	cobra_send_fake_disc_eject_event();
	cobra_umount_disc_image();

	// Check if isolist.self is launching this app... 
	FILE* fp_flag = fopen("/dev_hdd0/game/SISO00123/USRDIR/isolist_finished", "r");
	if(fp_flag) 
	{
		// load normally...
		fclose(fp_flag);
		*&fp_flag = NULL;

		// remove the launch flag...
		cellFsUnlink("/dev_hdd0/game/SISO00123/USRDIR/isolist_finished");

	} else {
		// generate ISO list...
		sys_game_process_exitspawn((char*)ISOLIST_SELF, NULL, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M);
	}
	
	if(!LoadModules()) 
	{
		// error...
		(void)exit_app();
		return 0;
	}
	
	// setup sys callback
	if(cellSysutilRegisterCallback(0, callback_sysutil_exit, NULL) != CELL_OK) 
	{
		// error...
		(void)exit_app();
		return 0;
	}

	InputInit();

	if(InitPSGLVideo(device, context, screen_width, screen_height, render_width, render_height))
	{
		// clear vid on startup
		(void)render(true);
	
		// init font
		if(!font_init(render_width, render_height)) { bRun = false; }

		// init app core modules, ftp, settings, etc...
		if(!init_core()) { bRun = false; }
		
		// loop
		while(bRun)
		{
			cellSysutilCheckCallback();			

			(void)input();			
			(void)render(false);			
		}

	} else {
		// error msg here...
	}
	
	(void)exit_app();
	return 0;
}