recursal/Fanatic-Fandom huggingface dataset:
Multitool

The **Multitool** is an important part of the user interface in *Retro Gadgets*.

The Multitool sits to the left of the workbench. It's used to edit gadgets and their assets, as well as serving as the game's main menu and interface.

## Gadget view

Once starting to edit a gadget, this screen will appear.

1. This is the ID of the gadget on the computer. Clicking it will open the folder where it's stored, allowing quick access to its rgadget file.
2. The edit button open the gadget's assets. Duplicate (or Jailbreak for gadgets downloaded from the Workshop) will make a new copy of the gadget and Delete will delete it.
3. This button allows changing of the gadget's permissions.
4. These triangle-shaped buttons allow editing the gadget's name and description.
5. This section allows publishing a finished gadget to the Workshop. The tags allow categorizing the gadget and the "Showcase" flag will put it in the showcase list.

### Permissions

To use Wifi and Webcam functions on each gadget, permissions need to be granted. Otherwise, trying to make a web request or display a picture will result in an access denied error. To enable permissions, edit the gadget and click on the Permissions button in the Multitool shown above.

## Asset list

This screen is where one manages the assets contained in a gadget. The three buttons at the top, respectively:

* Allows creating new SpriteSheets with the Sprite Editor
* Create new Code with the Code Editor
* And import an external asset from your computer, such as an audio file to use as an AudioSample.

To import assets into a gadget, they must be in the Import folder, which can be found by clicking the Gadget Archive button in the main menu.

For assets to be used within a gadget's code, a ROM module must be included in the gadget.

## Bottom screen

In the bottom screen of the Multitool, you can change different properties of each module you click on your gadget while the Multitool is open. At the top of this screen, you can also see the name each one of your gadget's modules has, in order to use them in your code.

The properties labeled as Software can either be changed here, for your gadget's initial state at power on, or be changed with code your gadget runs. Properties labeled Hardware can only be changed here. One such property is Symbol, which changes what is printed physically on a button.
Eli Mateus

Nome Completo: Eli Mateus

Kimer (Atualmente)

**Eli Mateus** é um dos principais da segunda parte da historia de Ciferul 0, e o melhor amigo de Colazzo.

## Historia

### Biografia

Muito pouco ser sabe sobre Mateus, alem de que ele nasceu no dia 25 de Agosto de 1994. Antes de conhecer Colazzo, ele atuava como um valentão da escola chamada Candido Portinari. No entanto, isso muda quando um dos braços direito de Ciferul, chamado Goeth Zalgatoth Gremory mata os seus pais. O fazendo ir para adoção também e mais para frente conhecendo Colazzo, que onde ambos ser tornaria amigos de infancia pelo fato de ambos terem sido adotados desde dali.
Screen

**Screen** is a module in *Retro Gadgets*. It's what displays the images generated with a VideoChip.

## Sizes

Screens come in five different sizes with the following resolutions each:

16x1632x3240x4064x3664x64
By carefully positioning two or more screens next to each other, they can be joined together to make screens of different sizes and shapes. Remember it is still necessary to individually connect each separate screen to a VideoChip in order to display images on them.

## Properties

**VideoChip** VideoChip
The offset of the screen's top-left position in the corresponding VideoChip's overall rendering buffer.

read only
**Offset** vec2
The offset of the screen's top-left position in the corresponding VideoChip's overall rendering buffer.

read only
**Width** number
The width of the screen in pixels.

read only
**Height** number
The height of the screen in pixels.
ScreenButton

**ScreenButton** is a module in *Retro Gadgets*. It's a button that can display images on itself, meaning that it works like a Screen and a Button at the same time.

The resolution of the screen inside the button is 16x16.

## Properties

read only
**ButtonState** boolean
Returns true if the button is currently pressed, false otherwise.

read only
**ButtonDown** boolean
A boolean flag which will be true only in the time tick the corresponding button changes its state to pressed.

read only
**ButtonUp** boolean
A boolean flag which will be true only in the time tick the corresponding button changes its state to released.

**InputSource** InputSource
An InputSource to be used to trigger the button state.

**VideoChip** VideoChip
The VideoChip the screen part of this button is bound to.

read only
**Offset** vec2
The offset of the screen's top-left position in the corresponding VideoChip's overall rendering buffer.

read only
**Width** number
The width of the screen in pixels.

read only
**Height** number
The height of the screen in pixels.

## Events

**ScreenButtonEvent** : { ButtonDown boolean, ButtonUp boolean, Type string }
Triggered when the ScreenButton is pressed or released.

* ButtonDown is true if the button was just pressed.
* ButtonUp is true is the button was just released.
* Type is "ScreenButtonEvent"..
AnalogStick

**AnalogStick** is a module in *Retro Gadgets*. It's a little joystick-like input device for a gadget, which has smooth movement in all directions.

Similar to the DPad in functionality.

## Properties

read only
**X** number
The position of the stick along the horizontal axis, ranging from -100 to 100.

read only
**Y** number
The position of the stick along the vertical axis, ranging from -100 to 100.

**InputSourceX** InputSource
The module associated with the stick's horizontal axis. See InputSource for more info.

**InputSourceY** InputSource
The module associated with the stick's vertical axis. See InputSource for more info.

## Events

**StickValueChangeEvent** : { X number, Y number, Type string }
Triggered when the D-Pad is pressed.

* X and Y are the respective values of the pad
* Type is "StickValueChangeEvent"

## In the Multitool

The InputSource properties can be set from the Multitool while editing a gadget to set these values without using code.
Retro Gadgets Wiki

