Home

Awesome

craftos2-plugins

This repository contains a number of small plugins for CraftOS-PC. These were previously in separate Gists, but were moved here to consolidate them into one repository as well as to provide built versions.

You can download pre-built versions of these plugins for Windows in x64-windows.

ccemux

The CCEmuX plugin as included with CraftOS-PC. This repo will only contain a mirror of the original file in the CraftOS-PC repo.

computronics-tape

Emulates the Computronics tape drive, including DFPWM audio playback.

Installation

Just drop the plugin file into plugins.

API

The peripheral constructor accepts two optional arguments: a path to a file to save/load the tape to/from, and the size of the tape in megabytes (decimals accepted). If no file is specified, the tape data will only be present in memory. The size must be at least 64 kB and less than 16 MB; sizes are rounded down to the nearest 64 kB block (so 200 kB is rounded to 192 kB). Size defaults to 1 MB.

See the Computronics wiki for more information on the peripheral's methods.

discord

Discord Rich Presence for CraftOS-PC.

Installation

Drop the plugin file into the plugins directory. In addition, download the Discord GameSDK, and copy these files depending on your OS:

Usage

Just launch CraftOS-PC, and rich presence will automatically enable. If you use cash, you'll need to run rom/autorun/discord.lua to enable it.

glasses

Adds the Plethora and Advanced Peripherals AR Glasses/Goggles, allowing vector graphics in a separate window.

Current status:

Installation

Drop the glasses.dll plugin file into plugins, and add the rest of the libraries to the application directory or next to the plugin.

API

See the Plethora and Advanced Peripherals documentation.

joystick

Adds the ability to use joysticks and gamepads with CraftOS-PC.

Installation

Just drop the plugin file into plugins.

API

To use a joystick, call joystick.open(id). This will return a new joystick handle, and enables event reporting for the selected joystick.

Joystick handle

Events

periphemu_lua

Allows you to register custom peripherals that call back to Lua functions.

Installation

Just drop the plugin file into plugins.

API

The periphemu_lua API contains a single function create to register a peripheral type. It takes the name of the peripheral (string), and a table with all of the methods of the peripheral. Each method takes a self argument in the beginning, which is an empty table that is unique to each peripheral instance, and can be used to store state for that peripheral.

A __new method may be added, which is called when the peripheral is attached, and takes self, the side of the peripheral, the type, and any arguments passed to periphemu.create. This can be used to set up the state of the peripheral before use.

While creating a peripheral registers it for all computers, it will not be usable on computers that have not called create first. In addition, registered peripherals may not be removed later, but their methods can be modified at any time by calling create again.

sound

Adds a number of programmable sound channels (default 4) that play sound waves with the specified frequency, wave type, volume, and pan position.

Installation

Just drop the plugin file into plugins.

Configuration

API

The sound API contains all the functions required to operate the sound generator.