4)+Plugins - PDModdingCommunity/PD-Loader GitHub Wiki
- TLAC - Arcade controller and touch screen emulator with support for XInput, DS4, keyboard, and mouse. Originally developed by samyuu.
- Patches - Required for the game to run.
- Render - Allows the use of custom display modes.
- DivaMovie (PD Loader unstable, or 1.5.3 as a separate download) - Allows playback of WMV movies without hardware acceleration. Not used if hardware acceleration is supported. Currently not compatible with MP4 videos or Wine. Developed by Skyth and somewhatlurker with the help of twistero's research.
- Launcher - Allows the user to change some settings before starting the game (optional).
- DivaSound - Replacement audio output by somewhatlurker, this plugin is a must if you have audio issues or no audio at all.
- DiscordDiva (Windows-only) - Discord integration by bela333.
- DivaImGui - In-game UI for changing the resolution per-PV, handling VSync, changing all 6 modules (without use_card), forcing the toon shader or DoF, and more. If you use MSI Afterburner/RivaTuner, set RivaTuner to "Framebuffer" instead of "Viewport" for it to work. By lybxlpsv.
.dva plugins are just standard .dlls with a changed extension. PD Loader will load them into diva.exe automatically before the game starts.
Any native .dll should work.
The default plugins are written in C++ (C++/CLI for Launcher), so that's what this page is based on.
(.NET dlls or similar aren't supported, but it should be possible to use a native wrapper)
To run code when loaded, you should create a DllMain
entry point and check for
DLL_PROCESS_ATTACH
as the call reason:
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
yourCode();
break;
case DLL_PROCESS_DETACH:
cleanup();
break;
}
return TRUE;
}
DLL_PROCESS_DETACH
is optional because plugins will stay loaded until the game is quit.
(and even then it seems like it may not be called)
Within your own code, you're free to modify memory or patch/replace functions however you want.
If you don't have much experience, you may wish to copy parts of the bundled plugins to help.
InjectCode
from Patches is very useful, and Render is a fairly small plugin with an example of
directly modifying memory (resolutionType
) and using detours to hook functions.
Launcher has the ability to show information or config exported from your plugin if you wish.
You can implement some or all of the following:
extern "C" __declspec(dllexport) LPCWSTR GetPluginName(void)
extern "C" __declspec(dllexport) LPCWSTR GetPluginDescription(void)
extern "C" __declspec(dllexport) PluginConfigArray GetPluginOptions(void)
PluginConfigArray
is from PluginConfigApi.h (it can be included in your plugins).
You should return PluginConfigArray{ _countof(cfg), cfg }
. (cfg is a PluginConfigOption[]
)
Each element of a PluginConfigOption[]
should be { CONFIG_***, new PluginConfig***Data{ ... } }
(replace ...
with values for all members of the appropriate struct)
WARNING: iniFilePath must be an absolute path
- CONFIG_BOOLEAN => new PluginConfigBooleanData
- CONFIG_NUMERIC => new PluginConfigNumericData
- CONFIG_STRING => new PluginConfigStringData
- CONFIG_DROPDOWN_INDEX => new PluginConfigDropdownIndexData
- CONFIG_DROPDOWN_TEXT => new PluginConfigDropdownTextData
- CONFIG_DROPDOWN_NUMBER => new PluginConfigDropdownNumberData
- CONFIG_RESOLUTION => new PluginConfigResolutionData
- CONFIG_GROUP_START => new PluginConfigGroupData
- CONFIG_GROUP_END => nullptr
- CONFIG_BUTTON => new PluginConfigButtonData
- CONFIG_SPACER => new PluginConfigSpacerData
Currently, DivaSound (the version in this repo) serves as an example of plugin config. You can refer to its code for help.