Cocoon
Posts: 49 from 2024/7/11
The specifics are:
- Find out what functions the DLL for the game in question needs exported/imported (checking the code for "GetProcAddress" is a good one here. Though sometimes they take the names of the functions from somewhere else, so more source code analysis needed
- construct a little array from it.
For RetroArch Cores it looks like this for example. While for games like Heretic2 or Quake 2 there might be both imports and exports. You then of course also need to setup the function pointers referenced here.
dll_tExportSymbol DLL_ExportSymbols[]=
{
{dllFindResource,"dllFindResource"},
{dllLoadResource,"dllLoadResource"},
{dllFreeResource,"dllFreeResource"},
{retro_init,"retro_init"},
{retro_deinit,"retro_deinit"},
{retro_api_version,"retro_api_version"},
{retro_get_system_info,"retro_get_system_info"},
{retro_get_system_av_info,"retro_get_system_av_info"},
{retro_set_environment,"retro_set_environment"},
{retro_set_video_refresh,"retro_set_video_refresh"},
{retro_set_audio_sample,"retro_set_audio_sample"},
{retro_set_audio_sample_batch,"retro_set_audio_sample_batch"},
{retro_set_input_poll,"retro_set_input_poll"},
{retro_set_input_state,"retro_set_input_state"},
{retro_reset,"retro_reset"},
{retro_run,"retro_run"},
{retro_serialize_size,"retro_serialize_size"},
{retro_serialize,"retro_serialize"},
{retro_unserialize,"retro_unserialize"},
{retro_get_memory_data,"retro_get_memory_data"},
{retro_get_memory_size,"retro_get_memory_size"},
{retro_cheat_reset,"retro_cheat_reset"},
{retro_cheat_set,"retro_cheat_set"},
{retro_load_game,"retro_load_game"},
{retro_unload_game,"retro_unload_game"},
{retro_get_region,"retro_get_region"},
{retro_set_controller_port_device,"retro_set_controller_port_device"},
{retro_load_game_special,"retro_load_game_special"},
{retro_set_audio_sample_batch,"retro_set_audio_sample_batch"},
{retro_set_audio_sample,"retro_set_audio_sample"},
{0,0}
};
dll_tImportSymbol DLL_ImportSymbols[]=
{
{0,0,0,0}
};
int DLL_Init(void)
{
return 1L;
}
void DLL_DeInit(void)
{
}
#endif