Apple ][ Hi-res VGI Vector Routines

This page is talking about some proof of concept work done on an AGI-like interpreter I made checking for the feasability of a hi-res MYST with graphics similar to "The Wizard and the Princess".



For info on the hi-res Myst proof of concept using this library see here




Details

I was prepping for a Mysterium talk and got to thinking about the eternal question people ask, "why not hi-res". Higher resolution graphics take up a lot more space, but you can use tricks like they did back in the 1980s to essentially make simple vector-based graphics. These are slow and often cartoony looking, but can be a good compromise between lo-res graphics and super-detailed bitmaps.

I did a silly proof of concept in 280 bytes of Applesoft BASIC on the Apple II twitter bot and enough people liked it that I decided to put together a small graphics lib.

As you'll note, I've only implemented a few of the scenes. It's a lot of work, and to do a full game you need 800+! Also for proper gameplay you'd want a hi-res sprite library and a few other things that are tricky in hi-res on the Apple II which has a famously obtuse graphics subsystem (a lot of the complexities can probably be placed on Woz's amazing hardware optimizations to save gates, but you have to make up for it in software).


Legal Note

This product contains trademarks and/or copyrighted works of Cyan. All rights reserved by Cyan. This product is not official and is not endorsed by Cyan.

Implementation

The Apple II hi-res graphics are a bit too complex to get into here. Roughly, you get 280x192 graphics with 6 colors. There are complex rules about which colors can go where, and you get NTSC fringing.

My VGI (VMW vector-graphics interpreter) is just a small commandset with up to 16 commands, followed by hard-coded paramaters. You can specify colors and draw circles, boxes, and triangles (with lots of limitations because I am lazy and some drawing primitives are legitamitely hard to code, expecially in 8-bit with no floating point and no multiply/divide). I did write an accelerated box-draw primitive because otherwise the scenes took too long to draw.

You can read the documenation on it here:README.VGI

The text interaction isn't real, it's just some hard coded responses. It's using the Apple II ROM input routines, a side effect of which you can't "OPEN" the door as Applesoft thinks you're trying to open a file on disk and throws an error.

Video

An information video, with a capture on a real Apple IIe platinum:


Screenshots

Note: these were captured with the AppleWin emulator.

Also, watch the video if you can, half the fun is watching them draw.




Graphics Comparison

Below is a brief comparison of your graphics options. For a more thorough comparison check out this page discussing graphics tradeoffs with the lo-res Myst port.

Original Graphic
Handmade Lo-res (40x48 15 colors) Version
Automatic conversion Tool-created Hi-res Image
Handmade Hi-res (280x192 6 colors) VGI Graphics

So could it be done?

So would it be possible to make a game in hires with the same footprint as the lores game? It might be, although losing 8k of RAM for the framebuffer will hurt. Also the VGI decoder is a few K as well, and we'd have to write a sprite library for the pointer, and not sure what to do about animations and such.

But for the clock image:

System Requirements


Downloads

Disk Images

Source


Mini-faq


Development Notes

15 July 2021

Added initial support to the Apple II lores Myst engine, see more info here

21 June 2021

Finally got things posted. Thought I was done but forgot I wanted to do a fireplace scene too.

20 June 2021

Wrote filled circle code. Did not write generic triangle routine, even though it would be useful. It's actually hard to write an 8-bit generic triangles. You can modify the Bresenham line drawing, but even that's hard to do in 8-bits because it uses signed numbers and you quickly run out of room.

19 June 2021

The initial box drawing routine using the Applesoft HGR ROM routines is too slow. Mostly because it has no dedicated horizontal line drawing code so it is doing slow address calculation and drawing point-at-a-time.

Writing a fast horizontal line myself turned out to be a huge undertaking and my code is still full of off-by-one errors. While it's fun to curse Woz here, most of my problem was normal stuff like edge cases when the line doesn't start cleanly at byte boundaries (you'd have those issues on any platform). The weird Apple II address stuff can mostly be hidden with some lookup tables (even the weird divide-by-7 stuff).

16 June 2021

Posted an Apple II Basic bot initial implementation which ended up being way more popular than I expected. Since this is vaguely related to a talk I'm giving next month I decided to see how quickly I could put together a "real" vector interpreted scene.


Lo-res Fully Playable Apple II Myst
Other Apple II Demakes
Other VMW Software Demos
Other Apple2 Projects
Back to the VMW Software Productions Page