Display: How to get inverted characters...

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
User avatar
XavSnap
Posts: 757
Joined: Sat May 10, 2008 4:23 pm

Display: How to get inverted characters...

Post by XavSnap » Thu Feb 16, 2017 10:29 pm

VB81 XuR text chart:

1] A character bloc on the screen:

Code: Select all

1 PRINT AT 0,0;"<- IT S A TEST 12345 aAbBcCdD ->"
10 LET ADD=PEEK(16397)*256+PEEK(16396)+1
20 FOR A=ADD TO ADD+31
30 POKE A,PEEK(A)+(128 AND (PEEK(A)<128))
40 NEXT A
2] A character (or more) by switching the full screen in inverted video.

Code: Select all

1 REM [HEX:\
2A,0C,40,11,00,00,19,01,00,03,3E,\
76,23,BE,28,FC,3E,80,AE,77,0B,78,\
B1,20,F1,C9 ]
10 LET S=100
20 LET L=5
25 LET A=16514
30 PRINT"SCORE: ";
31 RAND USR A
32 PRINT S;
33 RAND USR A
34 PRINT " LIVES: ";
35 RAND USR A
36 PRINT L;
37 RAND USR A
3] A blinking character using PRINT AT location.

Code: Select all

1 PRINT AT 10,10;
5 REM GET THE DF-CC AFTER A PRINT AT
10 REM CURRENT SCREEN OFFSET.
20 PRINT AT 3,15;"HELLO";
30 LET DADD=PEEK(16399)*256+PEEK(16398)-5 
35 POKE DADD,PEEK(DADD)+(128 AND PEEK(DADD)<128)-(128 AND PEEK(DADD)>=128)
40 GOTO 30
4] A string value. (memorised reversed characters)

Code: Select all

5 DIM A$(5,6)
10 LET A$(1)="HELLO1"
11 LET A$(2)="HELLO2"
12 LET A$(3)="HELLO3"
13 LET A$(4)="HELLO4"
14 LET A$(5)="HELLO5"
18 REM GET POINTER ADD.
19 FOR A=1 TO 5
20 LET A$(A)=A$(A)
30 GOSUB 100
40 LET ADD=PEEK(16445)*256+PEEK(16444)
50 FOR X=ADD TO ADD+5
60 POKE X,PEEK(X)+128
70 NEXT X
75 PRINT A$(A)
76 NEXT A
80 STOP
90 REM PUT IN BUFFER
100 POKE 16444,PEEK(16402)
110 POKE 16445,PEEK(16403)
130 RETURN

Post Reply