**Welcome to the Retro Gadgets Wiki!**

the *Retro Gadgets* compendium by the players, for the players.

Please feel free to contribute by creating new articles or expanding existing ones.

About

"You look up from your cosy little workbench. It's dark out, what time is it? It doesn't matter; you've been in the flow and are adding the final touches to your latest retro gadget. Just one more line of code, a spray of paint here, a sticker there – it's done. You power it on... The start-up sound kicks in... the needles on the gauges flutter, and the screen lights up... it's glorious. It's ready to share with the world. Now, all it needs is a name.

"Feel the exhilaration of building your own eye-popping real-working gadgets. Lose yourself as you build, solder, code, customise, and play with electrifying gadgets at your relaxing workbench. Build video game consoles, weather machines, lightboards, radios, drum machines... any gadget you can think of. What will you come up with next?"

*from the Steam store page*

Basics

How to playModulesLuaClassesGame support

User Interface

MultitoolSprite EditorCode EditorAirbrush

Participate

Have a page you'd like to add to the Retro Gadgets Wiki? Get started by giving your article a name and hitting "Create Page." Edits and improvements to existing pages are also appreciated.

Adding content

* If you are unsure of what to do or how to create a page, search for a few articles on the same topic and see what they look like. You can always view the source code in a wiki and learn from what others have done.
* An edit doesn't have to be massive; if you feel you don't want to create whole articles, then just fixing spelling errors and broken links is enough.

Help

Getting Started
How to Contribute
Guides
All Help articles

Images

more...

Game

* **Developer:** Licorice ehf and Studio Evil
* **Publisher:** Licorice ehf
* **Genre:** Simulation, Sandbox
* **Mode:** Single-player
* **Media:** Digital

**Release date**
* **November 30, 2022** (early access)
	+ Windows
* **TBD** (full release)

Video

```

```

Wiki

Recent changes
Create an account
New pages
Missing pages

Links

***Retro Gadgets***
Official site
Official documentation
Steam
Facebook
Twitter
Reddit
Instagram
Youtube
Twitch
Discord

**Studio Evil**
Official site

Twitter

Twitter
Switch

**Switch** is a module in *Retro Gadgets*. It works similar to a Button, but holds its state as flipped or not flipped instead of being a momentary push button.

## Properties

read only
**State** boolean
The state of this switch.

**InputSource** InputSource
An InputSource to be used to trigger the switch's state.

## Events

**SwitchStateChangeEvent** : { State boolean, Type string }
Triggered when the Switch is flipped.

* State is the new state of this switch.
* Type is "SwitchStateChangeEvent".
Code Editor

The Code Editor is a part of the user interface in *Retro Gadgets* where one can write the Lua code a gadget's CPU will run. Beginners at programming who want to see some code examples can use the Tutorial button on the main menu for a variety of built-in gadgets to inspect and learn from.

At the bottom of the editor, there is a status bar that will tell the runtime state of the code while your gadget is on. It can show the performance of the gadget in "tps" (Ticks Per Second), or if the gadget has encountered an error. Errors are displayed in red and can be hovered over to show more information about what happened.

At the bottom-right there are 4 buttons, respectively:

* Debugging will show line numbers so you can click them to set breakpoints in your code to inspect it more closely. Your code will pause at the breakpoint until told to continue, and clicking the current running line will show you a stacktrace.
* Word wrap will wrap around lines that are too long horizontally to be displayed on the screen. When disabled, a horizontal scroll bar will be shown instead.
* Minus button will decrease the resolution of the code editor, meaning letters are bigger and less code will fit on screen at once.
* Plus button will increase the resolution of the code editor, meaning letters are smaller and more code will fit on screen at once.

Depending on the monitor's resolution, the minus and plus buttons may not have any effect.

To learn more about how to program in Retro Gadgets, see the Code glossary and Code structure pages.
LedButton

**LedButton** is a module in *Retro Gadgets*. It's a button that can tell when it's pressed or released, and can glow with a LED embedded in it.

## Properties

read only
**ButtonState** boolean
Returns true if the button is currently pressed, false otherwise.

read only
**ButtonDown** boolean
A boolean flag which will be true only in the time tick the corresponding button changes its state to pressed.

read only
**ButtonUp** boolean
A boolean flag which will be true only in the time tick the corresponding button changes its state to released.

**InputSource** InputSource
An InputSource to be used to trigger the button state.

**LedState** boolean
The lit/unlit state of the Led of this button.

**LedColor** color
The color of the Led of this button.

## Events

**LedButtonEvent** : { ButtonDown boolean, ButtonUp boolean, Type string }
Triggered when the LedButton is pressed or released.

* ButtonDown is true if the button was just pressed.
* ButtonUp is true is the button was just released.
* Type is "LedButtonEvent".

## In the Multitool

Different symbols can be selected to be printed on some sizes of buttons in the bottom screen of the Multitool.

## Examples

The state of the button and the state of the LED can be tied together to make a button light up while it's pressed:

```
function update()
    -- LED state always being set to Button state every tick
    gdt.LedButton0.LedState = gdt.LedButton0.ButtonState
end

```
Led

**Led** is a module in *Retro Gadgets*. It's a small light that can change colors.

## Properties

**State** boolean
LED on/off state.

**Color** Color
LED color.

## Examples

A small piece of code for a color-changing LED:

```
-- turn the LED on once at startup
gdt.Led0.State = true

-- store a value for hue
local hue = 0

function update()
    -- set LED color with hue
    gdt.Led0.Color = ColorHSV(hue, 100, 100)

    -- increase hue and wrap back to 0 once it reaches 360
    hue = (hue + 1) % 360
end

```
Class

