afterware
Resources
Saved
Code · experiment

A Flash game ported to an IBM 5150 in CGA

Original

Someone is squeezing a scatological Flash game onto the 1981 IBM PC, and the trick is reprogramming a CGA card's CRT controller on the fly.

Build sheet
Device page
IBM 5150 →
Device
IBM 5150 PC
Display
CGA text mode, 160x86 window
Language
C + assembler
Compiler
Open Watcom V2
Can I build this?Intermediate · AI 3/5 · $100–300
Difficulty
Intermediate
AI-buildability
3/5

AI can write the C and assembler and explain the MC6845 timing, but cycle-exact CRT register tricks need testing on real vintage hardware, and AI knows little about them.

Time
A few weeks
Cost
$100–300
Tools
Open Watcom V2 compilerDOS machine with CGA cardassemblerCRT monitor
Starter prompt

Based on "A Flash game ported to an IBM 5150 in CGA" on Afterware: https://afterware.xyz/p/a-flash-game-ported-to-an-ibm-5150-in-cga

Write a DOS C program using Open Watcom V2 that runs a simple state machine in CGA text mode. Use inline assembler to reprogram the MC6845 CRT controller so the character cell height changes mid-frame, giving a larger pixel window. Target an IBM 5150 with a CGA card and test on several DOS machines.

Estimates based on the original write-up. How AI-buildability is scored. Building with an AI assistant? Connect it to Afterware (free MCP server).

Story

CGA was never built for the fine detail of a 2000s Flash game. TheRasteri got around that by borrowing a trick from the Amstrad CPC demoscene: a few lines of hand-written assembler reprogram the MC6845 CRT controller that sits on the CGA card, changing character height on the fly. The result is the equivalent of a 160 x 86 pixel window in CGA text mode.

The game is written in C with Open Watcom V2, structured as one large state machine. He tests it across a range of DOS machines to shake out the bugs that only show up on certain hardware.

For anyone building for vintage DOS, the MC6845 trick is the part to steal. Changing the character cell height mid-frame turns a text mode into something that looks like graphics, and it works on real iron, not just in an emulator.

Resources · 1
More like this
More like this