2016-04-02 18:00:47 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* 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"
|
|
|
|
|
2021-09-06 21:16:45 +02:00
|
|
|
using std::string;
|
|
|
|
using std::vector;
|
|
|
|
using std::ifstream;
|
|
|
|
using std::ios;
|
2016-04-02 18:00:47 +02:00
|
|
|
|
|
|
|
#define TAG_GAME_ID "{gameid}"
|
|
|
|
#define TAG_LOC "{loc}"
|
|
|
|
#define TAG_CONSOLE "{console}"
|
|
|
|
|
2016-04-03 02:51:40 +02:00
|
|
|
#define PLUGIN "PLUGIN"
|
2016-04-02 18:00:47 +02:00
|
|
|
#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
|
|
|
|
{
|
2020-08-25 00:58:09 +02:00
|
|
|
string path;
|
2016-04-03 02:51:40 +02:00
|
|
|
u32 magic;
|
2016-04-02 18:00:47 +02:00
|
|
|
u32 caseColor;
|
-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
|
|
|
int romPartition;
|
2016-04-03 02:51:40 +02:00
|
|
|
string romDir;
|
|
|
|
string fileTypes;
|
2016-04-02 18:00:47 +02:00
|
|
|
string DolName;
|
|
|
|
string coverFolder;
|
|
|
|
string consoleCoverID;
|
|
|
|
string BannerSound;
|
|
|
|
u32 BannerSoundSize;
|
|
|
|
vector<string> Args;
|
|
|
|
wstringEx DisplayName;
|
2019-07-10 16:24:44 +02:00
|
|
|
s8 boxMode;
|
2020-07-17 22:23:42 +02:00
|
|
|
bool state;
|
2016-04-02 18:00:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class Plugin
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
u8 *GetBannerSound(u32 magic);
|
|
|
|
u32 GetBannerSoundSize();
|
2016-04-03 02:51:40 +02:00
|
|
|
u32 GetCaseColor(u8 pos);
|
2016-04-02 18:00:47 +02:00
|
|
|
const char *GetDolName(u32 magic);
|
|
|
|
const char *GetCoverFolderName(u32 magic);
|
2016-04-03 02:51:40 +02:00
|
|
|
const char *GetRomDir(u8 pos);
|
2020-08-25 00:58:09 +02:00
|
|
|
void SetRomDir(u8 pos, const string &rd);
|
2019-09-11 22:57:16 +02:00
|
|
|
string GetRomName(const char *FullPath);
|
|
|
|
string GetRomId(char *romPath, u32 Magic, Config &m_crc, const char *datadir, const char *platform, const char *name);
|
-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
|
|
|
int GetRomPartition(u8 pos);
|
2020-08-25 00:58:09 +02:00
|
|
|
void SetRomPartition(u8 pos, int part);
|
2020-07-17 22:23:42 +02:00
|
|
|
const string& GetFileTypes(u8 pos);
|
2016-04-02 18:00:47 +02:00
|
|
|
wstringEx GetPluginName(u8 pos);
|
2020-08-25 00:58:09 +02:00
|
|
|
string GetPluginPath(u8 pos);
|
2020-07-17 22:23:42 +02:00
|
|
|
u32 GetPluginMagic(u8 pos);
|
|
|
|
u8 GetPluginPosition(u32 magic);
|
2019-07-10 16:24:44 +02:00
|
|
|
s8 GetBoxMode(u8 pos);
|
2016-04-03 02:51:40 +02:00
|
|
|
|
|
|
|
void init(const string& m_pluginsDir);
|
2020-08-25 00:58:09 +02:00
|
|
|
void AddPlugin(Config &plugin, const string &iniPath);
|
2016-04-03 02:51:40 +02:00
|
|
|
void Cleanup();
|
2020-07-17 22:23:42 +02:00
|
|
|
bool GetEnabledStatus(u8 pos);
|
2022-12-10 22:10:29 +01:00
|
|
|
bool GetEnabledStatus(const char *magic);
|
2020-07-17 22:23:42 +02:00
|
|
|
void SetEnablePlugin(u8 pos, u8 ForceMode = 0);
|
|
|
|
const vector<bool> &GetEnabledPlugins(u8 *num);
|
2016-04-03 02:51:40 +02:00
|
|
|
bool PluginExist(u8 pos);
|
|
|
|
|
2016-04-02 18:00:47 +02:00
|
|
|
vector<string> CreateArgs(const char *device, const char *path,
|
|
|
|
const char *title, const char *loader, u32 title_len_no_ext, u32 magic);
|
2016-04-03 02:51:40 +02:00
|
|
|
string GenerateCoverLink(dir_discHdr gameHeader, const string& constURL, Config &Checksums);
|
|
|
|
char PluginMagicWord[9];
|
|
|
|
|
2016-04-02 18:00:47 +02:00
|
|
|
private:
|
|
|
|
vector<PluginOptions> Plugins;
|
|
|
|
vector<bool> enabledPlugins;
|
2020-07-11 22:31:14 +02:00
|
|
|
s16 Plugin_Pos;
|
2016-04-02 18:00:47 +02:00
|
|
|
string pluginsDir;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern Plugin m_plugin;
|
|
|
|
|
|
|
|
#endif
|