mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 03:55:11 +00:00
some changes for rpi (#546)
disable coopnet on rpi until we can get some valid libraries compiled
This commit is contained in:
parent
406959e568
commit
547928ae16
2 changed files with 6 additions and 7 deletions
1
Makefile
1
Makefile
|
@ -255,6 +255,7 @@ endif
|
||||||
ifeq ($(TARGET_RPI),1)
|
ifeq ($(TARGET_RPI),1)
|
||||||
$(info Compiling for Raspberry Pi)
|
$(info Compiling for Raspberry Pi)
|
||||||
DISCORD_SDK := 0
|
DISCORD_SDK := 0
|
||||||
|
COOPNET := 0
|
||||||
machine = $(shell sh -c 'uname -m 2>/dev/null || echo unknown')
|
machine = $(shell sh -c 'uname -m 2>/dev/null || echo unknown')
|
||||||
|
|
||||||
# Raspberry Pi B+, Zero, etc
|
# Raspberry Pi B+, Zero, etc
|
||||||
|
|
|
@ -417,15 +417,14 @@ void smlua_push_object(lua_State* L, u16 lot, void* p) {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
u64 pointer = (uintptr_t) p;
|
|
||||||
|
|
||||||
// add to allowlist
|
// add to allowlist
|
||||||
smlua_cobject_allowlist_add(lot, pointer);
|
smlua_cobject_allowlist_add(lot, (u64)(intptr_t) p);
|
||||||
|
|
||||||
// get a cobject from a function
|
// get a cobject from a function
|
||||||
lua_getglobal(L, "_NewCObject"); // Get the function by its global name
|
lua_getglobal(L, "_NewCObject"); // Get the function by its global name
|
||||||
lua_pushinteger(L, lot);
|
lua_pushinteger(L, lot);
|
||||||
lua_pushinteger(L, pointer);
|
lua_pushinteger(L, (u64)(intptr_t) p);
|
||||||
|
|
||||||
if (lua_pcall(L, 2, 1, 0) != LUA_OK) {
|
if (lua_pcall(L, 2, 1, 0) != LUA_OK) {
|
||||||
LOG_ERROR("Error calling Lua function: %s\n", lua_tostring(L, -1));
|
LOG_ERROR("Error calling Lua function: %s\n", lua_tostring(L, -1));
|
||||||
|
@ -438,13 +437,12 @@ void smlua_push_pointer(lua_State* L, u16 lvt, void* p) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 pointer = (uintptr_t) p;
|
smlua_cpointer_allowlist_add(lvt, (u64)(intptr_t) p);
|
||||||
smlua_cpointer_allowlist_add(lvt, pointer);
|
|
||||||
|
|
||||||
// get a cpointer from a function
|
// get a cpointer from a function
|
||||||
lua_getglobal(L, "_NewCPointer"); // Get the function by its global name
|
lua_getglobal(L, "_NewCPointer"); // Get the function by its global name
|
||||||
lua_pushinteger(L, lvt);
|
lua_pushinteger(L, lvt);
|
||||||
lua_pushinteger(L, pointer);
|
lua_pushinteger(L, (u64)(intptr_t) p);
|
||||||
if (lua_pcall(L, 2, 1, 0) != LUA_OK) {
|
if (lua_pcall(L, 2, 1, 0) != LUA_OK) {
|
||||||
LOG_ERROR("Error calling Lua function: %s\n", lua_tostring(L, -1));
|
LOG_ERROR("Error calling Lua function: %s\n", lua_tostring(L, -1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue