This is the bespoke VM used for the game Another World (AKA Out of This World).
![[office.gif]]
# Notability
Another World is a classic 1991 adventure side-scroller with stunning polygonal real-time rendered visuals that was ported to run on nearly every common system available from the late 80s onward.
At its core was a relatively simple 29 bytecode virtual machine that allowed it to be tightly focused, portable, performant, and require only standard data media for the era such as a single 1.44MB floppy. It was available on 7 platforms across 4 different architectures in the first 3 years of its initial release.
Fabien Sanglard has done a solid [analysis](https://fabiensanglard.net/another_world_polygons/index.html) of the bytecode, [architecture](https://fabiensanglard.net/anotherWorld_code_review/index.php), and also ported the engine to even more platforms.
On GoG the version sold there includes design notes and interviews with the creator.
The look of this game has always impressed me and stuck with me since I first saw it as a kid, even though I don't find the gameplay interesting, the story and visuals are very compelling.
# Instruction Set
The instruction set is a standard 8-bit bytecode format.
| | 0x00 | 0x01 | 0x02 | 0x03 | 0x04 | 0x05 | 0x06 | 0x07 | 0x08 | 0x09 | 0x0A | 0x0B | 0x0C | 0x0D | 0x0E | 0x0F |
| ---- | ---------------------- | ------------ | ------------ | ---- | ---- | ---- | ------------- | ----------- | ------------- | ------------ | ------------- | ---------- | ------------- | ---------- | ---------- | ---------- |
| 0x00 | CMOV | MOV | ADD | CADD | CALL | RET | PAUSE<br>THRD | COND<br>JMP | SET<br>VECT | JNZ | CJMP | SET<br>PAL | RESET<br>THRD | SLCT<br>FB | FILL<br>FB | COPY<br>FB |
| 0x10 | BLIT<br>FB | KILL<br>THRD | DRAW<br>TEXT | SUB | AND | OR | SHL | SHR | PLAY<br>SOUND | LOAD<br>RESC | PLAY<br>MUSIC | | | | | |
| 0x20 | | | | | | | | | | | | | | | | |
| 0x30 | | | | | | | | | | | | | | | | |
| 0x40 | DRAW\_POLY\_SPRITE | | | | | | | | | | | | | | | |
| 0x50 | | | | | | | | | | | | | | | | |
| 0x60 | | | | | | | | | | | | | | | | |
| 0x70 | | | | | | | | | | | | | | | | |
| 0x80 | DRAW\_POLY\_BACKGROUND | | | | | | | | | | | | | | | |
| 0x90 | | | | | | | | | | | | | | | | |
| 0xA0 | | | | | | | | | | | | | | | | |
| 0xB0 | | | | | | | | | | | | | | | | |
| 0xC0 | | | | | | | | | | | | | | | | |
| 0xD0 | | | | | | | | | | | | | | | | |
| 0xE0 | | | | | | | | | | | | | | | | |
| 0xF0 | | | | | | | | | | | | | | | | |
`DRAW_POLY_SPRITE` and `DRAW_POLY_BACKGROUND` are indicated by the leading bits `01...` and `1...` respectively, with the subsequent 4 or 5 bits being used directly as arguments.
# Implementations
Many for nearly every hardware available.
## FPGA
```cardlink
url: https://boingboing.net/2023/07/19/classic-game-another-world-implemented-as-hardware.html
title: "Classic game Another World implemented as hardware | Boing Boing"
description: "Another World (Out of This World in the U.S.) is a true classic, a title not only loved for its outstanding design, art and gameplay but studied in exhaustive detail because of its excellent implem…"
host: boingboing.net
favicon: /wp-content/uploads/fbrfg/favicon-32x32.png
image: https://i0.wp.com/boingboing.net/wp-content/uploads/2023/07/image-96.png?fit=902%2C632&ssl=1
```
# References
- https://www.anotherworld.fr/anotherworld_uk/