Jump to content

Photo

Large Capital Letters in BASIC


22 replies to this topic

#1 Casey OFFLINE  

Casey

    Star Raider

  • 94 posts

Posted Mon Jul 17, 2017 6:11 PM

Is it possible to access the large capital character definitions and use them in BASIC or Extended BASIC?  I could see some definite uses for making titles or instructions stand out, and replace the lower case character set with the large capitals from the title screen.  Anyone ever done that?



#2 chue OFFLINE  

chue

    Star Raider

  • 98 posts

Posted Mon Jul 17, 2017 6:41 PM

In Extended Basic, you can use CHARPAT to store the character patterns in a string variable.
 
This example grabs all of the uppercase definitions and uses them to redefine the lowercase 'a' character:

10 DIM X$(25)
20 FOR I=0 TO 25
30 CALL CHARPAT(65+I,X$(I))
40 NEXT I
50 PRINT "aaaaaaaaaaaaaaaa"
60 FOR I=0 TO 25
70 CALL CHAR(97,X$(I))
80 NEXT I
90 GOTO 60
 


Edited by chue, Mon Jul 17, 2017 6:48 PM.


#3 Casey OFFLINE  

Casey

    Star Raider

  • Topic Starter
  • 94 posts

Posted Mon Jul 17, 2017 8:21 PM

Sorry, I may have not been clear in what I meant.  There are 2 sets of large capital letters built into the TI.  One is the set you see when you are in TI BASIC or most other modules.  The other is the set on the master title screen when you turn the computer on.  The initial screen in TI Invaders is an example of a game that uses both fonts at the same time.  It's that kind of thing I'd like to do in BASIC.



#4 chue OFFLINE  

chue

    Star Raider

  • 98 posts

Posted Mon Jul 17, 2017 9:31 PM

Ah, I missed that.  No worries.



#5 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,231 posts
  • Location:Silver Run, Maryland

Posted Mon Jul 17, 2017 11:20 PM

There are three character sets stored contiguously in GROM 0:

 

Character Set                                    Address   ASCII Codes   Bytes/Char

-----------------------------------------------  -------   -----------   ----------

Standard (the large caps you seek),              04B0h     32 – 95        8

Small Capitals (capital letters used by Basic),  06B0h     32 – 95        7

Lowercase (actually, small caps),                0870h     96 – 126       7

 

It is easy enough to read these tables in Assembly Language.  I am not sure how you would do it in Basic.  They are listed in Heiner Martin’s TI Intern (available in the Development Resources sticky thread, post #1), pages 105 – 107 and 127 – 128.  The GROM address of the three tables is 04B0h – 0948h.

 

The first character set can be read as is because it has 8 bytes/char.  However, the other two sets are stored with only 7 bytes/char.  For those, you must insert a zero byte in front of each pattern.

 

...lee



#6 RXB OFFLINE  

RXB

    River Patroller

  • 2,643 posts
  • Location:Vancouver, Washington, USA

Posted Tue Jul 18, 2017 4:44 AM

Using RXB:

100 CALL CLEAR
110 PRINT "WORKING..."
120 A=1204! A is the address in decimal of Hex >04B4
130 FOR C=32 TO 95! This counts standard characters 32 to 95
140 CALL MOVES("G$",7,A,D$)! Moves 7 bytes from GROM address in A to STRING D$
150 FOR F=1 TO 7! Count to fix from HEX to Decimal
160 R=ASC(SEG$(D$,F,1))+32! R is adjusted value of HEX converted to Decimal
170 NEXT F! Counter of string position
180 E$=E$&"00"! Adds in null bytes to make a full character definition
190 A=A+7! Increments A to next character definition in GROM
200 CALL CHAR(C,E$)! Load new definition of character
210 PRINT CHR$(C);
220 NEXT C
230 END


#7 S1500 ONLINE  

S1500

    River Patroller

  • 4,467 posts
  • Location:Twin Cities

Posted Tue Jul 18, 2017 7:14 AM

After all these years, how did I not notice that there's two sets of all-capitals fonts? Huh.



#8 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 3,850 posts
  • Location:Denmark

Posted Tue Jul 18, 2017 7:45 AM

Using RXB:

100 CALL CLEAR
110 PRINT "WORKING..."
120 A=1204! A is the address in decimal of Hex >04B4
130 FOR C=32 TO 95! This counts standard characters 32 to 95
140 CALL MOVES("G$",7,A,D$)! Moves 7 bytes from GROM address in A to STRING D$
150 FOR F=1 TO 7! Count to fix from HEX to Decimal
160 R=ASC(SEG$(D$,F,1))+32! R is adjusted value of HEX converted to Decimal
170 NEXT F! Counter of string position
180 E$=E$&"00"! Adds in null bytes to make a full character definition
190 A=A+7! Increments A to next character definition in GROM
200 CALL CHAR(C,E$)! Load new definition of character
210 PRINT CHR$(C);
220 NEXT C
230 END

  

It does not seem to work correctly. Since "the large caps" has 8 bytes and not 7 bytes, see Lee's post, that may be part of the problem.

 

In the case of working with 8 bytes (instead of 7), using CALL MOVE (instead of CALL MOVES) would probably make it much simpler, shorter and quite fast.

 

;)

  