There are a number of **classes** available to Lua scripts in *Retro Gadgets*. Classes work as a mold for the creation of objects.

## List of classes

The Lua classes associated with modules are not listed here. See the modules page for lists of modules.

* Asset
* Code
* Color
* Gadget
* InputSource
* Motherboard
* PixelData
* SpriteSheet
* vec2
* vec3

Technical note: Lua doesn't have true classes; instead, Lua classes are actually objects set up to be used exclusively as prototypes to create specific types of objects. But because such prototypes function so similarly, they are often referred to as classes.
CPU

**CPU** is a module in *Retro Gadgets*. It is what runs the Code assets in a gadget to control all the gadget's modules.

## Sizes

The different CPU sizes support different amounts of EventChannels at once.

The small CPU can have up to 4 EventChannels.The medium CPU can have up to 16 EventChannels.The large CPU can have up to 64 EventChannels.
Aside from that, the different CPU sizes do not operate differently.

## Properties

read only
**Source** Code
The code asset uploaded to the CPU.

read only
**Time** number
The time since the gadget is turned on, expressed in seconds.

read only
**DeltaTime** number
The time elapsed since the last tick, expressed in seconds.

**EventChannels** {Module}
A table which is used to connect each Event Channel with a module in your gadget that can trigger that channel with its events.

## In the Multitool

One can set the Source and EventChannels properties from the Multitool while editing a gadget to set these values without using code.
LedStrip

**LedStrip** is a module in *Retro Gadgets*. They are several LEDs joined together into one group.

## Properties

A LedStrip works similarly to an array of LEDs, its properties are tables that correspond to each LED in the LedStrip. The tables should be addressed with [index].

**States** {boolean}
A table that maps each of the LED's lit/unlit status.

**Colors** {Color}
A table that maps each of the LED's colors.

## Examples

This example uses the CPU's Time to select a LED to turn on, such that a light moves on the strip each second. Since the lights will stay on until we tell them not to, the code also gets the previous light to turn off, otherwise all lights on the strip would come on and stay on forever.

```
function update()
    -- round down cpu time and then truncate to the number of leds in our strip
    local ledToTurnOff = math.floor(gdt.CPU0.Time) % #gdt.LedStrip0.States
    -- we do the same with the next number over to get the adjacent light
    local ledToTurnOn = math.floor(gdt.CPU0.Time+1) % #gdt.LedStrip0.States

    -- since the modulo truncation starts at 0 and the states table starts at 1, we need to add 1 to both numbers
    gdt.LedStrip0.States[ledToTurnOff+1] = false
    gdt.LedStrip0.States[ledToTurnOn+1] = true
end

```
Vec2

**vec2** is a class in *Retro Gadgets*. There are vec2 and vec3 vector object types which are used for coordinate systems such as drawing images in a VideoChip.

The individual components of each of these types cannot be modified (e.g. setting X or Y individually), they can only be created or read. It can be more useful to store your values separately and only turn them into vector types when necessary.

However, it's useful to note you can apply certain matrix operations to these types like so:

```
vec2(1,2) * 2 -- returns vec2(2,4)
vec2(1,2) * vec2(2,1) -- returns vec2(2,2)

vec2(1,2) - vec2(1,0) -- returns vec2(0,2)
vec2(1,2) - 1 -- causes RuntimeException

```

## Global methods

This methods isn't part of the vec2 class; instead, it is defined globally.

**vec2**( x number, y number ) vec2
Creates and returns a vec2 vector.

## Properties

read only
**X** number
The X component of this vec2 object.

read only
**Y** number
The Y component of this vec2 object.
Airbrush

The **Airbrush** is a part of the user interface in *Retro Gadgets*. It's a tool that paints gadget shells and modules. Click on it in the bottom right corner of the desk, and the camera will pan to show all the options such as colors and different nozzles. Like the other tools and drawers, the Airbrush is only available while the gadget is powered off. This is noted by the toolbox being closed with a lid while the gadget is on.

## Using the Airbrush

When the Airbrush is active, it will follow the cursor with a red marker indicating where it's pointing. This marker will change in shape and size depending on the nozzle, size, and mode currently active.

To change the size of brush, scroll up and down with the mouse wheel. The size will be indicated both by the red marker and by a number on the handle of the Airbrush. To change the nozzle shape, simply click on them in the Airbrush's tool box to pick them up. Pressing X will toggle between locking to horizontal and vertical line modes, before returning to regular freehand mode. Optionally hold down the left shift key to zoom into your gadget for precision. Press Ctrl-Z to undo each paint stroke when desired.

To select a color for the Airbrush, simply click on an ink bottle on the right, or click with the right mouse button to select a secondary color. This color will be used when painting with the right button instead of the left button.

Stickers can be used as masks for painting over. By placing a stencil sticker on the gadget, painting over it, then removing the sticker with the tweezers, the shell won't be painted where the sticker was sitting.

Certain modules can be painted with the Airbrush by clicking directly on them, and some modules also have a secondary color that can be set. For example, painting the Keypad with the left click will paint the bezel around the buttons, while painting it with the right click will paint the buttons themselves.

Once done using the Airbrush, simply click on its empty spot in the tool box to put it away.
Slider

**Slider** is a module in *Retro Gadgets*. It's a linear component that slides from one end to the other to set numerical values.

Similar to the Knob in functionality.

## Properties

**Value** number
The value returned by the position of the slider, ranging from 0 to 100.

