Enhance the build to target-compile both C16 versions of VolksForth.

This commit is contained in:
Philip Zembrod 2020-07-05 22:46:37 +02:00
parent 67e498ccef
commit 31781aeea7
10 changed files with 183 additions and 30 deletions

View File

@ -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

Binary file not shown.

Binary file not shown.

View File

@ -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}"

21
6502/C64/emulator/build-vf.sh Executable file
View File

@ -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}"

View File

@ -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

View File

@ -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

View File

@ -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

24
6502/C64/src/vf-main.fth Normal file
View File

@ -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

View File

@ -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, )