This is a re-imagining of the ZX Spectrum demo
"Scroll Block" by Otomata Labs from Deadline(Berlin) 2024.
I had seen the 194-frame animation from the demo on zxart and was impressed
by it, and its resolution was very close the the 40x48 Apple II lo-res mode.
So I wrote some scripts to automatically convert the animated gif
to lo-res files, and then
wasted a lot of time fitting all 194 frames onto a 64k Apple II. You
can see this proof of concept here.
It was suggested this could turn into an actual demo which led to discussion
with Otomata Labs and I created a more complete re-implementation, and grongy
provided a nice title screen.
Video
Recording captured on an actual Apple IIe platinum.
Sorry about the sound capture, there are various reasons it's not the best
and I think youtube isn't helping much either.
Implementation / Differences
The biggest difference from the ZX version is there's no scroll text.
It would have been extremely difficult to do that on Apple II. Either I would
have had to sacrifice the bottom 8 lines of the screen in split graphics/text
mode, or else I would have had to do some sort of vapor-lock/cycle counting
to do mid-screen resolution changes to have it at the top. It might have
almost been doable if the music was 60Hz (US Apple II screen refresh
frequency) but the music is 50Hz. (Though now thinking about it, maybe
if I only updated the animation every 6 50Hz frames that's the same as
5 60Hz frames... hmmmm).
I wrote the Apple II code completely from scratch in 6502 assembly,
I didn't look at the ZX code. It uses my
pt3_lib for the audio, and ZX02 compression to fit the animation frames.
My original 194 frame version only barely fit in 64k. It turns out the
ZX demo only used half of those. So for this version I also only use
half, which leaves room for the title screen and other stuff. I actually
use 96 frames rather than 97 because being divisible by 8 simplifies things a
lot, hopefully it's not noticable.
A lo-res 40x48x15 color lo-res screen is roughly 1k.
So 96 frames would be 96k. So how does that fit? I use ZX02 compression,
and compress in 8k (8-frame) chunks. Every 4 interrupts (12.5 fps) a new
frame is copied over (and it uses page flipping to smooth things a bit).
There's only one 8k window to decompress in... so the code is constantly
decompressing the next batch of frames into the same window
and things are timed carefully so that the frame being read out isn't being
over-written by the decompression thread.
The various wipes on the title screen are from the "Total Replay" apple II games
collection by 4am.
g
The visualizer was actually pretty easy, the PT3 player has the 3 volume
channels easily accessible in zero page so it's not much code to plot
them.
System Requirements
Apple II
You need 64k of RAM and a Mockingboard.
It uses timer interrupts so won't work without
the Mockingboard
Superogue started causing trouble and suggested I submit this to Outline,
which then led to extensive discussions with grongy which eventually
led to this. Hopefully it favorably compares to the ZX Spectrum version.