read only
**IsMoving** boolean
Returns true if the user is moving the slider.

## Events

**SliderValueChangeEvent** : { Value number, Type string }
Triggered when the slider is moved.

* Value is the respective value given by the slider's position
* Type is "SliderValueChangeEvent"

## Examples

A simple code using some math to map the slider's value into the hue of a LED's color:

```
-- a function that maps "value"
-- from a scale of "src_from" to "src_to"
-- into a scale of "tgt_from" to "tgt_to"
function map(value, src_from, src_to, tgt_from, tgt_to)
    return ((value - src_from) / (src_to - src_from) * (tgt_to - tgt_from)) + tgt_from
end

-- turn LED on at startup
gdt.Led0.State = true

function update()
    -- map slider 0-100 to hue 0-360
    local hue = map(gdt.Slider0.Value, 0, 100, 0, 360)

    -- set LED color to hue
    gdt.Led0.Color = ColorHSV(hue, 100, 100)
end

```
Keypad

**Keypad** is a module in *Retro Gadgets*. It's a grid of buttons that can be used in a group.

## Properties

A Keypad works similarly to a grid of LedButtons, its properties are all multi-dimensional tables that correspond to each button in the Keypad. The tables should be addressed with [column][row].

read only
**ButtonsState** {{boolean}}
A multi-dimensional table mapping the state of each button to a boolean value.
Returns true if the corresponding button is currently pressed, false otherwise.

read only
**ButtonsDown** {{boolean}}
A multi-dimensional table mapping boolean flags which will be true only in the time tick the corresponding button changes its state to pressed.

read only
**ButtonsUp** {{boolean}}
A multi-dimensional table mapping boolean flags which will be true only in the time tick the corresponding button changes its state to released.

**ButtonsInputSource** {{InputSource}}
A multi-dimensional table mapping InputSources to each of the buttons in the Keypad.

## Events

**KeypadButtonEvent** : { X number, Y number, ButtonDown boolean, ButtonUp boolean, Type string }
Triggered when a button is pressed or released.

* X is the column of the button that triggered the event.
* Y is the row of the button that triggered the event.
* ButtonDown is true if the button was just pressed.
* ButtonUp is true is the button was just released.
* Type is "KeypadButtonEvent".

## In the Multitool

Different symbols can be selected to be printed on each one of the buttons of the keypad in the bottom screen of the Multitool.
Gadget

**Gadget** is a class in *Retro Gadgets*. It represents the gadget itself, and is available through the global gdt object. The modules of the gadget are accessed through properties of this object.

## Properties

A Gadget has a property for each module attached to the gadget in addition to the following:

read only
**Motherboards** Motherboards
The multitool connector. It isn't clear if there is any purpose to accessing this through code.

read only
**MultitoolConnector** MultitoolConnector
The multitool connector. It isn't clear if there is any purpose to accessing this through code.

The properties for most modules are named after their class with a number appended according to the order in which they were added to the gadget, with the count starting from 0. For example, the first CPU is called CPU0. Some modules do not have the number, such as the ROM module, which is simply called ROM, because no more than one can be installed on a gadget.
AnalogGauge

**AnalogGauge** is a module in *Retro Gadgets*. It's a physical device for visualizing a numerical value with a moving needle.

## Properties

**Value** number
Setting this to a number between 0 and 100 will move the needle from left to right relative to that number.

## Examples

Here's some code that sets an AnalogGauge to 100 if a LedButton is pressed down:

```
function update()
    -- if the button is pressed down
    if gdt.LedButton0.ButtonState then
        -- then the gauge gets set to 100
        gdt.Gauge0.Value = 100
    -- otherwise
    else
        -- the gauge will be set to 0
        gdt.Gauge0.Value = 0
    end
end

```

Note that even though the setting of the value is instantaneous, since the physical needle of the gauge can't move instantly, it will bounce between 0 and 100 in this example.
Retro Gadgets

***Retro Gadgets*** is a single-player simulation sandbox game for Windows being developed by Licorice ehf and Studio Evil (together calling themselves Evil Licorice) and to be published by Licorice ehf.

## Description

"You look up from your cosy little workbench. It's dark out, what time is it? It doesn't matter; you've been in the flow and are adding the final touches to your latest retro gadget. Just one more line of code, a spray of paint here, a sticker there – it's done. You power it on... The start-up sound kicks in... the needles on the gauges flutter, and the screen lights up... it's glorious. It's ready to share with the world. Now, all it needs is a name.

"Feel the exhilaration of building your own eye-popping real-working gadgets. Lose yourself as you build, solder, code, customise, and play with electrifying gadgets at your relaxing workbench. Build video game consoles, weather machines, lightboards, radios, drum machines... any gadget you can think of. What will you come up with next?"

*from the Steam store page*

## Game support

Retro Gadgets Wiki is focused on creating the definitive guide to *Retro Gadgets*. But while we make an effort to be complete, which may include game bugs and fixes for them, we are not an official game support channel. Please direct support requests to the game's Steam Discussions or the game's Discord.

## Videos

```

```

## System requirements

### Minimum

Requires a 64-bit processor and operating system

* **OS:** Microsoft Windows 8 / 8.1 / 10 (64 bit)
* **Processor:** Intel Core2Duo 2GHz or AMD equivalent (or better)
* **Memory:** 4 GB RAM
* **Graphics:** Intel HD series 5000 (or better) or discrete video card
* **DirectX:** Version 9.0c
* **Storage:** 300 MB available space

### Recommended

