diff --git a/6502/C64/Makefile b/6502/C64/Makefile index a323731..a5cc9bb 100644 --- a/6502/C64/Makefile +++ b/6502/C64/Makefile @@ -8,6 +8,8 @@ VERSION=vf-latest vf_blk_d64_files = $(wildcard disks/*.d64) vf_blk_fth_files = $(patsubst %.d64, %.fth, $(vf_blk_d64_files)) +vf_fth_files = $(wildcard src/vf-*.fth) +vf_fth_files_petscii = $(patsubst src/%, cbmfiles/%, $(vf_fth_files)) test_files = $(wildcard tests/*.f*) test_files_petscii = $(patsubst tests/%, cbmfiles/%, $(test_files)) @@ -32,7 +34,7 @@ test64: test-c64.result # expected to be binary identical. bincmp: cmp cbmfiles/c64-vf-latest cbmfiles/c64-volksforth83 - cmp cbmfiles/c16-vf-latest cbmfiles/c16-volksforth83 + cmp cbmfiles/c16p-vf-latest cbmfiles/c16-volksforth83 run-devenv: emulator/devenv.T64 emulator/run-in-vice.sh devenv @@ -50,16 +52,18 @@ cbmfiles/tcbase: emulator/c64-testbase.T64 emulator/build-tcbase.sh \ disks/tc38q.d64 cbmfiles/tc-base.fth emulator/build-tcbase.sh -cbmfiles/c64-vf-latest: emulator/tcbase.T64 emulator/build-c64forth.sh \ - disks/vforth4_2.d64 disks/tc38q.d64 cbmfiles/vf-c64-main.fth - emulator/build-c64forth.sh +cbmfiles/c64-vf-latest: emulator/tcbase.T64 emulator/build-vf.sh \ + disks/vforth4_2.d64 disks/tc38q.d64 $(vf_fth_files_petscii) + emulator/build-vf.sh vf-c64-main.fth c64-vf-latest + +cbmfiles/c16-vf-latest: emulator/tcbase.T64 emulator/build-vf.sh \ + disks/vforth4_2.d64 disks/tc38q.d64 $(vf_fth_files_petscii) + emulator/build-vf.sh vf-c16-main.fth c16-vf-latest + +cbmfiles/c16p-vf-latest: emulator/tcbase.T64 emulator/build-vf.sh \ + disks/vforth4_2.d64 disks/tc38q.d64 $(vf_fth_files_petscii) + emulator/build-vf.sh vf-c16p-main.fth c16p-vf-latest -# Temp stopgap to fit c16 into default use of VERSION=vf-latest -# until we have a proper c16 targetcompiler rule. -# Missing part: Moving the target machine definition from vforth4_2.d64 -# screen 9 to somewhere more flexible. Likely two .fth files. -cbmfiles/c16-vf-latest: cbmfiles/c16-volksforth83 - cp $< $@ # Core test targets diff --git a/6502/C64/cbmfiles/c16-vf-latest b/6502/C64/cbmfiles/c16-vf-latest new file mode 100644 index 0000000..473cd3b Binary files /dev/null and b/6502/C64/cbmfiles/c16-vf-latest differ diff --git a/6502/C64/cbmfiles/c16p-vf-latest b/6502/C64/cbmfiles/c16p-vf-latest new file mode 100644 index 0000000..0b38587 Binary files /dev/null and b/6502/C64/cbmfiles/c16p-vf-latest differ diff --git a/6502/C64/emulator/build-c64forth.sh b/6502/C64/emulator/build-c64forth.sh deleted file mode 100755 index bfbfd7e..0000000 --- a/6502/C64/emulator/build-c64forth.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# Script for target-compiling the C64 version of VolksForth. -# It uses the tcbase binary, i.e. the resident part of the target -# compiler, adds the transient part of the target compiler, and then -# loads the C64 VolksForth sources, and saves the target. - -set -e - -emulatordir="$(dirname "${BASH_SOURCE[0]}")" -basedir="$(realpath --relative-to="$PWD" "${emulatordir}/..")" - -rm -f "${basedir}/cbmfiles/c64-vf-latest" - -keybuf="include vf-c64-main.fth\n\ -save-target c64-vf-latest\ndos s0:notdone\n" - -DISK9=vforth4_2 DISK10=tc38q "${emulatordir}/run-in-vice.sh" \ - "tcbase" "${keybuf}" diff --git a/6502/C64/emulator/build-vf.sh b/6502/C64/emulator/build-vf.sh new file mode 100755 index 0000000..cf4d611 --- /dev/null +++ b/6502/C64/emulator/build-vf.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Script for target-compiling the CBM versions of VolksForth. +# It uses the tcbase binary, i.e. the resident part of the target +# compiler, adds the transient part of the target compiler, then +# loads the VolksForth sources, and saves the target. + +set -e + +emulatordir="$(dirname "${BASH_SOURCE[0]}")" +basedir="$(realpath --relative-to="$PWD" "${emulatordir}/..")" + +source="$1" +target="$2" + +rm -f "${basedir}/cbmfiles/${target}" + +keybuf="include ${source}\nsave-target ${target}\ndos s0:notdone\n" + +DISK9=vforth4_2 DISK10=tc38q "${emulatordir}/run-in-vice.sh" \ + "tcbase" "${keybuf}" diff --git a/6502/C64/src/vf-c16-main.fth b/6502/C64/src/vf-c16-main.fth new file mode 100644 index 0000000..075599e --- /dev/null +++ b/6502/C64/src/vf-c16-main.fth @@ -0,0 +1,34 @@ + +hex + +2 drive 27 30 thru + +1 drive + +Onlyforth hex + c load \ clear memory and + d e thru \ clr labels .status + +\ *** Block No. 9, Hexblock 9 + +\ Target-Machine clv06dec88 + +cr .( Host is: ) + (64 .( C64) C) + (16 .( C16) C) + + : ) ; immediate + : (C ; immediate + +\ : (C64 ; immediate + : (C16 ; immediate +\ : (C16+ ; immediate + : (C16- ; immediate + + : (C64 [compile] ( ; immediate +\ : (C16 [compile] ( ; immediate + : (C16+ [compile] ( ; immediate +\ : (C16- [compile] ( ; immediate + + +include vf-main.fth diff --git a/6502/C64/src/vf-c16p-main.fth b/6502/C64/src/vf-c16p-main.fth new file mode 100644 index 0000000..2bb8569 --- /dev/null +++ b/6502/C64/src/vf-c16p-main.fth @@ -0,0 +1,43 @@ + +hex + +2 drive 27 30 thru + +1 drive + +Onlyforth hex + c load \ clear memory and + d e thru \ clr labels .status + +\ *** Block No. 9, Hexblock 9 + +\ Target-Machine clv06dec88 + +cr .( Host is: ) + (64 .( C64) C) + (16 .( C16) C) + + : ) ; immediate + : (C ; immediate + +\ : (C64 ; immediate + : (C16 ; immediate + : (C16+ ; immediate +\ : (C16- ; immediate + + : (C64 [compile] ( ; immediate +\ : (C16 [compile] ( ; immediate +\ : (C16+ [compile] ( ; immediate + : (C16- [compile] ( ; immediate + +\ *** Block No. 10, Hexblock a + +\ load/remove JSR-Macros clv14.4.87) + +Assembler also definitions + +\needs C16+Jsr 8 load +' C16+Jsr Is Jsr .( JSR Is:C16+ ) + + +include vf-main.fth diff --git a/6502/C64/src/vf-c64-main.fth b/6502/C64/src/vf-c64-main.fth index 50b473f..1ee019a 100644 --- a/6502/C64/src/vf-c64-main.fth +++ b/6502/C64/src/vf-c64-main.fth @@ -3,4 +3,32 @@ hex 2 drive 27 30 thru -1 drive f load +1 drive + +Onlyforth hex + c load \ clear memory and + d e thru \ clr labels .status + +\ *** Block No. 9, Hexblock 9 + +\ Target-Machine clv06dec88 + +cr .( Host is: ) + (64 .( C64) C) + (16 .( C16) C) + + : ) ; immediate + : (C ; immediate + + : (C64 ; immediate +\ : (C16 ; immediate +\ : (C16+ ; immediate +\ : (C16- ; immediate + +\ : (C64 [compile] ( ; immediate + : (C16 [compile] ( ; immediate + : (C16+ [compile] ( ; immediate + : (C16- [compile] ( ; immediate + + +include vf-main.fth diff --git a/6502/C64/src/vf-main.fth b/6502/C64/src/vf-main.fth new file mode 100644 index 0000000..7430516 --- /dev/null +++ b/6502/C64/src/vf-main.fth @@ -0,0 +1,24 @@ + + +include vf-pr-target.fth + +Onlyforth + +(C64 $801 ) (C16 $1001 ) dup displace ! + +Target definitions here! + +$10 $7D thru + +Assembler nonrelocate + +.unresolved + +' .blk is .status + +include vf-pr-target.fth + +cr .( for manual saving:) +cr .( save-target volksforth83) +cr +quit diff --git a/6502/C64/src/vf-pr-target.fth b/6502/C64/src/vf-pr-target.fth new file mode 100644 index 0000000..c14648e --- /dev/null +++ b/6502/C64/src/vf-pr-target.fth @@ -0,0 +1,18 @@ +\ *** Block No. 11, Hexblock b + +cr .( Target is: ) \ clv14.4.87) + + +(C .( CBM ) +(C64 .( C64 ) +(C16 .( C16 with ) +(C16+ .( 64kb ) +(C16- .( 32kb ) + +cr .( Target is not: ) + +(C \ ) .( CBM, ) +(C64 \ ) .( C64, ) +(C16 \ ) .( C16, ) +(C16+ \ ) .( C16+64kb, ) +(C16- \ ) .( C16-32kb, )