Fantasies

2021-03-03

Consoles

I have always been mesmerized by fantasy consoles like PICO-8 [1] or TIC-80 [2]. They include the low-end constraints of game consoles from the eighties with high-level languages such as lua and current computer performance. People have been very creative to go over those limits, as far as creating a stunning Doom port [3]. I myself spent time fiddling with the concept. First by writing a half-baked "player" for PICO-8 cartridges to run on a cheap retro-gaming (RS-97) that features a MIPS cpu. It still requires quite a bit of work because Lexilaffle had the interesting idea of modifying key aspects of the lua interpreter to secure their assets.

[1] PICO-8

[2] TIC-80

[3] Doom on PICO-8

Terminal

Gemini is sort of a fantasy protocol. Even though it addresses some of the core problems of the web as we know it, its shortcomings, such as the impossibility to build "apps" or its denial of the social web, make it look like a nostalgic artefact from the past. For some reason I love the aesthetics of such artifacts.

Before discovering Gemini, I though a lot about fantasy computers and, I developed my own idea of the concept. First, unlike consoles that have graphics, it has to be an ASCII terminal. I love ASCII/ANSI art, and I deeply regret being born too late to enjoy the golden age of BBS. So I plan on recreating a modern days Bulletin Board System with ASCII graphics.

I have hacked a few iterations before. One used TCC [4] to compile C code "scripts" with an API giving access to a 80x25 CP437 [5] character screen displayed through SDL. Later, I explored ASCII roguelike development and made all sorts of hacks including a micropython framework which can render colorized bi-tone tiles such as ASCII characters.

[4] TCC

[5] Codepage 437

[6] Pyrogue

Design

This is a short design document for the BBS fantasy computer.

- It will use a 8x8 font with two 256 character banks

- The second bank will be customizable

- text/plain

- text/bbs: a gemini-like / markdown-like format with support for coloring / styling

- application/bbs: scripts that execute client side and can change

- print(x, y, text, fg, bg): show text

- peek(x, y): get char, fg, bg at given spot

- poke(x, y, c, fg, bg): set character at given location

- canvas primitives: rect / line / circle / polygon / paint?

- on_key(key, scancode, action, modifiers): key pressed

- on_char(char, modifiers): character pressed / composed

- on_mouse(x, y, button, action, modifiers): mouse moved or clicked

- on_render(time): called 60 times per second to draw the content of the terminal

- navigate(url): change url of current page

- require(url): load remote module

- fetch(url): get data from same server (status, content-type, data)

- bank(num): change character bank

- load_bank(url): load font from url

- interaction primitives: input / alert / confirm ?

- theme(color): change URL/status bar main color

- UI elements? add_link(x, y, text, url, fg, bg): simple way of adding a link

An implementation is pending, but it would be interesting to see if it can be built to run natively and in a web browser.