Gather around, children, and let me tell you a story. In the beginning, there was XZip by Andrew Plotkin. XZip was an Infocom interpreter for X-Windows. The code was fairly reasonable, though slightly under-documented, as such things tend to be. Then Andrew wrote MaxZip, a Macintosh port of XZip. Then Andrew wrote MaxTADS, a modification of MaxZip which ran TADS games instead of Z-Machine games. As expected, by this time the code was becoming hard to follow. Then I decided to write TADS/2, an OS/2 GUI TADS interpreter. For its code base I used much of MaxTADS. Finally, I wrote WinTADS, the Win95/NT GUI TADS interpreter. WinTADS is based on TADS/2 which is based on MaxTADS which is based on MaxZip which is based on XZip. This code is nasty. I make no apologies -- it has survived its OS journey exceedingly well, and it does what it is supposed to do. You are welcome to peruse the code and glean what knowledge you can from it. If you want to understand much of the source, use Andrew's XZip as a triangulation point. Be warned, though: I've hacked much of the keyboard and display code for my own purposes. One other bit of advice: when you compile WinText.c, you will get many warnings. These are due to the cavalier way WinText.c treats its short and long variables. I once attempted to fix all these errors, which resulted in the code that controls scrolling not working any more. If the warnings bother you excessively, feel free to fix them. If you're successful and WinTADS still works, by all means send me the diffs and I'll incorporate them into the code. My approach to garnishing has been much like my approach to spicing food: too little, and never in the right spots. Where I've had to make changes to the TADS code, I have followed Andrew's practice of adding a comment containing three pound symbols (###), to make it easy to grep for them. The following files comprise the WinTADS source: WinTADS.c -- The main WinTADS procedures, including the window procedures WinCtls.c -- The controls for WinTADS, i.e. menus, status bar, etc. WinText.c -- The WinTADS text engine WinIo.c -- Input/output routines WinKbd.c -- Keyboard setup and key translation WinEmux.c -- X-emulation routines (remember, WinTADS was once XZip) WinClip.c -- Clipboard functions WinBound.c -- Functions to bind/unbind WinTADS Stream.c -- My stream class. WinTADS uses it for handling keystrokes os_depend.c -- OS-dependent TADS functions WinTADS.rc -- The WinTADS resource file global.h -- Global variables WinTADS.h -- Various #defines for menu and dialog IDs WinIO.h -- #define and prototyping for IO routines os_depend.h -- OS-dependent TADS defines Uninstal.c -- The source for the TADS uninstallation program Uninstal.h -- The #defines for Uninstall Uninstal.rc -- The Uninstall resource file WinTADS.dsp -- Project and WinTADS.dsw -- workspace files for Visual C++ The following icons are included: WinTADS.ico, WinSmall.ico, WinTGAM.ico, WinTSAV.ico, Uninstal.ico In the htads directory: appctx.h, bif.h, cmap.h, cmd.h, dat.h, dbg.h, emt.h, err.h, fio.h, ler.h, lib.h, lin.h, linf.h, los.h, lst.h, ltk.h, mch.h, mcl.h, mcm.h, mcs.h, obj.h, oem.h, opc.h, os.h, osifc.h, osifctyp.h, oswin.h, ply.h, prp.h, prs.h, regex.h, run.h, std.h, sup.h, tadsexit.h, tio.h, tok.h, trd.h, voc.h In the ctads directory: askf_os.c bif.c, bifgdum.c, cmap.c, cmd.c, dat.c, dbgtr.c, dummy.c, errmsg.c, execmd.c, fio.c, fioxor.c, getstr.c, indlg_os.c, ler.c, linfdum.c, lst.c, mch.c, mcm.c, mcs.c, obj.c, oem.c, oserr.c, osifc.c, osnoui.c, oswinx.c, out.c, output.c, ply.c, qas.c, regex.c, run.c, runstat.c, suprun.c, trd.c, voc.c, vocab.c