diff --git a/Makefile b/Makefile
index 0cf69ce..e416137 100755
--- a/Makefile
+++ b/Makefile
@@ -15,8 +15,10 @@ STACK_SIZE := 61800
LUA_DIR := Source
SRC_DIR := src
BUILD_DIR := build
-SRC_MAIN := $(SRC_DIR)/main.c $(SRC_DIR)/rom.s
-SRC := $(SRC_MAIN) $(SRC_SDK)
+ROM_ASM := $(SRC_DIR)/rom.s
+ROM_ASM_MAC := $(SRC_DIR)/rom_mac.s
+SRC_MAIN := $(SRC_DIR)/main.c
+SRC := $(SRC_MAIN) $(SRC_SDK) $(ROM_ASM)
UXN_ROM := roms/dvd.rom
ROM_FILE := $(BUILD_DIR)/uxn.rom
ROM_OBJ := $(BUILD_DIR)/rom.o
@@ -69,6 +71,7 @@ ifeq ($(DETECTED_OS), Linux)
DYLIB_FLAGS = -shared -fPIC
DYLIB_EXT = so
PDCFLAGS = -k -sdkpath $(SDK)
+ SRC_NATIVE = $(SRC)
endif
ifeq ($(DETECTED_OS), Darwin)
CLANGFLAGS = -g
@@ -76,6 +79,7 @@ ifeq ($(DETECTED_OS), Darwin)
DYLIB_FLAGS = -dynamiclib -rdynamic
DYLIB_EXT = dylib
PDCFLAGS = -k
+ SRC_NATIVE = $(SRC_MAIN) $(SRC_SDK) $(ROM_ASM_MAC)
endif
# Setup debug/release builds.
@@ -131,5 +135,5 @@ simulator: $(BUILD_DIR)/pdex.${DYLIB_EXT} | $(BUILD_DIR)
$(BUILD_DIR)/pdex.${DYLIB_EXT}: $(WATCH_SRC) $(ROM_FILE)| $(BUILD_DIR)
cp $(UXN_ROM) $(ROM_FILE)
$(SIMCOMPILER) $(DYLIB_FLAGS) -lm -DTARGET_SIMULATOR=1 -DTARGET_EXTENSION=1\
- $(INC_FLAGS) -o $(BUILD_DIR)/pdex.${DYLIB_EXT} $(SRC)
+ $(INC_FLAGS) -o $(BUILD_DIR)/pdex.${DYLIB_EXT} $(SRC_NATIVE)
rm $(ROM_FILE)
diff --git a/src/rom_mac.s b/src/rom_mac.s
new file mode 100644
index 0000000..af0f0f1
--- /dev/null
+++ b/src/rom_mac.s
@@ -0,0 +1,9 @@
+.section __TEXT,__text
+
+.balign 4
+.global _uxn_rom
+_uxn_rom:
+.incbin "build/uxn.rom"
+
+.global _uxn_rom_size
+.set _uxn_rom_size, . - _uxn_rom
--
2.39.3 (Apple Git-145)
This is for uxn-playdate, it enables running games in the playdate
simulator on MacOS. Turns out the expected assembly format is a bit
different.