Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Commodore 64 uses two related but different values to display text: PETSCII for characters and control actions handled by BASIC and the KERNAL, and screen codes stored in screen memory to select glyphs for the VIC-II. The glyph itself is an 8-by-8 pattern, while its color is stored separately. Keeping those three things—input encoding, glyph selection, and color—distinct explains why a byte that prints “A” is not the same byte you write directly to screen RAM.

How does the Commodore 64 character set work?

When the VIC-II displays a character in standard character mode, it reads a screen code from screen memory and uses that code to find the glyph pattern in character memory. The character’s color comes separately from color memory. A screen position therefore does not store a complete letter or its color in one value: character selection and color are separate.

Each built-in glyph is an 8-by-8 grid represented by eight bytes, one byte for each row. Within a row, the bits specify which dots are on. The Commodore 64 Programmer’s Reference Guide describes it this way: “Each character is formed in an 8 by 8 grid of dots, where each dot may be either on or off.” Commodore 64 Programmer’s Reference Guide, “Character Definitions”.

The VIC-II can use character patterns in character-generator ROM for the standard set, or be configured to read character data from RAM. RAM makes custom glyphs possible: a program can draw its own eight-row patterns and direct the video chip to use them. Because the custom data takes the place of the standard set for that configuration, a program that still needs ordinary letters or symbols must copy those patterns into its custom character set too. The guide explains the display and programmable-character arrangement in “Standard Character Mode”.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

What is the difference between PETSCII and screen codes?

PETSCII is the character and control-code system used by the C64’s KERNAL and BASIC interfaces. BASIC statements such as PRINT, CHR$(), GET, and INPUT work with PETSCII, as do keyboard and file operations. A PETSCII value may represent a visible character, but it may instead tell the screen editor to change color, move the cursor, toggle reverse video, or switch character-set mode. It is not safe to treat every byte as printable text.

Screen codes are different: they are the values written into screen RAM to choose which glyph the VIC-II displays. For example, uppercase A is PETSCII 65, but its screen code is 1 in the uppercase/graphics set. Digits, spaces, and some punctuation share values between schemes, which can conceal the distinction until a program handles letters or graphic symbols. The mapping and control-code distinction are laid out in Appendix G — PETSCII, Screen Codes & Color Codes.

Reverse video illustrates why the route matters. With BASIC output, reverse video is a PETSCII state controlled through the character stream. With direct screen-memory placement, the corresponding reversed glyph is represented by a screen code in the reverse range. In either case, color remains a separate value rather than being encoded as part of the character glyph.

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

How do I get PETSCII graphics on a C64?

Print a character through BASIC

For BASIC PRINT, provide PETSCII. CHR$(n) constructs a byte value, which may print a symbol or perform a control action, depending on the code and current display state. The exact visible result can depend on which built-in character set is active; a control code that selects a mode changes the active glyph set, not the underlying meaning of screen RAM values.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Place a glyph directly in screen memory

For direct writes to screen RAM, use screen codes for the active character set rather than assuming a PETSCII value will select the same glyph. In uppercase/graphics mode, for example, write screen code 1 to display uppercase A. Set the desired color independently in color memory. This method is useful when a program needs precise control over screen positions without sending characters through BASIC’s screen editor.

Make custom graphics

  1. Prepare the character patterns in RAM. Each glyph needs eight bytes, one for each of its eight rows; set the bits for the dots that should appear.

    Rank #3
    Sale
    Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
    • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
    • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
    • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
    • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
    • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
  2. Configure the VIC-II to use the RAM character data for the display. Character-pattern addresses depend on the selected screen code, character-set location, and VIC-II memory bank; the Programmer’s Reference Guide gives the relationship as CHARACTER ADDRESS = SCREEN CODE*8 + (CHARACTER SET*2048) + (BANK*16384).

  3. Copy any standard glyphs your program still requires into the RAM character set, since custom character data replaces the standard set in that configuration.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  4. Write the appropriate screen codes into screen RAM and set colors separately in color memory.

    Rank #4
    Sale
    UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
    • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
    • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
    • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
    • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
    • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

What are the C64’s two built-in character sets?

The C64’s built-in sets trade access to lowercase letters against access to graphic symbols. Switching sets changes which glyph pattern a code displays; it does not make PETSCII and screen codes interchangeable.

Set Letters available Graphics How selection works
Uppercase/graphics Uppercase letters Includes graphic and block symbols useful for text-mode pictures, borders, and interfaces. Selected through system or video configuration; BASIC control codes are also commonly used to select a mode.
Lowercase/uppercase Lowercase and uppercase letters Fewer graphic symbols than the uppercase/graphics set. Selected through system or video configuration; BASIC control codes are also commonly used to select a mode.

The visible choice is practical: use uppercase/graphics when a text screen needs its broader set of built-in symbols, or the lowercase/uppercase set when both letter cases matter more. For a custom set, the same principle applies at a lower level: the VIC-II displays the glyph patterns the configured character memory provides.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep the three display values straight

For a deeper technical treatment, the Commodore Programmer’s Reference Guide chapter on graphics covers standard character mode and programmable character shapes: Standard Character Mode and Character Definitions.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.