* **OS:** Microsoft Windows 10 (64 bit) / 11
* **Processor:** Intel Core i5 series or AMD equivalent (or better)
* **Memory:** 8 GB RAM
* **Graphics:** 512 MB DirectX 9.0c compatible graphics card (shader model 4)

## External links

* Official site
* Official documentation
* *Retro Gadgets* on Steam
* *Retro Gadgets* on Facebook
* *Retro Gadgets* on Twitter
* *Retro Gadgets* on Reddit
* *Retro Gadgets* on Instagram
* *Retro Gadgets* on Youtube
* *Retro Gadgets* on Twitch
* *Retro Gadgets* on Discord
* Studio Evil
Motherboard

**Motherboard** is a class in *Retro Gadgets*. Motherboards can be accessed via the Motherboards table property on the gdt object or through the Motherboard property on any Module.

A gadget has separate motherboards when boards are placed without being connected to each other and modules added to each board. A Motherboard isn't in the gdt.Motherboards table if it doesn't have one attached module.

## Properties

A Motherboard has a property for each modules attached to the board, using the same names those modules have on the gdt object.

read only
**MultitoolConnector** MultitoolConnector
The multitool connector. It isn't clear if there is any purpose to accessing this through code. Note that this property is present only on the main motherboard.
PixelData

**PixelData** is a class in *Retro Gadgets*. It is a data structure containing video data.

This structure is used to provide Lua with an optimized way to do GetPixel and SetPixel, the buffer is kept on the Lua side minimizing read and write overhead.

## Static methods

**PixelData.new**( width number, height number, color Color ) PixelData
Constructor used to create a PixelData.

width and height represent its size while color defines the color with which it is initialized.

## Properties

read only
**Width** number
Width in pixels of the buffer.

read only
**Height** number
Height in pixels of the buffer.

## Methods

**GetPixel**( x number, y number ) Color
Returns the color of the pixel at the coordinate specified by x and y.

**SetPixel**( x number, y number, color Color )
Sets the color of the pixel at the coordinate specified by x and y.
Vec3

**vec3** is a class in *Retro Gadgets*. There are vec2 and vec3 vector object types which are used for coordinate systems such as drawing images in a VideoChip.

The individual components of each of these types cannot be modified (e.g. setting X, Y, or Z individually), they can only be created or read. It can be more useful to store values separately and only turn them into vector types when necessary.

However, it's useful to note you can apply certain matrix operations to these types like so:

```
vec3(1,2,3) * 2 -- returns vec3(2,4,6)
vec3(1,2,3) * vec3(3,2,1) -- returns vec3(3,4,3)

vec3(1,2,3) - vec3(1,0,2) -- returns vec2(0,2,1)
vec3(1,2,3) - 1 -- causes RuntimeException

```

## Global methods

This methods isn't part of the vec3 class; instead, it is defined globally.

**vec3**( x number, y number, z number ) vec3
Creates and returns a vec3 vector.

## Properties

read only
**X** number
The X component of this vec3 object.

read only
**Y** number
The Y component of this vec3 object.

read only
**Z** number
The Z component of this vec3 object.
GamepadChip

**GamepadChip** is a module in *Retro Gadgets*. It allows control over gadgets using the computer's real game controller.

Similar in functionality to the KeyboardChip.

## Properties

**GamepadIndex** number
Setting this property allows you to select which one of the gamepads currently connected to your computer the chip will use.

read only
**IsActive** boolean
Returns whether or not the selected gamepad is currently active (plugged in and available) on your computer.

## Methods

**GetButton**( name InputName ) InputSource
Returns an InputSource for a given button.

**GetAxis**( name InputName ) InputSource
Returns an InputSource axis for a given axis.

**GetButtonAxis**( negativeName InputName, positiveName InputName ) InputSource
Returns an InputSource axis controlled by two given buttons, one for negative and one for positive values.

## Events

**GamepadChipIsActiveEvent**( IsActive boolean, Type string )
Triggered when a gamepad becomes active or inactive.

* IsActive returns whether or not the selected gamepad currently became active.
* Type is "GamepadChipIsActiveEvent".

**GamepadChipButtonEvent**( ButtonDown boolean, ButtonUp boolean, IsAxis boolean, InputName InputName, Type string )
Triggered when a gamepad control is pressed or released.

* ButtonDown is true if a button or axis was pressed at this event.
* ButtonUp is true if a button or axis was released at this event.
* IsAxis is true if the input that triggered this event is an axis.
* InputName returns the input name of the key that triggered this event.
* Type is "GamepadChipButtonEvent".

## Input names

The following inputs can be used as axis, that is, they return analog values ranging from -100 to 100.

* GamepadChip.LeftStickX
* GamepadChip.LeftStickY
* GamepadChip.RightStickX
* GamepadChip.RightStickY

The following inputs can be used as buttons, that is, they can be pressed or released.

## Troubleshooting

### GamepadChip isn't receiving input from gamepad and IsActive return false

When playing *Retro Gadgets* through Steam, Steam may automatically apply the "Keyboard (WASD) and Mouse" template in Controller Layout by default. This prevents *Retro Gadgets* from detecting the gamepad, leaving the GamepadChip to ignore it. To solve this, use the Controller Layout option for *Retro Gadgets* in Steam and change it to the Gamepad template.
AudioChip

**AudioChip** is a module in *Retro Gadgets*. It can be used together with a Speaker to make gadgets produce sounds through the usage of AudioSamples.

## Sizes

The different sizes of AudioChips determine how many concurrent channels each of them supports:

