WiiFlow_Lite/source/list/ListGenerator.hpp

62 lines
2.5 KiB
C++
Raw Normal View History

/****************************************************************************
* Copyright (C) 2012 FIX94
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef _LISTGENERATOR_HPP_
#define _LISTGENERATOR_HPP_
#include <string>
#include <vector>
#include <stdio.h>
#include "defines.h"
#include "types.h"
#include "config/config.hpp"
#include "loader/wbfs.h"
#include "loader/disc.h"
#include "gui/GameTDB.hpp"
- Plugin game list generator now gets rom title and ID from wiimpathy's plugins database files. a 'reload cache' will need to be done for each plugin source so the title and ID can be added to the current cached list. custom titles still work and will override plugin database files. titles are based on custom titles file then plugins database file and finally the rom filename. if the ID is not found in the plugins database files it will have an ID of 'PLUGIN' and no game info will be displayed on the game info screen. arcade rom clones are not included in the plugins database files to keep the files short. Any arcade rom clones you have will either not be found or will aquire the same ID and title as the parent rom when the CRC of the clone rom is included in the parent roms list of CRC's. you will need to manually edit both the CRC list file and xml database file to include the rom info on any clone you have in order for them to display the correct title and game info. i would think only a small handfull of your roms would be clones. reload cache may take longer now to create the cached list. I found zipped roms for snes, nes, and others are no problem because even if the filename can't be found the crc does not need to be calculated. it is merely taken from the zip file which already holds the crc. on the other hand, half of my gba roms are unzipped with a gba extension. so my gba list takes 10 seconds or so to make because the crc of the unzipped roms does need to be calculated. mame roms use the filename but if it's a clone then it will calculate the crc of the rom zip file. thus any clones will slow things down unless you add them to the database files mentioned above. I imagine megaCD and PS1 cd games will be slow to reload cache. but at least you only need to do it once or whenever you add or delete a game. wiimpathy's database files use the no intro naming convention. i'm not crazy about it because it moves any leading 'the' to the end preceded by a comma. in this case i use custom titles ini to put the title the way i want.
2019-09-11 22:57:16 +02:00
#include "plugin/plugin.hpp"
#define CONFIG_FILENAME_SKIP_DOMAIN "PLUGINS"
#define CONFIG_FILENAME_SKIP_KEY "filename_skip_regex"
#define CONFIG_FILENAME_SKIP_DEFAULT "((dis[ck]|tape|side|track)[ _-]([b-l][^a-z]|0*[2-9]|0*[1-9][0-9]))|(disc2[.]iso)|(neogeo[.]zip)|(FUNBOOT[.]ROM)"
class ListGenerator : public std::vector<dir_discHdr>
{
public:
void createSFList(u8 maxBtns, Config &m_sourceMenuCfg, const string& sourceDir);
void Init(const char *settingsDir, const char *Language, const char *plgnsDataDir, const std::string& fileNameSkipPattern);
-updating wiiflow lite to beta 4.3.0 -fixed using categories to hide GC disc 2's. Apparently this has never really worked right for some time or ever. -fixed deleting the cached cover texture file for plugin games. Delete cover for plugins only deletes the cached texture file (.wfc) -fixed favorites and adultonly (parental lock) for plugin games. Apparently I may have broke this a few revisions back. -favorites and adultonly for plugin games now have their own domains in gamecfg1- [FAVORITES_PLUGINS] and [ADULTONLY_PLUGINS]. just makes it more organized. -only wii, GC, channels are added to [PLAYCOUNT] and [LAST_PLAYED] in gamecfg1. -now loading gamecfg1 at startup and leaving it loaded till exit. no more loading it and unloading all the time. -fixed scrolling for game_info synopsis, credits, and help text. -made source menu buttons wider for wiiflow default. old 80x80, now 100x80. looks better. -display music info now defaults to off -screensaver_disabled now defaults to yes -show GC view button is now on by default no matter what. the only way it is disabled is if you edit wiiflow.ini manually. this is how all the view buttons work. -removed hiding homebrew button but if wiiflow locked it won't work or in sourceflow it won't show. -dump_list is now under [GENERAL] instead of each view. Also only works for Wii, GC, and channels. -sorting only works for Wii, GC, and Channels now. disabled for sourceflow, plugins, homebrew, and combined view. -now if no games are found a message is shown with the current path so you can see where wiiflow is looking. (except for plugins) -removed auto create emuNAND for emuNAND view if gamelist is empty. just go to settings>NAND settings if you want to extract or disable it. -now when no games are found all buttons at bottom are still accessible allowing you to change the view or go to settings and change current partition or path and even extract your NAND to create a EmuNAND. Or go to Home Menu and Install a Wii or GC game. -removed auto extract NAND to emuNAND when launching a Wii game with EmuNAND save. Now a message is diplayed saying 'emuNAND for saves not found - using real NAND'. -made the speed at which cover titles fade in/out almost instantly. -removed update button from Home Menu. online update code is still there but not used and probably won't be used any more as there just isn't a need for it now. -removed ftp button from Home Menu and all code for the FTP server. I just use WiiXplorer's FTP server. it seems to work better for me. -disabled keep USB Alive thread for now. i think there's a possibilty it might be the cause of my SD/USB files getting corrupted. -removed Btn B and - combo to switch partitions. didn't seem useful anymore. -redid nand emulation settings menu. looks like this now: pg1 Select EmuNAND EmuNAND Enulation Select SaveNAND SaveNAND Emulation pg2 Extract Saves All Missing Extract NAND Select Saves Partition -no longer blocking Select Plugin menu and View icons when using source menu combined view -now Select Plugins Menu is like switching to plugin view but you get to choose the plugins first -now [PLUGIN] partition= is the default partition for all plugins. to change individual plugins add 'romPartition=x' to the plugin ini. x is the partition number 0 thru 8 with SD being 0. this is how my usbloadergx plugin mod works.
2016-10-05 01:44:13 +02:00
void Clear();
void ParseScummvmINI(Config &ini, const char *Device, const char *datadir, const char *platform, const string& DBName, bool UpdateCache);
- Plugin game list generator now gets rom title and ID from wiimpathy's plugins database files. a 'reload cache' will need to be done for each plugin source so the title and ID can be added to the current cached list. custom titles still work and will override plugin database files. titles are based on custom titles file then plugins database file and finally the rom filename. if the ID is not found in the plugins database files it will have an ID of 'PLUGIN' and no game info will be displayed on the game info screen. arcade rom clones are not included in the plugins database files to keep the files short. Any arcade rom clones you have will either not be found or will aquire the same ID and title as the parent rom when the CRC of the clone rom is included in the parent roms list of CRC's. you will need to manually edit both the CRC list file and xml database file to include the rom info on any clone you have in order for them to display the correct title and game info. i would think only a small handfull of your roms would be clones. reload cache may take longer now to create the cached list. I found zipped roms for snes, nes, and others are no problem because even if the filename can't be found the crc does not need to be calculated. it is merely taken from the zip file which already holds the crc. on the other hand, half of my gba roms are unzipped with a gba extension. so my gba list takes 10 seconds or so to make because the crc of the unzipped roms does need to be calculated. mame roms use the filename but if it's a clone then it will calculate the crc of the rom zip file. thus any clones will slow things down unless you add them to the database files mentioned above. I imagine megaCD and PS1 cd games will be slow to reload cache. but at least you only need to do it once or whenever you add or delete a game. wiimpathy's database files use the no intro naming convention. i'm not crazy about it because it moves any leading 'the' to the end preceded by a comma. in this case i use custom titles ini to put the title the way i want.
2019-09-11 22:57:16 +02:00
void CreateRomList(Config &platform_cfg, const string& romsDir, const vector<string>& FileTypes, const string& DBName, bool UpdateCache);
void CreateList(u32 Flow, const string& Path, const vector<string>& FileTypes, const string& DBName, bool UpdateCache);
u32 Color;
u32 Magic;
bool usePluginDBTitles;
private:
void OpenConfigs();
void CloseConfigs();
string gameTDB_Path;
string CustomTitlesPath;
string gameTDB_Language;
};
typedef void (*FileAdder)(char *Path);
void GetFiles(const char *Path, const std::vector<string>& FileTypes,
FileAdder AddFile, bool CompareFolders, u32 max_depth = 2, u32 depth = 1);
extern ListGenerator m_cacheList;
#endif /*_LISTGENERATOR_HPP_*/