Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
char pointer bend to another address
#1
hello, good day.

how can you change the character pointer to another address to create new characters?

I want to change all characters.

greetings
Reply
#2
You can use UDG as always, or use the normal CHARS ptr.
CHARS ptr is a ROM variable that must point to Address of your chars - 256.

You can declare an UInteger variable to be mapped to CHARS (23568)

Code:
DIM CHARS As UInteger AT 23568

Now you can read and set this variable to point to your new char table with

Code:
CHARS = Myaddress - 256
---
Boriel
Reply
#3
hello, thanks for the help.

what do I have to write now so that I can change the character "K"?

thanks.
greetings
Reply
#4
To change only the character "K" I suggest to use UDG (User Defined Graphics).
If you compile with the --sinclair option, the compiler will enable several features at once, to maximize compatibility with Sinclair's ROM BASIC.
Then you can POKE at USR "k" + i, using READ and DATA:
Code:
FOR i = 0 TO 7
   READ a
   POKE USR "k" + i, a
NEXT i

REM PRINT the UDG "k"

PRINT "\K \K"

DATA 85, 170, 85, 170, 85, 170, 85, 170

Please read here about using UDGs:
https://zxbasic.readthedocs.io/en/docs/syntax/
---
Boriel
Reply
#5
hello, good day.

why is the letter "Y" not ok?


number_y:
DATA 129,129,129,129,129,129,129,129 

greetings

Code:
cls

RESTORE number_h
FOR i = 0 TO 7
   READ a
   POKE USR "h" + i, a
NEXT i

RESTORE number_k
FOR i = 0 TO 7
   READ a
   POKE USR "k" + i, a
NEXT i

RESTORE number_y
FOR i = 0 TO 7
   READ a
   POKE USR "y" + i, a
NEXT i

PRINT "\H \H"
PRINT "\K \K"
PRINT "\Y \Y"

number_h:
DATA 255, 129, 129, 129, 129, 129, 129 ,255
number_k:
DATA 85, 170, 85, 170, 85, 170, 85, 170
number_y:
DATA 129,129,129,129,129,129,129,129
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)