mirror of
https://github.com/forth-ev/VolksForth.git
synced 2025-08-08 09:24:59 +00:00
CPM: Switch text file conversion of block source files *.fb from *.fth to *.fb.txt
to differentiate them from genuine stream sources.
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
|
||||
srcfbfiles = $(wildcard src/*.fb)
|
||||
srcfbtxtfiles = $(patsubst src/%.fb, src/%.fb.txt, $(srcfbfiles))
|
||||
srcfthfiles = $(patsubst src/%.fb, src/%.fth, $(srcfbfiles))
|
||||
testsfbfiles = $(wildcard tests/*.fb)
|
||||
testsfbtxtfiles = $(patsubst tests/%.fb, tests/%.fb.txt, $(testsfbfiles))
|
||||
testsfthfiles = $(patsubst tests/%.fb, tests/%.fth, $(testsfbfiles))
|
||||
fb_txt_files = $(srcfbtxtfiles) $(testsfbtxtfiles)
|
||||
fthfiles = $(srcfthfiles) $(testsfthfiles)
|
||||
|
||||
whitch_runcpm = $(shell which RunCPM)
|
||||
@@ -11,7 +14,7 @@ cpmfilesdir = cpmfiles
|
||||
|
||||
bin: $(cpmfilesdir)/v4th.com
|
||||
|
||||
fth: $(fthfiles)
|
||||
fb.txt: $(fb_txt_files)
|
||||
|
||||
clean:
|
||||
rm -f *.log *.golden *.result
|
||||
@@ -34,10 +37,10 @@ run-editor: | msdos
|
||||
msdos:
|
||||
ln -s ../../8086/msdos msdos
|
||||
|
||||
src/%.fth: src/%.fb ../../tools/fb2fth.py
|
||||
src/%.fb.txt: src/%.fb ../../tools/fb2fth.py
|
||||
../../tools/fb2fth.py $< $@
|
||||
|
||||
tests/%.fth: tests/%.fb ../../tools/fb2fth.py
|
||||
tests/%.fb.txt: tests/%.fb ../../tools/fb2fth.py
|
||||
../../tools/fb2fth.py $< $@
|
||||
|
||||
run-volks4th: \
|
||||
|
@@ -1,95 +0,0 @@
|
||||
|
||||
\ *** Block No. 0, Hexblock 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\ *** Block No. 1, Hexblock 1
|
||||
|
||||
\ log2file loadscreen phz 20aug23
|
||||
|
||||
1 3 +thru
|
||||
|
||||
\\
|
||||
: .1x ( n -- ) $30 + dup $39 > IF 7 + THEN (emit ;
|
||||
|
||||
: .4x ( n -- )
|
||||
ascii $ (emit 4 0 DO $10 u/mod LOOP drop .1x .1x .1x .1x
|
||||
$20 (emit ;
|
||||
|
||||
: .2x ( n -- )
|
||||
ascii $ (emit 2 0 DO $10 u/mod LOOP drop .1x .1x
|
||||
$20 (emit ;
|
||||
|
||||
|
||||
|
||||
\ *** Block No. 2, Hexblock 2
|
||||
|
||||
\ logfile phz 20aug23
|
||||
|
||||
Dos also Forth definitions
|
||||
|
||||
$18 constant fcb\nam
|
||||
create logfile ," LOGFILE TXT" fcb\nam allot 1 logfile c!
|
||||
create logdma b/rec allot
|
||||
variable logoffset 0 logoffset !
|
||||
|
||||
: logflush logdma dma! logfile $15 bdos $80 dma! ;
|
||||
|
||||
: logc! ( c -- )
|
||||
logoffset @ dup >r logdma + c! r> 1+
|
||||
dup logoffset ! b/rec =
|
||||
IF logflush 0 logoffset ! THEN ;
|
||||
|
||||
|
||||
\ *** Block No. 3, Hexblock 3
|
||||
|
||||
\ log-emit log-type log-cr alsologtofile pphz 03sep23
|
||||
|
||||
: log-emit ( char -- )
|
||||
dup (emit logc! ;
|
||||
|
||||
: log-type ( addr count -- )
|
||||
0 ?DO count log-emit LOOP drop ;
|
||||
|
||||
: log-cr ( -- )
|
||||
(cr #cr logc! #lf logc! ;
|
||||
|
||||
Output: alsologtofile
|
||||
log-emit log-cr log-type (del noop 2drop (at? ;
|
||||
|
||||
|
||||
|
||||
|
||||
\ *** Block No. 4, Hexblock 4
|
||||
|
||||
\ logopen phz 20aug23
|
||||
|
||||
: logopen ( -- )
|
||||
logfile filenamelen + 1+ fcb\nam erase
|
||||
0 logoffset !
|
||||
logfile killfile
|
||||
logfile createfile
|
||||
alsologtofile ;
|
||||
|
||||
: logclose ( -- )
|
||||
cr display &26 logc! logflush logfile closefile ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user