Written and Maintained by Gregory Nacu


Subscribe to C64OS.com with your favorite RSS Reader
March 27, 2017Software

Petscii Art Animation

I had a fun weekend with my C64. I hope you all did as well. I've got an order put in for two games from Psytronik and I'm on the waiting list for the second batch of The Bear Essentials. I'm really excited to have recently discovered that the C64 gaming scene is alive and well. I was so happy I even subscribed to the C64 Games magazine Freeze64! You should check them out, and buy something. Support the development of new content!

A couple of posts ago I wrote about my PETSCII Art Renderer. I got in my head an idea about animating PETSCII art. It's pretty simple really, the implementation is very naive. But, hey, it works! And it's actually pretty cool.

I looked for some neat animated gifs on the web, and uploaded them to: http://picasion.com/split-animated-gif/. There are a handful of options, about the only option I use is to reduce the size to 320 px wide. Then you can download a zip of the frames, numbered 0.gif through X.gif however many frames there are.

I then run them through the PETSCII Art Renderer, one frame at a time, and save each frame as a separate file. Starting with a common prefix, then a letter, a through z (only 26 frames max for now). And a .pet extension. Then I copy the files to the C64 using the uIEC/SD. In the article I posted earlier, I'd written a little BASIC program to read the file to the screen. The problem of course is that reading the file with BASIC is very slow. It takes a few seconds to get just one image onto the screen. Instead, I'd also written an ASM version of the viewer that loads one image to the screen. So, I modified this viewer and called it aniview.

It's an animation, so I feel like it needs to be watched rather than described. Here it is, on Vimeo.

What's kind of interesting about this is that the frames are streaming one at a time straight from disk (a CMD HD in the video) to screen memory. I think if I use RLE compression, and load a frame to somewhere else in memory and then decompress it to the screen, I could probably get a much better frame rate. At the moment, without any optimizations the CMD HD gives me about 4 to 5 frames per second. I could probably get that up to a respectable 10 or 12 fps if the frames would compress well.

I really like the fact that the frames are streaming from disk, because it means there is no "load" time, and no need to hold more than one frame in memory at a time. Thus the animations can be arbitrarily long. They could be much longer than 64 kilobytes worth of data long. Plus they loop very easily. I've been playing around with ways to get the PETSCII Art Renderer to render and save all the frames of an animation in a more automated way. It would be nice to get it to do the RLE compression too. How great would it be to be able to convert a movie file, that is say 4 or 5 minutes long to be viewable in realtime on the C64? Really cool.

I hope you enjoyed this light fluffy post! Look forward to my next post about C64 OS's memory manager and about how to implement a minimalist memory manager, in general, in 6502 ASM.

Featured Posts

C64OS.com has grown to be more than just a blog about one developer's progress, it is becoming a resource to surround and support a type of C64 user that wants to benefit from the Commodore community and get the most out of modern hardware expansions for their beloved platform.

After writing many posts on the C64 OS weblog, the unfortunate reality is that some of my best work gets lost in the stream of news and developments. Be sure not to miss these full–length editorial reviews:

May 16, 2017Editorial

Review: FREEZE64 Fanzine

December 5, 2016Editorial

World of Commodore '16

Programming Reference

August 4, 2017Programming Reference

6502 / 6510 Instruction Set

August 4, 2017Programming Reference

Commodore 64 PETSCII Codes

August 3, 2017Programming Reference

Commodore 64 Screen Codes


Needs some ideas? Trying searching for:
PETSCII, Animation, Memory or Pointers

Recent Posts

December 5, 2017Software

The Big 5 Oh

November 24, 2017Software

BASIC Wedge Programs

November 22, 2017Hardware

3D Printed Components

November 15, 2017Technical Deep Dive

Anatomy of a Koala Viewer

October 31, 2017Programming Theory

Passing Inline Arguments

October 23, 2017Technical Deep Dive

How the C64 Keyboard Works

October 18, 2017Programming Theory

A C64 OS App's Start Of Life

September 26, 2017Hardware

New C64c Cases Available

September 18, 2017Programming Theory

Organizing a Big Module

September 11, 2017Programming Theory

Toolkit Introduction

August 15, 2017Programming Theory

Organizing Module Layout

August 4, 2017Programming Reference

6502 / 6510 Instruction Set

August 4, 2017Programming Reference

Commodore 64 PETSCII Codes

August 3, 2017Programming Reference

Commodore 64 Screen Codes

August 1, 2017Programming Theory

Base Conversion in 6502 (2/2)

July 21, 2017Hardware

Commodore Logo Mark Patch

July 5, 2017Programming Theory

Object Orientation in 6502

June 30, 2017Programming Theory

Base Conversion in 6502 (1/2)

June 20, 2017Software

Huge Site Update

June 5, 2017Software

Recursive File Copier in BASIC

May 29, 2017Technical Deep Dive

Implementing Factorial in 6502

May 16, 2017Editorial

Review: FREEZE64 Fanzine

May 9, 2017Programming Theory

Pointers in Practice, Menus

May 1, 2017Programming Theory

Loading Sequential Files

April 27, 2017Programming Theory

HomeBase Applications

Older Posts

Full Post Archive