1
1
\ HILITE.FTH create reverse color characters and removes itself
2
2
\ INCLUDE DSK1.TOOLS
3
3
4
- MARKER /REMOVE \ put a "bookmark in the dictionary"
5
-
6
- NEEDS MALLOC FROM DSK1.MALLOC
7
4
HEX
8
5
: ]PDT ( char# -- 'pdt[n] ) 8* 800 + ; \ VDP pattern Descriptor table
9
6
10
7
400 CONSTANT 1K
11
8
12
9
: 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
16
12
DO
17
- I DUP C @ INVERT SWAP C! \ invert char pattern
13
+ I VC @ INVERT I 1K + VC! \ invert char patterns in VDP RAM
18
14
LOOP
19
- R@ 80 ]PDT 1K VWRITE \ write RAM back to VDP upper charset
20
- R> MFREE ; \ release the memory
15
+ ;
21
16
17
+ \ use this word at the start of your program
22
18
INVERTFONT ( change the VDP memory)
23
- /REMOVE ( remove the above code from the Forth dictionary)
24
19
25
20
\ *permanent routines*
26
21
\ Type a string with reversed colors
@@ -31,8 +26,9 @@ INVERTFONT ( change the VDP memory)
31
26
: NORMAL ( Vaddr len --) BOUNDS DO I VC@ 7F AND I VC! LOOP ;
32
27
: REVERSE ( Vaddr len --) BOUNDS DO I VC@ 80 XOR I VC! LOOP ;
33
28
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 ;
36
32
37
33
DECIMAL
38
34
: BLINKER ( Vaddr len -- ) BEGIN 2DUP REVERSE 500 MS KEY? UNTIL 2DROP ;
@@ -44,7 +40,11 @@ DECIMAL
44
40
45
41
0 23 AT-XY ." Press a key to stop demo"
46
42
3000 MS
47
- 0 1 AT-XY VPOS 34 REVERSE
48
43
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