Fake Bios |
Why not make an Apple II pretend to be a PC. Nothing that exciting
here though adapting an 8-pixel wide font to the 7-pixel wide
Apple II was a pain. It actually is doing some system detection here so the output varies based on your hardware setup. |
Intro |
The pan across the landscape is a 2-pixel horizontal scroll
which is really hard to do on Apple II. There's no
hardware scrolling. Each byte of hi-res
memory is 3.5 pixels, so when scrolling you have to cross
byte boundaries. The bits are in LSB (least-significant bit)
order but also the top bit doesn't scroll (it's a palette
bit) and if you're not careful the colors will swap. It's jerky
because I'm not using page-flipping here (that would be even
more complex). I'm using lookup tables. Oddly the technique
I'm using is based on a writeup I found on my system recently
that I had saved off of usenet in 1996 for some reason.
No hardware sprites on the Apple II either. I'm actually just moving chunks of memory here for ths ships and not really doing sprites. I have the y-coord a bit off which makes a bit of a warping effect but I thought it looked cool and left it. |
Chessboard | There were a lot of better ways I could have done this, but I'm just using sprites to cheat a bit. I didn't have time to hack up a real 3d-render, or even some sort of triangle-drawing library. I made the chessboard orange instead of purple as due to the color palettes things interact better (you can't have purple/green in the same 3.5 pixel chunk of screen as blue/orange). You still see some fringing at the edges, that's because the proper way to do this would be to have a mask to mask off the transparent parts of the sprite but that would make it slower and also use a lot more RAM that what I'm doing which is doing transparency at 3.5 pixel boundaries. Also while you can only have your X-position be on multiples of 3.5 pixels, it does handle automatically shifting the sprite data to make sure the colors still look right for both odd/even columns. |
Tunnel |
I wasted a week trying to get a good tunnel effect and gave
up (after some very interesting results (
1
2
3
4
)) from buggy code.
Drawing circles is a pain on 6502. So for this I just
took 2 screenshots and page flip. I think this captures
best the fast pace of the original.
A lot of tunnel code involves multiply, divide, and trig functions and that all makes a 6502 assembly programmer weep. Though the c64 people pulled it off for their version so I should try to find out how they did it. Note that the Second Reality effect is a bit more interesting that a plain tunnel as it wiggles the camera around too. |
Circles / Interference |
The circle code and some of the interference code are based
on code from Hellmood's famous Memories demo.
I should have tried to make actual circular interference patterns
but just cheated and used some existing code that gave vaguely
similar patterns. As I said before, drawing circles quickly
when you don't have multiply or trig functions is a pain.
Lookup tables and self-modifying code only get you so far.
I did manage to get sound sync on the falling bars, that was tricky (although depending how you watch the video the sync might not match up for you) |
Monster Graphic |
The graphics are mostly automated conversions.
I have been using Kris Kennaway's
iipix
converter. However it sometimes needs some tweaking and works
better on photos than on drawings. In the end I often just
reduce images to a low number of colors and then fill manually
with dither patterns.
The scroll here is a quick hack, it needed to be fast. It's actually going 7 color pixels at a time as the naive 3.5 approach would make the colors swap each step and I didn't have time to make a version that did things properly. |
New Way to Scroll |
Just two images with page flipping, didn't have time to
do this properly.
Not only would I have to somehow map a font texture to a 3d surface, but even just masking off the leaves would be a pain. |
Lens/ Rotozoom |
Done in lo-res for speed. The lens part I meant to do some sort
of warping when drawing the transparent sprite. I was going to use
colors to specify an offset to get when looking up the
warped pixels from the background. As a placeholder
I was just anding the colors in, and it actually looked OK as an
effect and I never had time to implement things properly.
You might miss it, but the music is paused so that a sound sample can be played out the speaker. Rotozoom is based on previous rotozoom code I had. Instead of a color border I should wrap, it's just the only fast way to do that is a power-of-two wrap but the Apple II screen is 40x48 and I haven't had time to figure out a good way of managing that. I could easily do 32x32 but getting a smooth transition from 40x48 is tricky. |
Plasma | I'd been trying for years to get a hi-res plasma going on the Apple II. In the end this is based on French Touch's Plasmagoria plasma code, but converted for hi-res. It only draws ever other line for speed. As far as I know no one has ever done full-screen hi-res plasma on Apple II before. |
Plasmacube | I think this is my favorite effect. Again the French Touch code, but with my own masking applied. The masks have R/G/B components to apply different color lookups to the underlying plasma. The cubes are pre-rendered. Only 8 steps, but they compress really well. I probably have room for 16 steps but ran out of time. |
Bouncing Dots |
I meant to do something fancier. In the end it looked surprisingly
well. It's not doing any of the fancy patterns in the original
though, but this is one case I might be able to approximate
it with enough lookup tables.
This is a case I've since looked at the actual code (and the modern remake) but everyone uses either OpenGL or the original code is doing deep VGA tricks so it'll be tricky to port over the exact algorithm. |
Transmission | I had a really nice hi-res version of the background, but couldn't figure out a good way to do the sword in hi-res without a huge amount of work (diagonal sprites, color clash). So in the end I went with lo-res which I think worked out OK. I even got the "transmission" line said there if you listen closely. There's a glitch at the start due to a disk access and I didn't have time to fix it, I should have cleared the screen to black before it happened, in fact I thought I had so not sure why it didn't. |
Ocean Voxels | Fully cheating on this one. It's just screengrabs hand-colored by me and being decompressed via ZX02 full speed. This takes up 24k which is much larger than most of the other effects. |
Polar Lady | I wanted to make it bounce, even had various plans for trying to do it (it's not easy, again because of the weird way pixels work on hi-res, you can't just scale them out slightly without weird color effects). In the end I just had to settle for a quick vertical scroll. |
3D-scene |
As you might guess this is not rendered in 3d. It's a bunch
of rectangles being drawn really quickly. I started out optimizing the rectangle lists by hand, this is something I did for a lot of my Apple II bot entries. Hand optimizing took forever, so I wrote a program that given a lo-res screen will attempt to find optimal rectangle coverage. It's about 10-20 percent worse than by hand, but so much faster. I still take the 4fps screen grabs and convert them to 40x48 with proper lo-res color selection by hand. You'll notice it stops before the actual end, ran out of time. And then it switches to hi-res and sprites for the finale. |
Credits | Using 4am's font and libs here. The scroll in of the thumbnail is not perfect, didn't have time to scroll it in from off screen properly. The final credits are again a little jerky as I'm not using page flipping. |