The small AudioChip supports 4 channels.The medium AudioChip supports 16 channels.The large AudioChip supports 32 channels.
## Properties

read only
**ChannelsCount** number
Number of available channels for this AudioChip. Each channel can independently play an audio sample.

**Volume** number
The global AudioChip volume.

## Methods

**GetSpectrumData**( channel number, samplesCount number ) {number}
Returns the audio spectrum values of a channel as a table of number values, each one expressing the value of a different frequency.

samplesCount must be a power of 2 (ie 128/256/512 etc) Min = 64 Max = 8192.

**GetDspTime**( ) number
Returns the current internal AudioChip's DSP time. It is meant to be used in combination with the PlayScheduled method. The returned number is expressed in seconds.

**Play**( audioSample AudioSample, channel number )
Immediately plays an AudioSample on a specific channel.

**PlayScheduled**( audioSample AudioSample, channel number, dspTime number )
Schedule the play of and AudioSample at a specific DSP time, expressed in seconds, on the specific channel.

**PlayLoop**( audioSample AudioSample, channel number )
Immediately plays an AudioSample on a specific channel, looping it.

**PlayLoopScheduled**( audioSample AudioSample, channel number, dspTime number )
Schedule the play of and AudioSample at a specific DSP time, expressed in seconds, on the specific channel, looping it.

**Stop**( channel number )
Stops any audio playing on a specific channel

**Pause**( channel number )
Pause the audio on a specific channel

**UnPause**( channel number )
Resumes the audio on a specific channel

**IsPlaying**( channel number ) boolean
Returns true if a channel is currently playing audio

**IsPaused**( channel number ) boolean
Returns true if a channel is currently paused.

**GetPlayTime**( channel number ) number
Returns the current play time of a channel, expressed in seconds.

**SeekPlayTime**( time number, channel number )
Sets the current position of the play head, for the specific channel, expressed in seconds.

**SetChannelVolume**( volume number, channel number )
Sets the current volume for a channel, 0-100 range.

**GetChannelVolume**( channel number ) number
Gets the current volume for a channel, 0-100 range.

**SetChannelPitch**( pitch number, channel number )
Sets the pitch for a channel. Acts as a multiplier. A value of 1 means the default pitch for a sample, a value of 2 plays the sample one octave higher.

**GetChannelPitch**( channel number ) number
Gets the current pitch of a channel.
RealityChip

**RealityChip** is a module in *Retro Gadgets*. It allows reading some values about real-world usage of the computer from inside *Retro Gadgets*.

## Properties

read only
**Cpu.TotalUsage** number
The total CPU usage of the system, from 0 to 100.

read only
**Cpu.CoresUsage** {number}
An array that contains the CPU usage of each logical CPU core, from 0 to 100.

read only
**Ram.Available** number
Available RAM expressed in MB.

read only
**Ram.Used** number
Used RAM expressed in MB.

read only
**Network.TotalSent** number
Total sent by network interfaces expressed in Mbps.

read only
**Network.TotalReceived** number
Total received from network interfaces expressed in Mbps.
Yhwach

Nome Completo: Juha Bach

**Yhwach** é um dos antagonistas principais no final de Bleach (Ciferulverse), junto com Mayuri Kurotsuchi, ele é o Rei Quincy, e o lider dos Wandenreich,

## Historia

Yhwach foi o progenitor do legado Quincy, apesar dos Quincy não acreditarem que o Yhwach foi o primeiro de sua raça. Em todos os Quincy e descendente o sangue fluir pelos ancestrais, o propio se identifica como filho do Rei das Almas o que implica que os Quincy tambem são relacionados com o Rei das Almas. Na medida em que a historia é contada Yhwach nasceu em mill e duzentos anos antes dos eventos da serie, Yhwach tambem acreditou que o Mundo dos Humanos, Hueco Mundo e a Sociedade das Almas deveriam ser fundir em um só, para tirar o medo dos humanos. No futuro, Yhwach se tornou um lider Quincy, e fez o seu imperior chamado de Lichtreich. Após a sua conquista culminou na destruição de muitas cidades, depois de uma tentativa de golpe de uma dupla de Quincy, Bazzard Black e o Jugram Haschwalth, embora Yhwach tenha escolhido Jugram como seu braço direito, pois ele percebeu que Jugram tinha abilidade de distribuir as almas como ele mesmo fazia. Depois disso a cerca de mill anos atrás Lichtreich voltou a sua atenção para a Soul Society, Yhwach liderou uma invasão Quincy numa tentativa de tentar usurpar o seu pai Rei das Almas, e destruir o equilibrio, ele teve uma luta contra o Yamamoto, onde Genryusai foi capaz de selar o Yhwach num sono eterno. No entanto, Yhwach foi capaz de recuperar as suas funções depois de noventa anos, e ele recuperou o seu poder antigo Auswaller para drenar cada Quincy impuro de sua energia espiritual. Ele então fez duas vitimas sendo Kanae Katagiri e Masaki Kurosaki, depois disso ao algum tempo Yhwach continuou a recrutar Quincys para sua causa um deles foi O Äs Nödt, um homem religioso que foi hospitalizado após um acidente. Algum tempo após a derrota de Sōsuke Aizen, o Wandenreich invadiu Hueco Mundo e mataram varios Hollow por lá. Eles tambem nessa invasão acabaram prendendo a Arrancar, Espada 3, Tier Harribel como prisoneira de guerra no castelo de wandenreich de Silbern e reidivicando o territorio do Hueco Mundo para Wandenreich, considerando uma pedra fundamental para invasão a Soul Society.
SegmentDisplay

