Skip to content
TimotheeGreg edited this page Aug 24, 2023 · 59 revisions

Console

console_example

Available Commands

Command Description Usage
help Show current version, welcome message, specs, 80K RAM layout, 16K VRAM layout, list of available commands, api commands, keys, buttons and their corresponding codes, startup options, terms, license help [<text> | version | welcome | spec | ram | vram | commands | api | keys | buttons | startup | terms | license]
exit / quit Exit the application exit / quit
edit Switches to the code editor edit
new Creates a new Hello World cartridge new < lua | ruby | js | moon | fennel | scheme | squirrel | wren | wasm | janet | python >
load Load cartridge from the local filesystem (there's no need to type the .tic extension). You can also load just the data (sprites, map etc) from another cart load <cart> [sprites | map | cover | code | sfx | music | palette]
save Save cartridge to the local filesystem, use .lua .rb .js .moon .fnl .nut .wren .wasmp cart extension to save it in text format [PRO version]. Use .png to save it in a png cartridge. save <cart>
run Run current project run
resume Resume last loaded project resume
eval / = run code eval / =
dir / ls Show list of local files dir / ls
cd Change directory cd
mkdir Make directory mkdir
folder Open working directory in OS (Windows, Linux, Mac OS) folder
add Show file open dialog to add file to TIC [browser version] add
del Delete from the filesystem del <file>
get Show file save dialog to download file [browser version] get <file>
export Export cart to HTML or as a native build, export sprites or cover as image, or export sfx and music to wav files (0.80). Use alone=1 to export the game without the editors [PRO version] export [html | native | sprites | cover | map | sfx | music]
import Import code/images from an external file. import [code | map | screen | sprites | tiles]
cls / clear Clear screen cls / clear
demo Install demo carts demo
config Show config.tic file editor when used without parameter, use reset param to reset current configuration, use default to edit default cart template config [reset | default]
surf Open carts browser surf
menu Show game menu where you can setup keyboard/gamepad buttons mapping (0.80)

For those operating systems that support it, tab completion and command history is available in the console.

Evaluating Code

Example of eval usage.
To log the results use trace.
Note that you need to run a cart first to launch the virtual machine, otherwise you'll get an empty string whatever you do.

> eval trace("Hello World")
Hello World
> eval t=8

> eval trace(t%3)
2

Importing images

While importing images, colors are merged to the closest color of the palette.
For example, with default palette, this image:
easter
becomes:
screen16

Note that if the palette is all black (like default bank1) the imported image will be all black.

Clone this wiki locally