MCPcopy Create free account
hub / github.com/TASEmulators/fceux / CallRegisteredLuaFunctions

Function CallRegisteredLuaFunctions

src/lua-engine.cpp:2303–2325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2301}
2302
2303void CallRegisteredLuaFunctions(LuaCallID calltype)
2304{
2305 assert((unsigned int)calltype < (unsigned int)LUACALL_COUNT);
2306 const char* idstring = luaCallIDStrings[calltype];
2307
2308 if (!L)
2309 return;
2310
2311 lua_settop(L, 0);
2312 lua_getfield(L, LUA_REGISTRYINDEX, idstring);
2313
2314 int errorcode = 0;
2315 if (lua_isfunction(L, -1))
2316 {
2317 errorcode = lua_pcall(L, 0, 0, 0);
2318 if (errorcode)
2319 HandleCallbackError(L);
2320 }
2321 else
2322 {
2323 lua_pop(L, 1);
2324 }
2325}
2326
2327void ForceExecuteLuaFrameFunctions()
2328{

Callers 4

FCEUI_EmulateFunction · 0.85
TaseditorAutoFunctionFunction · 0.85
TaseditorManualFunctionFunction · 0.85

Calls 4

lua_settopFunction · 0.85
lua_getfieldFunction · 0.85
lua_pcallFunction · 0.85
HandleCallbackErrorFunction · 0.85

Tested by

no test coverage detected