Overview
Introduction
PETSCII is the character set Commodore built into the PET, VIC-20, and C64, and its default ("unshifted") mode is famous among retro-computing enthusiasts for having no lowercase letters at all, a quirk that trips up a lot of first attempts at C64 text conversion.
This tool converts ASCII text to unshifted PETSCII hex byte values, handling that lowercase quirk explicitly rather than silently mangling or rejecting lowercase input.
What Is ASCII to PETSCII Converter?
A text-to-byte encoder for the Commodore 64's default, unshifted PETSCII character set, where printable byte values 32-126 line up with ASCII almost one-to-one.
It implements only the unshifted mode; the C64's alternate shifted mode (with real lowercase letters, but different graphics symbols) is a separate, documented limitation this tool doesn't attempt to cover.
How ASCII to PETSCII Converter Works
The input is validated as strict 7-bit ASCII and restricted to the printable range 32-126, since PETSCII's control-code region (colors, cursor movement) is an entirely separate, non-ASCII-related system this tool doesn't attempt to model.
Each character is upper-cased first (a no-op for characters that are already uppercase, digits, punctuation, or space), then its code point is written as a 2-digit uppercase hex byte, matching unshifted PETSCII's near-identity mapping to ASCII.
When To Use ASCII to PETSCII Converter
Use it when preparing text to POKE into Commodore 64 screen memory or generate PETSCII byte sequences for a C64 program, demo, or emulator test.
It's also a fast way to see exactly how PETSCII's lack of default lowercase affects a specific piece of text before writing it to real C64-targeted output.
Often used alongside PETSCII to ASCII Converter, ASCII to Hex Converter and Hex to ASCII Converter.
Features
Advantages
- Handles the well-known no-lowercase quirk explicitly and predictably instead of leaving it as a silent surprise.
- Near-identity mapping to ASCII for the printable range makes the output easy to sanity-check by eye.
- Clearly scoped to the unshifted/default character set rather than implying full PETSCII coverage it doesn't provide.
Limitations
- Cannot preserve original lowercase letters; they're always converted to uppercase first, a real and stated limitation of implementing only the unshifted charset.
- Doesn't implement the C64's shifted PETSCII mode or its screen-code (as opposed to PETSCII) byte layout, both separate systems from what's covered here.
Examples
Best Practices & Notes
Best Practices
- If preserving case matters for your use case, that's a sign unshifted PETSCII (and therefore this tool) isn't the right fit; the C64's shifted mode would be needed instead, which this tool doesn't implement.
- Round-trip through PETSCII to ASCII Converter to see concretely what information survives the conversion and what doesn't.
Developer Notes
Implemented as `char.toUpperCase().codePointAt(0)` per character (a no-op for non-letters), formatted as 2-digit uppercase hex; input is restricted to printable ASCII 32-126 up front since PETSCII's 0-31 control-code region is a completely different, non-ASCII-mapped system that this tool doesn't attempt to model.
ASCII to PETSCII Converter Use Cases
- Generating PETSCII byte sequences to POKE into C64 screen or color memory from a modern tool
- Preparing text for a Commodore 64 demo, game, or BASIC program that expects unshifted PETSCII bytes
- Demonstrating the C64's no-default-lowercase quirk to someone unfamiliar with retro 8-bit character sets
Common Mistakes
- Expecting lowercase ASCII input to survive the round trip unchanged; unshifted PETSCII has no lowercase, so it's upper-cased on the way in.
- Assuming this covers PETSCII's control codes (colors, cursor movement); those are a separate system from the printable-character mapping this tool implements.
Tips
- If your output looks identical to a plain ASCII-to-hex conversion, that's expected for uppercase input, since unshifted PETSCII and ASCII agree almost everywhere in the printable range.
- Test with a mix of uppercase and lowercase input to see the upper-casing behavior directly rather than assuming it from the docs alone.