How to make a Plug-In patch for MD of NEO2 Ultra Menu Application V2
This note will explain in detail how to make plug-in for the MD of NEO2 Ultra Menu. First, we know that the plug-in is a DLL type use by Neo2Client.exe. When the app launch up, it will enumerate all of the plug-in dll located in the special folder” C:\NEO2 Ultra Menu\ Plug_In\MD”. Then, when MD game rom adds, the app will the all these plug-in dll in order, passing the rom file path as a parameters. So the Third-party plug-in providers can do any pretreatment befor the rom add to MD cartridge.
The following shows how to make a plug-in DLL in VC6:
1. first, setup a dll project:
2. Use the default option, this is a dll support MFC.
3. Derivative a sub-class from CPlugBase, CPlugBase declare in “PlugBase.h”, then you can add your patch work inside the function of Patching(), which will be call by the main app.
class CMyPlug : public CPlugBase
{
public:
CMyPlug(){
};
virtual ~CMyPlug(){
};
public:
// Note:
// Thanks Mr.Conle ! The function prototype of this version had been improved!
bool Patching(NeoResultBlock *pBlock)
{
// demo code here!
char c[256];
wsprintf (c, "OK, The ROM buffer add is 0x%x, size:%d save size:%d arg:%s",
pBlock->romBuffer, pBlock->romBufferLength, pBlock->saveAllocationSize, pBlock->arguments);
MessageBox(NULL, c, "Plug Message", MB_OK|MB_ICONINFORMATION);
return true;
}
void Release(){
delete this;
}
private:
};
and the pointer parameter inside Patching () is define as NeoResultBlock struct:
struct NeoResultBlock
{
void* romBuffer; // points to the loaded and decoded buffer without header . Just how it is before you add it to the cart filesystem.
char* arguments; // the configuration arguments. Set it to NULL if there are no arguments.
int romBufferLength; // the length of the rom starting from the header
int saveAllocationSize; // saveAllocationSize is the save size selected in the list view
// 0 - no save
// 8 - 8kbit
// 32 - 32 kbit
// 128 - 128kbit
// -1 - 24C01
};
Here arguments is a string contains some optional arguments as below, most of these argument are obtain from app by user setting.
-r(optional) stands for Region ( EUROPE / ASIA / FRANCE / JAPAN / USA / BRAZIL / HONGKONG )
-d(optional) stands for IO device ( JOYPAD , JOYPAD6 ,RS232C ...and more )
-c(optional) stands for checksum fix ( 1 or 0 )
-h(optional) stands for Copyright fix ( 1 or 0)
-f(optional) stands for common FIXES : Fixes copyright and checksum <- This will fix many "not working" reports
-a(optional) stands for add game genie code
-s(optional) stands for suffix means the type of rom
4. Add a export function as:
BOOL WINAPI Plug_CreateObject(void ** pobj){
*pobj = new CMyPlug;
return *pobj != NULL;
}
5. OK, there's only so much. Copy the dll to the destination after compile finish, then try you great job! More details can look at the demo source.
now can support ALMOST plugin arguments !
