DTV Picture Viewer

Almost a year before this project, I created a small BASIC program to view images from my PC on my Commodore 64DTV. I had also created a custom pallette in the Gimp completely by sight, comparing the color on one monitor to the color on my PC's monitor, until I thought it was right. It took me half of a day just to get all 256 colors. The BASIC program was slow, requiring as much as 20 minutes just to display a picture. The other problem was the enormous filesize of the images. But it worked.

I revisited the issue recently after no work appeared to have been done by anyone else on this front. My goal was to solve or reduce some of the problems listed above. The first thing I set out to do was get a better palette. So I used a video-capture card to capture a color-test pattern on the DTV. I used my best DTV which has all the video enhancements and even S-Video connected. Then I went into a paint program with this screen shot and literally grabbed the colors with the color picker, and created the 256-color palette this way. It worked very well. Get the palette below!

Palette for the Gimp: DTV.gpl
Palette for PaintShop Pro: dtv2_jasc.pal

The second thing I needed to do was come up with a primative compression routine. I ended up making my own version of RLE compression. So I came up with a pair of programs. One program is still written in BASIC. It is a compression program. It allows you to convert a RAW image over to a variety of formats supported by the viewing program. The next program is DTV-View, and it is written in machine language. I nicely compressed image will load from a regular commodore disk drive in just a few seconds. Part of the speedup came from being written in machine language, but the other part is that the image on disk is much smaller now and so there is less transfer of information from the disk to the DTV.

The RLE Image converter is very user-friendly. It works from BASIC, but there is a blitzed version also available for download which is much faster. However, I really never intended to use the program from my DTV. The best way to use this program is under VICE (or your favorite C64 emulator) and set the source drive to a file-system mapped folder on your harddrive and set the destination drive to a disk image. The first screen allows you to pick the source and destination drives, along with what type of compression you wish to use, and the filename. You can actually choose to store it as a RAW image, but it will have a compatible header on the image for the viewing program. In some cases (especially highly dithered images) a RAW image may actually be smaller than the compressed one.

Download the RLE Compressor here: RLE-CONVERT.PRG
Download the Blitz'ed version here: C_RLE-CONVERT.PRG
Download the viewer here: DTV-VIEW.PRG Source here: dtv-view.asm

After you hit go, it will check that the source file exists before going any further. Error checking in this program is only moderate. There are some errors that will not be detected and it will try to compress nothingness. It will confirm the CODEC that the file is being stored in, and count the percentage as it works. Bare in mind it is very slow, taking as long as 30 minutes. Even the blitz compiled version can take 10 minutes to work. The way I use it is in VICE and I set VICE to warp-mode, which takes less than a minute to complete the compression process. Once it is finished, it will give you the size in KiloBytes that the final compressed file was reduced to. If it ends up being more than 60K, then you may want to save it as a RAW. It will also give you the drive status for any of the drives that were accessed during the procedure. If any errors occurred that weren't detected during the encoding routine, they will probably show up here.

Take a look at some of the pictures below. You can see what they look like when viewed on a color-fixed DTV. Also I have taken 3 different types of pictures. One is a photograph. The next is a complex cartoon image with a lot of shading, and the last is a hand-drawn (by me) image of two cartoon characters that uses no shading. You can compare the sizes of the images and loading times to see how well each type can be expected to compress with my RLE compressor. You can click the images for a larger view.

48K 34K 5K
1:36 minutes 1:06 minutes 12 seconds

Keep in mind that the real bottleneck here is the IEC disk drive transfer rate. In my tests, I'm using a 1581 with no accelleration (no jiffydos, fastload, etc) Since I'm not using the burst mode (since the DTV is not a C128) then the speed should be comparable with a 1541.

Download a disk image with these 3 pictures and many more below!

Get a 1541 disk image here: SLIDESHOW.D64
Get a 1581 disk image here: SLIDESHOW.D81 (Has a few extra images)

Back to main DTV Hacking Page