TempMail Ninja
//

DOS Solitaire Game Fits in QR Code and Runs Natively

7 min read
TempMail Ninja
DOS Solitaire Game Fits in QR Code and Runs Natively

In an era dominated by bloated multi-gigabyte video game installations, shader compilation stutters, and continuous background runtime dependencies, retrocomputing developer ClassicBits has produced a masterclass in low-level software precision. The project, known as TinySol, is a fully playable, feature-complete DOS Solitaire Game compiled down to an extraordinary physical footprint of just under 3 kilobytes (3 KB). Because the entire compiled executable binary occupies less storage than a single uncompressed low-resolution thumbnail image on the modern web, the application can be encoded in its entirety into a single high-density QR code. This enables users to scan a printed optical matrix off a paper document or floppy disk sleeve and immediately load a functioning game binary directly onto legacy x86 computer hardware.

Originally showcased across retro-tech communities, Hacker News, technical forums, and publications such as Hackaday, TinySol serves as both a functional software restoration effort and a striking demonstration of low-level x86 assembly programming. By operating directly on bare-metal hardware running MS-DOS, the program bypasses modern software abstraction layers, delivering a classic Klondike Solitaire experience that runs on systems ranging from original 1981 IBM PC 5150 models equipped with an 8088 CPU and 64 KB of RAM up to Pentium-era workstations.

Engineering TinySol: Pure x86 Assembly Without Runtime Crutches

The core philosophy driving TinySol is absolute bare-metal optimization. Unlike modern applications built using heavy cross-platform game engines or high-level interpreted languages, TinySol was written purely in hand-crafted 16-bit x86 Assembly and compiled using the Netwide Assembler (NASM). The author explicitly refrained from using automated code generators, AI-assisted synthesis tools, or third-party executable compression frameworks like UPX. The developer noted that for binary files under a few kilobytes, executable compression overhead often adds overhead rather than reducing storage footprint, while simultaneously introducing unnecessary CPU decompression steps at launch.

By writing pure assembly, every CPU register—including AX, BX, CX, DX, SI, and DI—is manually assigned to handle specific memory operations, state evaluations, and video interrupt routines. This hyper-efficient memory usage ensures that the application executes instantly without requiring external dynamic link libraries (DLLs), runtime runtimes, or dedicated graphics asset files.

To accommodate different operational constraints and hardware capabilities, the developer created a modular tier of build variants, balancing functionality against raw binary storage size:

  • Full Edition (~3.5 KB): Incorporates complete mouse driver support (compatible with Microsoft Mouse driver v6 standards), full game state save/load capabilities to disk, built-in undo/savestate memory, scoring, auto-finish automation, and hardware auto-detection.
  • Medium / Standard Edition (~3.0 KB): The primary release target optimized for optical QR code distribution. Retains full Klondike game logic, keyboard navigation, automatic video mode detection, F1–F4 live video mode switching, scoring, savestate undo functionality, and win state animations, while dropping mouse driver routines and file I/O operations.
  • Mini LoRez Edition (~2.2 KB): A stripped-down variant engineered strictly for low-resolution displays, designed specifically to fit on compact print media like 5.25-inch floppy disk sleeve labels.

Graphics Without Assets: Video Interrupts and Display Architecture

One of the most complex challenges in writing a tiny DOS Solitaire Game lies in rendering playing cards, tableau layouts, suit symbols, and text without relying on external bitmap image files. In modern game development, visual assets account for the vast majority of installation footprints. In TinySol, all playing card outlines, suit markers, numerical glyphs, and borders are rendered programmatically on the fly using raw BIOS video interrupts and direct memory writes to video RAM.

The program incorporates built-in hardware detection logic to identify the host system’s installed display adapter upon launch. It interfaces directly with BIOS Interrupt 10h (INT 10h) to initialize and manipulate low-level video modes. TinySol natively supports four legacy video display standards, giving users the ability to manually cycle between modes in real time using the function keys:

  • CGA Standard (INT 10h Mode 06h – F1 Key): Renders at 640×200 resolution in 2-color monochrome graphics. Optimized for early IBM PC color/graphics monitors and legacy composite setups.
  • AT&T 6300 / GRiD Gas-Plasma (INT 10h Mode 40h – F2 Key): Operates at 640×400 resolution in high-contrast 2-color monochrome mode. Specially programmed to support unique gas-plasma flat-panel displays found on vintage portable luggables like the GRiDCase 1500 series.
  • EGA Standard (INT 10h Mode 10h – F3 Key): Displays at 640×350 resolution with full 16-color palette support, providing distinct green felt background representation and crisp card detail.
  • VGA Standard (INT 10h Mode 12h – F4 Key): Operates at 640×480 resolution in 16-color high-resolution mode, delivering clean line rendering and smooth visual feedback.

