- Program shows up as basic even though its not - CE Toolchain compiled and linked
- 12 Jan 2025 10:57:33 am
I'm writing a program in C with a custom makefile and CE toolchain and I have encountered many errors of which I have struggled to but have overcome on my own except for this one where for some reason my program shows up as basic and after inspecting the hex of my program's .8xp file and messaging with ChatGPT to ask why my program won't run I've come to the conclusion that it is missing the "Asm84CEPrgm" signature, however I have been unable to fix this as I've referenced the CE toolchain provided makefile while writing my own but for some reason I can't get my program to run without an immediate error. So what I would like to know is what I could possibly have done wrong in writing my makefile or possibly my initial start.asm (this was used to fix an earlier error). I will provide these files for the purpose of fixing this problem and for future people who have this problem to reference.
Makefile:
Code:
src/platforms/ti/-84p/ce/start.asm:
Code:
Thank you for your time,
- Samm
Makefile:
Code:
# == ---------------------------------------------------- ==
# Cunix
# [PROJECT] START DATE: 1/6/2025
# Copyright (c) Samm 2025, All Rights Reserved.
# Samm
# == ---------------------------------------------------- ==
NAME := CUNIX
PLATFORM ?= ti/-84p/ce/py
DEBUG ?= 0
ifneq ($(filter x86 x86/-64,$(PLATFORM)),) # x86
else ifneq ($(filter ti/-84p/ce ti/-84p/ce/py,$(PLATFORM)),) # Ti-84+ CE
CC := ez80-clang
BCC := convbin
AS := fasmg
LINK := ez80-link
IMGCC := convimg
ALLOC ?= STANDARD
BSSHEAP_LOW ?= D052C6
BSSHEAP_HIGH ?= D13FD8
STACK_HIGH ?= D1A87E
INIT_LOC ?= D1A87F
endif
empty :=
comma :=,
space :=$(empty) $(empty)
SRC := ./src
RES := $(SRC)/res
BUILD_DIR := ./build
OBJ_DIR := $(BUILD_DIR)/objs
BIN_DIR := $(BUILD_DIR)/bin
ifneq ($(filter ti/-84p/ce ti/-84p/ce/py,$(PLATFORM)),) # Ti-84+ CE
TOOLCHAIN := $(shell cedev-config --prefix)
SYSTEM_INC := $(TOOLCHAIN)/include
SYSTEM_LIBDIR := $(TOOLCHAIN)/lib
SYSTEM_LIB := $(filter-out %libload.lib,$(wildcard $(SYSTEM_LIBDIR)/libload/*.lib))
LIBS := $(patsubst %,"%"$(comma)$(space),$(strip $(SYSTEM_LIB)))
endif
ARG_QUOTE = '$(subst ','\'',$1)'
CFLAGS := -nostdinc -I$(SRC) -I$(SYSTEM_INC) -isystem -integrated-as -Wall -Wextra -Oz -std=c11 -target ez80
BINFLAGS := -k 8xp -r -n $(NAME)
# -r -k 8xp-compressed -e zx7 -n $(NAME)
# -r -k 8xp -n $(NAME)
PLATFORM_DIRS := $(SRC)/platforms $(dir $(SRC)/platforms/$(PLATFORM))
C_SOURCES := $(filter-out $(SRC)/apps/%,$(shell find $(SRC) -type f -name '*.c' ! -path "$(SRC)/platforms/*"))
C_SOURCES += $(foreach DIR,$(PLATFORM_DIRS),$(wildcard $(DIR)*.c))
APP_C_SOURCES := $(shell find $(SRC)/apps -type f -name '*.c')
# ASM_SOURCES := $(shell find $(SRC) -type f -name '*.asm' ! -path "$(SRC)/platforms/* ! -path $(SRC)/apps/*")
ASM_SOURCES := $(foreach DIR,$(PLATFORM_DIRS),$(wildcard $(DIR)*.asm))
ICON := $(RES)/icon.png
OBJ := $(patsubst $(SRC)/%.c,$(OBJ_DIR)/%.c.bc,$(C_SOURCES))
LDBCLTO = $(OBJ_DIR)/lto.bc
LDLTO = $(OBJ_DIR)/lto.src
ICON_OBJ := $(OBJ_DIR)/icon.src
ifneq ($(filter ti/-84p/ce ti/-84p/ce/py,$(PLATFORM)),) # Ti-84+ CE
OUTPUT := $(BIN_DIR)/$(NAME).8xp
OUTPUT_OBJ := $(OBJ_DIR)/$(NAME).bin
# $(TOOLCHAIN)/lib/crt/crt0.src
$(OUTPUT): $(OUTPUT_OBJ)
@mkdir -p $(BIN_DIR)
$(BCC) -i $^ -o $@ $(BINFLAGS)
LDFLAGS := -v 0 \
$(call ARG_QUOTE,$(TOOLCHAIN)/meta/ld.alm) \
-i $(call ARG_QUOTE,DEBUG := $(DEBUG)) \
-i $(call ARG_QUOTE,HAS_PRINTF := 0) \
-i $(call ARG_QUOTE,HAS_LIBC := 1) \
-i $(call ARG_QUOTE,HAS_LIBCXX := 0) \
-i $(call ARG_QUOTE,PREFER_OS_CRT := 0) \
-i $(call ARG_QUOTE,PREFER_OS_LIBC := 0) \
-i $(call ARG_QUOTE,ALLOCATOR_$(ALLOC) := 1) \
-i $(call ARG_QUOTE,include "$(TOOLCHAIN)/meta/linker_script") \
-i $(call ARG_QUOTE,range .bss $$$(BSSHEAP_LOW) : $$$(BSSHEAP_HIGH)) \
-i $(call ARG_QUOTE,provide __stack = $$$(STACK_HIGH)) \
-i $(call ARG_QUOTE,locate .header at $$$(INIT_LOC)) \
-i $(call ARG_QUOTE,source $(patsubst %,"%"$(comma) ,$(LDLTO) $(ASM_SOURCES) $(TOOLCHAIN)/lib/crt/crt0.src)) \
-i $(call ARG_QUOTE,library $(LIBS))
# -i $(call ARG_QUOTE,source $(ICON_OBJ)$(comma) $(patsubst %,"%"$(comma) ,$(OBJ) $(ASM_SOURCES)))
$(OUTPUT_OBJ): $(LDLTO) $(ICON_OBJ)
@echo Linking objects...
$(AS) $(LDFLAGS) $@
$(LDLTO): $(LDBCLTO)
@$(CC) -S $(EZLTOFLAGS) $(call ARG_QUOTE,$<) -o $(call ARG_QUOTE,$@)
$(LDBCLTO): $(OBJ)
@$(LINK) $(foreach d,$^,$(call ARG_QUOTE,$d)) -o $(call ARG_QUOTE,$@)
$(OBJ_DIR)/%.c.bc: $(SRC)/%.c
@mkdir -p $(dir $@)
@$(CC) -MD -c -emit-llvm $(CFLAGS) $(call ARG_QUOTE,$<) -o $(call ARG_QUOTE,$@)
$(ICON_OBJ): $(ICON)
@mkdir -p $(dir $@)
$(IMGCC) --icon '$(ICON)' --icon-output '$(ICON_OBJ)' --icon-format asm
test: clean all
cemu-autotester ./tests/
endif
all: $(OUTPUT)
clean:
rm -rf $(BUILD_DIR)
print-vars:
@echo "C_SOURCES: $(C_SOURCES)"
@echo "OUTPUT: $(OUTPUT)"
@echo "LIBS: $(LIBS)"
src/platforms/ti/-84p/ce/start.asm:
Code:
; == ---------------------------------------------------- ==
; Cunix
; [PROJECT] START DATE: 1/6/2025
; Copyright (c) Samm 2025, All Rights Reserved.
; Samm
; == ---------------------------------------------------- ==
assume adl=1
section .text
public __start
extern _main
__start:
call _main
ld hl, 0
ret
Thank you for your time,
- Samm