**SegmentDisplay** is a module in *Retro Gadgets*. It's a collection of different seven-segment displays for showing numbers.

## Segments

Each digit of a SegmentDisplay has its segments enumerated as such:

12345678
Each digit of a multi-digit display has all these segments, except for the display with two dots in the middle. In the case of that display, the two dots are instead enumerated as their own "digit" in which each segment is each dot, making the total of "digits" for it 5. Additionally, the 8th segment (the dot) is absent.

4 digits5 "digits"
## Properties

**States** {{boolean}}
A table that maps the lit/unlit state of each of the segments in the display.

**Colors** {{Color}}
A table that maps the color of each of the segments in the display.

## Methods

**ShowDigit**( groupIndex number, digit number )
A helper function to show a numerical digit in a whole display. groupIndex is the digit that you want the number to show on, digit is the number you want to show.

**SetDigitColor**( groupIndex color, Color number )
A helper function to set the color of a whole numerical digit at once. groupIndex is the digit that you want to change the color of, color is the color you want to set it to.

## Examples

Here's how to display the CPU time (measured in seconds) on a 4-digit SegmentDisplay:

```
-- shorthand display module to "disp"
local disp = gdt.SegmentDisplay0

function update()
    -- store the CPU time rounded down
    local time = math.floor(gdt.CPU0.Time)

    -- each digit gets remainder of division by 10
    -- each next digit gets divided by 10 to get next decimal place
    disp:ShowDigit(4, time % 10)
    disp:ShowDigit(3, (time/10) % 10)
    disp:ShowDigit(2, (time/100) % 10)
    disp:ShowDigit(1, (time/1000) % 10)
end

```
Multitool debug methods

This Multitool bottom screen in *Retro Gadgets* functions as a debug screen while the gadget is powered on. It works like a terminal window. These global methods allow one to display information on it, providing an easy output to help make sure code is working right.

## Global methods

**log**( log string )
This will print a message on the screen using the current settings. The method print(message) is an alias to this method.
Keep in mind that to log numerical values, they must first be converted into string with tostring(value).

**logWarning**( message string )
This will print a message on the screen, automatically colored yellow.

**logError**( message string )
This will print a message on the screen, automatically colored red.

**write**( text string )
This will print a message on the screen without automatically adding a line break. Calling this method repeatedly will always print on the same line.

**writeln**( text string )
This will print a message on the screen adding a line break at the end. Functionally the same as log(message).

**setFgColor**( colorId number )
Sets the foreground color of the text to be printed. Uses the numbers on the ANSI colors table for Foreground.

**setBgColor**( colorId number )
Sets the background color of the text to be printed. Uses the numbers on the ANSI colors table for Background.

**resetFgColor( )**( )
Resets the text foreground color to the default bright white.

**resetBgColor( )**( )
Resets the text background color to the default black.

**resetColors( )**( )
Resets both background and foreground colors for the text to their defaults.

**setCursorPos**( column number, line number )
Sets the absolute position of the cursor, that is, where text is going to be printed. Takes both column and line at once.

**setCursorX**( column number )
Sets only the absolute horizontal position of the cursor to column.

**setCursorY**( line number )
Sets only the absolute vertical position of the cursor to line.

**moveCursorX**( deltaColumn number )
Moves the cursor relative to its current position, horizontally by an amount of deltaColumn characters.

**moveCursorY**( deltaLine number )
Moves the cursor relative to its current position, vertically by an amount of deltaLine characters.

**saveCursorPos**( )
Saves the current position of the cursor to memory.

**restoreCursorPos**( )
Moves the cursor to the position previously saved with saveCursorPos().

**clear**( )
Clears the entire screen.

**clearToEndLine**( )
Clears only the line where the cursor currently is.

## ANSI colors

The ANSI colors used in *Retro Gadgets* are as follows:
FlashMemory

**FlashMemory** is a module in *Retro Gadgets*. It allows the storage of persistent data while the gadget is powered off or even put away while not playing Retro Gadgets.

## Sizes

FlashMemory modules have a capacity for how much data they can store, and each different chip size has a different capacity:

The small FlashMemory can store 4096 bytes.The medium FlashMemory can store 32768 bytes.The large FlashMemory can store 256000 bytes.
## Properties

read only
**Size** number
Returns the overall capacity of the memory in bytes.

read only
**Usage** number
Returns the amount of data in bytes currently stored.

## Methods

**Save**( table table ) boolean
Saves table into the flash memory. Returns true if saving was successful, false otherwise.

**Load**( ) table
Returns the table stored in the memory.

## Examples

To store data in a FlashMemory, the data must be in the form of a table.

To store a default number value of 100, for example:

```
-- first we check if the flash is empty, meaning there is no data in it yet
-- this way we can store something default only if there isn't already saved data
local value = 100

if gdt.FlashMemory0.Usage == 0 then
    -- we put the value we want to store into a table
    -- constructing the table like so gives it a "value" key
    local data = {
        value = value
    }

    gdt.FlashMemory0:Save(data)
end

```

Once the gadget starts, it will check if there is already data saved in the FlashMemory. If there isn't it'll create a data table with a key value containing the value of 100, and save it.

That same table can then be retrieved from the FlashMemory again:

local data = gdt.FlashMemory0:Load()

```
-- this assumes your data table was given a "value" key
-- otherwise you can index it like any other table by numerical index: data[1]
log(tostring(data.value))

```
Boros

**Boros** é o primeiro principal antagonista em One Punch Man (Ciferulverse), ele é o consquistador de mundo.

