Jump to content
IGNORED

How Define set characters in BASIC with POKE ??


Andrea

Recommended Posts

45 minutes ago, Andrea said:

Hello User's ATARI,

 

How to Define set characters in BASIC with POKE ??

 

 

each character is 8-bytes, one byte for each row.    They are stored in ATASCII order, first 128 characters only.  The trick is there is a pointer that you need to change to point to your new character set, and I forget where that pointer is offhand.

Link to comment
Share on other sites

I believe each character set is 1K in size, the register that points to the character sets is 756 (Hex $2F4) it's called CHBASE

Default is 224 for upper case characters and 226 for lower case.

 

So if you create your own character set, it must reside on a page boundary, then poke the high byte of the address into location 756

 

First reserve the memory you want

 

Lower RAMTOP by 1K to place your new character set.

10 TOP=(PEEK(106)-4)*256

20   POKE 106,PEEK(106)-4  

 

in your program, have the new character set as DATA statements

then something like 

 

30 I=0

40 RESTORE 10000

50 READ A: IF A = -1 THEN 100

60 POKE TOP+I

70 I=I+1: GOTO 50

 

100 YOUR PROGRAM HERE

110 POKE 756,PEEK(106) : REM POINT AT YOUR NEW SET

.

.

9999 END

10000 DATA 1,23,3,4,65,77,88,99 

10010 DATA .... the rest of your CHAR set

11000 DATA , 33,44,55,66,77,88, -1  :REM end with a -1

 

Edited by TGB1718
Link to comment
Share on other sites

2 hours ago, TGB1718 said:

30 I=0

40 RESTORE 10000

50 READ A: IF A = -1 THEN 100

60 POKE TOP+I

70 I=I+1: GOTO 50

 

Your POKE is missing the value.  Should be POKE TOP+I,A

BTW:  Since the character set is a known size, you could change this to use a FOR/NEXT loop, which would take less code, likely be faster and also save the extra -1 in the data statements.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...