Jump to content
IGNORED

multi colored fonts


hloberg

Recommended Posts

one of the things a lot of 8-bits of the era had that was really nice was the use of multi-colored fonts. in XB it's easy to have 2 color fonts by redefining the lower case char set upper then change the color of the sets. but XB won't let you get to the chars above 143. if you were able to you could add 2 more char sets and define colors for 4 color char sets.

of course not being a assembler programmer I'm not sure how one would or could do this. if possible a nice CALL LINK(Y,X,"STRING",COLORSET)?

Link to comment
Share on other sites

I wrote this program using TML as multicolor fonts (below). problem is it's about twice as slow since it has to draw each character in bitmap in software. XB256 almost gets you there except how do you specify the upper two colors sets (above 143) without specifying the char code for each character you want to print? a CALL LINK(Y,X,"STRING",COLORSET) would let you enter the string the the color set.

maybe it's time I bit the bullet and learned TMS9900 assembler. It can't be that much harder than 6502. This might be a good project to learn on.

@senior_falcon is this something similar to your 40 column routine? Drop the 40 column code, insert 4 char sets and a pointer to the beginning of each set for color choice. Would it very hard are am I missing something that make it near impossible?

 

 

Link to comment
Share on other sites

Pixelpedant has half the answer. As he says, you can copy segments of the VDP to a string and then write them to a different area of VDP ram. For example CALL LINK("VREAD",5376,255,A$) will read screen2 character definitions from ascii 64 to 95. Then you can write them to a different part of vdp memory using VWRITE. 

The other piece of the puzzle is that you can force CALL LINK("DISPLY") to use a different screen offset. The screen offset for DISPLY is at 9596. Normally this is 96, but you can poke any value you want to this location. So, for example, you could define ascii 160 to 175 with the patterns for 64 to 95, define different colors for those characters, then change the screen offset and print normally using DISPLY.

1376712580_multicolortext.JPG.be965606cb53432c35a13440b7d68ba6.JPG


5 CALL LINK("SCRN2")
10 CALL LINK("VREAD",5376,255,P$)
20 FOR I=4096 TO 4608 STEP 256 :: CALL LINK("VWRITE",I,P$):: NEXT I
25 CS=17 :: F=4 :: B=16 :: GOSUB 1000
26 CS=21 :: F=2 :: B=14 :: GOSUB 1000
27 CS=25 :: F=9 :: B=12 :: GOSUB 1000
30 FOR I=0 TO 255 :: PRINT CHR$(I);:: NEXT I
32 CALL LOAD(9596,192):: CALL LINK("DISPLY",1,1,"ATTENTION^TI^ENTHUSIASTS")
33 CALL LOAD(9596,224):: CALL LINK("DISPLY",2,1,"YOU^CAN^DISPLAY^TEXT^IN")
34 CALL LOAD(9596,0):: CALL LINK("DISPLY",3,1,"DIFFERENT^COLORS")
35 CALL LOAD(9596,96):: CALL LINK("DISPLY",4,1,"USING XB256 IN SCREEN2")
40 GOTO 40
1000 FOR I=0 TO 3 :: CALL LINK("COLOR2",CS+I,F,B):: NEXT I :: RETURN

 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, senior_falcon said:

Pixelpedant has half the answer. As he says, you can copy segments of the VDP to a string and then write them to a different area of VDP ram. For example CALL LINK("VREAD",5376,255,A$) will read screen2 character definitions from ascii 64 to 95. Then you can write them to a different part of vdp memory using VWRITE. 

The other piece of the puzzle is that you can force CALL LINK("DISPLY") to use a different screen offset. The screen offset for DISPLY is at 9596. Normally this is 96, but you can poke any value you want to this location. So, for example, you could define ascii 160 to 175 with the patterns for 64 to 95, define different colors for those characters, then change the screen offset and print normally using DISPLY.

1376712580_multicolortext.JPG.be965606cb53432c35a13440b7d68ba6.JPG



5 CALL LINK("SCRN2")
10 CALL LINK("VREAD",5376,255,P$)
20 FOR I=4096 TO 4608 STEP 256 :: CALL LINK("VWRITE",I,P$):: NEXT I
25 CS=17 :: F=4 :: B=16 :: GOSUB 1000
26 CS=21 :: F=2 :: B=14 :: GOSUB 1000
27 CS=25 :: F=9 :: B=12 :: GOSUB 1000
30 FOR I=0 TO 255 :: PRINT CHR$(I);:: NEXT I
32 CALL LOAD(9596,192):: CALL LINK("DISPLY",1,1,"ATTENTION^TI^ENTHUSIASTS")
33 CALL LOAD(9596,224):: CALL LINK("DISPLY",2,1,"YOU^CAN^DISPLAY^TEXT^IN")
34 CALL LOAD(9596,0):: CALL LINK("DISPLY",3,1,"DIFFERENT^COLORS")
35 CALL LOAD(9596,96):: CALL LINK("DISPLY",4,1,"USING XB256 IN SCREEN2")
40 GOTO 40
1000 FOR I=0 TO 3 :: CALL LINK("COLOR2",CS+I,F,B):: NEXT I :: RETURN

 

 

