hn.today

"Not Conio but Compatible" Adapter for Atari ST Vbcc

retrogamecoders.com3 points0 comments
Screenshot of "Not Conio but Compatible" Adapter for Atari ST Vbcc

This explains a portable "Not Conio But Compatible" adapter that draws a roguelike on Atari ST by emitting VT52 escape sequences to the TOS console via GEMDOS instead of poking screen memory. It details the VT52 command set used (clear/home, cursor positioning with ESC Y plus row+32/col+32, foreground/background colour with ESC b/ESC c, cursor control, clear-to-end-of-line), and shows using Cconout for output and Cnecin/Cconis for input. The write path maps symbolic glyph IDs to ASCII characters, moves the cursor, sets colour, and prints the glyph with a handful of Cconout calls. Keyboard handling inspects the high-word scan code for arrow keys and ASCII for letters, WASD, space, return and escape. Palette handling is addressed via XBIOS Setcolor to force a black background and white text on init, and restore defaults on shutdown.

Technical rationale and trade-offs are explained: direct screen writes are possible but inconvenient because ST screens are bitmaps with model-dependent bitplane layouts and boot-time screen addresses (Logbase), so VT52 lets the OS handle fonts and bitplane arithmetic. Performance is slower than raw blitting but fast enough for a turn-based roguelike even on non-blitter 520 STs; timing uses Vsync and randomness uses XBIOS RNG seeded into a small xorshift. The adapter is implemented in plat_atarist.c, complements an Amiga adapter, and enables porting the retro-C game to any vbcc target with a console; a ready-to-run EmuTOS preset is provided for quick testing in-browser.

Read on retrogamecoders.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.