From 0d7c00007a2ef64709bc4b87a4821825ca26dd49 Mon Sep 17 00:00:00 2001 From: mooinglemur Date: Sun, 8 Oct 2023 22:42:11 +0000 Subject: [PATCH 1/2] [BUILD] Makefile dependency fixes and enhancements (#184) --- Makefile | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 063625eb..a5b58191 100644 --- a/Makefile +++ b/Makefile @@ -223,7 +223,47 @@ FAT32_DEPS = \ BASIC_DEPS= \ $(GENERIC_DEPS) \ + basic/code1.s \ + basic/code2.s \ + basic/code3.s \ + basic/code4.s \ + basic/code5.s \ + basic/code6.s \ + basic/code7.s \ + basic/code8.s \ + basic/code9.s \ + basic/code10.s \ + basic/code11.s \ + basic/code12.s \ + basic/code13.s \ + basic/code14.s \ + basic/code15.s \ + basic/code16.s \ + basic/code17.s \ + basic/code26.s \ + basic/declare.s \ + basic/graph.s \ + basic/init.s \ + basic/sound.s \ + basic/tokens.s \ + basic/token2.s \ + basic/x16additions.s \ + math/code18.s \ + math/code19.s \ + math/code20.s \ + math/code21.s \ + math/code22.s \ + math/code23.s \ + math/code24.s \ + math/code25.s \ + math/declare.s \ + math/exports.s \ + math/fadd.s \ + math/fmult.s \ + math/fsqr.s \ + math/jumptab.s \ math/math.inc \ + math/trig.s \ $(GIT_SIGNATURE) MONITOR_DEPS= \ @@ -234,14 +274,16 @@ CHARSET_DEPS= \ $(GENERIC_DEPS) AUDIO_DEPS= \ - $(GENERIC_DEPS) - -UTIL_DEPS= \ - $(GENERIC_DEPS) + $(GENERIC_DEPS) math/math.s \ BANNEX_DEPS= \ $(GENERIC_DEPS) +X16EDIT_DEPS= \ + $(GENERIC_DEPS) \ + $(wildcard x16-edit/*.asm) \ + $(wildcard x16-edit/*.inc) + KERNAL_OBJS = $(addprefix $(BUILD_DIR)/, $(KERNAL_SOURCES:.s=.o)) KEYMAP_OBJS = $(addprefix $(BUILD_DIR)/, $(KEYMAP_SOURCES:.s=.o)) @@ -384,7 +426,7 @@ $(BUILD_DIR)/bannex.bin: $(BANNEX_OBJS) $(BANNEX_DEPS) $(CFG_DIR)/bannex-x16.cfg ./scripts/relist.py $(BUILD_DIR)/bannex.map $(BUILD_DIR)/bannex # Bank D-E: X16 Edit -$(BUILD_DIR)/x16edit-rom.bin: +$(BUILD_DIR)/x16edit-rom.bin: $(X16EDIT_DEPS) @mkdir -p $$(dirname $@) (cd x16-edit && make clean rom) cp x16-edit/build/x16edit-rom.bin $(BUILD_DIR)/x16edit-rom.bin From 464fba88c337e4f65896479e582c9a241981b843 Mon Sep 17 00:00:00 2001 From: mooinglemur Date: Mon, 9 Oct 2023 04:32:01 +0000 Subject: [PATCH 2/2] [X16EDIT] changes from upstream (#185) --- Makefile | 7 +++++++ x16-edit/.git-commit | 2 +- x16-edit/Makefile | 2 +- x16-edit/main.asm | 20 +++++++++++++++++--- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a5b58191..9f5b85a0 100644 --- a/Makefile +++ b/Makefile @@ -323,6 +323,13 @@ all: $(BUILD_DIR)/rom.bin $(ROM_LABELS) $(ROM_LST) $(BUILD_DIR)/rom.bin: $(BANK_BINS) cat $(BANK_BINS) > $@ +x16edit_update: + @rm -rf x16edittmp + git clone https://github.com/stefan-b-jakobsson/x16-edit.git x16edittmp + rsync -av --delete --delete-after --exclude=/.git --exclude=/customrom.bin x16edittmp/ x16-edit/ + (cd x16-edit && git rev-parse HEAD > .git-commit) + rm -rf x16edittmp + clean: rm -f $(GIT_SIGNATURE) rm -rf $(BUILD_DIR) diff --git a/x16-edit/.git-commit b/x16-edit/.git-commit index c8de3902..3d431956 100644 --- a/x16-edit/.git-commit +++ b/x16-edit/.git-commit @@ -1 +1 @@ -efd2bc583ae5c9a1b78dfbce639925a4471469e4 +2a4546c6282fde4b1e035a865223a66a5c5f21c5 diff --git a/x16-edit/Makefile b/x16-edit/Makefile index 24c1404f..77a4d09e 100644 --- a/x16-edit/Makefile +++ b/x16-edit/Makefile @@ -30,4 +30,4 @@ $(BUILD_DIR)/x16edit-rom.bin: $(BUILD_DIR)/help.bin $(BUILD_DIR)/help_short.bin # Clean-up target clean: - rm -f $(BUILD_DIR)/* + rm -f $(BUILD_DIR)/* \ No newline at end of file diff --git a/x16-edit/main.asm b/x16-edit/main.asm index 071062b2..ac2e1cf1 100644 --- a/x16-edit/main.asm +++ b/x16-edit/main.asm @@ -145,7 +145,7 @@ exit: .proc main_loadfile_with_options_entry jsr main_init bcs exit ;C=1 => init failed - + ;Auto indent bbr0 r1+1, :+ inc cmd_auto_indent_status @@ -227,7 +227,7 @@ exit: ; the values are ignored and replaced with X=1 and Y=255. ;Returns.............: C=1 if program initialization failed ;Error returns.......: None -.proc main_init +.proc main_init ;Ensure we are in binary mode cld @@ -264,6 +264,13 @@ exit: cpy mem_top bcs err + ;Save R2-R4 on stack + ldx #5 +: lda r2,x + pha + dex + bpl :- + ;Set program mode to default stz APP_MOD @@ -281,7 +288,6 @@ exit: bridge_jsrfar_call help_decompress cli - jsr mem_init jsr file_init jsr keyboard_init @@ -292,6 +298,14 @@ exit: jsr scancode_init jsr mouse_init + ;Restore stack + ldx #0 +: pla + sta r2,x + inx + cpx #6 + bne :- + ;Exit without errors, C=0 clc rts