Cronus GPC Documentation
Cronus CommunityGPC LibraryGPC Guide
  • Welcome
  • Introduction
    • GPC Explained
    • What's New with Zen?
  • Basic Syntax
  • A Simple Tutorial
  • Style Guide
  • GPC Structure
  • Basic GPC Structure
  • Definitions
  • Data Section
  • Remapping
  • Variables
  • Init Section
  • Main Section
  • Combo Section
  • User Created Functions
  • GPC Programming Basics
  • Constants
    • Zen
      • OLED
      • ASCII Constants
      • PIO
    • Keyboard
      • Keyboard
    • Controller
      • Polar
      • LED
      • Rumble
      • PS3
      • PS4
      • XBox 360
      • Xbox One
      • Nintendo WII
      • Nintendo Switch
    • Racing Wheel
      • G29
      • G27
      • G25
      • DF
      • DF GT
      • DF Pro
    • Trace
    • Memory
    • Misc
  • Flow Control
  • Persistent Memory
  • Operator Types
  • Identifiers
  • Functions & Commands
    • Internal Functions
      • Bit Functions
      • Combo Functions
      • Math Functions
      • Device Functions
      • OLED Display Functions
    • Console Functions
      • Core Console Functions
    • Controller Functions
      • Core Controller Functions
      • Rumble Functions
      • LED Functions
    • Keyboard Functions
      • Core Keyboard Functions
  • GPC Examples
    • #1
Powered by GitBook
On this page
  • BIT Functions
  • Combo Functions
  • Math Functions
  • Device Functions
  • LED Display Functions

Was this helpful?

  1. Functions & Commands

Internal Functions

PreviousIdentifiersNextBit Functions

Last updated 3 years ago

Was this helpful?

Within this section of the manual you will find the functions and commands the Virtual Machine uses to handle data in GPC scripts.

BIT Functions

Function

Description

Zen

Plus

Sets one Bit

✔️

✔️

Clears one Bit

✔️

✔️

Tests a Bit

✔️

✔️

Stores a value into a Bit Index

✔️

✔️

Gets a value from the Bit Index

✔️

✔️

Combo Functions

Function

Description

Zen

Plus

Runs a combo

✔️

✔️

Checks if a combo is running

✔️

✔️

Stops a running combo

✔️

✔️

Restarts a running combo

✔️

✔️

Math Functions

Function

Description

Zen

Plus

Returns an absolute value of a number

✔️

✔️

Returns the inverse value of a number

✔️

✔️

Raise and value to the specified power

✔️

✔️

Calculates an integer square root

✔️

✔️

Generates a random value between the specified range

✔️

❌

Device Functions

Function

Description

Zen

Plus

Returns the elapsed time between main iterations in milliseconds

✔️

✔️

Returns the active slot number

✔️

✔️

Loads a specified slot

✔️

✔️

Returns the identifier of the controller button

✔️

✔️

Sets the vm timeout for the next iteration

✔️

✔️

Sets the stick output at a given angle and radius with a high resolution value

✔️

❌

Sets the LED on the ZEN to the supplied RGB color

✔️

❌

Sets the LED on the ZEN to the supplied HSB color

✔️

❌

The clamp() function clamps a value between an upper and lower bound. clamp() enables selecting a middle value within a range of values between a defined minimum and maximum. It takes three parameters: a minimum value, a preferred value, and a maximum allowed value.

✔️

❌

LED Display Functions

Function

Description

Zen

Plus

Draws a pixel on the OLED display

✔️

❌

Draws a line on the OLED display

✔️

❌

Draws a rectangle on the OLED display

✔️

❌

Draws a circle on the OLED display

✔️

❌

Puts a character into the string buffer for puts_oled

✔️

❌

Draws the characters supplied using putc_oled on the OLED display

✔️

❌

Sets the entire OLED display to a single color

✔️

❌

Draws a string on the OLED display

✔️

❌

Bit Functions
Combo Functions
Math Functions
Device Functions
set_bit
clear_bit
test_bit
set_bits
get_bits
pixel_oled
line_oled
rect_oled
circle_oled
putc_oled
puts_oled
cls_oled
printf
abs
inv
pow
isqrt
random
combo_run
combo_running
combo_stop
combo_restart
get_rtime
get_slot
load_slot
get_ctrlbutton
vm_tctrl
set_polar
set_rgb
set_hsb
clamp function