MLC Documentation


Home ~ General Information ~ The Basics ~ Command Reference ~ Screenshots ~ Downloads

Command Reference

For more information about the arguments used in commands, see Variable Types and the VAT.

ABSL ARRY BITM CINT CLRS CLSN CMAP DATA DBMP DEND DISP DMAP DRAW FEND FGOB FNCT FRUN GKEY HALT IIFF INPT LINE NMAP PAUS PIXL PIXT POLR RCLP READ RECT RNDM RSET SHFT SIZE SPRT STOP SUBS TCHK TEXT TILE WAIT WKEY WRTE

ABSL [int_Integer],[intName]

ARRY [arrayName] [size]

Creates an array of integers containing [size] elements. For example:
MLC:
#FNCT MAIN
#ARRY @A,3
@A(1)=3
#FEND

BITM [bitmapName] [8 or 16]

Declares a bitmap in the data section. Valid bitmap sizes are 8x8 and 16x16. Bitmaps are used for sprites and tilemaps, but can be drawn by themselves by using DBMP. The format for declaring a bitmap looks like:
#BITM [SHIP 8
1038000010101000
0000FE7C38383810
EFC70183C7C7C7EF
Where the first line of bitmap data is the light gray buffer data (in this case, 1038000010101000), the second is the dark gray buffer, and the last is the mask. A sprite editor written in assembly is included in MLC for the TI-86, and hopefully a sprite editor written in MLC itself will be finished sometime.

See: SPRT DATA and DEND

CINT [string_String],[integerName]

Converts [string_String] to an integer and stores the result in [integerName]. Negative numbers are allowed, but anything other than a single number isn't allowed (MLC 68K actually you to do things like CINT "523+63*ARY(*PTR+3)",%I but I don't recommend taking advantage of this because other interpreters don't support it - I'll have to get around to removing this "feature").

CLRS

Clears the hidden screen buffer.

CLSN [spriteName1],[spriteName2],[intName] or
CLSN [spriteName],0,[intName],[pointerName]

CLSN [spriteName1],[spriteName2],[intName] detects if [spriteName1] and [spriteName2] are colliding, or in other words, if they somehow overlap (transparent overlaping sections are included). If they do overlap, [intName] is set to equal 1 - otherwise, it is 0.

CLSN [spriteName],0,[intName],[pointerName] detects if [spriteName] is colliding with any existing sprites. If it is, then [intName] is set to 1 and [pointerName] is a pointer to the sprite colliding with [spriteName]. Otherwise, [intName] is set to 0.

CMAP [mapName],[spriteName],[arrayNameX],[arrayNameY]

Finds where each corner of [spriteName] is touching the map elements of [mapMame] and stores the positions of the map elements in [arrayNameX] and [arrayNameY] (the position of [map name] is determined from the position it was last drawn with DMAP).

DATA

This begins the data section, where bitmaps are stored. The data section should probably be at the end of the program. Example:
MLC:
#FNCT MAIN
#FEND

#DATA

#BITM [SHIP 8
1038000010101000
0000FE7C38383810
EFC70183C7C7C7EF

#DEND

See: DEND and BITM

DBMP [bitmapName],[int_X],[int_Y]

