From 547928ae1652f3a7b9a6fd8d0b61a2cf890acf08 Mon Sep 17 00:00:00 2001 From: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com> Date: Mon, 27 Nov 2023 12:04:10 +1000 Subject: [PATCH] some changes for rpi (#546) disable coopnet on rpi until we can get some valid libraries compiled --- Makefile | 3 ++- src/pc/lua/smlua_utils.c | 10 ++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index eff6f2d0..e3222228 100644 --- a/Makefile +++ b/Makefile @@ -255,6 +255,7 @@ endif ifeq ($(TARGET_RPI),1) $(info Compiling for Raspberry Pi) DISCORD_SDK := 0 + COOPNET := 0 machine = $(shell sh -c 'uname -m 2>/dev/null || echo unknown') # Raspberry Pi B+, Zero, etc @@ -1211,7 +1212,7 @@ ifeq ($(VERSION),eu) $(BUILD_DIR)/src/game/level_info.o: $(BUILD_DIR)/text/us/define_courses.inc.c $(BUILD_DIR)/src/game/level_info.o: $(BUILD_DIR)/text/de/define_courses.inc.c $(BUILD_DIR)/src/game/level_info.o: $(BUILD_DIR)/text/fr/define_courses.inc.c - + O_FILES += $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o else ifeq ($(VERSION),sh) diff --git a/src/pc/lua/smlua_utils.c b/src/pc/lua/smlua_utils.c index 0fe0a193..011a809a 100644 --- a/src/pc/lua/smlua_utils.c +++ b/src/pc/lua/smlua_utils.c @@ -417,15 +417,14 @@ void smlua_push_object(lua_State* L, u16 lot, void* p) { lua_pushnil(L); return; } - u64 pointer = (uintptr_t) p; // add to allowlist - smlua_cobject_allowlist_add(lot, pointer); + smlua_cobject_allowlist_add(lot, (u64)(intptr_t) p); // get a cobject from a function lua_getglobal(L, "_NewCObject"); // Get the function by its global name lua_pushinteger(L, lot); - lua_pushinteger(L, pointer); + lua_pushinteger(L, (u64)(intptr_t) p); if (lua_pcall(L, 2, 1, 0) != LUA_OK) { 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; } - u64 pointer = (uintptr_t) p; - smlua_cpointer_allowlist_add(lvt, pointer); + smlua_cpointer_allowlist_add(lvt, (u64)(intptr_t) p); // get a cpointer from a function lua_getglobal(L, "_NewCPointer"); // Get the function by its global name lua_pushinteger(L, lvt); - lua_pushinteger(L, pointer); + lua_pushinteger(L, (u64)(intptr_t) p); if (lua_pcall(L, 2, 1, 0) != LUA_OK) { LOG_ERROR("Error calling Lua function: %s\n", lua_tostring(L, -1)); }