## Historia

Depois da vinda do conquistador de universos e destruidor de mundos logo veio parar no planeta terra, Boros que vende um planeta com duras condições de vida, o que deu aos membros de sua raça uma força sem precedentes. Boros subiu entre eles como o melhor, crescendo tão forte que praticamente ninguém conseguiu se igualar a ele. No final ele acabou ficando entediado e decidiu se voltar para conquistar a galactica e criar os Ladrões da Matéria Negra, viajando pelo espaço para encontrar um oponente que pudesse lhe dar a luta que desejava. Durante suas viagens, ele se encontrou com um cartomante que lhe disse que encontraria um oponente muito forte no distante planeta Terra. Depois disso embora os seus companheiros de tripulação desconfiassem da profecia, ele seguiu e depois dos 20 anos eles finalmente chegaram à Terra. A sua nave que ele controla onde que Geryuganshoop o informa de um intruso que invadiu a nave e estava matando suas forças. Boros diz a ele para se juntar a Groribas e Melzargard, mas Geryuganshoop informa que Groribas já foi derrotado. Boros retorna ao seu trono e espera pacientemente pelo intruso. Após a derrota Geryuganshoop, o Saitama finalmente chega em Boros, que o parabeniza e conta sua história, mas Saitama lhe dá um soco, dizendo-lhe que o tédio era uma desculpa estúpida para atacar outros planetas.

Logo em seguida Boros sobrevive aos socos do Saitama que quebra a sua armadura. Ele também afirmou que era apenas um limitador de poder, Boros libera seu poder e os dois guerreiros lutam. Apesar de perder um braço, Boros continua lutando e eventualmente o regenera. Ele então libera sua forma Meteoric Burst, continuamente atacando Saitama e chutando-o com força suficiente para mandá-lo para a lua. Depois disso o Saitama retorna e usa os seus socos normais consecutivos que pulverizam Boros, embora ele se recupere quase imediatamente. Impressionado, Boros lança seu ataque final, o Colapsing Star Roaring Cannon, que era um enorme raio de energia forte o suficiente para destruir todo o planeta. Depois disso o Saitama o contra-ataca com os seus socos sérios o que repele o ataque de Boros eo fere criticamente. Depois disso durante a luta o Boros sem energia, ele elogia o Saitama, dizendo que foi uma boa luta. No entanto, Boros o chama de mentiroso, pois percebe que Saitama estava se segurando e que não era páreo para ele, morrendo pouco depois.
Webcam

**Webcam** is a module in *Retro Gadgets*. It takes video input from a camera connected to the computer.

## Properties

**RenderTarget** VideoChip
The VideoChip this camera is streaming contents to.

read only
**AccessDenied** boolean
Will return true if Camera access is denied. See Permissions for more information.

read only
**IsActive** boolean
Returns true if the Webcam is currently being used.

read only
**IsAvailable** boolean
Returns true if the Webcam is available for being used.

## Methods

**GetRenderBuffer**( ) RenderBuffer
Gets the camera RenderBuffer. The render buffer obtained can then be fed to the DrawRenderBuffer method of the VideoChip module.

## Events

**WebcamIsActiveEvent** : { IsActive boolean, IsAvailable boolean, AccessDenied boolean, Type string }
Triggered when the Webcam's active state changes.

* IsActive is true if the Webcam is being used.
* IsAvailable is true if the Webcam is available for use.
* AccessDenied is true if permissions are disabled for Webcams.
* Type is "WebcamIsActiveEvent".
ROM

**ROM** is a module in *Retro Gadgets*. It provides access to assets through code. These include some built-in assets such as the StandardFont.

Note: Since there can be only have one ROM per gadget, it will not have a number after its name in the gadget's list of modules:

```
gdt.ROM

```

## Properties

ROM contains two main properties, User and System. User gives access to assets added to the gadget through the Multitool, and System accesses the built-in assets. Each one of those two properties have their own tables as such:

read only
**Assets** {Asset}
Returns a table of all assets regardless of type.

read only
**SpriteSheets** {SpriteSheet}
Returns a table of only SpriteSheets.

read only
**Codes** {Code}
Returns a table of only Code assets.

read only
**AudioSamples** {AudioSample}
Returns a table of only AudioSamples.
Knob

**Knob** is a module in *Retro Gadgets*. It's a circular component that rotates from left to right to set numerical values.

Similar to the Slider in functionality.

## Properties

**Value** number
The value returned by the position of the knob, ranging from -100 to 100.

read only
**IsMoving** boolean
Returns true if the user is moving the knob.

## Events

**KnobValueChangeEvent** : { Value number, Type string }
Triggered when a button is pressed or released.

* X is the column of the button that triggered the event.
* Y is the row of the button that triggered the event.
* ButtonDown is true if the button was just pressed.
* ButtonUp is true is the button was just released.
* Type is "KeypadButtonEvent".

## Examples

A simple code using some math to map knob's value into the hue of a LED's color:

```
-- a function that maps "value"
-- from a scale of "src_from" to "src_to"
-- into a scale of "tgt_from" to "tgt_to"
function map(value, src_from, src_to, tgt_from, tgt_to)
    return ((value - src_from) / (src_to - src_from) * (tgt_to - tgt_from)) + tgt_from
end

-- turn LED on at startup
gdt.Led0.State = true

function update()
    -- map slider -100,100 to hue 0,360
    local hue = map(gdt.Knob0.Value, -100, 100, 0, 360)

    -- set LED color to hue
    gdt.Led0.Color = ColorHSV(hue, 100, 100)
end

```