Kromi One

@kromi.one

A new home computer in the spirit of the Amiga: its own FPGA chipset and its own simple, extendable OS, KromiOS. For games, work and enthusiasts. Built by Sergej in Germany. Devlog and newsletter: kromi.one

KromiOS's Studio reads your Lua as you write it: type the name of a table you made yourself, add a dot, and it offers that table's own fields and functions, however you gave them to it.

Screenshot of KromiOS at 1920 × 1080: Studio with a short Lua file, Ball.lua, in which a table called ball gets its fields from its constructor, from an assignment and from two functions. On the last line, ball. has just been typed, and a list offers x, y, speed and colour as fields and move and reset as functions, with the help line: A field of ball, set in this file.

Two players, two keyboards: a program on Kromi One can now tell which keyboard or mouse each key press and movement came from. Tested on the board with Sergej's own keyboard and mouse: 434 key presses and 806 mouse moves, every one put down to the right device.

Revision 20 of KROM, released 13 October: the network for programs, 700 to 780 Mbit/s out; which keyboard, 434 keys and 806 mouse moves each named to the right device; at the board, a small Pong typed into KromiOS's Studio, not one input lost.

Unplugging a keyboard a hundred times by hand is no fun, so Kromi One's firmware does it itself: it switches the USB port's power off and on and times each return. 100 of 100 came back, the slowest after 0.42 s. #FPGA #retrocomputing

How a key press travels on Kromi One: keyboard or mouse, the board's hub, the firmware KROM, then KromiOS or a game. Below: 7 µs or less for half of all input events, 33 µs for the slowest, 100 of 100 plug cycles.

KromiOS is on the network: it gets an address by itself, answers pings and moves data over TCP in both directions, each side checking every byte. On the real board it has just got its first address from our home router. #KromiOS

KromiOS now picks up where you left off: after a restart your windows come back where they were. And the menu bar has a clock, with your time zone and summer time kept on the card.

Programs on Kromi One can now hand our chipset 8-bit (256-colour palette) and 16-bit images, and it draws them directly. For Kromylist, our port of a tactics game, that should cut a battle's art from 100–170 MiB to about 20–31 MiB, by the port's own estimate.

Our OS found a bug in our firmware. KromiOS's file system noticed that a write to the SD card only finished while the program kept calling KROM; KROM's own tests waited a different way and never saw it. Fixed the same morning, and checked on the board: 256 MiB written, read back intact.

#ScreenshotSaturday: Kromylist, our Duelyst port for Kromi One, now plays all six starter decks. 5,800 games against the original JavaScript game: every move identical. It also runs on the real board, 95–98 % of battle frames at 60 fps. Pictures: Kromi One emulator. Art: Duelyst (CC0)

Five battles from the card game Kromylist in a grid, one per starter deck: Lyonar against Abyssian on a blue battlefield, Songhai by a green lake, Vetruvian, Magmar on orange sand, Vanar on dark water, each with units, health numbers and the hand of cards along the bottom. A dark panel reads: Kromylist, all six starter decks, 21 pairings, 5,800 games: every move identical. Pictures from the Kromi One emulator. Art: Duelyst (CC0).

Sergej typed the whole US keyboard into KromiOS on the real board, row by row, with Shift and accented letters. 323 key events: none lost, none out of order. 99 % reached KromiOS within 22 ms of KROM taking them from the keyboard. #KromiOS #FPGA

On the board, KromiOS live: every key arrived, 323 key events typed by hand with none lost, and a keyboard with a hub inside now comes up at every start. Ctrl+Alt+Esc fixed on the board.

Every frame Kromi One's chipset draws is checked: the display computes a checksum of each frame it sends to the monitor, and we compare it with our reference renderer. In the triangles run on the board, 1,799 frames, half a minute of picture, were checked: none different, none late. #FPGA

20,160 triangles, 60 Hz, 9.9 ms engine time, 1.27 ms of KROM's time per frame.

Press Ctrl+Alt+F12 on Kromi One and a panel appears over any program: temperatures, fan, power, CPU load, memory, FPS. The chipset draws it as the picture goes out, so a game doesn't lose a frame: on the board, the frame checksum is the same with the panel on or off. Art: Kenney (CC0)

A 2D platformer in a sunny desert at 1920 × 1080: a round yellow character in a space helmet jumps between coins, with a bee and a purple snail nearby. In the top right, a grey developer panel lists the chip build, temperatures, fan at 10 %, the load of four CPU cores, memory, 60.0 frames per second with the 2D engine 17 % busy and no underflows, the SD card, the DisplayPort link and the module's power of about 5.2 W. Drawn the way Kromi One's chipset draws it. Characters: Kenney (CC0).

The first time Sergej ran his Pong on the real machine, it didn't start. KromiOS refused because the game used a part of the system it hadn't declared. One missing line in the game's app file fixed it. Not a bug: KromiOS's permissions doing exactly what they're for. #KromiOS

