Skip to content

🛠️ UTILITIES#

The utilities provided are essential for managing files and performance metrics in ANTIRUINS.

Note

There is a global table called STATS that contains various information just as FPS, Lua update and render time, the PVR render time and memory, etc.

STATS = {
    dt      = 0, -- delta time in mS.
    update  = 0, -- time taken by the Lua update function. (uS)
    render  = 0, -- time taken by the Lua render function. (uS)
    pvrTime = 0, -- time taken by the PVR render function. (uS)
    pvrMem  = 0, -- memory used by the PVR render function. (% used)
    fps     = 0, -- frames per second.
    sprites = 0, -- number of sprites current drawn.
    memory  = 0, -- memory used by the game. (Kb)
    }

File Management#

function findFile(filename)
Returns a path if the filename is found on the /cd, /rd, /pc, or in the loaded game folder.


function mountRomdisk(fileName, mountpoint)
Mounts a romdisk at the specified mountpoint. The most common mountpoint is “/rd”.


function unmountRomdisk(mountpoint)
Unmounts the specified mountpoint and frees up memory.


function executeBinary(filename)
Executes a binary file. Works only on Dreamcast.


Timing#

function getUS()
Returns the current microseconds since the game has started.


function getMS()
Returns the current milliseconds since the game has started.


function getFPS()
Returns the current frames per second.