Ok, i knew about the 1st part but didn't know about the 2nd part, thanks. I rewrote my latest yahtzee program without TML (just white display at) and it was twice as fast since I know you have to essentially draw every character on the screen in bitmap mode in TML. TML seemed a bit overkill for just using colored fonts. I like using color fonts in games and this adds a real good addition. Im going to redo my yahtzee to get a real world feel and post later. thanks.

another nice is this can be compiled.

Edited by hloberg
more
  • Like 1
Link to comment
Share on other sites

setup a CALL routine to simplify and added notes. doesn't seem to slow it down. also going to play around adding the numbers and space.

 

7 ! LOAD DSKx.XB256 1ST
11 CALL LINK("SCRN2")
13 ! -----------SETUP AREA -----------
15 ! LOAD IN FONTS
17 CALL LINK("VREAD",5376,255,P$)::! LOAD IN STANDARD FONT
20 FOR I=4096 TO 4608 STEP 256 :: CALL LINK("VWRITE",I,P$):: NEXT I:: ! COPY TO OTHER FONT AREAS
25 ! NOTE-IF YOU WANT TO USE SPACES NEED TO DEFINE A SPACE, ALSO NUMBERS NOT REDEFINED
30 ! SET COLOR CS=CHARSET, F=FORE COLOR, B=BACK COLOR
40 CS=17 :: F=4 :: B=16 :: GOSUB 70 :: ! SETCOLOR 2
50 CS=21 :: F=2 :: B=14 :: GOSUB 70 :: ! SETCOLOR 3
60 CS=25 :: F=9 :: B=12 :: GOSUB 70 :: ! SETCOLOR 4
63 GOTO 90
65 ! FONTBASE SETCOLOR 1=96(NORMAL),2=192,3=224,4=0
70 FOR I=0 TO 3 :: CALL LINK("COLOR2",CS+I,F,B):: NEXT I :: RETURN
80 ! ------------END SETUP------------
90 FOR I=0 TO 255 :: PRINT CHR$(I);:: NEXT I:: ! SHOW ALL FONTS
95 ! CALL XC - EXAMPLES  
100 CALL XC(1,1,192,"ATTENTION^TI^ENTHUSIASTS")
110 CALL XC(2,1,224,"YOU^CAN^DISPLAY^TEXT^IN")
120 CALL XC(3,1,0,"DIFFERENT^COLORS")
130 CALL XC(4,1,96,"USING XB256 IN SCREEN2")
140 !
240 GOTO 240
1900 ! CALL ROUTINE
2000 SUB XC(Y,X,FONTBASE,A$)
2100 CALL LOAD(9596,FONTBASE):: CALL LINK("DISPLY",Y,X,A$)
2200 SUBEND

Edited by hloberg
more
Link to comment
Share on other sites

a short praise of the work Harry is doing.

When these computers came out the benchmark was 'what can it do in BASIC?' TI XB was/is a very powerful BASIC and easy to use and is still is my favorite BASIC of the era. But one thing that did frustrate me was just how much of the power of the TMS9918a was locked away from the XB user. you couldn't access the 40 column text or the bitmap graphics or even the useless multi-color mode from XB.

But Harry Wilhelm has addressed all of that. With TML, T40 and XB256 he has addressed these shortcomings and so much, much more. it's his stuff that has brought me back to the TI-99 as I  can finally do a lot of the programing I did on the Atari 8-bit on the TI99 and more. 

thanks, Harry.

  • Like 3
Link to comment
Share on other sites

Oh, Jafar, you're too kind. I'm embarrassed. I'm blushing.

 

 

(edit) CALL LINK("VREAD",5376,255,P$)  -  Ideally this would be 256, but a string cannot be that long. The final byte of the character definition is undefined, as you can see in the picture I posted. Two reads of 128 bytes would do the trick if that is a problem. 

Edited by senior_falcon
  • Like 1
  • Thanks 1
  • Haha 1
Link to comment
Share on other sites

I remember a multicolored font demo that Eric Paul Rebel did at the TI Treff one year (1990?). It is on the set of disks he released into the public domain shortly thereafter, and may be available in the various UG disk libraries from the European TI groups.

 

His disks were titled EPR-1 through EPR-4.

Edited by Ksarul
  • Like 1
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...