This screenshot was taken by KromiOS itself: Print Screen now saves the whole screen as a PNG on the card. KromiOS writes the file with its own code, about 100 KB for a full-HD desktop, spread over a few frames so the desktop never stalls. So far in the emulator. #KromiOS

Screenshot of KromiOS at 1920 × 1080, taken by KromiOS itself: the Terminal lists the files in Home: on the card, writes a line into Home:Session.txt and reads it back.

KromiOS's Studio now colours your code by what each word means: keywords, functions, fields, Lua's own library, your parameters in their own colour, and globals underlined with dots. And while you type, it offers names, your own variables and Lua's functions, as today's editors do.

Screenshot of KromiOS at 1920 × 1080: Studio with ten lines of plain Lua, a score counter. Keywords, numbers, a function's parameter, the fields score.points and score.best, and the globals add and total, each with a dotted line, are in their own colours. On a new line, to has just been typed, and a list offers total (a global of this file) and Lua's tonumber and tostring, with a line of help: A global, never made local in this file.

A test that proved nothing: after a power cut, KromiOS replays the journal NetBSD leaves on the card. The first test passed, but NetBSD writes a moment after each journal entry, so the cut never hit the gap. With a slower virtual card it did: 511 blocks replayed, the same as NetBSD's own replay.

Tomorrow on the devlog: KromiOS on the real machine. It hands the whole machine to a program and takes it back, a hundred times in a row, and the display's own frame checksums caught a bug no emulator could show. #KromiOS #FPGA

KromiOS's desktop on a monitor connected to the Kromi One prototype.

We switched on our own computer. The board lights up, our firmware starts from flash, picks a game from the SD card, and our own chip draws every picture. No PC, no console, no GPU. Filmed on our prototype board. Full session: https://youtu.be/ZUVw6epM-DE

Pull the card out while KromiOS is saving, and it asks: "Please put back the card", with what's waiting and which app asked. Put it back and the save carries on, like an Amiga asking for its floppy. We pulled it at 135 points across whole saves: nothing was ever left broken. #Amiga #KromiOS

Screenshot of KromiOS at 1920 × 1080: Studio is saving a small Lua file to Home: when the card is taken out. KromiOS asks: Please put back the card. Studio's save waits for the card, nothing is lost, and when the card is back the save goes on by itself. Waiting: Home:Projects/Days.lua, Studio, saving. Behind the dialog, dimmed, the file's few lines of Lua, coloured by what each word means.

KromiOS now remembers your settings on the card: theme, keyboard layout and sounds come back after a restart. A change is saved a few seconds later, and a damaged settings file is left alone, with one note to say so.

Screenshot of KromiOS at 1920 × 1080, light theme: Settings, the Appearance page (the sidebar lists Appearance, Apps, Sound and Time), with Theme (Light, Dark) and Highlighting (On, Off), and under them the line: Kept on Home:, also when KromiOS starts again. The card's Home and Disk 1 volumes are on the desktop.

Small win overnight: Kromylist, our card battler for Kromi One, passed its first full check on the real hardware. Five recorded games, 103,813 frames, every pixel identical to the reference, every move the same. Battles hold 60 frames a second for 90–95 % of frames.

KSound 1.0 is done: Kromi One's sound engine mixes 16 voices on a processor core of its own. On the real board it played our piece 18 times in a row, bit for bit, no dropouts, under full 1080p graphics. And this morning we heard it through the monitor's speakers.

Switch Kromi One on, and about two seconds later our firmware shows what's on the SD card: KromiOS, a test program, Kromylist. Choose with the arrow keys, press Enter; when a program ends, you're back at the menu. KromiOS shows its first picture 255 ms after you pick it.

Pixel-exact picture of KROM's start screen on Kromi One, 1920 × 1080: the KROM logo, Choose a program, and a list of three: KromiOS (system), KromTest and Kromylist (direct), each marked not signed; Up and Down to choose, Enter to start.

Sound on: Kromi One's own sound engine, KSound, plays its first music: up to 16 voices mixed live in 48 kHz stereo, on a real-time core of its own. Every sound is synthesised from scratch, no samples. This clip is from our emulator, sample-exact; the listening test on the board comes next.

Palettes are back. Kromi One's chipset now draws 8-bit pictures through a 256-colour table, like classic machines: switch the table and the colours move, without touching the image. Palette cycling! On the real machine every frame matched to the pixel: 30 s at 60 frames a second. #pixelart #Amiga

Pixel-exact frame, identical to what Kromi One's chipset draws on the real machine: rainbow rings fill the whole 1920 × 1080 frame, an 8-bit picture whose every pixel is a colour number, drawn through a 256-colour table. In front, a 16-bit sunset over hills, a 16-bit rainbow strip and small glowing balls. Programmer art from a chipset test.