Skip to content

Commit b806fd9

Browse files
author
theBF
committed
Update HILITE.FTH
1 parent e90b18e commit b806fd9

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

LIB.ITC/HILITE.FTH

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
\ HILITE.FTH create reverse color characters and removes itself
22
\ INCLUDE DSK1.TOOLS
33

4-
MARKER /REMOVE \ put a "bookmark in the dictionary"
5-
6-
NEEDS MALLOC FROM DSK1.MALLOC
74
HEX
85
: ]PDT ( char# -- 'pdt[n] ) 8* 800 + ; \ VDP pattern Descriptor table
96

107
400 CONSTANT 1K
118

129
: INVERTFONT ( -- )
13-
1K MALLOC >R \ get a 1K buffer
14-
0 ]PDT R@ 1K VREAD \ copy VDP patterns to RAM
15-
R@ 1K BOUNDS \ loop thru 1K byte by byte
10+
0 ]PDT 1K
11+
BOUNDS \ loop thru pattern table byte by byte
1612
DO
17-
I DUP C@ INVERT SWAP C! \ invert char pattern
13+
I VC@ INVERT I 1K + VC! \ invert char patterns in VDP RAM
1814
LOOP
19-
R@ 80 ]PDT 1K VWRITE \ write RAM back to VDP upper charset
20-
R> MFREE ; \ release the memory
15+
;
2116

17+
\ use this word at the start of your program
2218
INVERTFONT ( change the VDP memory)
23-
/REMOVE ( remove the above code from the Forth dictionary)
2419

2520
\ *permanent routines*
2621
\ Type a string with reversed colors
@@ -31,8 +26,9 @@ INVERTFONT ( change the VDP memory)
3126
: NORMAL ( Vaddr len --) BOUNDS DO I VC@ 7F AND I VC! LOOP ;
3227
: REVERSE ( Vaddr len --) BOUNDS DO I VC@ 80 XOR I VC! LOOP ;
3328

34-
\ test code
35-
: .HICHARS FF 80 DO I EMIT LOOP ;
29+
\ test code ........................................
30+
: .HICHARS CR FF 80 DO I EMIT LOOP ;
31+
: .LOCHARS CR 80 0 DO I EMIT LOOP ;
3632

3733
DECIMAL
3834
: BLINKER ( Vaddr len -- ) BEGIN 2DUP REVERSE 500 MS KEY? UNTIL 2DROP ;
@@ -44,7 +40,11 @@ DECIMAL
4440

4541
0 23 AT-XY ." Press a key to stop demo"
4642
3000 MS
47-
0 1 AT-XY VPOS 34 REVERSE
4843

49-
0 3 AT-XY VPOS 19 BLINKER
50-
;
44+
\ X Y len
45+
0 1 >VPOS 34 REVERSE
46+
0 3 >VPOS 19 BLINKER
47+
;
48+
49+
.LOCHARS
50+
.HICHARS

0 commit comments

Comments
 (0)