![]() |
TIPower Language Reference | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description: Alt: variable += value or variable = variable + value. See Math Operators. Example: Byte(a, b)
Description: ANDS variable with value and assigns result to variable. See the example for a good explanation Example: Byte(a,b,c)
Description: See AsmOn.
Description: Incorporates ASM code following the statement straight into the final source code. This is useful for programmers who are fluent with ASM and want to add special optimizations, etc. Comments in an AsmOn block use a ';' not a '/'. Labels and variable names should also be in all caps. Example: AsmOn
Description: Declares a byte size variable. Values for a byte are integers ranging from 0 to 255. If a math operation assigns a value more than 255 to a byte, it is flipped over, like 255+5=4. You can declare up to 16 bytes at a time. All variables declared in TIPower are global and accessable as well as declarable in any place. Example: Byte(xpos,ypos)
Description: Value can be anything, including variables. Must be enclosed in parantheses! Variations include Case, CaseLess, and CaseMore. See Select for an example.
Description: Traps every possibility not used yet in a Select..Case...EndSelect structure. See Select for more info and an example.
Description: Fills memory at location with 0. Use this really to clear buffers or initialize large amounts data. Example: / this clears the screen buffer on any calculator:
Description: This is used for dealing with very large sprites of any width. Height is the width of the sprite in rows. Width is the width of the sprite in bytes (pixels/8). Skip is the difference between the sprite and the screen in width. When copying, the program does this: writes width bytes, skips skip bytes, writes width bytes, etc. There are three variations of CopyMemoryAbridged: CopyMemoryAbridgedSkipBoth (for when you are copying from a large sprite buffer to another large sprite buffer), CopyMemoryAbridgedSkipDest (for when you are copying a large sprite buffer to the screen), and CopyMemoryAbridgedSkipSource (for when you are copying a segment of the screen to a large sprite buffer). See the example for a common usage. Example: / Code for a 96x64 title screen:
Description: Copies a large amount of memory BACKWARD through memory. Useful really only if you want to scroll the screen down. Example: #onlyTI86
Description: Copies a large amount of memory going FORWARD through memory. Set the destination to be one byte ahead of the source, and then whatever is in the first source byte will fill the rest of size. Use this primarily on TI-86's to copy the buffer or on any calculator to scroll the screen up. Example: #onlyTI86
Description: Declares any other type of data. This can be used if you wish to use simple arithmetic with addresses. For instance, declaring a sprite named 'man' and data 'man+4' lets you add 4 to the address of 'man' in a function call for instance, letting you send the last 4 bytes of the sprite to a function. If you wich to declare any type of data used for libraries or level data, use the DataStart command to define the data. Example: Data(messagedata, leveldata)
Description: Begins the declaration of a block of data associated with variable name, which should have already been declared with Data. Just like AsmOn, you should use ';' inside the declaration. Example: /The following is data for a MessageBox library call:
Description: Alt: variable-- Decrements a byte,word, or pointer by one. See Increment.
Description: Declare a function so it can be called before it is defined. See Function for details on the syntax. Your later definition of the function shouldn't have any arguments. Example: DeclareFunction(DrawMan, sysbytearg0, sysbytearg1)
Description: Alt: variable /= value or variable = variable / value. See Math Operators. Both Multiplication and Division suck up memory and speed! Please consider this! Example: Byte(a, b)
Description: Very small and fast loop structure. Use only when you have a few commands! Using Djnz with a large amount of memory to jump back through will yield an Assembler Error, which you may not catch. Repeats value times through the loop. Use EndDjnz to end the loop. Value can be a Byte variable or any number from 0 to 255 (Repeating 0 times actually means it repeats 256 times!. Example: / Draws Hello! 5 times down the screen
Description: A little slower than Djnz but is unlimited in size of the loop. Also, you can assign 1 to variable at any time to make that the last iteration of the loop. The current loop value is stored inside variable. Example: / Draws a number line (from 5 - 1) down the screen
Description: Begins a Do...While Loop.
Description: Ends a Data declaration. Example: Data(ABCS)
Description: Ends a Djnz...EndDjnz loop structure. See Djnz for details.
Description: Ends a DjnzVar...EndDjnzVar loop structure. See DjnzVar for more details.
Description: Preferable last statement in Main Function. Helps to stabilize system for it to go back into your OS. See example in StartExec
Description: Ends a For...EndFor loop structure. See For for more details.
Description: Ends a function definition. See Function
Description: Ends a If conditional structure
Description: Ends the definition of a Select...Case...EndSelect structure. See Select for more info and an example.
Description: Ends a sprite declared using Sprite8 or Sprite16.
Description: End's a function starting with SystemFunction, See SystemFunction for more info.
Description: This is similar to #define in C except you cannot really define macros. Equate variables are treated as numbers and are later replaced by the assembler with the numbers you assign them. A few system equates exist to make Cross-Plaforming a snap if you use them in programs. One is used in the example. Example: Function(Center, sysbytearg0)
Description: Exits a function before the end of it's declaration. Useful for stuff like the example. Example: Function(gameloop)
Description: Typical FOR loop. Runs from start to stop stepping either 1 at a time or whatever is specified by step. Negative step values are not supported, so you'll have to use Do...While loops for those. Use EndFor to end the loop. Example: / This prints 0-25 down the screen diagonally in steps of 5
Description: Begins a function definition and declares the function if DeclareFunction has not yet been called. If the function name is 'Main' then this is where program execution begins (like in C). TIPower GOLD does not support recursive functions. Arguments are the names of variables that have already been declared of types Byte,Word, or Pointer. To pass information to functions, these variables are assigned the values in the function call. Thus you can REALLY optimize your programs in size and speed if you use the same variables when calling functions. See the example for a fast function call and slow function call. For information on sysbytearg0 and sysbytearg1, see SystemVariables. Example: Function(IHaveNoPoint, sysbytearg0, sysbytearg1, sysbytearg2)
Description: Conditional if statement, variations include IfEqual, IfNotEqual, IfLess, IfMore, IfNotLess, IfNotMore, as well as IfKey variations. If you wish to have a If..Else..Endif structure instead of a If...EndIf structure, Use the keyword Else After the conditional (like IfEqualElse). All If structures must be multi-line and must end with EndIf. Example: Word(score, highscore)
Description: New. Allows you to use a direct conditional if a key is being pressed. See KeyDown for a list of the key constants on each calculator. Variations of IfKey include IfKey, IfKeyElse, IfNotKey, and IfNotKeyElse. Example: / Fighting Game Function that prints out practice moves
Description: Alt: variable++ Increments a byte,word, or pointer by one. See Decrement.
Description: For TI-86 only! Defines a custom interrupt routine for use with the EnableInterrupt system function. Use '0' or '1' in the middle three arguments to set your options. If counter is set to '1' then counter name must be a Byte,Word, or Pointer variable name. Example: Byte(intcounter)
Description: If the key in keyconstant is being pressed, then 0 is assigned to variable. If it isn't being pressed a nonzero value is being pressed. In most cases, the new IfKey convention is better to use than this. But if you find yourself checking a certain key status several times, it is more efficient to assign the key status to a variable using this statement. Most of the key constants are similar on all the calculators, but in order to allow games to keep the same layout over multiple calculators, I've created the key constants A, B, C, and D. Use these instead of actual key names to make cross-platforming easier. (A is the main key (usually 2nd), etc..) Also EXIT is a keyconstant on all of the calculators, as well as UP, DOWN, LEFT, and RIGHT. The following table shows calculator specific key constants:
Description: TIPower GOLD v2.0 introduces new Math Operators into the mix. Use the following table as your guide to the new operators (most, except multiplication and division, are just like C):
a = b + c /this is legal a = b + c * d /this is illegal Such multiple operations will probably be introduced in version 3.0. Stay tuned.
Description: Creates and defines a data variable that is size large. This is useful for loading strings into the data, or using a screen buffer. Example: MemSpace(mybuffer, NUMSCREENBYTES)
Description: Alt: variable $= value or variable = variable $ value. See Math Operators. Both Multiplication and Division suck up memory and speed! Please consider this! Example: Byte(a, b)
Description: NOTS a value and assigns result to variable. See the example for a good explanation Example: Byte(a,b)
Description: ORS variable with value and assigns result to variable. See the example for a good explanation Example: Byte(a,b,c)
Description: Declares a variable which contains the memory location of other variables and data. Setting a pointer equal to any other variable actually loads that variables memory location into the variable. Use '*' before a pointer to indicate that you wish to do operations on the data at the memory location stored in the pointer, rather than the actual location of memory. Most math operations work with both pointers and pointer references (although most operations assume the pointer points to a Byte) Example: Pointer(mypoint)
Description: There are several preprocessor directives at your disposal. To indicate that the following code is only for a particular build type, use #only[buildtype] . Build types include TI86, TI83P, TI83ION, TI83MIRAGE. Please note that preprocessor directives are case-sensitive, so #onlyTI83P will work, but #OnlyTI83p would not. To end your #only structure, use (you guessed it!) #endonly which is also case sensitive. See the examples of CopyMemory functions to see these directives in action. The other directive I offer is #include, which includes after that a filename (never in quotes or '<>'s!). The compiler checks three places for the file specified in the include: the current working directory, the same directory as the current file, and the TIPower GOLD root directory (which is where system.TI6 is located.)
Description: Alt: variable %= value or variable = variable % value. See Math Operators. Useful for determining if a number is even or not, as well as finding random numbers from 0 to value. Both Multiplication and Division suck up memory and speed! Please consider this! Example: Byte(a, b)
Description: A typical BASIC-type SELECT-CASE structure command. Use Case statements for selecting each option, and CaseElse to catch any other options. Use EndSelect to end the structure. See the following example for the exact syntax. Example: / Selects which type of enemy is to be used for this level
Description: Alt: variable = value. See Math Operators. Assigns value to variable. Example: Byte(a)
Description: Begins the definition of a sprite 16 bits in width. Use either 1's and 0's or X's and '.'s to define the sprite. Sprite can be any height (other than 0) Each row in the definition represents a row in the sprite gfx. Data less than 16 bits wide yields an error. See the example, it's the best way to describe it. Example: /This defines a 16x16 sprite. A portrait of you!
Description: Begins the definition of a sprite 8 bits in width. Use either 1's and 0's or X's anc '.'s to define the sprite. Sprite can be any height (other than 0) Each row in the definition represents a row in the sprite gfx. Data less than 8 bits wide is finished with 0 data. See the example, it's the best way to describe it. Example: /This defines a 8x8 sprite
Description: Preferable first statement in your 'Main' Function. This initializes the system (such as clearing the screen, turning off the run indicator, etc.). Example: Title("My Game")
Description: Declares a string variable. Behaves pretty much just like a Data variable, except you can use it to replace strings as arguments. Only really necessary if you find yourself using the same string in several places, then using a string variable saves memory. See the example. Example: /This:
Description: Alt: variable -= value or variable = variable - value. See Math Operators. Example: Byte(a, b)
Description: This is the only TIPower statement for use in system functions. A system function may require that another function be included in the source in order for that function to run properly. For instance, a Draw2Pixels system function might require the SetPixel system function. Setting this requirement with SysFuncRequire enables the compiler to make sure that that function is included in the final source Example: SystemFunction(Draw2Pixels, sysbytearg0, sysbytearg1)
Description: Use SystemFunction to add functions in ASM to your program. All labels in the ASM code must be in ALL CAPS. You must also include the all-caps label at the beginning of the code. Arguments are the same as the Function statement. You may have up to 15 arguments in one function. SystemFunctions that are not called anywhere in TIPower code will not be included in the final program. This makes them useful for libraries, etc. Example: SystemFunction(QuickClearScreen)
Description: Must be the first line of EVERY program (not include files)! If not you will have Assembler Errors! Line after Title must be '#include system.TI6' so that all the available system functions are open to you. See Preprocessor Directives for more information about #include. Example: Title("Resident Evil 86")
Description: Used with the system function LoadString. The string MUST be contained in quotes because it is CASE-SENSITIVE (due to the OS being case sensitive) if you are not sure of the EXACT name of the string, load it on to your calculator and check if you have the case correct. This is also used in library include files to define Library variable names. Example: VarString("mystring")
Description: Must use a conditional not unlike in the If statement. Variations include WhileEqual, WhileNotEqual, WhileLess, WhileMore, WhileNotLess, and WhileNotMore. If the condition is true, then the loop is reiterated. Useful for games that monitor health and death. Example: Byte(dead)
Description: Declares a 2-byte size variable. Values for a word are integers ranging from 0 to 65535. All other rules are similar to Byte. Some operations do not allow using a word value. The most common of which is using a word as the second operator in a division statement. Words CANNOT be used in multiplication. Example: Word(Score, Size)
Description: XORS variable with value and assigns result to variable. See the example for a good explanation Example: Byte(a,b,c)
|