mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-25 19:31:58 +01:00
13e65956fe
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.
103 lines
3.1 KiB
C++
103 lines
3.1 KiB
C++
/****************************************************************************
|
|
* 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 _PLUGIN_HPP_
|
|
#define _PLUGIN_HPP_
|
|
|
|
#include <fstream>
|
|
#include <iostream>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "config/config.hpp"
|
|
#include "loader/disc.h"
|
|
|
|
using namespace std;
|
|
|
|
#define TAG_GAME_ID "{gameid}"
|
|
#define TAG_LOC "{loc}"
|
|
#define TAG_CONSOLE "{console}"
|
|
|
|
#define PLUGIN "PLUGIN"
|
|
#define PLUGIN_ENABLED "PLUGINS_ENABLED"
|
|
#define PLUGIN_DEV "{device}"
|
|
#define PLUGIN_PATH "{path}"
|
|
#define PLUGIN_NAME "{name}"
|
|
#define PLUGIN_NOEXT "{name_no_ext}"
|
|
#define PLUGIN_LDR "{loader}"
|
|
|
|
struct PluginOptions
|
|
{
|
|
u32 magic;
|
|
u32 caseColor;
|
|
int romPartition;
|
|
string romDir;
|
|
string fileTypes;
|
|
string DolName;
|
|
string coverFolder;
|
|
string consoleCoverID;
|
|
string BannerSound;
|
|
u32 BannerSoundSize;
|
|
vector<string> Args;
|
|
wstringEx DisplayName;
|
|
s8 boxMode;
|
|
};
|
|
|
|
class Plugin
|
|
{
|
|
public:
|
|
u8 *GetBannerSound(u32 magic);
|
|
u32 GetBannerSoundSize();
|
|
u32 GetCaseColor(u8 pos);
|
|
const char *GetDolName(u32 magic);
|
|
const char *GetCoverFolderName(u32 magic);
|
|
const char *GetRomDir(u8 pos);
|
|
string GetRomName(const char *FullPath);
|
|
string GetRomId(char *romPath, u32 Magic, Config &m_crc, const char *datadir, const char *platform, const char *name);
|
|
int GetRomPartition(u8 pos);
|
|
const string& GetFileTypes(u8 pos);
|
|
wstringEx GetPluginName(u8 pos);
|
|
u32 getPluginMagic(u8 pos);
|
|
s8 GetPluginPosition(u32 magic);
|
|
s8 GetBoxMode(u8 pos);
|
|
|
|
void init(const string& m_pluginsDir);
|
|
bool AddPlugin(Config &plugin);
|
|
void Cleanup();
|
|
void EndAdd();
|
|
bool GetEnableStatus(Config &cfg, u32 magic);
|
|
void SetEnablePlugin(Config &cfg, u8 pos, u8 ForceMode = 0);
|
|
const vector<bool> &GetEnabledPlugins(Config &cfg, u8 *num);
|
|
bool PluginExist(u8 pos);
|
|
|
|
vector<string> CreateArgs(const char *device, const char *path,
|
|
const char *title, const char *loader, u32 title_len_no_ext, u32 magic);
|
|
vector<dir_discHdr> ParseScummvmINI(Config &ini, const char *Device, u32 Magic, const char *datadir, const char *platform);
|
|
string GenerateCoverLink(dir_discHdr gameHeader, const string& constURL, Config &Checksums);
|
|
char PluginMagicWord[9];
|
|
|
|
private:
|
|
vector<PluginOptions> Plugins;
|
|
vector<bool> enabledPlugins;
|
|
s8 Plugin_Pos;
|
|
string pluginsDir;
|
|
bool adding;
|
|
};
|
|
|
|
extern Plugin m_plugin;
|
|
|
|
#endif
|