2012-04-10 19:12:38 +02:00
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
// Name : plugin.hpp
|
|
|
|
// Copyright : 2012 FIX94
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
#ifndef _PLUGIN_HPP_
|
|
|
|
#define _PLUGIN_HPP_
|
|
|
|
|
|
|
|
#include <fstream>
|
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
2012-05-06 14:03:43 +02:00
|
|
|
#include <vector>
|
2012-04-10 19:12:38 +02:00
|
|
|
|
2012-06-09 13:06:47 +02:00
|
|
|
using namespace std;
|
|
|
|
|
2012-04-10 19:12:38 +02:00
|
|
|
#include "config/config.hpp"
|
2012-04-12 00:01:41 +02:00
|
|
|
#include "loader/disc.h"
|
2012-04-10 19:12:38 +02:00
|
|
|
|
2012-06-09 13:06:47 +02:00
|
|
|
#define SWAP32(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) | (((x) & 0xff0000) >> 8) | (((x) >> 24) & 0xff))
|
|
|
|
|
|
|
|
#define TAG_GAME_ID "{gameid}"
|
|
|
|
#define TAG_LOC "{loc}"
|
|
|
|
#define TAG_CONSOLE "{console}"
|
2012-04-10 19:12:38 +02:00
|
|
|
|
2012-05-01 15:30:16 +02:00
|
|
|
struct PluginOptions
|
|
|
|
{
|
|
|
|
u8 *BannerSound;
|
|
|
|
u32 BannerSoundSize;
|
|
|
|
u32 magicWord;
|
|
|
|
string DolName;
|
|
|
|
string coverFolder;
|
2012-06-08 21:29:23 +02:00
|
|
|
string consoleCoverID;
|
2012-05-11 20:46:43 +02:00
|
|
|
wstringEx DisplayName;
|
2012-05-01 15:30:16 +02:00
|
|
|
u32 caseColor;
|
|
|
|
bool ReturnLoader;
|
|
|
|
};
|
|
|
|
|
2012-04-10 19:12:38 +02:00
|
|
|
class Plugin
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool AddPlugin(Config &plugin);
|
|
|
|
u8* GetBannerSound(u32 magic);
|
|
|
|
u32 GetBannerSoundSize();
|
|
|
|
char* GetDolName(u32 magic);
|
2012-05-01 15:30:16 +02:00
|
|
|
char* GetCoverFolderName(u32 magic);
|
2012-06-17 13:01:43 +02:00
|
|
|
string GenerateCoverLink(dir_discHdr gameHeader, string url, Config &Checksums);
|
2012-05-05 22:07:54 +02:00
|
|
|
wstringEx GetPluginName(u8 pos);
|
|
|
|
u32 getPluginMagic(u8 pos);
|
|
|
|
bool PluginExist(u8 pos);
|
|
|
|
void SetEnablePlugin(Config &cfg, u8 pos, u8 ForceMode = 0);
|
2012-05-06 14:03:43 +02:00
|
|
|
vector<bool> GetEnabledPlugins(Config &cfg);
|
2012-04-14 21:43:37 +02:00
|
|
|
bool UseReturnLoader(u32 magic);
|
2012-05-29 15:55:23 +02:00
|
|
|
bool isScummVM(u32 magic);
|
2012-05-23 18:27:55 +02:00
|
|
|
bool isMplayerCE(u32 magic);
|
|
|
|
vector<string> CreateMplayerCEArguments(const char *src);
|
2012-04-10 19:12:38 +02:00
|
|
|
void init(string);
|
|
|
|
void Cleanup();
|
|
|
|
void EndAdd();
|
2012-05-06 14:03:43 +02:00
|
|
|
vector<dir_discHdr> ParseScummvmINI(Config &ini, string Device);
|
2012-05-29 15:49:28 +02:00
|
|
|
|
2012-04-10 19:12:38 +02:00
|
|
|
private:
|
2012-05-04 20:05:41 +02:00
|
|
|
s8 GetPluginPosition(u32 magic);
|
2012-05-06 14:03:43 +02:00
|
|
|
vector<PluginOptions> Plugins;
|
2012-05-04 20:05:41 +02:00
|
|
|
s8 Plugin_Pos;
|
2012-04-10 19:12:38 +02:00
|
|
|
string pluginsDir;
|
|
|
|
bool adding;
|
|
|
|
};
|
|
|
|
#endif
|