Overview

RedPower Control is about using computers in Minecraft, both as devices the player can interact with and as devices that can examine and control the world around them. The computers in RedPower Control do not run a specific programming language; rather, they emulate an actual computer system with CPU and peripherals, and that CPU can be programmed in many different languages. RedPower Control comes with the ability to craft floppy disks that contain a FORTH interpreter (called MineOS) that is included with RedPower, but the computers can be programmed in a number of different languages.

Craftable Components


Notes

The current recipies for the components are temporary. On the Minecraft Forums, Eloraam said, "Computers are tech 3. That's why the recipes are all full of temporary components right now - you need missing tech 2 machines to even make the missing parts. Here's a hint: no wood is involved in building them."

On the Minecraft Forums, Eloraam said, "...RP Control contains not a vanilla 6502..., but an extended variants that contains the instructions of 6502 and 65C02, plus about half the instructions and addressing modes of the 65C816 (including 16 bit mode), in addition to a set of completely new instructions and two addressing modes (which I've labelled the 65EL02, because I like the pun). And yes, it includes a 16x16 single cycle multiply and a 32/16 hardware divide. I'm just odd that way."

On IRC, Eloraam described Control's CPU as "...a 65EL02, it supports all the 6502, 65C02, and part of the 65C816 instruction set."

RP Control Internals

direwolf20's video Mod Spotlight - Red Power 2 PR5 - Computers

Items about Control from Eloraam's Blog: Redpower blog

Programming Languages

Although FORTH is the default language because it is the only language with a built-in interpreter in RedPower Control, the 65EL02 is a genuine CPU and is quite capable of running code written in other languages. Language tools (such as compilers) targeting the original 6502 series may or may not work, both due to differences between the 65EL02 and the original CPUs and due to the fact that the RedPower Control peripherals do not work the same way as real-world hardware used on computers of that era. Languages that clearly divide responsibilities between language and standard library may be able to accommodate the second problem by discarding the standard library but keeping the language tools.

FORTH

FORTH is the “default language” most people use to program RedPower Control computers. This is because RedPower Control includes a built-in FORTH interpreter, called MineOS, which can be accessed by crafting an ordinary blank floppy disk with a piece of redstone dust, then booting the resulting disk. Crafting the FORTH boot disk with a second piece of redstone dust gives an extended FORTH boot disk, a variant of the interpreter with more built-in functionality but which requires more RAM to run.

A screenshot of the FORTH interpreter being used, early in its life:
The output of WORDS, followed by writing Hello World.
The output of WORDS, followed by writing Hello World.

Listed below are a number of resources of interest to FORTH programmers. You will also want to look at the pages for the individual craftable components, listed above.

A Beginners Guide to Forth

FORTH Basics

Other Forth tutorials

Starting FORTH has been recommended for those unfamiliar with the language.
First demonstration of the Forth interpreter:

Forth Dictionary

Forth Dictionary

Forth Boot Disk

This Python 3.2 script can be used to decompile the Forth boot disk image. It should work with MineOS 1.1. Note that the disassembler doesn't know all the instructions.


Similar to above python script, but based on Java and capable of dumping both disk images and binary files. Still in an early stage, but functionality will increase over time.
RPC/8 Tool
(v0.3alpha, compatible with MineOS 1.0 and up)

Useful programs

Library of useful functions
Small utility programs
Direct interpretation from disk for MineOS 1.0 or later

Assembly Language

Assembly language is quite readily usable to program the 65EL02, though if you are playing in multiplayer you will need a way to get your assembled code onto the server (RedPower does not include a built-in way to transfer 65EL02 code from client to server, so you will need the server admin’s assistance to set this up). Assembly language programmers will want to look at the 65EL02 technical documentation for information.

BASIC

BASIC, standing for Beginners’ All-Purpose Symbolic Instruction Code, is a fairly easy language to get started with and was often provided by the BIOS of many old computers (“ROM BASIC”). Interpreters were also included in many older operating systems, and some BASIC compilers have existed too. For RedPower Control, a porting attempt has brought Microsoft Basic 6502 to RedPower.

Tools and Extensions

This page contains links to tools and extensions to be used with Control.