diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 960797d9..7055be8e 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -49,6 +49,10 @@ extern "C" #ifdef WIN32 int iuplua_open(lua_State * L); int iupcontrolslua_open(lua_State * L); + + //luasocket + int luaopen_socket_core(lua_State *L); + int luaopen_mime_core(lua_State *L); #endif } @@ -4902,6 +4906,14 @@ int FCEU_LoadLuaCode(const char *filename, const char *arg) { #if defined( WIN32) && !defined(NEED_MINGW_HACKS) iuplua_open(L); iupcontrolslua_open(L); + + //luasocket - yeah, have to open this in a weird way + lua_pushcfunction(L,luaopen_socket_core); + lua_setglobal(L,"tmp"); + luaL_dostring(L, "package.preload[\"socket.core\"] = _G.tmp"); + lua_pushcfunction(L,luaopen_mime_core); + lua_setglobal(L,"tmp"); + luaL_dostring(L, "package.preload[\"mime.core\"] = _G.tmp"); #endif luaL_register(L, "emu", emulib); // added for better cross-emulator compatibility diff --git a/vc/luaperks.lib b/vc/luaperks.lib index fd689f4c..a7bd1246 100644 Binary files a/vc/luaperks.lib and b/vc/luaperks.lib differ