Retrolang, A Programming Language for PlayStation 1

Enthusiasts of development for the classic Sony PlayStation game console may be interested in Retrolang — a new SDK and its eponymous programming language, developed entirely from scratch with no dependencies on third-party software. The toolkit includes a compiler that targets the MIPS R3000 CPU architecture, an assembler, a disassembler, a build automation system, a small standard library, and a collection of demonstrations—including a 2D platformer engine and a 3D graphics demo.

A key feature of the project is its complete legal integrity. The SDK was developed entirely independently, without the use of disassembled code, and contains no copyrighted material. Retrolang aims to replace outdated—and often proprietary—utilities with modern, open-source alternatives. The project is fundamentally self-contained; the only external software used is mkpsxiso, which is employed for creating disc images.

Retrolang platformer demo

From the developer:

"I began exploring the PlayStation in the early 2010s. It started when I learned how to compile programs using the leaked, legacy official SDK known as PsyQ, which uses the C89 standard. Most of the console's hit titles were created using this very tool. Despite being ancient software—dating back to the Windows 95 era—it is actually quite convenient to work with. However, it didn't feel right to rely on pirated software, even if it has long since been abandoned. Furthermore, PsyQ is closed-source, making it impossible to modify. That is why I set out to write my own graphics library, PSXLib. Things started moving forward; I delved quite deeply into the details at the assembly-language level. However, I wasn’t satisfied with any of the existing assemblers for the console, so I decided to build my own—which I named "Retrolang"—while simultaneously studying the MIPS-I architecture and the PlayStation boot protocol in great detail. Later, in 2026, I expanded this tool into a compiler and adapted PSXLib for it, enhancing and extending the library (now renamed "Retrolib"). At the same time, I added several utility tools to the SDK, which are necessary for preparing assets for PlayStation games".

Retrolang can be described as "ANSI C from a parallel universe." It is a simple, C-like procedural language specifically designed for programs that must operate under extremely limited memory constraints. It supports basic integer types and pointers to them. The language includes type casting, static arrays, strings, and structures. All standard arithmetic, logical, and bitwise operators, as well as control-flow constructs, are implemented. The language features weak typing—a deliberate design choice, as the language serves as a very thin semantic layer over the underlying machine logic. Types that are binary-compatible are implicitly convertible to one another; this applies to all pointers, as well as to the conversion between pointers and 32-bit integers. Memory access is unrestricted, and there are no access specifiers (such as const).

Unlike C, Retrolang exposes certain low-level PlayStation capabilities through intrinsics—built-in compiler instructions that expand into specific blocks of machine code rather than standard function calls. This allows for the use of BIOS functions and GTE (Geometry Transformation Engine) commands without the need to write parts of the program in assembly language. The language, nevertheless, includes a fully functional inline MIPS-I assembler.

The SDK provides a system library called Retrolib, which simplifies interaction with the hardware:

  • GPU operations and 2D/3D graphics rendering, either directly or via command buffers and the DMA;
  • Reading TIM files and loading them into video memory;
  • Gamepad input handling;
  • BIOS interaction, including custom interrupt handlers setup;
  • CD-ROM operations;
  • Memory card management;
  • CD Audio and XA audio playback;
  • STR video playback;
  • SEQ music playback.

The SDK includes the following programs:

  • RLC — the Retrolang compiler, which also functions as an assembler and linker;
  • Retrobuild — a build automation system;
  • PSXDISASM — a disassembler for MIPS-I binaries;
  • PNG2TIM — PNG to TIM format converter;
  • WAV2VAG — PCM WAV audio to VAG format converter;
  • XA Tool — XA streams encoder/interleaver;
  • SEQ Tool — a program for converting MIDI and MOD music to SEQ format;
  • DATWrite — a tool for generating a system-area patch for disc images, used to insert licensing information. It includes an add-on exporter for Blender, allowing users to create a custom TMD logo model for a game's boot screen;
  • GPSXEmu — a PlayStation emulator in the early stages of development.

Project repository: https://github.com/gecko0307/retrolang

Copyright © 2008-2026 The FPS Team and co-authors. Available under СС BY-NC-SA 3.0. When copying, a link to the source is required. Russian version