Пример #1
0
void c_fbaRL::InitFilterList()
{
    bProcessingGames = true;

    nBurnSelected = -1;

    nSelectedGame = 0;
    nGameListTop = 0;
    nFilteredGames = 0;

    fgames = (c_game**)malloc(sizeof(c_game) * MAX_GAMES);
    //memset(fgames, 0, sizeof(c_game) * MAX_GAMES);

    // process...

    for(int n=0; n < nTotalGames; n++)
    {
        if(!g_opt_bDisplayMissingGames && !games[n]->bAvailable)
        {
            continue;
        }

        if(FilterGame(games[n]->sysmask) == false)
        {
            continue;
        }
        fgames[nFilteredGames] = new c_game(nFilteredGames);

        strcpy(fgames[nFilteredGames]->path		, games[n]->path);
        strcpy(fgames[nFilteredGames]->zipname	, games[n]->zipname);
        strcpy(fgames[nFilteredGames]->title	, games[n]->title);
        strcpy(fgames[nFilteredGames]->sysmask	, games[n]->sysmask);
        memcpy(&fgames[nFilteredGames]->nSize	, &games[n]->nSize, sizeof(uint64_t));
        memcpy(&fgames[nFilteredGames]->bAvailable	, &games[n]->bAvailable, sizeof(bool));

        nFilteredGames++;
    }

    if(nFilteredGames < 1) {
        bProcessingGames = false;
        ResetPreviewImage();
        return;
    }

    // Sort Filtered list by Title
    qsort(fgames, nFilteredGames, sizeof(c_game*), _FcCompareStruct);
    bProcessingGames = false;

    nStatus = STATUS_UPDATEPREVIEW;
}
Пример #2
0
void c_fbaRL::DlgDisplayFrame()
{
	switch(nStatus)
	{
		case STATUS_ROMPATH_CHANGED:
		{
			//::cellMsgDialogOpen2(
			//	CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL, 
			//	"Remeber to rescan ROMs after you finish configuring all paths,\nyou can do so at the Game List section.", 
			//	DlgCallbackFunction, (void*)STATUS_ROMPATH_CHANGED, NULL
			//);

			// Force Re-Scan
			// delete old cache
			cellFsUnlink("/dev_hdd0/game/FBAL00123/USRDIR/FBA.GAMELIST.CACHE.DAT");
			break;		
		}

		case STATUS_ROMSCAN_DLG:
		{
			::cellMsgDialogOpen2(
				CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO|
				CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_NO, 
				"Do you want to Rescan all configured paths for ROM(s) ?", 
				ExitDlgCallbackFunction, (void*)STATUS_ROMSCAN_DLG, NULL
			);
			break;
		}

		case STATUS_MISSING_GAME_DLG:
		{
			::cellMsgDialogOpen2(
				CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO|
				CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_NO, 
				"Error: There was a problem locating the specified game, if you had it on a USB Storage Device, \n"
				"make sure it is properly connected.\n\n"
				"Do you want to Re-Scan all configured paths for ROM(s) ?",
				ExitDlgCallbackFunction, (void*)STATUS_ROMSCAN_DLG, NULL
			);
			break;
		}

		case STATUS_CORRUPT_APP_DLG:
		{
			::cellMsgDialogOpen2(
				CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL
				|CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK
				|CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_ON
				|CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_OK, 
				"Error: FB Alpha RL installation is corrupted, please re-install it.", 
				ExitDlgCallbackFunction, (void*)STATUS_EXIT, NULL
			);

			break;
		}

		case STATUS_EXIT:
		{
			::cellMsgDialogOpen2(
				CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO|
				CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_NO, 
				"Do you want to exit FB Alpha RL and return to XMB ?", 
				ExitDlgCallbackFunction, (void*)STATUS_EXIT, NULL
			);
			break;
		}

		case STATUS_EXIT_FBARL_RA:
		{
			::cellMsgDialogOpen2(
				CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO|
				CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_NO, 
				"Do you want to exit and load FB Alpha RetroArch (modified core / fb_alpha.SELF) ?",
				ExitDlgCallbackFunction, (void*)STATUS_EXIT_FBARL_RA, NULL
			);
			break;
		}

		case STATUS_EXIT_MMAN:
		{
			::cellMsgDialogOpen2(				
				CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO|
				CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_NO, 
				"Do you want to exit and load \"multiMAN\" ?",
				ExitDlgCallbackFunction, (void*)STATUS_EXIT_MMAN, NULL
			);
			break;
		}

		case STATUS_EXIT_IMANAGER:
		{
			::cellMsgDialogOpen2(				
				CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO|
				CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_NO, 
				"Do you want to exit and load \"Iris Manager\" ?",
				ExitDlgCallbackFunction, (void*)STATUS_EXIT_IMANAGER, NULL
			);
			break;
		}

		case STATUS_UPDATEPREVIEW:
		{
			UpdateBurnSelected(fgames[nSelectedGame]->zipname);
			UpdatePreviewImage();
			break;
		}

		case STATUS_RESETPREVIEW:
		{
			ResetPreviewImage();
			break;
		}

		case STATUS_ROMSCAN_START:
		{
			char szMsg[256] = "";
			sprintf(szMsg, "Scanning ROM(s), please wait...\n\nNotice: If you have MAME complete romset, be patient, the process could take a few minutes.");

			::cellMsgDialogOpen2(
				CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL
				|CELL_MSGDIALOG_TYPE_BUTTON_TYPE_NONE
				|CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_ON
				|CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_NONE
				|CELL_MSGDIALOG_TYPE_PROGRESSBAR_SINGLE,
				szMsg,
				DlgCallbackFunction, NULL, NULL
			);

			sys_ppu_thread_t thread_id;

			sys_ppu_thread_create(
				&thread_id,
				_ScanROMs,						// callback function
				0x1337,							// arg
				0,								// priority
				0x300000,							// stack size
				SYS_PPU_THREAD_CREATE_JOINABLE, //
				"ROMScan"						// name
			);
			break;
		}

		case STATUS_ROMSCAN_END:
		{
			cellMsgDialogAbort();
			SaveGameListCache();
			fbaRL->InitFilterList();
			break;
		}
	}

	nStatus = STATUS_NORMAL;
}