# SDK for OfflineList

1. Plugin
1.1. Some declaration
1.2. Function summary
2. Module
2.1. Some declaration
2.2. Function summary

## Plugin

### Some declaration

Functions for launch the emulator:
C++: typedef void (__stdcall FLaunchEmulatorFile)(char *fileName);
Delphi: type FLaunchEmulatorFile = procedure(fileName:PChar); stdcall;
fileName : indicate the complete path of the rom (archived or not).
C++: typedef void (__stdcall FLaunchEmulatorCRC)(char *crc);
Delphi: type FLaunchEmulatorCRC = procedure(crc:PChar); stdcall;
crc : indicate the crc of the file you want launch with the emulator.
Function for add files:
C++: typedef void (__stdcall FAddRoms)(char *files);
Delphi: FAddRoms = procedure(files:PChar);
files is a string representing the files names separated by the char "\0" (#0 in delphi) and terminated by a doble "\0".
The files can be archives or simple files.
Exemple:
- for one file: "C:\\foo.zip\0\0" (or 'C:\foo.zip' + #0#0 in delphi)
- for more than one files: "C:\\foo.zip\0D:\\foo2.gba\0 ... D:\\foox.gba\0\0"
Function for get the unknows files folder:
C++: typedef char *(__stdcall FGetUnknownROMSDir)();
Delphi: FGetUnknownROMSDir = function(): pchar; stdcall;
Return the path of the unknown files folder.
Fonction for extracting files:
C++: typedef INT32 (__stdcall FExtractRom)(char *crc, char *folder, INT32 patch, INT32 overwrite);
Delphi: FExtractRom = function(crc:PChar; folder: PChar; patch:Integer; overwrite:Integer): Integer; stdcall;
crc: extract file with the correponding crc.
folder: the folder to extract files.
patch: specify if the files must be patched by the modules activated (0 for not patch, other values to patch).
overwrite: specify if the extraction can overwrite existing files.
Structure for files info:
C++:
typedef struct s_info{
s_info *nextInfo; // the next game selected.
char *crc; // indicate the crc of the rom file.
char *name; // indicate the name of the game.
char *named; // indicate the rom naming.
long num; // indicate the release number of the rom.
long size; // indicate the size of the rom.
INT32 location; // indicate the location of the rom.
INT32 language; // indicate the Language(s) of the rom.
char *save; // indicate the save type of the rom.
char *publisher; // this is the publisher of the game.
char *sourceItem; // this is the group who release the first dump available for the rom.
char *comment; // this is the comment available for this rom.
char *fileExtention; // the file extention of the rom.
char *system; // the system of the dat file who contains this rom.
char *fileName;
} s_info;
Delphi:
type
PInfo = ^TInfo;
TInfo = record
nextInfo: PInfo;
crc: PChar;
name: PChar;
named: PChar;
num: Integer;
size: Integer;
location:Integer;
language:Integer;
save: PChar;
publisher: PChar;
sourceItem: PChar;
comment: PChar;
fileExtention: Pchar;
system: Pchar;
fileName: PChar;
end;
nextInfo: the next item selected.
location: the item location, the values are:
0 = Europe
1 = USA
2 = Germany
3 = China
4 = Spain
5 = France
6 = Italy
7 = Japan
8 = Netherlands
9 = England
10 = Denmark
11 = Finland
12 = Norway
13 = Poland
14 = Portugal
15 = Sweden
16 = Europe USA
17 = Europe USA Japan
18 = USA Japan
19 = Australia
20 = North Korea
21 = Brazil
22 = South Korea
23 = Europe Brazil
24 = Europe USA Brazil
25 = USA Brazil
language: the item language(s), the individual values are:
1 = French
2 = English (US)
4 = Chinese
8 = Danish
16 = Dutch
32 = Finland
64 = German
128 = Italian
256 = Japanese
512 = Norwegian
1024 = Polish
2048 = Portuguese
4096 = Spanish
8192 = Swedish
16384 = English (UK) (only if English (US) already exist)
32768 = Portuguese (BR)
65536 = Korean
Structure for functions:
C++:
typedef struct {
FExtractRom *extractRom;
FLaunchEmulatorFile *launchEmulatorFile;
FLaunchEmulatorCRC *launchEmulatorCRC;
FAddRoms *addRoms;
FGetUnknownROMSDir *getUnknownROMSDir;
} s_functions;
Delphi:
type
TFunctions=record
extractRom: FExtractRom;
launchEmulatorFile: FLaunchEmulatorFile;
launchEmulatorCRC: FLaunchEmulatorCRC;
addRoms: FAddRoms;
getUnknownROMSDir: FGetUnknownROMSDir;
end;

### Function summary

C++: void __stdcall closePlugin()
Delphi: procedure closePlugin; stdcall;
This function is called when the plugin is deactivated.
C++: char *__stdcall getAuthor()
Delphi: function getAuthor: PChar; stdcall;
Return the plugin author.
C++: char *__stdcall getName()
Delphi: function getName: PChar; stdcall;
Return the plugin name.
C++: char *__stdcall getSDKVersion()
Delphi: function getSDKVersion: PChar; stdcall;
Return the SDK plugin version. NEEDED (the SDK version 0.1 to 0.6 are not used anymore)
C++: char *__stdcall getSmallComment()
Delphi: function getSmallComment: PChar; stdcall;
Return the small comment for describe the plugin.
C++: char *__stdcall getVersion()
Delphi: function getVersion: PChar; stdcall;
Return the plugin version.
C++: void __stdcall initPlugin(s_functions functions, char *folder)
Delphi: procedure initPlugin(functions: TFunction; folder:PChar); stdcall;
This function is called when the plugin is activated. NEEDED
functions: The functions structure.
folder: The folder where the plugin can store data.
C++: char *__stdcall inMenu()
Delphi: function inMenu: PChar; stdcall;
If there are only one menu it will be displayed directly else if there are at least 2 menus there will be sub-menu of a menu named like the plugin.
Return the list of menu which should be desplayed in the plugin menu.
The menus must be separated by "\0" and the string must be finished by "\0\0"
You can add a separator by naming a menu "-".
C++: char *__stdcall inPopupMenu()
Delphi: function inPopupMenu: PChar; stdcall;
If there are only one menu it will be displayed directly else if there are at least 2 menus there will be sub-menu of a menu named like the plugin.
Return the list of menu which sould be displayed in context menu in the list of item.
The menus must be separated by "\0" and the string must be finished by "\0\0"
You can add a separator by naming a menu "-".
C++: char *__stdcall inPopupMenuHave()
Delphi: function inPopupMenuHave: PChar; stdcall;
If there are only one menu it will be displayed directly else if there are at least 2 menus there will be sub-menu of a menu named like the plugin.
Return the list of menu which sould be displayed in context menu in the list of item. (for available item)
The menus must be separated by "\0" and the string must be finished by "\0\0"
You can add a separator by naming a menu "-".
C++: char *__stdcall inPopupMenuMiss()
Delphi: function inPopupMenuMiss: PChar; stdcall;
If there are only one menu it will be displayed directly else if there are at least 2 menus there will be sub-menu of a menu named like the plugin.
Return the list of menu which sould be displayed in context menu in the list of item. (for missing item)
The menus must be separated by "\0" and the string must be finished by "\0\0"
You can add a separator by naming a menu "-".
C++: boolean __stdcall isCompatible(char *system)
Delphi: function : PChar; stdcall;
This function is called for know if the data file is supported by the plugin.
C++: void __stdcall onMenuClick(INT32 action)
Delphi: procedure onMenuClick(action: Integer); stdcall;
This function is called when the user click on the context menu of the list of item.
The "action" integer indicate wich menu is clicked 0 for the first menu, 1 for the second, ...
C++: void __stdcall onPopupMenuClick(INT32 action, s_info itemInfo)
Delphi: procedure onPopupMenuClick(action: Integer; itemInfo: PInfo); stdcall;
This function is called when the user click on the context menu of the list of item.
The "action" integer indicate wich menu is clicked 0 for the first menu, 1 for the second, ...
C++: void __stdcall onPopupMenuHaveClick(INT32 action, s_info itemInfo)
Delphi: procedure onPopupMenuHaveClick(action: Integer; itemInfo: PInfo); stdcall;
This function is called when the user click on the context menu of the list of item (for available item).
The "action" integer indicate wich menu is clicked 0 for the first menu, 1 for the second, ...
C++: void __stdcall onPopupMenuMissClick(INT32 action, s_info itemInfo)
Delphi: procedure onPopupMenuMissClick(action: Integer; itemInfo: PInfo); stdcall;
This function is called when the user click on the context menu of the list of item (for missing item).
The "action" integer indicate wich menu is clicked 0 for the first menu, 1 for the second, ...
C++: void __stdcall rename(INT32 language)
Delphi: procedure rename(language: Integer); stdcall;
This function is called at startup of OfflineList and when the user change the selected language.
The language value:
- 0 : English
- 1 : French
- 2 : Chinese (Simp)
- 3 : Chinese (Trad)
- 4 : German
- 5 : Dutch
- 6 : Italian
- 7 : Japanese
- 8 : Norwegian
- 9 : Polish
- 10 : Portuguese (Brazil)
- 11 : Spanish
- 12 : Spanish (Mexico)
- 13 : Swedish
- 14 : Danish
- 15 : Czech
- 16 : ... .

## Module

### Some declaration

C++:
typedef struct {
char *filePath;
char *crc; // indicate the crc of the rom file.
char *name; // indicate the name of the game.
char *named; // indicate the rom naming.
INT32 num; // indicate the release number of the rom.
} s_item;
Delphi:
type
TItem = record
filePath : PChar;
crc: PChar;
name: PChar;
named: PChar;
num: Integer;
end;
filePath: the path of the file to modify
crc: the item/file crc
name: the item name
named: the item "naming"
num: the item number

### Function summary

C++: void __stdcall closeModule()
Delphi: procedure closeModule; stdcall;
This function is called when the module is deactivated.
C++: void __stdcall editRom(s_item *item)
Delphi: procedure editRom(item: TItem); stdcall;
Function for edit an item.
C++: char *__stdcall getAuthor()
Delphi: function getAuthor: PChar; stdcall;
Return the module author.
C++: char *__stdcall getName()
Delphi: function getName: PChar; stdcall;
Return the module name.
C++: char *__stdcall getSDKVersion()
Delphi: function getSDKVersion: PChar; stdcall;
Return the SDK module version. NEEDED (the SDK version 0.1 to 0.6 are not used anymore)
C++: char *__stdcall getSmallComment()
Delphi: function getSmallComment: PChar; stdcall;
Return the small comment for describe the module.
C++: char *__stdcall getVersion()
Delphi: function getVersion: PChar; stdcall;
Return the module version.
C++: void __stdcall initModule(char *folder)
Delphi: procedure initModule(folder:PChar); stdcall;
This function is called when the module is activated. NEEDED
folder: The folder where the module can store data.
C++: boolean __stdcall isCompatible(char *system)
Delphi: function : PChar; stdcall;
This function is called for know if the data file is supported by the module.
C++: void __stdcall rename(INT32 language)
Delphi: procedure rename(language: Integer); stdcall;
This function is called at startup of OfflineList and when the user change the selected language.
The language value:
- 0 : English
- 1 : French
- 2 : Chinese (Simp)
- 3 : Chinese (Trad)
- 4 : German
- 5 : Dutch
- 6 : Italian
- 7 : Japanese
- 8 : Norwegian
- 9 : Polish
- 10 : Portuguese (Brazil)
- 11 : Spanish
- 12 : Spanish (Mexico)
- 13 : Swedish
- 14 : Danish
- 15 : Czech
- 16 : ... .