• Goog Blog

  • by Goog

Hi, I'm Goog. Creator and founder of CommodoreServer.com, the Comet64 Internet Modem and the Portland Commodore Users Group in Portland, Oregon USA (PDXCUG.org). I am excited about all things Commodore, but my passion lies with the Commodore 64.

Apr
28

Convert Screen Codes to PETSCII

Here is a little BASIC routine to convert screen code data to printable PETSCII.

At our last Portland Commodore Users Group Meeting, I drew up a quick little screen to alert people that our screencast was underway, as seen here:

C64 Screencast

It turned out pretty good for just doing it on the fly, so I decided I wanted to SAVE it.  The problem was, I drew it in the C64 screen editor without any BASIC.  So I just had to save the screen codes to RAM, along with the color data.

The SAVE went fine, but how would I bring it back to the screen again? The answer was to write up a quick little program to read the contents of RAM and print it back to the screen.  But one problem: the data was screen codes and not character codes, so I couldn't just say PRINT CHR$(CH); for each character read out of RAM.  I needed to convert screen codes to printable PETSCII.

Following is the program that reads it from my saved RAM location (32768) along with the saved color data (33792) and prints each saved character to the screen.  It is pretty slow, because, you know...BASIC.  But it did the job.  So I thought I would share the conversion process with you.

Open the PDXCUG Disk and then click on the SCREENLOADER program to see the code.  Or you could download it and run it... but you'll have to load the screen itself into RAM (PDXWELCOME) first and then type NEW.  The program will look in the 32768 range for the screen data.

This screen code-to-PETSCII routine is nothing new, but thought it might be handy to have here as a reference, anyway.  Enjoy.

Leave a Comment

You must be signed-in to post comments.

Responses