rxb1.gif



#9 senior_falcon OFFLINE  

senior_falcon

    Dragonstomper

  • 855 posts
  • Location:Lansing, NY, USA

Posted Tue Jul 18, 2017 8:58 AM

You can do this using XB256.  You need to be in screen2 with CALL LINK("SCRN2") and then CALL LINK("CHSETL") will replace the 7 pixel high font with the 8 pixel one.

 

I just discovered that the XB256 manual is incomplete.  There is another subprogram: CALL LINK("CHSETD") which will load a character set with true lower case letters that have descenders on the p, y, etc. 



#10 RXB OFFLINE  

RXB

    River Patroller

  • 2,643 posts
  • Location:Vancouver, Washington, USA

Posted Tue Jul 18, 2017 9:23 AM

  

It does not seem to work correctly. Since "the large caps" has 8 bytes and not 7 bytes, see Lee's post, that may be part of the problem.

 

In the case of working with 8 bytes (instead of 7), using CALL MOVE (instead of CALL MOVES) would probably make it much simpler, shorter and quite fast.

 

;)

  

rxb1.gif

There is no CALL MOVE in RXB the only MOVE works in edit mode for lines and came from GK XB.

 

LOL now I see the problem!!!

 

My conversion from HEX to Dec failed.


Edited by RXB, Tue Jul 18, 2017 9:42 AM.


#11 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 3,850 posts
  • Location:Denmark

Posted Tue Jul 18, 2017 9:39 AM

There is no CALL MOVE in RXB the only MOVE works in edit mode for lines and came from GK XB.

 

Hmmm. Okay. Guess the examples in the manual fooled me. :|

 

Anyways, a CALL MOVES (from GROM to VDP) should then be able to do the trick with "the large caps" in a sec or so. ;)

 

rxb2.png



#12 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 3,850 posts
  • Location:Denmark

Posted Tue Jul 18, 2017 9:52 AM

Is it possible to access the large capital character definitions and use them in BASIC or Extended BASIC?  I could see some definite uses for making titles or instructions stand out, and replace the lower case character set with the large capitals from the title screen.  Anyone ever done that?

 

Here are plain BASIC programs that simply redefine the characters to "the large caps" using CALL CHAR. ;)

 

Attached File  largecaps.tib.txt   2.53KB   10 downloads

Attached File  largecaps.xb.txt   1.5KB   9 downloads



#13 Tursi OFFLINE  

Tursi

    River Patroller

  • 4,684 posts
  • Location:BUR

Posted Tue Jul 18, 2017 12:26 PM

 The GROM address of the three tables is 04B0h – 0948h.

 

It's worth noting that the actual location of the characters in GROM can vary slightly -- when I did the loader for the multicarts I wrote code to look up the actual address by parsing the GROM branch vector. It was hacky but it worked. ;)

 

Also, completely unimportant, but the 99/4 actually has an even smaller small capitals character set than the 4A, stored only 6 bytes to a character IIRC. (I remember I had to deal with a difference in count). ;)



#14 Casey OFFLINE  

Casey

    Star Raider

  • Topic Starter
  • 94 posts

Posted Tue Jul 18, 2017 4:26 PM

