diff --git a/6502/C64/Makefile b/6502/C64/Makefile index 05a0157..81f5c84 100644 --- a/6502/C64/Makefile +++ b/6502/C64/Makefile @@ -3,17 +3,18 @@ # the file format conversion tools from the tools/ subdir of # https://github.com/pzembrod/cc64 to be installed. -# VERSION=volksforth83 -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)) +vf_flavours = full-c64 full-c16+ full-c16- lite-c64 lite-c16+ lite-c16- +vf_binaries = $(patsubst %, cbmfiles/vf-%, $(vf_flavours)) test_files = $(wildcard tests/*.f*) test_files_petscii = $(patsubst tests/%, cbmfiles/%, $(test_files)) - +test_logs = $(patsubst %, test-%.log, $(vf_flavours)) +working_vf_flavours = full-c64 full-c16+ lite-c64 lite-c16+ +test_resuls = $(patsubst %, test-%.result, $(working_vf_flavours)) # Target to convert all .d64 images into .fth files for easier reading. vf_blk_fth: $(vf_blk_fth_files) @@ -28,9 +29,11 @@ clean: # Convenience targets -test: test-c64.result test-c16.result +test: $(test_resuls) -test64: test-c64.result +test64: test-full-c64.result + +lite64: test-lite-c64.result debug-64: emulator/tcbase.T64 emulator/build-vf.sh \ disks/vforth4_2.d64 disks/tc38q.d64 $(vf_fth_files_petscii) @@ -52,50 +55,75 @@ cbmfiles/tcbase: emulator/c64-vf-390.T64 emulator/build-tcbase.sh \ disks/tc38q.d64 disks/file-words.d64 cbmfiles/tc-base.fth emulator/build-tcbase.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-main-c64.fth c64-vf-latest +$(vf_binaries): emulator/tcbase.T64 emulator/build-vf.sh \ + disks/tc38q.d64 $(vf_fth_files_petscii) -# C16 with 64 kB RAM or Plus4 - called (C16+ in the sources. -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-main-c16+.fth c16-vf-latest +cbmfiles/vf-full-c64: + emulator/build-vf.sh vf-full-c64.fth vf-full-c64 -# C16 with 32 kB RAM - called (C16- in the sources. -cbmfiles/c16-vf-32k: emulator/tcbase.T64 emulator/build-vf.sh \ - disks/vforth4_2.d64 disks/tc38q.d64 $(vf_fth_files_petscii) - emulator/build-vf.sh vf-main-c16-.fth c16-vf-32k +cbmfiles/vf-full-c16+: + emulator/build-vf.sh vf-full-c16+.fth vf-full-c16+ + +cbmfiles/vf-full-c16-: + emulator/build-vf.sh vf-full-c16-.fth vf-full-c16- + +cbmfiles/vf-lite-c64: + emulator/build-vf.sh vf-lite-c64.fth vf-lite-c64 + +cbmfiles/vf-lite-c16+: + emulator/build-vf.sh vf-lite-c16+.fth vf-lite-c16+ + +cbmfiles/vf-lite-c16-: + emulator/build-vf.sh vf-lite-c16-.fth vf-lite-c16- # Core test targets -test-c64.result: emulator/c64-vf-latest.T64 $(test_files_petscii) \ - emulator/run-in-vice.sh tests/evaluate-test.sh test-c64.golden - rm -f test-c64.log test-c64.result - cp disks/empty.d64 disks/scratch.d64 - DISK9=scratch emulator/run-in-vice.sh c64-vf-latest \ - "include run-vf-tests.fth\n1234567890\n" - petscii2ascii cbmfiles/test.log test-c64.log - tests/evaluate-test.sh test-c64 +$(test_logs): $(test_files_petscii) emulator/run-in-vice.sh -test-c16.result: emulator/c16-vf-latest.T64 $(test_files_petscii) \ - emulator/run-in-vice.sh tests/evaluate-test.sh test-c16.golden - rm -f test-c16.log test-c16.result - VICE=xplus4 emulator/run-in-vice.sh c16-vf-latest \ - "include run-vf-tests.fth\n1234567890\n" - petscii2ascii cbmfiles/test.log test-c16.log - tests/evaluate-test.sh test-c16 +test-full-c64.log: emulator/vf-full-c64.T64 disks/scratch.d64 + DISK9=scratch emulator/run-in-vice.sh vf-full-c64 \ + "include run-full-tests.fth\n1234567890\n" + petscii2ascii cbmfiles/test.log $@ -c64_golden_parts = prelim core coreext double block report-blk -c64_golden_files = $(patsubst %, tests/golden/%.golden, \ - $(c64_golden_parts)) -test-c64.golden: $(c64_golden_files) +test-lite-c64.log: emulator/vf-lite-c64.T64 + emulator/run-in-vice.sh vf-lite-c64 \ + "include run-lite-tests.fth\n1234567890\n" + petscii2ascii cbmfiles/test.log $@ + +test-full-c16+.log: emulator/vf-full-c16+.T64 + VICE=xplus4 emulator/run-in-vice.sh vf-full-c16+ \ + "include run-min-tests.fth\n1234567890\n" + petscii2ascii cbmfiles/test.log $@ + +test-lite-c16+.log: emulator/vf-lite-c16+.T64 + VICE=xplus4 emulator/run-in-vice.sh vf-lite-c16+ \ + "include run-min-tests.fth\n1234567890\n" + petscii2ascii cbmfiles/test.log $@ + +test-%.result: test-%.log test-%.golden tests/evaluate-test.sh + rm -f $@ + tests/evaluate-test.sh $(basename $@) + +disks/scratch.d64: disks/empty.d64 + cp $< $@ + + +test-full-c64.golden: $(patsubst %, tests/golden/%.golden, \ + prelim core coreext double block report-blk) cat $? > $@ -c16_golden_parts = prelim core -c16_golden_files = $(patsubst %, tests/golden/%.golden, \ - $(c16_golden_parts)) -test-c16.golden: $(c16_golden_files) +test-lite-c64.golden: $(patsubst %, tests/golden/%.golden, \ + prelim core coreext double report-noblk) + cat $? > $@ + +c16_golden_parts = $(patsubst %, tests/golden/%.golden, \ + prelim core) + +test-full-c16+.golden: $(c16_golden_parts) + cat $? > $@ + +test-lite-c16+.golden: $(c16_golden_parts) cat $? > $@ # Rules for building Forth binaries on top of the plain vanilla @@ -106,15 +134,6 @@ cbmfiles/devenv: emulator/run-in-vice.sh emulator/build-devenv.sh \ disks/vforth4_1.d64 disks/vforth4_3.d64 disks/file-words.d64 emulator/build-devenv.sh -# Deprecated -# cbmfiles/c64-testbase: emulator/run-in-vice.sh emulator/build-testbase.sh \ -# emulator/c64-$(VERSION).T64 disks/file-words.d64 -# emulator/build-testbase.sh c64 $(VERSION) - -# cbmfiles/c16-testbase: emulator/run-in-vice.sh emulator/build-testbase.sh \ -# emulator/c16-$(VERSION).T64 disks/file-words.d64 -# VICE=xplus4 emulator/build-testbase.sh c16 $(VERSION) - # Generic T64 tape image rule diff --git a/6502/C64/cbmfiles/c16-vf-latest b/6502/C64/cbmfiles/c16-vf-latest deleted file mode 100644 index abcc03b..0000000 Binary files a/6502/C64/cbmfiles/c16-vf-latest and /dev/null differ diff --git a/6502/C64/cbmfiles/c16-volksforth83 b/6502/C64/cbmfiles/c16-volksforth83 deleted file mode 100644 index 0b38587..0000000 Binary files a/6502/C64/cbmfiles/c16-volksforth83 and /dev/null differ diff --git a/6502/C64/cbmfiles/c64-vf-latest b/6502/C64/cbmfiles/c64-vf-latest deleted file mode 100644 index a9eb5d4..0000000 Binary files a/6502/C64/cbmfiles/c64-vf-latest and /dev/null differ diff --git a/6502/C64/cbmfiles/c64-volksforth83 b/6502/C64/cbmfiles/c64-volksforth83 deleted file mode 100644 index ec518dd..0000000 Binary files a/6502/C64/cbmfiles/c64-volksforth83 and /dev/null differ diff --git a/6502/C64/cbmfiles/vf-full-c16+ b/6502/C64/cbmfiles/vf-full-c16+ new file mode 100644 index 0000000..17787f4 Binary files /dev/null and b/6502/C64/cbmfiles/vf-full-c16+ differ diff --git a/6502/C64/cbmfiles/vf-full-c64 b/6502/C64/cbmfiles/vf-full-c64 new file mode 100644 index 0000000..fbb7dd8 Binary files /dev/null and b/6502/C64/cbmfiles/vf-full-c64 differ diff --git a/6502/C64/cbmfiles/vf-lite-c16+ b/6502/C64/cbmfiles/vf-lite-c16+ new file mode 100644 index 0000000..e0b55ba Binary files /dev/null and b/6502/C64/cbmfiles/vf-lite-c16+ differ diff --git a/6502/C64/cbmfiles/vf-lite-c64 b/6502/C64/cbmfiles/vf-lite-c64 new file mode 100644 index 0000000..efddc5b Binary files /dev/null and b/6502/C64/cbmfiles/vf-lite-c64 differ diff --git a/6502/C64/src/vf-cbm-core.fth b/6502/C64/src/vf-cbm-core.fth index 6a50b4b..ceb533a 100644 --- a/6502/C64/src/vf-cbm-core.fth +++ b/6502/C64/src/vf-cbm-core.fth @@ -648,7 +648,7 @@ Code u< ( u1 u2 -- flag) : > ( n1 n2 -- flag) swap < ; -: 0> ( n -- flag) negate 0< ; +: 0> ( n -- flag) dup 0< swap 0= or not ; : 0<> ( n -- flag) 0= not ; diff --git a/6502/C64/src/vf-main-c16+.fth b/6502/C64/src/vf-full-c16+.fth similarity index 100% rename from 6502/C64/src/vf-main-c16+.fth rename to 6502/C64/src/vf-full-c16+.fth diff --git a/6502/C64/src/vf-main-c16-.fth b/6502/C64/src/vf-full-c16-.fth similarity index 100% rename from 6502/C64/src/vf-main-c16-.fth rename to 6502/C64/src/vf-full-c16-.fth diff --git a/6502/C64/src/vf-main-c64.fth b/6502/C64/src/vf-full-c64.fth similarity index 100% rename from 6502/C64/src/vf-main-c64.fth rename to 6502/C64/src/vf-full-c64.fth diff --git a/6502/C64/src/vf-lite-c16+.fth b/6502/C64/src/vf-lite-c16+.fth new file mode 100644 index 0000000..7ea722d --- /dev/null +++ b/6502/C64/src/vf-lite-c16+.fth @@ -0,0 +1,15 @@ + +include vf-tc-prep.fth + +include vf-trg-c16+.fth + +\ The actual volksForth sources + +include vf-head-c16.fth +include vf-cbm-core.fth +include vf-sys-c16.fth +include vf-cbm-file.fth +include vf-finalize.fth + +include vf-pr-target.fth +quit diff --git a/6502/C64/src/vf-lite-c16-.fth b/6502/C64/src/vf-lite-c16-.fth new file mode 100644 index 0000000..52d6597 --- /dev/null +++ b/6502/C64/src/vf-lite-c16-.fth @@ -0,0 +1,15 @@ + +include vf-tc-prep.fth + +include vf-trg-c16-.fth + +\ The actual volksForth sources + +include vf-head-c16.fth +include vf-cbm-core.fth +include vf-sys-c16.fth +include vf-cbm-file.fth +include vf-finalize.fth + +include vf-pr-target.fth +quit diff --git a/6502/C64/src/vf-lite-c64.fth b/6502/C64/src/vf-lite-c64.fth new file mode 100644 index 0000000..fd668b9 --- /dev/null +++ b/6502/C64/src/vf-lite-c64.fth @@ -0,0 +1,15 @@ + +include vf-tc-prep.fth + +include vf-trg-c64.fth + +\ The actual volksForth sources + +include vf-head-c64.fth +include vf-cbm-core.fth +include vf-sys-c64.fth +include vf-cbm-file.fth +include vf-finalize.fth + +include vf-pr-target.fth +quit diff --git a/6502/C64/tests/ans-shim.fth b/6502/C64/tests/ans-shim.fth index d85c447..1c6cdab 100644 --- a/6502/C64/tests/ans-shim.fth +++ b/6502/C64/tests/ans-shim.fth @@ -48,8 +48,6 @@ : :noname here ['] tuck @ , 0 ] ; : <> = not ; -\ Wrong for -32768: : 0> ( n -- flag) negate 0< ; -: 0> dup 0< swap 0= or not ; : 2>r r> -rot swap >r >r >r ; : 2r> r> r> r> swap rot >r ; diff --git a/6502/C64/tests/golden/prelim.golden b/6502/C64/tests/golden/prelim.golden index 4ab9c01..3f44f28 100644 --- a/6502/C64/tests/golden/prelim.golden +++ b/6502/C64/tests/golden/prelim.golden @@ -1,6 +1,5 @@ -ans-shim.fth CHAR exists 0> exists - +ans-shim.fth CHAR exists prelimtest.fth CR CR SOURCE TYPE ( Preliminary test ) CR diff --git a/6502/C64/tests/run-full-tests.fth b/6502/C64/tests/run-full-tests.fth new file mode 100644 index 0000000..395fa1c --- /dev/null +++ b/6502/C64/tests/run-full-tests.fth @@ -0,0 +1,26 @@ + +include vf-cbm-dos.fth +include logtofile.fth +logopen" test.log" + +include ans-shim.fth +: \vf [compile] \ ; immediate + +include prelimtest.fth +include tester.fth +\ 1 verbose ! +include core.fr +include coreplustest.fth + +include utilities.fth +include errorreport.fth + +include coreexttest.fth +include doubletest.fth +1 drive include blocktest.fth + +REPORT-ERRORS + +logclose + +dos s0:notdone diff --git a/6502/C64/tests/run-lite-tests.fth b/6502/C64/tests/run-lite-tests.fth new file mode 100644 index 0000000..08ab4c9 --- /dev/null +++ b/6502/C64/tests/run-lite-tests.fth @@ -0,0 +1,25 @@ + +include vf-cbm-dos.fth +include logtofile.fth +logopen" test.log" + +include ans-shim.fth +: \vf [compile] \ ; immediate + +include prelimtest.fth +include tester.fth +\ 1 verbose ! +include core.fr +include coreplustest.fth + +include utilities.fth +include errorreport.fth + +include coreexttest.fth +include doubletest.fth + +REPORT-ERRORS + +logclose + +dos s0:notdone diff --git a/6502/C64/tests/run-vf-tests.fth b/6502/C64/tests/run-min-tests.fth similarity index 62% rename from 6502/C64/tests/run-vf-tests.fth rename to 6502/C64/tests/run-min-tests.fth index 66d69c5..fc1608f 100644 --- a/6502/C64/tests/run-vf-tests.fth +++ b/6502/C64/tests/run-min-tests.fth @@ -1,39 +1,20 @@ include vf-cbm-dos.fth - include logtofile.fth - logopen" test.log" +include ans-shim.fth : \vf [compile] \ ; immediate -include ans-shim.fth - include prelimtest.fth - include tester.fth - \ 1 verbose ! - include core.fr - include coreplustest.fth \ The C16 VolksForth has LIMIT at $8000. \ More tests than up to here fill the dictionary. -(64 include utilities.fth C) -(64 include errorreport.fth C) - -(64 include coreexttest.fth C) - -(64 include doubletest.fth C) - -(64 1 drive C) -(64 include blocktest.fth C) - -(64 REPORT-ERRORS C) - logclose dos s0:notdone