As you my know, the TI-84 Plus C Silver Edition has a 10x26-character homescreen, while the TI-83 Plus and TI-84 Plus families had 8x16-character homescreens. Your first impulse might be to take all of your TI-83+/TI-84+ homescreen math and science programs and games and re-format them for the 10x26-character screen, releasing special TI-84 Plus C Silver Edition-only versions of your programs. There's a better solution: you can use some tricks in pure TI-BASIC to detect if you're running on a TI-84 Plus C Silver Edition or not, and make the same TI-BASIC executable adapt to the homescreen dimensions of the current calculator. There are two steps to this. The first is to figure out what sort of calculator you're running on, and the second is to use that information to generate homescreen output appropriate to the current homescreen size. Of course, there's no reason that you should be restricted to using this trick to figure out the maximum coordinates for Output(; you can also use it to decide whether to use color codes or not (pro-tip: use 10 for blue, 11 for red, 12 for black, and so on instead of the color name tokens, so that your programs will be loadable onto the older calculators).
To detect the current calculator model, you can use the fact that the graphscreen is now 265 pixels wide instead of 95 pixels. The following chunk of code will set C=1 if you're on a TI-84+CSE, or C=0 if you're on any of the black-and-white calculators.
Code:
This code first saves the graph window, to be polite. It then sets Xmin=0 and ΔX=1, which will automatically set Xmax=94 on a TI-83+ or TI-84+, or Xmax=264 on a TI-84+CSE. We can then set C equal to Xmax>94, which will be true (1) on a TI-84+CSE, or false (0) on a TI-83+ or TI-84+. Then, based on whether C is 0 or 1, you can make your programs adapt to the current calculator model. Some examples of how it could adapt:
I hope this helps, and I look forward to your own cross-compatible TI-BASIC games. What tricks of your own have you discovered? Is there a shorter/faster way to discover the calculator's model? I'll be expanding this post as suggestions roll in.
To detect the current calculator model, you can use the fact that the graphscreen is now 265 pixels wide instead of 95 pixels. The following chunk of code will set C=1 if you're on a TI-84+CSE, or C=0 if you're on any of the black-and-white calculators.
Code:
StoreGDB 0
:0→Xmin:1→ΔX
:Xmax>94→C
:RecallGDB 0
- If you are drawing a scrolling tilemapper sort of game on the homescreen, you can display 8+2C rows and 16+10C columns of the map at a time, which will work properly and fill the screen on all TI-83 Plus/TI-84 Plus-family calculators.
- If you are making a vertically-scrolling game or program, you will know that the homescreen is 8+2C rows tall, and that if you want Disp to always display on the bottom row, that you need to perform 8+2C dummy Disps first.
- If you are writing a graphscreen game, you can either make different sections of code run depending on the value of C, or you can adapt your Line, Text, and other commands to pick different coordinates based on C. Remember that the default line width for the TI-84 Plus C Silver edition is two pixels unless you tell it otherwise.
- If you're using colors, you can omit the color codes on non-TI-84+CSE calculators. Remember not to use the color codes like RED and BLUE directly in your program; otherwise you won't be able to transfer the program to TI-83+ and TI-84+ calculators. Instead, use the numeric equivalents, starting from 10 for RED.
I hope this helps, and I look forward to your own cross-compatible TI-BASIC games. What tricks of your own have you discovered? Is there a shorter/faster way to discover the calculator's model? I'll be expanding this post as suggestions roll in.