Creating your own MLC programs: ------------------------------- MLC programs are stored in BASIC programs with "MLC:" on the first line. Of course, like normal BASIC programs, you can write MLC programs with the Graphlink software on a computer, or on the calculator with the program editor. For a general guide to programming with MLC, go to www.dysfunction.earthforge.com (sorry about the ugly green-and-white color scheme, our site was hacked), click the "MLC" button on the left of the page, and follow the "Readme" link. However, the readme is usually a few versions behind, so look at syntax.txt for the details. ;-) If you can't figure something out, look at the code of the sample programs. Random important information: (General) Names of MLC programs can't be more than 7 characters MLC programs can't be over 11 KB All function/variable/sprite names are limited to 5 chars The screen is cleared before the program is executed, so you don't need to put CLRS at the beginning When counting line numbers in the error handler, only lines with commands or expressions are counted (most of the time, you don't need to worry about this, because the contents of the line with the error are shown - it works most of the time) Any gfx operations involving points outside (0,0) and (95,63) will be skipped, except with sprites and bitmaps (see the next section) Limits for data types are: 110 variables, 125 functions, 15 sprites, 40 8x8 bitmaps (remember that if you use a lot of memory with large arrays or bitmaps, you might not be able to reach these numbers) (Commands) The upper limit for RNDM can't be above 1024 CLRS just clears the screen buffer, since the physical screen is cleared at the start of the program, and will only have an effect after a DRAW command Sprites are clipped to the edges of the 96x64 screen (Variables) Array index starts at 0, arrays can have up to 255 elements String vars allowed 35 chars each 8x8 and 16x16 bitmaps are allowed Sprite positions can't be over 127 or under -127 (Pointers) If an array variable is assigned to a pointer, "*PTR=1,2,3,4" and "#PIXT 0,0,*PTR(1)" won't work Pointers can't be assigned to array elements or sprite properties ("*PTR:@ARRAY(0)" and "*PTR:^SPR.X" don't work) Pointers assigned to strings can't be used in the conditional expression after an IF command Supported commands: DATA, DEND, BITM, SPRT, CLSN, ARRY, SIZE, CLRS, TEXT, LINE, PIXL, PIXT, DISP, DBMP, RECT, SHFT, DRAW, STOP, RCLP, GKEY, WKEY, PAUS, FNCT, FRUN, FGOB, FEND, IIFF, THEN, IFND, RNDM, WRTE, READ, HALT, POLR, SUBS, RSET, CINT, ABSL, WAIT, INPT, NMAP, TILE, CMAP, TCHK, DMAP Memory management: If you use large arrays or tilemaps, you might have to consider the amount of memory they take up to avoid getting an "out of memory" error. There are 4 areas of free memory for vars in MLC86: 2x 180-byte areas, 1x 300-byte area, and 1x 318-byte area. The memory (in bytes) used by each variable type is: ints 2 strings [length]+1 arrays [size]*2+1 tilemaps [x size]*[y size]*2+4 (sprites and bitmaps are stored in their own separate memory areas) This means that you can't create an array with 200 elements, because even though there's enough total memory to hold it, it's not going to fit into any of the var memory areas. You shouldn't have to worry about this most of the time, though... I know I've put this notice into all the other files here, but for suggestions, help, comments, etc. please e-mail me at straney@umbi.umd.edu or visit our website at www.dysfunction.earthforge.com. Donald Straney / burntfuse