[DEVELOPER] CPU API Documentation - Game-Fusion/Commander-64 GitHub Wiki

CPU

The CPU API is a flexible and fast API for all of your processing needs. This is complete documentation of all CPU commands, what they do and how to use them.

Bit API functions


cpu.blshift(n, bit)

Shifts a number left by a specified number of bits


cpu.brshift(n, bit)

Shifts a number right arithmetically by a specified number of bits


cpu.blogic_rshift(n, bit)

Shifts a number right logically by a specified number of bits


cpu.bxor(m, n)

Computes the bitwise exclusive OR of two numbers


cpu.bor(m, n)

Computes the bitwise inclusive OR of two numbers


cpu.band(m, n)

Computes the bitwise AND of two numbers


cpu.bnot(n)

Computes the bitwise NOT of a number


  • There are also standard parallel commands along with multishell with the prefix t (eg. multishell.launch becomes cpu.tLaunch)

Other processes


cpu.sleep(time)

Waits for a certain amount of time


cpu.serialize(data)

Process and serialize given data.


cpu.unserialize(data)

Reverse serialization on data.


cpu.serializeJSON(data)

Serialize data in JSON form.


cpu.urlEncode(url)

Encode a string in URL suitable form.


cpu.locate(timeout)

Use location processes to attempt to find location