This is the bespoke [[Bytecode Interpreter|Bytecode VM]] used for the 1991 game [[Another World]] (AKA Out of This World).
![[office.gif]]
# Notability
The game [[Another World]] was really visually impressive for its era but the fact that it was written as a [[Bytecode Interpreter]] which was then ported nearly [[#Implementations|every system]] available from the late 80s onward really made it stand out.
# Instruction Set
At its core is a relatively simple 29 bytecode virtual machine that allows 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 within the first 3 years of its initial release.
Fabien Sanglard has done a solid analysis[^6] of the bytecode, architecture[^7], and also ported the engine to even more platforms.
>[!TODO]
> Finish the list.
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! This VM has been ported to nearly every kind of [[Game Console]],[^11] moderately-graphics-capable consumer computer[^10] [[ISA]] and [[Operating System|Operating System]] ever made. I'm not convinced that even this is a comprehensive list.
- [[Amiga]] (launch platform, 1991)
- [[Atari ST]] (launch platform, 1991)
## Ports
- [[3DO]] (1993)
- [[Android]] (2012)
- [[Atari Jaguar]] (2013)
- [[BSD]] (2024) unofficial[^5]
- [[DOS]] (1991)
- Apple
- [[Apple IIgs]] (1991?)
- [[Mac OS Classic]] on [[Macintosh]] II (1991)
- [[iOS]] (2011)
- [[MacOS]] X (2013) 32-bit-only
- GP32 (2005) semi-unofficial[^2]
- [[Linux]] (2014)
- Nintendo
- 3DS (2014)
- [[Gameboy Advance]] (2005) semi-unofficial[^1]
- [[N64]] (2011) unofficial[^9]
- [[SNES]] (1992)
- Switch (2018)
- Wii U (2014)
- [[SCUMM]] (1991?)
- ? Requires testing to confirm that the [[Windows 3.x]] will run in a [[SCUMM]] VM
- Sega
- [[Sega Genesis]] (1993)
- [[Sega CD]] (when?)
- Sony
- [[PlayStation]] 3 (2014)
- [[PlayStation]] Vita (2014)
- [[PlayStation]] 4 (2014) & (2020)
- [[Symbian]] (2005)
- [[Ti-83]]+CE (2022) unofficial[^4]
- [[Web Browser]] (2024) unofficial[^5]
- [[Windows]]
- [[GoG]] (2013)
- [[Steam]] (2013)
- [[Windows 3.x]] (1994)
- [[Windows Mobile]] (2006)
- [[Windows XP]] (2006)[^3]
- [[XBox]]
- XBox One (2020)
## Open Source
There is a series of forks implementing the bytecode interpreter under the [[GPLv2]] license. These are all *wildly* unofficial.
- Gregory Montoir (2011?) (needs source)
- presumably posted on a forum somewhere?
- [[Fabian Sanglard]] (2011)[^8]
- Christopher Bonhage `meek` (2022)[^9]
- Olivier Poncet `ponceto` (2024)[^5]
## FPGA
Yup it's even in hardware.
```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
```
- https://github.com/sylefeb/a5k
# References
[^1]: https://web.archive.org/web/20181113074949/http://www.foxysofts.com/index.php?l=content%2Fgba%2Fanworld.inc
[^2]: https://web.archive.org/web/20161014011652/https://www.distant-earth.co.uk/awgp32/
[^3]: https://www.anotherworld.fr/anotherworld_uk/index.htm
[^4]: https://www.cemetech.net/forum/viewtopic.php?p=300349
[^5]: https://github.com/ponceto/another-world-interpreter/
[^6]: https://fabiensanglard.net/another_world_polygons/index.html
[^7]: https://fabiensanglard.net/anotherWorld_code_review/index.php
[^8]: https://github.com/fabiensanglard/Another-World-Bytecode-Interpreter
[^9]: https://christopherbonhage.com/AnotherWorld-N64/
[^10]: https://www.pcgamingwiki.com/wiki/Another_World
[^11]: https://www.anotherworld.fr/anotherworld_uk/page_versions.htm
[^12]: https://www.gog.com/en/game/another_world_20th_anniversary_edition