From d51c2cfc0599544c2c1e0f0b39f7927bbea2713c Mon Sep 17 00:00:00 2001 From: Philip Zembrod Date: Sat, 2 Dec 2023 09:55:17 +0100 Subject: [PATCH] Add v4th-x16e target with x16edit invocation --- 6502/C64/Makefile | 16 +++++++++++++++- 6502/C64/src/v4th-x16e.fth | 30 ++++++++++++++++++++++++++++++ 6502/C64/src/vf-x16edit.fth | 16 ++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 6502/C64/src/v4th-x16e.fth create mode 100644 6502/C64/src/vf-x16edit.fth diff --git a/6502/C64/Makefile b/6502/C64/Makefile index a795e13..c7ef736 100644 --- a/6502/C64/Makefile +++ b/6502/C64/Makefile @@ -9,7 +9,7 @@ vf_fth_files = $(wildcard src/vf-*.fth src/v4th*.fth) vf_fth_files_petscii = $(patsubst src/%, cbmfiles/%, $(vf_fth_files)) vf_flavours = \ v4thblk-c64 v4thblk-c16+ v4thblk-c16- \ - v4th-c64 v4th-c16+ v4th-c16- v4th-x16 + v4th-c64 v4th-c16+ v4th-c16- v4th-x16 v4th-x16e vf_binaries = $(patsubst %, cbmfiles/%, $(vf_flavours)) test_files = $(wildcard tests/*.f*) @@ -88,6 +88,9 @@ cbmfiles/v4th-c16-: cbmfiles/v4th-x16: emulator/build-vf.sh v4th-x16 +cbmfiles/v4th-x16e: + emulator/build-vf.sh v4th-x16e + # Core test targets @@ -138,6 +141,13 @@ test-v4th-x16.log: cbmfiles/v4th-x16 emulator/sdcard.img mcopy -i emulator/sdcard.img ::TEST.LOG cbmfiles/test.log petscii2ascii cbmfiles/test.log $@ +test-v4th-x16e.log: cbmfiles/v4th-x16e emulator/sdcard.img + rm -f cbmfiles/test.log + emulator/run-in-x16emu.sh v4th-x16e \ + "include run-std-tests.fth\n1234567890" + mcopy -i emulator/sdcard.img ::TEST.LOG cbmfiles/test.log + petscii2ascii cbmfiles/test.log $@ + test-v4th-x16-39.log: $(test_files_petscii) emulator/run-in-vice.sh test-v4th-x16-39.log: cbmfiles/v4th-x16 emulator/sdcard.img @@ -201,6 +211,10 @@ test-v4th-x16.golden: $(patsubst %, tests/golden/%.golden, \ prelim core coreext double report-noblk) cat $^ > $@ +test-v4th-x16e.golden: $(patsubst %, tests/golden/%.golden, \ + prelim core coreext double report-noblk) + cat $^ > $@ + # Rules for building Forth binaries on top of the plain vanilla # c64-volksforth83. diff --git a/6502/C64/src/v4th-x16e.fth b/6502/C64/src/v4th-x16e.fth new file mode 100644 index 0000000..8843694 --- /dev/null +++ b/6502/C64/src/v4th-x16e.fth @@ -0,0 +1,30 @@ + +\ with build log: +' noop alias \log +\ without build log: +\ ' \ alias \log + +\log include logtofile.fth + +include vf-tc-prep.fth + +\log logopen" v4th-x16e.log" + +include vf-trg-x16.fth + +\ The actual volksForth sources + +include vf-head-x16.fth +include vf-cbm-core.fth +include vf-sys-x16.fth +include vf-cbm-file.fth +include vf-x16edit.fth +include vf-finalize.fth + 9f00 ' limit >body ! 9b00 s0 ! 9f00 r0 ! +include vf-memsetup.fth + +include vf-pr-target.fth +.( target compile complete) cr +\log logclose + +quit diff --git a/6502/C64/src/vf-x16edit.fth b/6502/C64/src/vf-x16edit.fth new file mode 100644 index 0000000..fe198cc --- /dev/null +++ b/6502/C64/src/vf-x16edit.fth @@ -0,0 +1,16 @@ + +$0001 | constant RomBank + +| Code (xed? ( -- n ) + $c000 lda pha $c003 lda Push jmp end-code + +| Code (xed ( -- ) + 2 # ldx $ff # ldy + $4 lda 0= ?[ $c000 jsr ][ $c003 jsr ]? + xyNext jmp end-code + + : xed ( -- ) + bl word count $4 c! $2 ! + RomBank c@ $d RomBank c! + (xed? $4c4c = IF (xed RomBank c! + ELSE RomBank c! ." no x16edit" THEN ;