Apple II 上的 Sierra 数码相机
Sierra digital cameras on the Apple II

原始链接: https://www.colino.net/wordpress/archives/2026/09/11/sierra-digital-cameras-on-the-apple-ii/

继成功添加对 Kodak DC-50 的支持后,开发者将其“Quicktake for Apple II”项目扩展至支持“Sierra 类”数码相机。通过利用 `libgphoto2` 代码库,开发者实现了一个模块化的驱动系统,可支持超过 80 种潜在机型,并已成功测试了三洋 VPC-G1 和 VPC-G200 相机。 该项目面临多项制约,包括内存有限、处理速度缓慢,以及 Apple II 硬件无法处理高速串行通信,被迫将速率限制在 19200bps。为了在单张软盘上容纳日益增多的支持机型,开发者实现了一个稳健的驱动接口,并将 zx02 压缩技术集成到系统加载器中以节省空间。虽然受限于 Apple II 的硬件性能,高分辨率 JPEG 解码等功能受到限制,但新驱动程序支持对相机设置、状态和图像捕获的全面控制。未来的计划包括攻克更复杂的佳能 PowerShot 350 协议,从而进一步巩固该软件作为 Apple II 平台上复古数码相机通用接口的实用价值。

Hacker News 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Apple II 上的 Sierra 数码相机 (colino.net) 18 分,ibobev 发布于 2 小时前 | 隐藏 | 过往 | 收藏 | 讨论 | 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

After successfully adding support for the Kodak DC-50 camera in Quicktake for Apple II, I investigated what else was there that had vastly overblown “System requirements”.

The Epson PhotoPC user manual page with their System Requirements

Based on libgphoto2’s source code, I chose to give a closer look to what I (and they) call the “Sierra-class” cameras. There are a lot of cameras sharing the same class of protocol there, more than 80 models are referenced. Not all of them will be usable on Apple II, as my JPEG decoder is hardcoded to 640×480 images (de-hardcoding it would be possible, but memory and CPU expensive, and it’s already slow enough as is that I don’t want – yet – to even try decoding and scaling down 800×600 or 1024×768). Even limited to 640×480 cameras, this will open a number of options.

I bought a pair of very cheap Sanyo cameras on eBay (a VPC-G1 from 1995, also sold as Epson PhotoPC PCDC001 and Sierra Imaging SD640, and a VPC-G200 from 1997), and started my 2026 summer staycation implementing my driver: during the previous release cycle, leading to the Kodak DC50 support, I reworked my code so that cameras drivers are now modules with a defined interface. This allows my program to only load the relevant driver into memory, making Quicktake for Apple II extensible with an arbitrary number of drivers as long as it fits on the floppy!

Here’s my “skeleton” driver that does nothing but the boilerplate. It basically defines a bitfield of supported features, and 16 “API methods”, most of which being optional. The only required endpoints are _wakeup, _set_speed, _get_information and _get_picture.

#define sierra_features 0b0000000011011111
//                                ||||||||_ SET_CAMERA_NAME
//                                |||||||__ SET_CAMERA_TIME
//                                ||||||___ SET_QUALITY,
//                                |||||____ SET_FLASH,
//                                ||||_____ TAKE_PICTURE,
//                                |||______ GET_THUMBNAIL,
//                                ||_______ DELETE_PICTURES,
//                                |________ RESERVED,
/* Camera callbacks */
void *sierra_callbacks[] = {
  /* FEATURES */        (void *)sierra_features,
  /* WAKEUP */          sierra_wakeup,
  /* SET_SPEED */       sierra_set_speed,
  /* SET_CAMERA_NAME */ sierra_set_camera_name,
  /* SET_CAMERA_TIME */ sierra_set_camera_time,
  /* GET_INFORMATION */ sierra_get_information,
  /* SET_QUALITY */     sierra_set_quality,
  /* SET_FLASH */       sierra_set_flash,
  /* TAKE_PICTURE */    sierra_take_picture,
  /* GET_PICTURE */     sierra_get_picture,
  /* GET_THUMBNAIL */   NULL,
  /* DELETE_PICTURES */ sierra_delete_pictures,
  /* GET_FILENAME */    sierra_get_filename,
  /* THUMB_HISTOGRAM */ NULL,
  /* THUMB_LOAD_DATA */ NULL,
  /* GET_QUALITY_STR */ sierra_get_quality_str,
  /* GET_FLASH_STR */   sierra_get_flash_str,
};

In the end, my Sierra driver implements almost everything my program supports: all information fields (camera name, camera time, quality mode, flash mode, pictures taken, pictures remaining, battery status) are readable, flash and quality modes are settable, we can snap a picture, etc.

The libgphoto2 Sierra driver has made things very easy as it is functional and easy to understand. It’s sprinkled with a a few magic numbers here and there, but they were easy to make sense of and #define.

The only feature not available is sierra_get_thumbnail. It actually is implemented, because it is easy to fetch a thumbnail from the camera: it’s the same procedure as getting a picture, using two different camera registers. But it’s not wired in the UI, as the thumbnails are JPEGs. There is no way I have room to load the JPEG decoder in the UI program, where thumbs are displayed, so I left it out.

Another small annoyance with the Sierra cameras (at least the two Sanyos I have) is that it seems they cheaped out on the serial chip. I can talk to them at 115200bps on the PC, but not on the Apple II. Sigrok captures of the signals show that the start bits start too soon after the stop bits, and this confuses the Apple II’s ACIA 6551, which throws framing errors. So, speed is limited to 19200bps – even on the IIgs.

A Sigrok capture, viewed in Pulseview, with the start bit starting on the stop bit. The stop bit also starts early.
A picture of a building with trees, straight out of the Sanyo VPC-G200

Supported cameras

Only noting the cameras I tested with, this will add support for:

I strongly suspect that the following cameras might work out-of-the-box, but that is untested.:

Refactoring again and next steps

Now that the Sierra driver is written, and even if the camera drivers themselves are stored compressed (using zx02) on the floppy, I had only 6kB left on the program’s floppy disk. Not really enough to add anything important… and I plan on adding more camera drivers!

So I kept on compressing things, and compressed the UI and image decoders binaries themselves. I could have made them self-decompressing, but that would have meant having multiple copies of the decompressor, one per binary. So instead, I extended Oliver Schmidt’s LOADER.SYSTEM to handle zx02-compressed binaries.

The next step is finding a new camera driver to implement, and it will be the Canon PowerShot 350, a 1998 camera, 18 years younger than the Apple II, with apparently a hell of a protocol.

I wonder if I should rename the Quicktake for Apple II project to reflect the fact that it supports more and more cameras? But I like the current name, and I have no better idea.

联系我们 contact @ memedata.com