Draws [bitmapName] to ([int_X],[int_Y]. You should consider using sprites and the DISP command instead though.

DEND

This ends the data section.

See: DATA and BITM

DISP [spriteName or .0]

Draws either [spriteName] or all existing sprites to the hidden buffer, using their x and y coordinates. For example:
MLC:
#FNCT MAIN
#SPRT ^SHIP,[SHIP
^SHIP.X=10
#SPRT ^ENMY,[ENMY
#DISP .0
#DRAW
#FEND
#DATA
#BITM [SHIP 8
1038000010101000
0000FE7C38383810
EFC70183C7C7C7EF

#BITM [ENMY 16
10380000101010001038000010101000
0000FE7C383838101038000010101000
EFC70183C7C7C7EF1038000010101000
#DEND
In the previous code, the [SHIP bitmap would be drawn to (10,0) and [ENMY would be drawn to (0,0).

See: SPRT

DMAP [int_X],[int_Y],[mapName]

Draws [mapName] to the top left corner of the hidden buffer at [int_X],[int_Y]. Remember, for the map to actually be displayed on the screen, you need to use DRAW, and tilemaps are created with NMAP.

See: TILE CMAP and TCHK

DRAW

Copies from the hidden screen buffer to the visible screen.

FGOB

Jumps to the beginning of the first function - useful for loops. For example:
#FNCT COOL
#PAUS
#FGOB
#FEND
Calling this COOL function would infinitely pause your calculator (note that in probably all MLC interpreters, you can break out of a program any time by using the in-program menu, triggered by pressing the ON key).

FNCT [functionName]

This creates a function called [functionName] that can be called with FRUN (remember, [functionName] can only be up to 5 characters long). Functions are ended with FEND. A function called MAIN is where execution of every MLC program starts, so every MLC program must have a MAIN function. For example:
MLC:
#FNCT COOL
#PAUS
#FEND
#FNCT MAIN
#FRUN COOL
#FEND
In the previous code, the MAIN function is run as always, which calls the COOL function, which pauses the calculator.

See: FGOB

FRUN [functionName]

Calls the funciton [functionName], and after executing [functionName], the program continues to the next line of code.

GKEY [int_keyCode],[intName]

Sets [intName] to 1 if the key [int_keyCode] is pressed, otherwise sets [int name] to 0. [int_keyCode] represents the key 10*row+column, where (column, row) is the location of the key on the calculator, starting from the upper left corner.

INPT [int_X],[int_Y],[str_Prompt],[int_Color],[variableName]

Displays [str_Prompt] at ([int_X],[int_Y]) and lets the user enter through the keyboard a number or string, and stores the result to [variableName]. exactly which variable types can be used?

HALT

Stops the program.

IIFF [conditionalExpression]

If [conditionalExpression] is true, the next line of code is executed. Otherwise, it is skipped. See operators and variables and the VAT for details on conditional expressions.

LINE [int_X1],[int_Y1],[int_X2],[int_Y2],[int_Color]

Draws a line from ([int_X1],[int_Y1]) to ([int_X2],[int_Y2]).

NMAP [int_width],[int_height],[mapName]

Creates a tilemap nameed [mapName] and with dimensions of [int_width] and [int_height].

See: TILE CMAP DMAP and TCHK

PAUS

Pauses the program until any key is pressed.

PIXL [int_X],[int_Y],[int_Color]

Sets the pixel at [int_X],[int_Y] to [color].

PIXT [int_X],[int_Y],[integerName]

Stores the color of the pixel at [int_X],[int_Y] in the hidden buffer to [integerName].

POLR [int_radius],[int_angle],[intNameX],[intNameY]

Converts the polar vector defined by [int_radius] and [int_angle] to rectangular, storing the resulting X value to [int_NameX] and the resulting Y value to [int_NameY], where [int_angle] is in degrees. This is useful for rotating points.

RCLP

Recalls the picture created by STOP.

RECT [int_X1],[int_Y1],[int_X2],[int_Y2],[int_Color1],[int_Color2]

Draws a rectangle with an upper right corner of [int_X1],[int_Y1] and a lower left corner of [int_X2],[int_Y2] with a border color of [int_Color1] and an inside filled color of [int_Color2].

RNDM [int_lowerLimit],[int_upperLimit],[intName]

Generates a random number between [int_lowerLimit] and [int_upperLimit] ([int_lowerLimit] and [int_upperLimit] are included as possibilities for being the random number) and stores the result in [intName]. [int_upperLimit] must be less than or equal to 1024.

RSET

Restarts the program (useful for returning to the title screen of a game).

SHFT [int_HorizAmount],[int_VertAmount],[int_Mode]

Shifts the hidden screen buffer horizontally right by [int_HorizAmount] and down by [int_VertAmount]. If [int_Mode] equals -1, the data pushed off the screen appears on the opposite side (the data pushed off of the bottom appears on the top and the data pushed off the right appears on the left). Otherwise, the empty space is filled with a color of [int_Mode] (0=white, 1=light gray, 2=dark gray, 3=black).

SIZE [stringName or arrayName] [integerName]

Stores the size (length) of an array variable or string variable to integerName.

SPRT [spriteName],[bitmapName]

Creates a sprite named [spriteName] that has a bitmap name of [bitmapName]. It's x and y coordinates are set to 0.

STOP

Stores the current picture in the hidden screen buffers (the ones that are drawn to be default) to another set of hidden buffers that can be recalled with RCLP.

SUBS [string_String],[int_StartingPosition],[int_EndingPosition],[stringName]

Stores the segment of [string_String] (which can is any string expression, including literal or variable strings) from [int_StartingPosition] to [int_EndingPosition] in the [stringName] variable. The position of the first character in a string is 0.

TCHK [mapName],[arrayNameX],[arrayNameY],[intName]

Checks each of the map elements specified by [arrayNameX], [arrayNameY] in [mapName] - if any of them are "solid," [intName] is set to 1, otherwise [intName] is set to 0. Use TILE to make bitmaps be considered "solid."

TEXT [int_X],[int_Y],[str_Text],[int_Color]

Writes [str_Text] to [int_X],[int_Y] in [int_Color].

TILE [mapName],[bitmapNamee1],[bitmapName2],...

Sets bitmaps in [mapName] to be "solid." This is used in combination with TCHK.

WAIT [int_delay]

Units???

WKEY [intName]

Waits (pauses the calculator) until a key is pressed and stores the key code to [intName]. They key code is determined by 10*row+column, where (column, row) is the location of the key on the calculator, starting from the upper left corner.

WRTE [int_position],[intName]

Writes the contents of [intName] to the program's "data string," which can be read by using READ. [int_position] probably shouldn't be more than 9...? Some versions of MLC partially support writing other variable types, like strings, but support isn't very good. (MLC 86's combination of using WRTE and READ on strings seems to result in corrupted strings.)

Page under construction - finish WRTE, READ, INPT and WAIT, find out whether MLC TI-86 allows complex math expressions to be used as arguments for [int_Number]-type arguments