Thanks all!  Good stuff.  I figured you'd need assembly language to actually access the character definitions, but a CALL CHAR program works just as well, if not a bit slow.

 

Since we're on the topic of character sets, the Extended BASIC addendum comes with a small program that creates "lowercase" capitals for the 99/4 from the uppercase character definitions.  They are... interesting. :)  The 99/8 had yet another font - I still don't think the new lowercase letters are attractive, but they are better than the short capitals the 99/4A has.  



#15 senior_falcon OFFLINE  

senior_falcon

    Dragonstomper

  • 855 posts
  • Location:Lansing, NY, USA

Posted Tue Jul 18, 2017 7:47 PM

gallery_34177_1071_128531.gif



#16 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 3,850 posts
  • Location:Denmark

Posted Wed Jul 19, 2017 12:22 AM

LOL now I see the problem!!!
 
My conversion from HEX to Dec failed.

 
Okay. Here's what I meant for RXB. ;)
 

100 for c=32 to 95::print chr$(c); ::next c::print : :
110 call moves("GV",512,1204,1024)
120 input i$
 

 

rxb3.gif



#17 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 3,850 posts
  • Location:Denmark

Posted Wed Jul 19, 2017 1:37 AM

Since we're on the topic of character sets, the Extended BASIC addendum comes with a small program that creates "lowercase" capitals for the 99/4 from the uppercase character definitions.  They are... interesting. :)  The 99/8 had yet another font - I still don't think the new lowercase letters are attractive, but they are better than the short capitals the 99/4A has.

 

Nice one. It's almost an okay small caps for the TI-99/4. The N should have been redefined as it looks like an M.
 
Works surprisingly well on the TI-99/4A, but off course you don't need it there. Almost a blueprint.
  
lowercase.xb.png

  



#18 RXB OFFLINE  

RXB

    River Patroller

  • 2,643 posts
  • Location:Vancouver, Washington, USA

Posted Wed Jul 19, 2017 2:32 AM

 

Hmmm. Okay. Guess the examples in the manual fooled me. :|

 

Anyways, a CALL MOVES (from GROM to VDP) should then be able to do the trick with "the large caps" in a sec or so. ;)

 

rxb2.png

Good catch I should not be up all night writing docs.



#19 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 3,850 posts
  • Location:Denmark

Posted Wed Jul 19, 2017 3:01 AM

There are three character sets stored contiguously in GROM 0:

 

Character Set                                    Address   ASCII Codes   Bytes/Char

-----------------------------------------------  -------   -----------   ----------

Standard (the large caps you seek),              04B0h     32 – 95        8

Small Capitals (capital letters used by Basic),  06B0h     32 – 95        7

Lowercase (actually, small caps),                0870h     96 – 126       7

 

  

It's funny how the lowercase small caps in the TI-99/4A takes up 7 bytes per character, when only 5 bytes are needed (per character). I suspect true lowercase was planned and space allocated. And then maybe Marketing found true lowercase to be too professional.
 
GfxRip:

 

grom.fonts.png



#20 mizapf OFFLINE  

mizapf

    River Patroller

  • 2,432 posts
  • Location:Germany

Posted Wed Jul 19, 2017 3:46 AM

The small caps have the advantage that they look like the standard font of the TI, but smaller, so this could be useful in games (like Parsec); on the other hand, maybe they did not want to encourage people to use lower-case, since everything in the TI world seems to be uppercase (up to the assembler language).


  • RXB likes this

#21 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 3,850 posts
  • Location:Denmark

Posted Wed Jul 19, 2017 10:33 AM

The 99/8 had yet another font - I still don't think the new lowercase letters are attractive, but they are better than the short capitals the 99/4A has.  

 

The TI-99/8 font is very similar to the TI-99/4.  ;)

 

ti99.4.8.font.gif



#22 Casey OFFLINE  

Casey

    Star Raider

  • Topic Starter
  • 94 posts

Posted Wed Jul 19, 2017 3:32 PM

Wow you are right there.  I didn't realize just how similar they were!  A rather curious choice indeed!



#23 Tursi OFFLINE  

Tursi

    River Patroller

  • 4,684 posts
  • Location:BUR

Posted Thu Jul 20, 2017 1:41 AM

What they chose to change there is interesting...!




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users