During runtime, pressing any of the assigned hotkeys (F1 through F4) invokes an instant re-initialization of the video buffer, dynamically scaling card spacing, border thickness, and font rendering parameters to match the newly active display resolution without crashing or corrupting active game memory state.

Implementing Gameplay, Scoring, and State Logic Under Memory Constraints

Fitting standard Klondike Solitaire rules into a 3 KB binary requires severe algorithmic discipline. The standard game requires tracking a 52-card randomized deck across seven tableau columns, four foundation piles (one per suit), a waste pile, and a stock draw deck. TinySol implements full Klondike mechanics, including 3-card draw cycles, suit alternation validation (red card on black card in descending order), and foundation build orders (ascending order starting from Ace to King).

To keep code size minimal while preserving standard user expectations, the game includes several sophisticated automation routines:

  • Scoring Engine: Replicates traditional Microsoft-style scoring mechanics without introducing continuous timer overhead interrupts, calculating points awarded for moves from waste to tableau, waste to foundation, and turning over face-down cards.
  • Auto-Finish System: Continuously monitors the state of all tableau piles. Once all face-down cards have been turned face-up and the stock deck is depleted, the assembly routine automatically detects that the board is solved and executes an automated cascade sequence moving remaining cards to the foundations.
  • In-Memory Savestate & Undo: Dedicated memory bytes track move operations, allowing full single-step or multi-step state restoration so players can reverse accidental card movements.
  • Input Compatibility: Full keyboard navigation allows movement via directional keys, enabling precise control on early systems like the IBM PC 5150 where optical or serial mice were rarely connected.

Extensive validation on real vintage hardware confirmed complete stability across decades of x86 system revisions. Real-world tests were documented on authentic machines, including an original 1981 IBM PC 5150 running MS-DOS 3.30 on an 8088 processor, a GRiDCase 1520 laptop with a 286 CPU running FreeDOS, a Zenith Heathkit Z-110 operating with 256 KB RAM, and high-speed Pentium 233 MHz systems running MS-DOS 6.22.

Optical Software Distribution: Loading a DOS Solitaire Game from a QR Code

Beyond its low-level software architecture, TinySol made waves in the retrocomputing community due to its physical and optical delivery mechanism. At the Vintage Computer Festival Southwest (VCFSW) 2026, the developer premiered the game in physical form. In addition to distributing physical 5.25-inch and 3.5-inch floppy diskettes accompanied by user manuals printed on vintage blue-bar tractor-feed paper using a Panasonic KX-P1624 dot-matrix printer, the developer leveraged the binary’s tiny size to enable optical distribution.

High-density QR codes (such as Version 40 matrix codes) can store up to 2,953 bytes of uncompressed raw binary data. Because the TinySol binary fits squarely within this boundary, the executable COM file was encoded directly into a printed 2D matrix printed directly onto paper floppy disk sleeves.

This optical delivery pipeline operates as follows:

  1. Optical Scan: A modern smartphone, webcam, or optical scanner reads the high-density QR code printed on paper or a card stock disk sleeve.
  2. Binary Extraction: The scanning utility decodes the raw payload into a standard 16-bit executable file (e.g., TINYSOL.COM) without requiring network access or external repository downloads.
  3. Transfer & Execution: The extracted binary is transferred to a legacy system via serial connection, FloppyDrive emulation, or SD-card adapter (such as a Gotek or XT-IDE drive interface) and executed instantly at the DOS prompt.

Demonstrated in video breakdowns by retro-computing historians and creators like LGR (Lazy Game Reviews), this workflow bridges 1980s computer hardware with modern optical data storage, turning physical paper sleeves into standalone software distribution media.

The Enduring Philosophy of Bare-Metal Precision

In modern software engineering, optimization is frequently sacrificed in favor of rapid iteration, abstraction, and bloated library frameworks. Projects like TinySol remind the developer community of what can be accomplished when software is built with total awareness of hardware architecture. By packing dynamic video interrupt routines, full Klondike Solitaire rules, input handlers, auto-finish solvers, and customizable scoring into less than 3,000 bytes, ClassicBits demonstrates that elegance in code is defined not by how much features can be added, but by how much excess can be stripped away without losing functional capability.

Whether scanned off a sheet of dot-matrix tractor-feed paper or booted from a 360 KB 5.25-inch magnetic diskette, TinySol stands as an impressive achievement in digital archaeology, retrocomputing craftsmanship, and assembly language engineering.

TN

Written by

TempMail Ninja

Digital privacy and online security expert. Passionate about creating tools that protect users' identity on the internet.