1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-06-25 22:09:35 +00:00
GLideN64/src/MupenPlusPluginAPI.cpp
Sergey Lipskiy adabb40e36 Always detect (RDRAMSize on rom start.
This fixes crash when 8MB game started after 4MB one.
2017-11-20 23:17:14 +07:00

60 lines
1.1 KiB
C++

#include "PluginAPI.h"
#include "Types.h"
#include "mupenplus/GLideN64_mupenplus.h"
#include "N64.h"
extern "C" {
EXPORT int CALL RomOpen(void)
{
if (rdram_size != nullptr)
RDRAMSize = *rdram_size - 1;
else
RDRAMSize = 0;
api().RomOpen();
return 1;
}
EXPORT m64p_error CALL PluginGetVersion(
m64p_plugin_type * _PluginType,
int * _PluginVersion,
int * _APIVersion,
const char ** _PluginNamePtr,
int * _Capabilities
)
{
return api().PluginGetVersion(_PluginType, _PluginVersion, _APIVersion, _PluginNamePtr, _Capabilities);
}
EXPORT m64p_error CALL PluginStartup(
m64p_dynlib_handle CoreLibHandle,
void *Context,
void (*DebugCallback)(void *, int, const char *)
)
{
return api().PluginStartup(CoreLibHandle);
}
EXPORT m64p_error CALL PluginShutdown(void)
{
return api().PluginShutdown();
}
EXPORT void CALL ReadScreen2(void *dest, int *width, int *height, int front)
{
api().ReadScreen2(dest, width, height, front);
}
EXPORT void CALL SetRenderingCallback(void (*callback)(int))
{
api().SetRenderingCallback(callback);
}
EXPORT void CALL ResizeVideoOutput(int width, int height)
{
api().ResizeVideoOutput(width, height);
}
} // extern "C"