This is just for letter A on account of the
(8*65)
If you want to do the same for letter B, it will be :
Code: Select all
POKE #B400+(8*66)+0, 1+32
...
POKE #B400+(8*66)+7, 1+32
What you have to know about your oric memory, is that it is a bunch of 8-bits boxes numbered from 0 to 65535 (In other words, in hexadecimal, it is numbered from #0000 to #FFFF). Those numbers are called addresses : just think about letter boxes in a street, numbered for the post officers.
The principle is that you should be able to retrieve or modifie any of those 65535 values.
In BASIC, there is a direct method wich is the use of POKE and PEEK (and also DEEK and DOKE).
If you want to retrieve a value :
value=PEEK(address)
If you want to change a value :
POKE address,value
Now, in you Oric memory, there are some set of boxes that contain your programs, some other nothing, some other some well known values (for instance, some squares represent the screen, some other the graphics of each caracter)
Starting at address #B400, you will find all the graphics of letters, numbers and special symbols.
For each letter, number or symbol, the graphics are defined with 8 lines of 6 pixels wide, in memory it means that each letter is coded with 8 contigous bytes (1 byte=8 bits=(6 usefull pixels+2 bits never used), 8 bytes=8 lines).
Starting from #B400, the graphics are also ordered in the ASCII value order, starting from caracter wich has the 0 ASCII value and finishing with graphics for the caracter wich has the ASCII value 127.
So for letter 'A', the address of graphics will start at #B400+(8*65) , 65 is the ASCII value of A, and will finish at address #B400+(8*65)+7.
It means that if you "POKE" at address #B400+(8*65), you change the graphics of letter A.
For B, graphics will start at address #B400+(8*66) , and will finish at address #B400+(8*66)+7.
The general formula to get the address of the graphics will start at :
#B400+(8*ASCII_VALUE)+0
More generally, we use some data statements, a loop, and a POKE in order to modify graphics :
Code: Select all
5 REM Som graphics for a Space Invaders game
10 V1=ASC('A')
20 V2=ASC('C')
30 FOR I=V1 TO V2
40 FOR J=0 TO 7
50 READ(L):POKE #B400+(8*I)+J
60 NEXT J
70 NEXT I
95 REM Graphics for letter A
100 DATA 8,8,28,42,42,42,8,0
105 REM Graphics for letter B
110 DATA 28,62,28,8,20,42,42,0
115 REM Graphics for letter A
120 DATA 34,54,42,62,8,20,34,0
150 PRINT "A B C "
Exercise :
Find in your manual, what contains the so specific addres #26A
Before doing it, try to guess, then what will do :
Try it then !
It is very often used for games