Skip to content

Instantly share code, notes, and snippets.

@kfox
Last active October 4, 2024 21:24
Show Gist options
  • Save kfox/09be3f474884527f44458a3cf0fc8e75 to your computer and use it in GitHub Desktop.
Save kfox/09be3f474884527f44458a3cf0fc8e75 to your computer and use it in GitHub Desktop.
MacOS command line to convert a binary C64 character set to comma-delimited hex

Convert a binary C64 character set to comma-delimited hex

  1. Replace raw c64 character set with the file name of your raw binary Commodore 64 character set.
  2. Paste the results into the dialog for the "import raw byte stream" prompt on the PETSCII Editor site by Krisztián Tóth.
cat "raw c64 character set" | \
  od -v -j 2 -t xC | \
  sed \
    -e 's/^.......//g' \
    -e 's/  */ /g' \
    -e 's/\([a-f0-9][a-f0-9]\)/\$\1, /g' \
    -e 's/^ //' \
    -e 's/  */ /g' | \
  tr -d '\n' | \
  sed 's/, $//' | \
  pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment