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

Console

console_example

Available Commands

Command Description
help [<text> | version | welcome | spec | ram | vram | commands | api | keys | buttons | startup | terms | license] 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
exit / quit Exit the application
edit Switches to the code editor
new < lua | ruby | js | moon | fennel | scheme | squirrel | wren | wasm | janet | python > Creates a new Hello World cartridge
load <cart> [sprites | map | cover | code | sfx | music | palette] 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
save <cart> 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.
run Run current project
resume Resume last loaded project
eval / = run code
dir / ls Show list of local files
cd Change directory
mkdir Make directory
folder Open working directory in OS (Windows, Linux, Mac OS)
add Show file open dialog to add file to TIC [browser version]
del <file> Delete from the filesystem
get <file> Show file save dialog to download file [browser version]
export [html | native | sprites | cover | map | sfx | music] 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]
import [code | map | screen | sprites | tiles] Import code/images from an external file.
cls / clear Clear screen
demo Install demo carts
config [reset | default] Show config.tic file editor when used without parameter, use reset param to reset current configuration, use default to edit default cart template
surf Open carts browser
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