Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

FactorioCpu

Working computer with its own architecture and programming language in Factorio game

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

FactorioCpu 💻⚙️

A functional computer built from combinators in the game Factorio, based on the von Neumann architecture, with support for the high-level programming language FPAS.

🇷🇺 Русская версия

What is this?

A minimalist computer supporting 26 different instructions, program storage for 1200 instructions, and RAM for 100 32-bit integer numbers. It allows writing programs in both assembly and a high-level language. And all of this runs on a circuit made of combinators within the game Factorio.

In addition to the computer itself, two peripheral devices are implemented – a screen and a joystick – enabling the creation of even more interesting programs.

Scheme in game

What can it do?

It is capable of everything from trivial number addition programs to full-fledged games like the famous "Snake". Before running in Factorio, you have the opportunity to debug your program in the emulator. Its main limitation is a speed of 1.5 instructions per second, but there are two ways to work around this.

I want to start using it!

Program Samples

How does it work?

It is based on the famous von Neumann architecture, implemented using 501 decider combinators, 281 arithmetic combinators, and 97 constant combinators.

The components include: ROM, instruction decoder, dual-bus system, registers, ALU, RAM, and an I/O device (the Factorio circuit network).

Additionally, using combinators and lamps, two peripheral devices are implemented: a screen and a joystick, which are connected to the computer via the I/O device.

The necessary software tools include an assembler, an FPAS compiler, and the FactorioCpu emulator (hereafter FCPU).

I want to learn more!

Internal scheme