QR Code on vintage systems

I was trying to see if I could use regular 7-bit ASCII to depict a QR code at either 40x25 or 80x25, and I don’t think it’s possible. I think a QR code needs some “half height” characters, and also “solid filled” characters that ASCII just doesn’t have.

But what about PETSCII ? I think there are some modern editors to help construct a scene using PETSCII symbols. I have to head out for today, but was wondering if anyone knew if this had already been tried or had thoughts about it? Maybe there are some other QR formats that I’m not familiar with. But I’m saying a QR code on a vintage screen that could at least contain one of those “tiny” URLs.

If not PETSCII, then I guess a custom font on EGA would have to be the next thing to try? (in keeping with a text mode resolution – but if had to go graphics, wonder what the smallest resolution is needed)

Seems a QR code needs to be 21x21 pixels at least (and sizes go up by 4 pixels at a time) and, I suppose, those pixels need to be near square. Many retro character-based systems will struggle, but I think you might be on to something with the PET, or PETSCII generally. I think the PET might have more or less square pixels - and for 21x21 you don’t even need the 2x2 graphics characters.

For the software side, there’s a project for the BBC Micro (which uses graphics modes for the display):

1 Like

Regarding the PET, it has a pixel ratio of 1:1.2 (in real life that is).

BTW, you can play around with a virtual PET 2001 here:

Usage Tips

  • Activate the checkbox labeled “Touch Cursor” to place the cursor anywhere on the screen by simple mouse click sor tapping.
  • Use the keyboard or the graphical keyboard below the screen or any combination thereof to enter a character. (E.g., you can hold the shift key and click the respective key on the graphical keyboard to type a block character.) ALT+R activates reverse video via the keyboard and SHIFT+ALT+R deactivates it again.
  • Mind that, like with all Commodore 8-bits with 40 column screens, typing or printing into the very last column at the right edge of the screen will extend this line to a double line, which may result in scrolling. (So best avoid this while drafting graphics.)
  • See the “Utils/Export” menu for various methods to export the screen.
    (The hex dump option will export screen codes, not PETSCII. PETSCII sequencies are best captured by exporting a BASIC program, which will genereate what’s currently on the screen. The latter option also allows you to come back to your work later, by simply dropping a file with that exported text. You may even engage in a bit of BASIC photoshopping, by combining sections from various exported programs or modifying them to your liking.
    Finally, mind the menu labeled “Escape” in the text export window, which gives you a choice of the format in which non-ASCII characters are encoded in a generated BASIC program.)
  • You’ll find that the arrangement of the graphics characters on the original PET 2001 keyboard layout is highly systematic, unlike with later Commodere 8-bits. No need for a special app, just to locate the available characters.

The TRS-80 Model I has pixels that are pretty square, and has greater than 21 X 21 resolution. That might do the job.

1 Like

At the height of the first wave of the pandemic — and for no discernible good reason — I put a QR code in this Amstrad CPC BASIC program:
WHO Alcohol Handrub calc for Amstrad CPC : scruss : Free Download, Borrow, and Streaming : Internet Archive
The BASIC program does not calculate the code in any way. I think I made it by converting qrencode’s ANSI text output. It uses half-height block graphics. Systems with sixel graphics might be able to do this quite well too


That looks really nice!

The thing with sixels - at least on the Beeb - is that they are different shapes (so they can’t all be square)… but I don’t know whether or not QR readers would be tolerant of Teletext-style QR codes. There’s one way to find out…

I guess, this could be accounted for by using two thirds of a sextal character for each line of QR-code “pixels” (actually “modules”) to distribute them evenly.

QR code has 3 major alignment markers (at the two top corners and at the bottom left corner, as well as a smaller one at an inset from the bottom right corner) and two lines of track markers (alternating modules extending vertically and horizontally from the inner corner of the top left alignment marker), so distortion shouldn’t matter (as long as this distortion is systematic).
An constant step size along these track markes may be preferable, though.

I transcribed @scruss’ QR code into a teletext (Mode 7) screen, and it works! (Both on Android and iOS) Despite the irregular and non-square pixels.


I’ve been reminded that the Color Computer has “semigraphics” - a way to put block-like characters in a controlled fashion while in text modes (maybe this is similar to what the Amstrad CPC is doing?).

1 Like

Yes, that’s what I did (though I don’t exactly remember how): the Amstrad CPC character set has quarter block “semigraphics” in positions 128–143:
Screenshot from 2023-01-24 20-19-10

With a less square / more familiar character aspect ratio, you can get by with only four block characters:

    U+0020                 SPACE
    U+2580        ▀        UPPER HALF BLOCK
    U+2584        ▄        LOWER HALF BLOCK
    U+2588        █        FULL BLOCK

This is how qrencode does it when it outputs UTF-8 text.

Even quite small screens can display QR codes if they have semigraphics. You don’t need to include the full border on a QR code

Here’s a quick look of the CoCo semigraphics with a quick little character-set display program I did:

Its character set doesn’t just set the symbol/“font” but also encodes a color. This limits the set of symbols, but as you mentioned - looks like a suitable set is there.

Hmm, so how about 40x25 mode of IBM PC extended ASCII? aka codepage 437 (219-223). Different font ratios at 80x25 and 40x25, right? Although maybe neither of them very square (for the PC). I wonder if this is what the wikipedia article meant that “CGA had semigraphics support”

The 6847 was quite logical in the way it gave you block characters. It had a full set covering all values of all quadrants, and in multiple colours, too. Its 32×16 text display could in theory give you a QR code 32 cells high: enough to fit a QR Code Version 3, encoding up to 77 case-insensitive characters.

CP437 only encodes the upper and lower half blocks, so 40×25 mode would have a very odd aspect ratio. 80×25 mode can give you 50 cells high, maybe just enough for a Version 8 QR Code holding up to 279 characters.

Teletext’s sixel mode (“Semigraphics 6”, in CoCo/Dragon parlance) could fit a really large QR Code into a text screen. 40×25 characters would give 80×75 sixel cells, just enough for a Version 14 QR Code holding up to 667 characters.

I’m going to have to produce examples now, amn’t I? I’m not going to even look at systems where I’d have to play with reverse video, such as PETSCII, to encode all quadrants of a character block.

1 Like

That I call spoiled. Back in days of lockdowns, this was considered a fair adventure… :wink:

1 Like

How about a recursive QR code. Redesign the sync cubes to reflect a tiny vesion of that QR code, :slight_smile:

I tried rendering a QR code using only regular asterisk characters. The decoders weren’t super happy about that, but would work if I zoomed and angled the camera just so. It seemed to me that near 1:1 ratio modules (pixels) are expected.

1 Like

I think doing so would be a pretty cool and somewhat useful retro challenge.

Here’s someone that did it for a TI-99/A: QR Code Generator for TI - TI-99/4A Computers - AtariAge Forums

I’m coding a QR encoder for the PDP-10. Work in progress. This is not yet a working symbol, but shows many of the features that should be there: finders, timing, alignment, version, format, and masking.


First successfull QR code output from a PDP-10.