diff --git a/Makefile b/Makefile index 063625eb..7850db82 100644 --- a/Makefile +++ b/Makefile @@ -281,6 +281,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