Cross Compatibility for 68k TI's
********************************

The cross compatible 68k TI's include the TI-89, TI-92+, and V200.
The TI-92 doesn't have the getConfg() command, which solely allows
for cross compatibility in TI-Basic.

Cross compatibility is important and well done in many of
my graphics programs. It's old news in assembly, however,
in TI-Basic few follow my example and are terrible programmers
for it. Here's the basis or cross compatibility:

getConfg() gives a list of your TI's features.
Here they are, as seen on my 92+:

{"Product Name", "Advanced Mathematics Software",
"OS Version", "2.09, 03/27/2003",
"Product ID", "01-1-C-57",
"ID #", "01132 07704 83A6",
"Screen Width", 240,
"Screen Height", 128,
"Window Width", 240,
"Window Height", 91,
"RAM Size", 262132,
"Free RAM", 105108,
"Archive Size", 655360,
"Free Archive", 577992}

And here's an example from a TI-89:

getConfg()
{"Product Name", "Advanced Mathematics Software",
"Version", "2.00, 09/25/1999",
"Product ID", "03-1-4-68",
"ID #", "01012 34567 ABCD",
"Screen Width", 160,
"Screen Height", 100,
"Window Width", 160,
"Window Height", 67,
"RAM Size", 262132,
"Free RAM", 197178,
"Archive Size", 655360,
"Free Archive", 655340}

yours may be a bit different, giving "Cert. Rev.  #", 0.
If so add 2 to x in all the getConfg()[x]. I think the difference
is from the TI being upgraded with a public released OS.

As you can see, we're given memory specs and screen sizes, as
well as less important details. The screen sizes let you know
if you're using an 89 or not; you can set certain variables
accordingly, like so:

Local width,height
If getConfg()[10]=160 Then
Text "You have a TI-89"
158 -> width
76 -> height
Else
Text "You don't have a TI-89"
238 -> width
102 -> height
EndIf

Which then allow a better control of graphics. You can easily center
picture and shapes in a single program instead of having 2, a good
skill to have when porting. Here's an example tilemap routine:

(a,b)
Prgm
Local width,height,x,y
setMode("Graph","Function")
setGraph("Axes","Off")
setGraph("Labels","Off")
setGraph("Grid","Off")
ClrDraw
ClrGraph

158 -> width
76 -> height
If getConfg()[10]=240 Then
238 -> width
102 -> height
EndIf

For x,0,width,b
For y,0,height,a
RplcPic sprite,y,x
EndFor
EndFor

Pause
ClrGraph
ClrDraw
ClrHome
DispHome
EndPrgm

It should run like: atest(a,b), where a is the height of the sprite picture
and b is the width of the sprite picture. With the example use: atest(12,12).

That's short, sweet, and simply perfect. It may be a few bytes larger
than a TI specific version, but now you don't have to worry about porting.
Please look at the graphical routines in my lib68k TI-Basic library for
things optimizations like this, which render that version cross compatible
with any of the 68k TI's, without a single change necessary. I saved a
12x12 sprite example, named 'sprite', for you to test. It's a simple cross.



Simple Notes:
*****************
mid(getConfg()[4],1,4) is the OS Version. It returns "1.xx" or "2.xx". So:

If mid(getConfg()[4],1,4)?"2.07" or mid(getConfg()[4],1,4)?"2.08" or
mid(getConfg()[4],1,4)?"2.09":Text "You don't have a clock"

Oh yeah...Notice that the 'Then' and 'EndIf' aren't necessary if only one
action/statement results from the condition.
***

getConfg()[10] is the Screen Width. On the TI-89 it is 160, otherwise it's 240.

***

getConfg()[12] is the Screen Height. On the TI-89 it is 100, otherwise it's 128.

***

getConfg()[14] is the Window Width. On the TI-89 it is 160, otherwise it's 240.

***

getConfg()[16] is the Window Height. On the TI-89 it is actually 76, not 67.
		On the TI-92+ or V200 it's 102, not 91.
***

getConfg()[18] is the RAM Size.

***

getConfg()[20] is the Free RAM.

***

getConfg()[18]-getConfg()[20] is the Used RAM.

***

getConfg()[22] is the Archive Size.

***

getConfg()[24] is the Free Archive.

***

getConfg()[22]-getConfg()[24] is the Used Archive.

***

getConfg()[18]+getConfg()[22] is the Total Memory.

***

getConfg()[20]+getConfg()[24] is the Total Free Memory.

***

(getConfg()[18]-getConfg()[22]) + (getConfg()[20]-getConfg()[24]) is the Total Used Memory.

*************************************




William White

Really Bored Productions II
www.geocities.com/really_bored_productions_2