Omnicalc provides additional functions for users and BASIC programmers. These functions can be accessed anywhere in the TI-OS by pressing the PRGM key twice. Also, if you have a function highlighted in this menu, pressing the + (Plus) key will show brief help regarding the function.
Important note: Due to conflicts with OS versions 1.15 and above, Omnicalc now uses a modified form of the real() token when displaying these tokens. This form uses real(XX, as the beginning, where XX is a unique token identifier. The parameters for the additional function follow afterwards. This will let you group, transfer, and edit programs with the custom tokens without problems. Example: real(30,5) is the same as !n(5). This is the only syntax supported by Omnicalc 1.2, and will allow programs to use these functions with the same ease and stability of the built-in OS functions.
Functions :
Viewing |
|
Because all of the functions are represented by "real(12," or something similarly cryptic, you can move the cursor to the beginning of the token (on top of the 'r' in real) and press and hold down On+0 to view the name of that function. The name will be displayed until you release the keys.
Functions :
Subfactorial |
|
The subfactorial function will calculate the subfactorial of a positive integer. This is used in probability. The subfactorial is the number of permutations of a set with no element remaining in its original position. For example, the set {1,2,3} has only two possiblities: {3,1,2} and {2,3,1}. Hence !n(3) returns 2.
Syntax: !n(
integer)
Returns: subfactorial of
integer
Functions : Base Conversions |
|
The baseInput() function allows for the entering of numbers in other number bases than decimal, specifically base 2 through base 36. There are two required arguments, the first is the number in strings to be converted, the second is the base of the number. The number is converted to decimal and returned. If you wish to convert the inputted base to another base, there are two methods. Either use the
Base Operations option to change the output format or add an optional third argument. The third argument is the base to convert to; it must be 2-36. The converted result of this function must be in the range 0 to (2^32)-1. Letters A-Z may be used in the string for bases above 10.
Syntax: baseInput(
string number, base, [new base])
Returns: the number converted into the current base display (usually decimal, use Base Operations to change)
Functions :
Constant |
|
The constant function will return the numeric value of a constant. There is one argument, a string containing the constant to return. Valid inputs are: NA, K, CC, EC, RC, GC, G, ME, MP, MN, H, C, U.
Syntax: const(
string)
Returns: numeric value of
string
Functions :
Execute Assembly |
|
ExecAsm() is used to run a string containing assembly language opcodes. This can be useful for embedding advanced features in BASIC programs without having to call external ASM programs. For example, the B_CALL to clear the LCD is 4540h. To B_CALL ClrLCDFull and then return would be ExecAsm("EF4045C9").
Syntax: ExecAsm(
string)
Returns: 1 if success after executing the ASM instructions.
Functions : Factor |
|
The factor function numerically factors a positive integer. It takes one argument, the integer to factor. It outputs a list of the prime factors in ascending order.
Syntax: factor(
integer)
Returns: list of prime factors of
integer
Functions : Gamma |
|
Gamma will return the gamma of a number. If you do not know what gamma is, then this function is not for you, read on to the next one :) It has one argument, a positive number.
Syntax: gamma(
number)
Returns: gamma of
number
Functions : Link Receive |
|
The linkGet() function will receive one byte over the link port. It has one argument, which is either 0 or 1. Zero indicates to try to get a byte immediately and fail if one is not present. One will make linkGet() wait indefinitely for a byte. linkGet returns either the byte received (0-255), or -1 if it failed.
Syntax: linkGet(
value)
Returns: byte received or will return -1 if could not get byte.
Functions : Link Send |
|
The linkSend function sends one byte over the link port. It has one argument, which is the value of the byte to send (0-255). It will send the byte immediately and return 0 if it was successful. If it was a failure and you are sending from a 83+ it will return -1. Due to the hardware assist in the TI-83/84 Plus Silver Edition it is not possible at this time to determine if sending a byte fails.
Syntax: linkSend(
value)
Returns: 0 if success or -1 if failure
Functions : Modulus Arithmetic |
|
The mod (modulo) function returns the integer remainder of a division. It takes two arguments, the first number is the dividend, the second is the divisor.
Syntax: mod(
dividend, divisor)
Returns: remainder of (
dividend ÷
divisor)
Functions : RAM Recover |
|
The RestoreMem() feature, if run on a TI-83/84 Plus Silver Edition that has the "RAM Recovery" option enabled, will restore the memory from the last backup point. The calculator must have been turned off at least once for this function to work. This function may turn off your calculator in the process. If the screen goes blank after running, press On to turn the calculator on. Your memory should be restored.
Syntax: RestoreMem(
0)
Functions : Roman Numerals |
|
The Rom>Dec function converts Roman numerals into our Arabic numerals. It has one argument, a string containing Roman numerals. Valid numerals are: I,V,X,L,C,D,M
Syntax: Rom>Dec(
string)
Returns: decimal equivalent of Roman numeral
string
Functions : Play |
|
The play() function is a complete reimplementation of the classic PLAY command in QBASIC. This requires either headphones to plug into the link port or the AM radio trick (check ticalc.org for the basics of listening to music on a calculator). There is only one argument, a command string composed of the following commands:
X | This will prevent the OS from checking for link activity, allowing BASIC commands such as Input to function correctly. Omnicalc will automatically reenable the link port when the BASIC program exits. It is suggested that music playing programs run play("X") as their first line. |
T | Valid values are T32 through T255. This sets the tempo of the music in quarter notes per minute. The default is 120. |
MN | Sets normal style, in which notes play for 7/8 of their length followed by 1/8 silence. This is the default style. |
MS | Sets staccato style, in which notes play for 3/4 of their length followed by 1/4 silence. |
ML | Sets legato style, in which notes play for their full length with no breaks between notes. |
L | Sets the length of notes. Omnicalc supports whole notes through sixty-fourth notes. Valid values are L1,L2,L4,L8,L16,L32, and L64. The default is L4. |
O | Sets the current octave. Valid values range from O0 (that's an O and a zero) to O6. The default octave is 2. Note that Omnicalc's octaves are one lower than QBASIC's. Omnicalc's notes range from 32.7 Hz to 3951.07 Hz (American Standard Pitch C1 to B7) |
< | Lowers the current octave by one. |
> | Raises the current octave by one. |
P | Plays a pause ranging from P1 to P64 (P1,P2,P4,P8,P16,P32,P64). This may be dotted by following with one or more periods. |
N | Plays a specific note from the 84 (12 * 7 octaves) that Omnicalc offers. Valid values are N0-N84. N0 is a pause. |
A-G | Plays the corresponding note in the current octave. Sharps (plus sign) and flats (minus sign) may follow to adjust the pitch, as well as a number to set the length of the specific note. |
The order of commands that can follow a note such as "A" can be confusing. As an example, A+1.. is a valid note. The sharp or flat must immediately follow the note's letter. Next, a note length may be specified (1,2,4,8,16,32,64). If no length is specified, the note is played with the length given in the L command. Last, one or more periods may follow to specify a dotted note. Each dot adds 1/2 of the previous length to the note. As an example, C. is 3/2 the length of a normal C, and C.. is 7/4 the length of a normal C.
Pauses may be dotted, e.g. "P4."
Download
mozart.8xp for a demonstration of play().
real(31,"T180P2P8L8GGGL2E-P32.P8L8FFFL2D") will play the opening notes of Beethoven's fifth symphony.
Functions : Radical Simplification |
|
Simp√ returns the simplified form of a square root. It has one argument, a positive integer which is the radicand.
Syntax: simp√(
integer)
Returns: string containing the simplified √(
integer)
Functions : Sprites |
|
Sprite is the most complicated function in Omnicalc. It takes a part of a picture variable and displays it to the screen. It has 7 arguments, with an optional eighth. All arguments are integers. The arguments in order from left to right are explained below:
- 0-9; this indicates which picture variable to use.
- The X coordinate (0-94) where the desired sprite is in the picture variable. Must be a multiple of 8.
- The Y coordinate (0-62) where the desired sprite is in the picture variable.
- The width of the sprite in pixels, must be a multiple of 8.
- The height of the sprite in pixels.
- The X coordinate on the screen where you want to show the sprite.
- The Y coordinate on the screen where you want to show the sprite.
- Optional: This argument is optional and has 4 possible values that control the display options. If omitted, sprite() will assume value 0 (XOR logic, update screen also):
- 0 - This will display the sprite to the graph buffer and update the display. It will use XOR logic.
- 1 - This will display the sprite to the graph buffer, but not update the display. (Useful for erasing a sprite when you plan to immediately redraw it in a different place; or building a tilemap). It will use XOR logic.
- 2 - This will display the sprite to the graph buffer and update the display. It will use OR logic.
- 3 - This will display the sprite to the graph buffer, but not update the display. It will use OR logic.
Example: If Pic0 contains the screenshot on the left, and you ClrDraw, and then execute the sprite() command shown in the middle picture, the screen will look as shown in the right picture.
Syntax: sprite(
picture variable number, sprite X, sprite Y, sprite width, sprite height, destination X, destination Y, [
options])
Returns: 0