Skip to main content

System

load

load(FILENAME, [NA], [PARAM_STR])

Load an application, PARAM_STR can be accessed through the interface after the application starts.

The new application will replace the current one after loading.

run

run([PARAM_STR])

Run from the start of the program.

run() Can be called from inside a running program to reset.

When PARAM_STR is supplied, it can be accessed during runtime with stat(6).

reset

reset()

Reset the running state. This includes color palettes, camera positions, clipping and fill patterns.

printh

printh(...)

Print arguments to the host operating system's console for debugging. The function is similar to lua's original print.

time

time()

t()

Return the number of seconds elapsed since the app was run.

This is not the real-world time, but is calculated by counting the number of times.

utcsec

utcsec()

Return the number of seconds elapsed since the 1970 utc.

utcdate (versoin>=6)

utcdate(fmt,[sec])

same as os.date

stat

stat(X)

Get system status where X is:

0        Memory usage, Unit kBytes
1 Cpu usage rate of the last frame
5 Platform version number
6 Parameters when the app loads
7 Current framerate
8 set frame rate

30 Is there keyboard data
31 Cached keyboard data
32 x position of mouse/touch
33 y position of mouse/touch
34 button state of mouse/touch

16..19
46..49 Index of currently playing SFX on channels 0..3
20..23
50..53 Note number (0..31) on channel 0..3
24/54 Currently playing pattern index
25/55 Total patterns played
56 Ticks played on current pattern

90..96 Local time : year, month, day, hour, minute, second, week(from 1 to 7 means from Sunday to Saturday)

statctl

statctl(key[,val])

Set the system state according to the key, if there is no val, it means just query, Return the last value.

altc:   alternative color (in 32-bit color mode, the alternate color used by the fill template)
tlmw: the width mask of the map used by tline
tlmh: the height mask of the map used by tline
tlmx: the x offset of the map used by tline
tlmx: the y offset of the map used by tline
sprm: sprite data address mapping, 0x60 means use vram address
scrm: screen data address mapping, 0x60 means use vram address, other values mean use sprite data address
mapw: map width definition, 0 means use the default width of the specification
colm: color mask definition, affects 4bpp drawing (analog fusion)

__listcarts

__listcarts()

Get application list.

__getparams

__getparams([del])

Get the application parameters, if del is true, the parameters will be cleared after getting.

__loadbioscart

__loadbioscart()

Load bios.

__loadprevcart

__loadprevcart()

Load the previous application (if it exists).

__loadsettingscart

__loadsettingscart()

Load system settings menu (common menu).

__togglepausemenu

__togglepausemenu([pause])

Load the pause menu (if there is no parameter, it will be reversed according to the current state).

__resetcart

__resetcart()

Reload application.

__cfgread

__cfgread(filename)

Read and return the content of the configuration file.

__cfgread

__cfgwrite(filename, str)

Write the content of the configuration file, and return true if successful.

__cfgdel

__cfgdel(filename)

Delete configuration file.