NEWS, EDITORIALS, REFERENCE
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.