Friday, March 16, 2007

It Talks!

Almost two years ago, I threw together an interpreter for the Infocom Z-Machine using C#.  This was actually an exercise that I used while teaching myself the internals of the Z-Machine itself.  I've said it before in this blog, but in my opinion, the single best way for a high-level language developer (like myself) to learn the low-level aspects of a particular machine architecture (be it a Z80, 6802, Atmel AVR, PIC, Z-Machine, etc), is to write an emulator to run the native code bytes.  Once you've gone through that exercise (especially the debugging process), you pretty much know exactly how each opcode works.

I've pulled out this Z-Machine library a couple of times when I wanted to test the capabilities of a particular technology.  For instance, when I wanted to see what SQLCLR could/could not do, I created a stored procedure interface to my library, and was able to play Zork completely on the database server itself (it turns out that you can do a lot using SQLCLR if you wanted to).

Last year, I plopped the source code into a GotDotNet workspace, and pretty much forgot about it.  Until yesterday when James Ashley from the Atlanta area emailed me to let me know about a little project of his that he is working on.

It turns out that James is really into SAPI (much like an INETA speaker from my area, Martin L. Shoemaker), and was able to create a System.Speech-based interface into my Z-Machine library.  What a great demo of the SAPI capabilities of the .NET Framework v3.0 by playing a text adventure game using only your computer's speakers and a microphone!

UPDATE: James' article can be found here: http://www.codeproject.com/useritems/SAPISophia.asp