├── SYSTEM ├── RN.BAT ├── RO.BAT ├── DB.BAT ├── CLASSES ├── 0.P56 ├── 0.V56 ├── 100.P56 ├── 555.V56 ├── 560.V56 ├── 996.VOC ├── 997.V56 ├── 998.V56 ├── 999.PAL ├── CONV.SC ├── DOOR.SC ├── JUMP.SC ├── OSC.SC ├── SAVE.SC ├── SC.EXE ├── STD.DRV ├── USER.SC ├── 560H.V56 ├── 560L.V56 ├── DLGEDIT.SC ├── DSLIDER.SC ├── FEATURE.SL ├── GROOPER.SC ├── LOGGER.SC ├── MOTION.SC ├── MOVECYC.SC ├── PAVOID.SC ├── PLANE.SC ├── PRINT.SC ├── PRINT.SL ├── RANDCYC.SC ├── SOUND.SC ├── SYSTEM.SH ├── TIMER.SC ├── WINDOW.SC ├── BORDWIND.SC ├── POLYEDIT.SC ├── RANGEOSC.SC ├── SLIDICON.SC ├── WALKTALK.SC ├── WRITEFTR.SC ├── S.BAT ├── SETSYS.BAT ├── 994.VOC ├── COUNT.SH ├── LOADMANY.SH ├── SORT.SH ├── NAMEFIND.SH ├── GAME.SH ├── SC.ERR ├── SIGHT.SH ├── CAT.SH ├── TALKERS.SH ├── RELDPATH.SC ├── REGPATH.SH ├── RESOURCE.CFG ├── 64994.SHM ├── DICON.SC ├── NAMEFIND.SC ├── LOADMANY.SC ├── COUNT.SC ├── FORCOUNT.SC ├── MOVEFWD.SC ├── POLYGON.SC ├── REVERSE.SC ├── REMAKE.LST ├── TUTORIAL.SC ├── 0.SC ├── BLOCK.SC ├── INTRFACE.SC ├── TRACK.SC ├── APPROACH.SC ├── CHASE.SC ├── DCICON.SC ├── WANDER.SC ├── 64990.SHM ├── SORT.SC ├── MAGNIFY.SC ├── OFFSETS.TXT ├── MENU.SH ├── FLAGS.SC ├── SPEEDTST.SC ├── PFOLLOW.SC ├── SCALER.SC ├── DPATH.SC ├── PATH.SC ├── PCHASE.SC ├── QSOUND.SC ├── DEDIT.SC ├── SCALETO.SC ├── FOLLOW.SC └── CURSOR.SC └── INTERP ├── ZD.BAT ├── Z.BAT ├── VMD.CPP ├── VMD.HPP ├── STRING.CPP ├── VMDIBM.HPP ├── VMDIMD.CPP ├── VMDMDO.HPP ├── PLAYVMD.CPP ├── VMDBASE.CPP ├── VMDCACHE.CPP ├── VMDLOOP.CPP ├── VMDSOUND.CPP ├── VMDTRACK.CPP ├── VMDVESA.CPP ├── VMDVIEW.CPP ├── DO.BAT ├── VCSCFG.BAT ├── STAMP.BAT ├── MENU.CPP ├── EXCEPT.HPP ├── RESTART.HPP ├── VCS.CFG ├── SYNC.HPP ├── SELECT.HPP ├── RECORD.CPP ├── CRITERR.CPP ├── HOTKEY.HPP ├── RECORD.HPP ├── STAMPVER.HPP ├── LANGUAGE.HPP ├── INFO.CPP ├── RESTART.CPP ├── SOUNDWIN.HPP ├── PICTURE.CPP ├── SCIDLG.HPP ├── ASM2CPP.HPP ├── SCII.HPP ├── KBDD.HPP ├── PROFILE.CPP ├── KBDW.HPP ├── CLEAN.BAT ├── INFO.HPP ├── CRITERRW.HPP ├── INTRPTW.CPP ├── CRITERRW.CPP ├── MIDI.HPP ├── PALMGRD.HPP ├── MSGD.HPP ├── MBOX.HPP ├── INTRPT.HPP ├── MSGW.HPP ├── VMDLIBS.HPP ├── FAULT.HPP ├── VGA.HPP ├── MONO.HPP ├── CRITERRD.HPP ├── TIMED.HPP ├── PALMGRT.HPP ├── VOCAB.HPP ├── SHIFTPAL.HPP ├── MSGW.CPP ├── KBDMGR.HPP ├── NETWORK.HPP ├── TIMED.CPP ├── BUFFERD.CPP ├── EVENTW.HPP ├── TIME.HPP ├── PDEVICE.HPP ├── PTRDEV.HPP ├── SCIDLLWS.H ├── KBDW.CPP ├── MEMMGRD.HPP ├── INTFLAG.HPP ├── SCIDLL.HPP ├── KBDMGRW.HPP ├── SAVEABLE.HPP ├── HOTKEY.CPP ├── BUFFERD.HPP ├── GETI.BAT ├── BUFFER.HPP ├── INTEG.HPP ├── BUFFERW.HPP ├── CELASM.HPP ├── AUDIOD.CPP ├── BUFFERW.CPP ├── TIMEW.HPP ├── SCID.HPP ├── CRITERR.HPP ├── BLOB.HPP ├── MESSAGE.HPP ├── WINCLASS.HPP ├── EVENTD.HPP ├── BREAKPT.HPP ├── MSGD.CPP ├── MEMMGRW.HPP ├── GRAPHBUF.HPP ├── MAGNIFY.HPP ├── VOCAB.CPP ├── TEXTID.HPP ├── LZSS.HPP ├── LANGUAGE.CPP ├── HEAPLEAK.HPP ├── NEWW.HPP ├── CURSOR.HPP ├── PLIST.HPP ├── PLATFRMD.CPP ├── STAMPVER.CPP ├── KBDMGR.CPP ├── DCOMP.H ├── MOVIE.HPP ├── MAKEINIT ├── PALMGRW.HPP ├── MATH.HPP ├── SILIST.HPP ├── NETMGR.HPP ├── DCOMP.HPP ├── DRAWLIST.HPP ├── NEWROOM.HPP ├── MOUSE.HPP ├── UVBELIB.H ├── SENDSTAC.HPP ├── VIDEO.HPP ├── SCALE.HPP ├── RATIO.CPP ├── EXCEPT.CPP ├── SCI.HPP ├── PALMGRD.CPP ├── SCIWIN.HPP ├── DEBUG.HPP ├── DEBUGDSP.HPP ├── FAULT.ASM ├── KBDD.CPP ├── ASM2CPP.CPP ├── DRIVER.HPP ├── GRAPH.HPP ├── PALMGRT.CPP ├── RECTLIST.HPP ├── WINTHUNK.HPP ├── WINGFUNC.HPP ├── KBDMGRD.HPP ├── STRING.HPP ├── RGB.HPP ├── SOL.HPP ├── RATIO.HPP ├── CONFIG.HPP ├── EVENTW.CPP ├── ARRAY.HPP ├── TEXTID.CPP ├── DOS.HPP ├── PALMGR.HPP ├── MILLISEC.ASM ├── CURSORD.HPP ├── GRAPHBUF.CPP ├── NETMGR.CPP ├── W32SUT.H ├── LIST.HPP ├── MOVIEW.HPP ├── MOUSED.HPP ├── PMACHINE.HPP ├── INTFLAG.ASM ├── GRAPHMD.HPP └── MEMID.CPP /SYSTEM/RN.BAT: -------------------------------------------------------------------------------- 1 | new\sierra 2 |  -------------------------------------------------------------------------------- /INTERP/ZD.BAT: -------------------------------------------------------------------------------- 1 | wmake > comp.err 2 |  -------------------------------------------------------------------------------- /SYSTEM/RO.BAT: -------------------------------------------------------------------------------- 1 | old\sierra 2 | 3 |  -------------------------------------------------------------------------------- /INTERP/Z.BAT: -------------------------------------------------------------------------------- 1 | wmake sierra=1 > comp.err 2 |  -------------------------------------------------------------------------------- /SYSTEM/DB.BAT: -------------------------------------------------------------------------------- 1 | wd /tr=rsi sierraub -W 2 |  -------------------------------------------------------------------------------- /SYSTEM/CLASSES: -------------------------------------------------------------------------------- 1 | Object ;system.sc 2 | -------------------------------------------------------------------------------- /SYSTEM/0.P56: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/0.P56 -------------------------------------------------------------------------------- /SYSTEM/0.V56: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/0.V56 -------------------------------------------------------------------------------- /INTERP/VMD.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/VMD.CPP -------------------------------------------------------------------------------- /INTERP/VMD.HPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/VMD.HPP -------------------------------------------------------------------------------- /SYSTEM/100.P56: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/100.P56 -------------------------------------------------------------------------------- /SYSTEM/555.V56: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/555.V56 -------------------------------------------------------------------------------- /SYSTEM/560.V56: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/560.V56 -------------------------------------------------------------------------------- /SYSTEM/996.VOC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/996.VOC -------------------------------------------------------------------------------- /SYSTEM/997.V56: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/997.V56 -------------------------------------------------------------------------------- /SYSTEM/998.V56: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/998.V56 -------------------------------------------------------------------------------- /SYSTEM/999.PAL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/999.PAL -------------------------------------------------------------------------------- /SYSTEM/CONV.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/CONV.SC -------------------------------------------------------------------------------- /SYSTEM/DOOR.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/DOOR.SC -------------------------------------------------------------------------------- /SYSTEM/JUMP.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/JUMP.SC -------------------------------------------------------------------------------- /SYSTEM/OSC.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/OSC.SC -------------------------------------------------------------------------------- /SYSTEM/SAVE.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/SAVE.SC -------------------------------------------------------------------------------- /SYSTEM/SC.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/SC.EXE -------------------------------------------------------------------------------- /SYSTEM/STD.DRV: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/STD.DRV -------------------------------------------------------------------------------- /SYSTEM/USER.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/USER.SC -------------------------------------------------------------------------------- /INTERP/STRING.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/STRING.CPP -------------------------------------------------------------------------------- /INTERP/VMDIBM.HPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/VMDIBM.HPP -------------------------------------------------------------------------------- /INTERP/VMDIMD.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/VMDIMD.CPP -------------------------------------------------------------------------------- /INTERP/VMDMDO.HPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/VMDMDO.HPP -------------------------------------------------------------------------------- /SYSTEM/560H.V56: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/560H.V56 -------------------------------------------------------------------------------- /SYSTEM/560L.V56: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/560L.V56 -------------------------------------------------------------------------------- /SYSTEM/DLGEDIT.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/DLGEDIT.SC -------------------------------------------------------------------------------- /SYSTEM/DSLIDER.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/DSLIDER.SC -------------------------------------------------------------------------------- /SYSTEM/FEATURE.SL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/FEATURE.SL -------------------------------------------------------------------------------- /SYSTEM/GROOPER.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/GROOPER.SC -------------------------------------------------------------------------------- /SYSTEM/LOGGER.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/LOGGER.SC -------------------------------------------------------------------------------- /SYSTEM/MOTION.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/MOTION.SC -------------------------------------------------------------------------------- /SYSTEM/MOVECYC.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/MOVECYC.SC -------------------------------------------------------------------------------- /SYSTEM/PAVOID.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/PAVOID.SC -------------------------------------------------------------------------------- /SYSTEM/PLANE.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/PLANE.SC -------------------------------------------------------------------------------- /SYSTEM/PRINT.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/PRINT.SC -------------------------------------------------------------------------------- /SYSTEM/PRINT.SL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/PRINT.SL -------------------------------------------------------------------------------- /SYSTEM/RANDCYC.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/RANDCYC.SC -------------------------------------------------------------------------------- /SYSTEM/SOUND.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/SOUND.SC -------------------------------------------------------------------------------- /SYSTEM/SYSTEM.SH: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/SYSTEM.SH -------------------------------------------------------------------------------- /SYSTEM/TIMER.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/TIMER.SC -------------------------------------------------------------------------------- /SYSTEM/WINDOW.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/WINDOW.SC -------------------------------------------------------------------------------- /INTERP/PLAYVMD.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/PLAYVMD.CPP -------------------------------------------------------------------------------- /INTERP/VMDBASE.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/VMDBASE.CPP -------------------------------------------------------------------------------- /INTERP/VMDCACHE.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/VMDCACHE.CPP -------------------------------------------------------------------------------- /INTERP/VMDLOOP.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/VMDLOOP.CPP -------------------------------------------------------------------------------- /INTERP/VMDSOUND.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/VMDSOUND.CPP -------------------------------------------------------------------------------- /INTERP/VMDTRACK.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/VMDTRACK.CPP -------------------------------------------------------------------------------- /INTERP/VMDVESA.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/VMDVESA.CPP -------------------------------------------------------------------------------- /INTERP/VMDVIEW.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/INTERP/VMDVIEW.CPP -------------------------------------------------------------------------------- /SYSTEM/BORDWIND.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/BORDWIND.SC -------------------------------------------------------------------------------- /SYSTEM/POLYEDIT.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/POLYEDIT.SC -------------------------------------------------------------------------------- /SYSTEM/RANGEOSC.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/RANGEOSC.SC -------------------------------------------------------------------------------- /SYSTEM/SLIDICON.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/SLIDICON.SC -------------------------------------------------------------------------------- /SYSTEM/WALKTALK.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/WALKTALK.SC -------------------------------------------------------------------------------- /SYSTEM/WRITEFTR.SC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmerMor/SCI32/HEAD/SYSTEM/WRITEFTR.SC -------------------------------------------------------------------------------- /SYSTEM/S.BAT: -------------------------------------------------------------------------------- 1 | call setsys 2 | x:..\tools\sc.exe -dl %1 %2 %3 %4 %5 %6 %7 > sc.err 3 | 4 |  -------------------------------------------------------------------------------- /INTERP/DO.BAT: -------------------------------------------------------------------------------- 1 | copy MIDIWS.I neww 2 | copy MIDI.I neww 3 | copy PMACHINE.I neww 4 | copy OPTBL.I neww 5 |  -------------------------------------------------------------------------------- /INTERP/VCSCFG.BAT: -------------------------------------------------------------------------------- 1 | set vcsdir=i:\sys\sci\vcs\ 2 | set vcssrc=i:\sys\sci\ 3 | set vcscfg=%vcssrc%vcs.cfg 4 | -------------------------------------------------------------------------------- /INTERP/STAMP.BAT: -------------------------------------------------------------------------------- 1 | copy sierra.exe stamped 2 | cd stamped 3 | stampver -ISIERRA.EXE -E 4 | cd \sierra\sq6dos 5 |  -------------------------------------------------------------------------------- /INTERP/MENU.CPP: -------------------------------------------------------------------------------- 1 | #include "sol.hpp" 2 | 3 | #include "kernel.hpp" 4 | 5 | void 6 | KDrawStatus(kArgs) 7 | { 8 | } 9 |  -------------------------------------------------------------------------------- /INTERP/EXCEPT.HPP: -------------------------------------------------------------------------------- 1 | // except.hpp 2 | 3 | #ifndef EXCEPT_HPP 4 | #define EXCEPT_HPP 5 | 6 | void InitExceptions(); 7 | 8 | #endif 9 |  -------------------------------------------------------------------------------- /INTERP/RESTART.HPP: -------------------------------------------------------------------------------- 1 | // restart.hpp 2 | 3 | #ifndef RESTART_HPP 4 | #define RESTART_HPP 5 | 6 | extern int gameRestarted; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /SYSTEM/SETSYS.BAT: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem map s:=..\system32 3 | map s:=apps\vol1:\games\sci\system 4 | set sinclude=..\src;..\msg;s: 5 | set game=999 6 | -------------------------------------------------------------------------------- /INTERP/VCS.CFG: -------------------------------------------------------------------------------- 1 | vcsDir=i:\sys\sci\vcs 2 | journal=i:\sys\sci\vcs\journal 3 | logsuffix=??? 4 | branchWarn 5 | semaphore 6 | writeProtect 7 | logWork = c: 8 | workdir = c: 9 | -------------------------------------------------------------------------------- /INTERP/SYNC.HPP: -------------------------------------------------------------------------------- 1 | // sync.hpp 2 | 3 | #ifndef SYNC_HPP 4 | #define SYNC_HPP 5 | 6 | int FindSync36Entry(ResNum, uchar, uchar, uchar, uchar, int*); 7 | 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /INTERP/SELECT.HPP: -------------------------------------------------------------------------------- 1 | // select.hpp 2 | 3 | #ifndef SELECT_HPP 4 | #define SELECT_HPP 5 | 6 | extern "C" short Nselector(char *,int,int); 7 | #pragma aux (PushArgs) Nselector; 8 | 9 | #endif -------------------------------------------------------------------------------- /SYSTEM/994.VOC: -------------------------------------------------------------------------------- 1 | .)*+"/3456D-J 2 | IFA 7,#($%&'BC 3 |   4 |  5 | 6 |   -------------------------------------------------------------------------------- /INTERP/RECORD.CPP: -------------------------------------------------------------------------------- 1 | #ifdef DEBUG 2 | 3 | #include "sol.hpp" 4 | 5 | #include "kernel.hpp" 6 | #include "record.hpp" 7 | 8 | void 9 | KRecord(kArgs) 10 | { 11 | } 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /INTERP/CRITERR.CPP: -------------------------------------------------------------------------------- 1 | // criterr.cpp 2 | 3 | #include "sol.hpp" 4 | 5 | #include "criterr.hpp" 6 | 7 | CritErrHandler::~CritErrHandler() 8 | { 9 | } 10 | 11 | CritErrHandler* critErrHandler; 12 | -------------------------------------------------------------------------------- /INTERP/HOTKEY.HPP: -------------------------------------------------------------------------------- 1 | // hotkey.hpp 2 | 3 | #ifndef HOTKEY_HPP 4 | #define HOTKEY_HPP 5 | 6 | void HotkeyRequest(); 7 | void Hotkey(); 8 | 9 | extern Bool hotkeyRequest; 10 | 11 | #endif 12 | 13 | 14 | -------------------------------------------------------------------------------- /INTERP/RECORD.HPP: -------------------------------------------------------------------------------- 1 | // record.hpp 2 | 3 | #ifndef RECORD_HPP 4 | #define RECORD_HPP 5 | 6 | #ifdef DEBUG 7 | 8 | class SOL_Event; 9 | 10 | void Recorder(SOL_Event&); 11 | 12 | #endif 13 | #endif 14 | -------------------------------------------------------------------------------- /INTERP/STAMPVER.HPP: -------------------------------------------------------------------------------- 1 | // stampver.hpp 2 | 3 | #ifndef STAMPVER_HPP 4 | #define STAMPVER_HPP 5 | 6 | void VerifyVerStamp(); 7 | int GetVerStamp(); 8 | 9 | extern int mapStamp; 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /INTERP/LANGUAGE.HPP: -------------------------------------------------------------------------------- 1 | // language.hpp 2 | 3 | #ifndef LANGUAGE_HPP 4 | #define LANGUAGE_HPP 5 | 6 | //BEW CHANGED void InitLanguage(); 7 | 8 | extern "C" { 9 | void InitLanguage(); 10 | } 11 | 12 | #endif 13 |  -------------------------------------------------------------------------------- /INTERP/INFO.CPP: -------------------------------------------------------------------------------- 1 | char makeDate[] = __DATE__; 2 | char makeTime[] = __TIME__; 3 | char maker[] = ""; 4 | char makeLocation[] = ""; 5 | char version[] = "2.100.002"; 6 | char makeComment[] = ""; 7 | -------------------------------------------------------------------------------- /INTERP/RESTART.CPP: -------------------------------------------------------------------------------- 1 | #include "sol.hpp" 2 | 3 | #include "kernel.hpp" 4 | #include "restart.hpp" 5 | 6 | void 7 | KGameIsRestarting(kArgs) 8 | { 9 | } 10 | 11 | void 12 | KRestartGame(kArgs) 13 | { 14 | } 15 | 16 | -------------------------------------------------------------------------------- /INTERP/SOUNDWIN.HPP: -------------------------------------------------------------------------------- 1 | // soundwin.hpp 2 | 3 | #ifndef SOUNDWIN_HPP 4 | #define SOUNDWIN_HPP 5 | 6 | void InitWinSound(); 7 | void SetMIDIType(int); 8 | void OpenSnd(); 9 | void CloseSnd(); 10 | 11 | #endif 12 | 13 |  -------------------------------------------------------------------------------- /INTERP/PICTURE.CPP: -------------------------------------------------------------------------------- 1 | #include "sol.hpp" 2 | 3 | #include "kernel.hpp" 4 | 5 | void 6 | KPicNotValid(kArgs) 7 | { 8 | } 9 | 10 | void 11 | KShow(kArgs) 12 | { 13 | } 14 | 15 | void 16 | KDrawPic(kArgs) 17 | { 18 | } 19 |  -------------------------------------------------------------------------------- /INTERP/SCIDLG.HPP: -------------------------------------------------------------------------------- 1 | #define DLG_CONFIRMDAC 100 2 | #define DLG_REQUIREDAC 200 3 | #define DLG_CONFIRMMIDI 300 4 | #define DLG_CHECKBOX 104 5 | #define DLG_CONFIRMREDBK 400 6 | -------------------------------------------------------------------------------- /INTERP/ASM2CPP.HPP: -------------------------------------------------------------------------------- 1 | extern "C" { 2 | 3 | void* pmLock0(); 4 | void setupTossRet(); 5 | 6 | void asm_fatal(int which, int parm1, int parm2, int parm3); 7 | #pragma aux asm_fatal parm [EDX] [EAX] [EBX] [ECX]; 8 | 9 | } 10 | 11 |  -------------------------------------------------------------------------------- /SYSTEM/COUNT.SH: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; COUNT.SH 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; This header file is unused 10 | 11 | 12 | (extern 13 | Count COUNT 0 14 | ) 15 | -------------------------------------------------------------------------------- /INTERP/SCII.HPP: -------------------------------------------------------------------------------- 1 | // scii.hpp 2 | // SCIIBM class 3 | 4 | #ifndef SCII_HPP 5 | #define SCII_HPP 6 | 7 | #ifndef SCI_HPP 8 | #include "sci.hpp" 9 | #endif 10 | 11 | struct SCIIBM : SCI { 12 | void InitExceptions(); 13 | }; 14 | 15 | #endif 16 |  -------------------------------------------------------------------------------- /SYSTEM/LOADMANY.SH: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; LOADMANY.SH 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Pablo Ghenis 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; This header file is unused 10 | 11 | 12 | (extern LoadMany LOADMANY 0) 13 | -------------------------------------------------------------------------------- /SYSTEM/SORT.SH: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; SORT.SH 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1989 5 | ;;;; 6 | ;;;; Author: Pablo Ghenis 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; This header file is unused 10 | 11 | 12 | (extern 13 | KList LSort SORT 0 14 | ) 15 | -------------------------------------------------------------------------------- /SYSTEM/NAMEFIND.SH: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; NAMEFIND.SH 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; This header file is unused 10 | 11 | 12 | (extern 13 | NameFind NAMEFIND 0 14 | ) 15 | -------------------------------------------------------------------------------- /INTERP/KBDD.HPP: -------------------------------------------------------------------------------- 1 | #ifndef KBDD_HPP 2 | #define KBDD_HPP 3 | 4 | #ifndef KBD_HPP 5 | #include "kbd.hpp" 6 | #endif 7 | 8 | struct KbdDOS : Kbd { 9 | Key Get(); 10 | Mod Modifiers(); 11 | Lock LockStatus(); 12 | void Reset(); 13 | }; 14 | 15 | #endif 16 |  -------------------------------------------------------------------------------- /INTERP/PROFILE.CPP: -------------------------------------------------------------------------------- 1 | #ifdef DEBUG 2 | 3 | // profile.cpp 4 | 5 | // we'll implement this when someone actually needs to use it 6 | 7 | #include "sol.hpp" 8 | 9 | #include "kernel.hpp" 10 | 11 | void 12 | KProfiler(kArgs) 13 | { 14 | } 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /INTERP/KBDW.HPP: -------------------------------------------------------------------------------- 1 | #ifndef KBDW_HPP 2 | #define KBDW_HPP 3 | 4 | #ifndef KBD_HPP 5 | #include "kbd.hpp" 6 | #endif 7 | 8 | struct KbdWin : Kbd { 9 | Key Get(); 10 | Mod Modifiers(); 11 | Lock LockStatus() { return 0; } 12 | void Reset(); 13 | }; 14 | 15 | #endif 16 |  -------------------------------------------------------------------------------- /INTERP/CLEAN.BAT: -------------------------------------------------------------------------------- 1 | del *.ob? 2 | del *.?pp 3 | del *.h 4 | del *.i 5 | del *.asm 6 | del *.map 7 | del *.lst 8 | del *.exe 9 | del makefile 10 | del makeinit 11 | del sierra.err 12 | del vcscfg.bat 13 | del vcs.cfg 14 | del *.rc 15 | del *.res 16 | del *.rex 17 | del *.ico 18 | -------------------------------------------------------------------------------- /INTERP/INFO.HPP: -------------------------------------------------------------------------------- 1 | // info.hpp 2 | 3 | #ifndef INFO_HPP 4 | #define INFO_HPP 5 | 6 | extern char makeDate[]; 7 | extern char makeTime[]; 8 | extern char maker[]; 9 | extern char makeLocation[]; 10 | extern char version[]; 11 | extern char makeComment[]; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /SYSTEM/GAME.SH: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; GAME.SH 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Jeff Stephenson 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; This header file is a dummy file to preclude accidentally including 10 | ;;;; a game-specific header 11 | 12 | -------------------------------------------------------------------------------- /SYSTEM/SC.ERR: -------------------------------------------------------------------------------- 1 | Sierra On-Line Script Compiler 4.100 (Jan 12 1995 14:23:57) 2 | (C) 1987-1995 by Sierra On-Line, Inc. All rights reserved. 3 | Class database locked. 4 | 0.sc 5 | No errors. 6 | game.sc 7 | No errors. 8 | bench.sc 9 | No errors. 10 | Class database unlocked. 11 | -------------------------------------------------------------------------------- /INTERP/CRITERRW.HPP: -------------------------------------------------------------------------------- 1 | // criterrw.hpp 2 | 3 | #ifndef CRITERRW_HPP 4 | #define CRITERRW_HPP 5 | 6 | #ifndef CRITERR_HPP 7 | #include "criterr.hpp" 8 | #endif 9 | 10 | class CritErrHandlerWin : public CritErrHandler { 11 | public: 12 | CritErrHandlerWin(); 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /INTERP/INTRPTW.CPP: -------------------------------------------------------------------------------- 1 | // intrptw.cpp 2 | // Dummy version of intrpt.cpp for Windows to enable linking 3 | 4 | #include "sol.hpp" 5 | 6 | #include "intrpt.hpp" 7 | 8 | void 9 | InstallServer(ServerFunc*, int) 10 | { 11 | } 12 | 13 | void 14 | DisposeServer(ServerFunc*) 15 | { 16 | } 17 |  -------------------------------------------------------------------------------- /INTERP/CRITERRW.CPP: -------------------------------------------------------------------------------- 1 | // criterrw.cpp 2 | // Windows specific handler 3 | 4 | #include "sol.hpp" 5 | 6 | #include "criterrw.hpp" 7 | 8 | CritErrHandlerWin::CritErrHandlerWin() 9 | { 10 | // This doesn't work for Windows. Will work on later. TM - 8/18/93 11 | // _harderr(Handler); 12 | } 13 |  -------------------------------------------------------------------------------- /SYSTEM/SIGHT.SH: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; SIGHT.SH 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1992 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; This header file is unused 10 | 11 | 12 | (extern 13 | IsOffScreen SIGHT 0 14 | CantBeSeen SIGHT 1 15 | AngleDiff SIGHT 2 16 | ) 17 | -------------------------------------------------------------------------------- /INTERP/MIDI.HPP: -------------------------------------------------------------------------------- 1 | // midi.hpp 2 | 3 | #ifndef MIDI_HPP 4 | #define MIDI_HPP 5 | 6 | #ifndef INTRPT_HPP 7 | #include "intrpt.hpp" 8 | #endif 9 | 10 | extern "C" { 11 | int DoSound(int, ...); 12 | ServerFunc SoundServer; 13 | }; 14 | #pragma aux (PushArgs) DoSound; 15 | 16 | #endif 17 | 18 |  19 | -------------------------------------------------------------------------------- /INTERP/PALMGRD.HPP: -------------------------------------------------------------------------------- 1 | #ifndef PALMGRD_HPP 2 | #define PALMGRD_HPP 3 | 4 | #ifndef PALMGRI_HPP 5 | #include "palmgri.hpp" 6 | #endif 7 | 8 | 9 | class PaletteMgrDOS : public PaletteMgrIndex 10 | { 11 | public: 12 | PaletteMgrDOS() {} 13 | void UpdateHardware(); 14 | }; 15 | 16 | 17 | #endif 18 |  -------------------------------------------------------------------------------- /INTERP/MSGD.HPP: -------------------------------------------------------------------------------- 1 | // msgd.hpp 2 | 3 | #ifndef MSGD_HPP 4 | #define MSGD_HPP 5 | 6 | #ifndef MSG_HPP 7 | #include "msg.hpp" 8 | #endif 9 | 10 | struct MsgMgrDOS : MsgMgr { 11 | ~MsgMgrDOS(); 12 | void MonoOutput(char* fmt); 13 | void MonoPosition(int row, int col); 14 | }; 15 | 16 | #endif 17 | 18 |  -------------------------------------------------------------------------------- /INTERP/MBOX.HPP: -------------------------------------------------------------------------------- 1 | #ifndef MBOX_HPP 2 | #define MBOX_HPP 3 | 4 | #include 5 | 6 | extern char mbuff[]; 7 | 8 | void MBox (char *, char *); 9 | void SciDisplay (char *,int xOrig=620,int yOrig=400,int width=140,int height=200,int history=50); 10 | Bool MBox2 (char *, char *); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /INTERP/INTRPT.HPP: -------------------------------------------------------------------------------- 1 | // intrpt.hpp 2 | 3 | #ifndef INTRPT_HPP 4 | #define INTRPT_HPP 5 | 6 | typedef void (ServerFunc)(); 7 | #pragma aux (ServerFunc, PushArgs); 8 | 9 | void InstallServer(ServerFunc*, int); 10 | void DisposeServer(ServerFunc*); 11 | void SetInterrupts(); 12 | void ResetInterrupts(); 13 | 14 | #endif 15 |  -------------------------------------------------------------------------------- /INTERP/MSGW.HPP: -------------------------------------------------------------------------------- 1 | // msgw.hpp 2 | 3 | #ifndef MSGW_HPP 4 | #define MSGW_HPP 5 | 6 | #ifndef MSG_HPP 7 | #include "msg.hpp" 8 | #endif 9 | 10 | class MsgMgrWin : public MsgMgr { 11 | public: 12 | ~MsgMgrWin(); 13 | void MonoOutput(char* fmt); 14 | void MonoPosition(int row, int col); 15 | }; 16 | 17 | #endif 18 | 19 |  -------------------------------------------------------------------------------- /INTERP/VMDLIBS.HPP: -------------------------------------------------------------------------------- 1 | #include "VMDMDO.HPP" 2 | #ifdef WINDOWS 3 | #include 4 | #endif 5 | 6 | #include 7 | // #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "compiler.hpp" 15 | #pragma hdrstop 16 |  -------------------------------------------------------------------------------- /INTERP/FAULT.HPP: -------------------------------------------------------------------------------- 1 | // fault.hpp 2 | 3 | #ifndef FAULT_HPP 4 | #define FAULT_HPP 5 | 6 | extern "C" { 7 | void __interrupt __far PanicDiv0(); 8 | void __interrupt __far PanicGP(); 9 | void InitPageFaultHandler(); 10 | }; 11 | #pragma aux (PushArgs) PanicGP; 12 | #pragma aux (PushArgs) PanicDiv0; 13 | #pragma aux (PushArgs) InitPageFaultHandler; 14 | 15 | #endif 16 |  -------------------------------------------------------------------------------- /INTERP/VGA.HPP: -------------------------------------------------------------------------------- 1 | #ifndef VGA_HPP 2 | #define VGA_HPP 3 | 4 | #if !defined (SOL_HPP) 5 | #include "sol.hpp" 6 | #endif 7 | 8 | 9 | class Vga 10 | { 11 | public: 12 | Vga(); 13 | ~Vga(); 14 | void Set320x200(); 15 | void Set640x480(); 16 | void SetText(); 17 | 18 | protected: 19 | int lenx; 20 | int leny; 21 | Int16 startupMode; 22 | }; 23 | 24 | 25 | #endif 26 | 27 | 28 |  -------------------------------------------------------------------------------- /INTERP/MONO.HPP: -------------------------------------------------------------------------------- 1 | // mono.hpp 2 | 3 | #ifndef MONO_HPP 4 | #define MONO_HPP 5 | 6 | extern "C" { 7 | void MonoStr(char* text); 8 | void MonoChar(char); 9 | void MonoSet(int row,int col); 10 | void MonoInit(); 11 | }; 12 | 13 | #pragma aux (PushArgs) MonoStr; 14 | #pragma aux (PushArgs) MonoChar; 15 | #pragma aux (PushArgs) MonoSet; 16 | #pragma aux (PushArgs) MonoInit; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /INTERP/CRITERRD.HPP: -------------------------------------------------------------------------------- 1 | // criterr.hpp 2 | 3 | #ifndef CRITERRD_HPP 4 | #define CRITERRD_HPP 5 | 6 | #ifndef CRITERR_HPP 7 | #include "criterr.hpp" 8 | #endif 9 | 10 | class CritErrHandlerDOS : public CritErrHandler { 11 | public: 12 | CritErrHandlerDOS(); 13 | ~CritErrHandlerDOS(); 14 | 15 | protected: 16 | static int __far Handler(unsigned deverr, unsigned errcode, unsigned far*); 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /INTERP/TIMED.HPP: -------------------------------------------------------------------------------- 1 | // timed.hpp 2 | 3 | #ifndef TIMED_HPP 4 | #define TIMED_HPP 5 | 6 | #ifndef TIME_HPP 7 | #include "time.hpp" 8 | #endif 9 | 10 | struct TimeMgrDOS : TimeMgr { 11 | ulong GetTickCount(); 12 | ulong GetMilliSec(); 13 | void SetTickCount(ulong); 14 | ulong& GetTickRef(); 15 | 16 | }; 17 | 18 | extern "C" ulong sysTicks; 19 | extern "C" ulong GetDOSMillisec(); 20 | 21 | #endif 22 | 23 |  -------------------------------------------------------------------------------- /SYSTEM/CAT.SH: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; CAT.SH 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; This header file is used by CAT.SC 10 | 11 | 12 | (enum -2 13 | YDOWN ;-2 14 | XDOWN ;-1 15 | NODIAG ;zero 16 | XUP ;1 17 | YUP ;2 18 | ) 19 | 20 | (enum 21 | SELFONLY ;FALSE = only animate yourself 22 | DODOITS ;TRUE = execute cast's doits 23 | ) 24 | -------------------------------------------------------------------------------- /INTERP/PALMGRT.HPP: -------------------------------------------------------------------------------- 1 | #ifndef PALMGRT_HPP 2 | #define PALMGRT_HPP 3 | 4 | #ifndef PALMGRI_HPP 5 | #include "palmgri.hpp" 6 | #endif 7 | 8 | class PaletteMgrTrue : public PaletteMgrIndex 9 | { 10 | public: 11 | PaletteMgrTrue() : PaletteMgrIndex() {} 12 | Bool UpdateForFrame(); 13 | 14 | protected: 15 | void ApplyAll(); 16 | void ApplyCycles(); 17 | void ApplyVary(); 18 | void ApplyFade(); 19 | }; 20 | 21 | 22 | #endif 23 |  -------------------------------------------------------------------------------- /INTERP/VOCAB.HPP: -------------------------------------------------------------------------------- 1 | // vocab.hpp 2 | 3 | #ifndef VOCAB_HPP 4 | #define VOCAB_HPP 5 | 6 | // special vocab files containing strings/data need by the system 7 | const KERNEL_VOCAB = 999; 8 | const OPCODE_VOCAB = 998; 9 | const SELECTOR_VOCAB = 997; 10 | const CLASSTBL_VOCAB = 996; 11 | const HELP_VOCAB = 995; 12 | const PROPOFS_VOCAB = 994; 13 | 14 | int GetVocabStr(int moduleNum, int entryNum, char* buffer); 15 | 16 | #endif 17 | 18 |  -------------------------------------------------------------------------------- /INTERP/SHIFTPAL.HPP: -------------------------------------------------------------------------------- 1 | #if !defined(SHIFTPAL_HPP) 2 | #define SHIFTPAL_HPP 3 | 4 | #define PALSHIFT 10 5 | 6 | #ifdef MACINTOSH 7 | extern Bool WING; //KGN defined in shiftpal.cpp 8 | #else 9 | extern Bool WING; 10 | #endif 11 | 12 | int AddPalShift(int val); 13 | void ShiftPaletteView (uchar* resBuffer); 14 | void ShiftPalettePic (uchar* resBuffer); 15 | void ShiftPaletteCel (uchar* resBuffer, long celOffset); 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /INTERP/MSGW.CPP: -------------------------------------------------------------------------------- 1 | // msgw.cpp 2 | 3 | #include "sol.hpp" 4 | #include "config.hpp" 5 | #include "mbox.hpp" 6 | #include "msgw.hpp" 7 | 8 | MsgMgrWin::~MsgMgrWin() 9 | { 10 | if (*fatalStrs) 11 | MBox(fatalStrs, "Panic"); 12 | else if (*quitStr) 13 | MBox(quitStr, "Quit"); 14 | } 15 | 16 | void 17 | MsgMgrWin::MonoOutput(char* str) 18 | { 19 | SciDisplay(str); 20 | } 21 | 22 | void 23 | MsgMgrWin::MonoPosition(int, int) 24 | { 25 | } 26 |  -------------------------------------------------------------------------------- /SYSTEM/TALKERS.SH: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; TALKERS.SH 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: SCI Message Editor 7 | ;;;; Updated: Do not update this file 8 | ;;;; 9 | ;;;; This file defines the default system talkers 10 | 11 | ; TALKERS.SH -- Produced by SCI Message Editor 3.411 12 | ; This file should only be edited with ME 13 | 14 | (define NARRATOR 99) 15 | (define PRINTMSG 97) 16 | (define SYSMSG 98) 17 | -------------------------------------------------------------------------------- /INTERP/KBDMGR.HPP: -------------------------------------------------------------------------------- 1 | #ifndef KBDMGR_HPP 2 | #define KBDMGR_HPP 3 | 4 | class SOL_Event; 5 | 6 | #ifndef KBD_HPP 7 | #include "kbd.hpp" 8 | #endif 9 | 10 | class KbdMgr 11 | { 12 | // a manager that gets keys for SCI 13 | public: 14 | virtual ~KbdMgr() {}; 15 | 16 | virtual void MapToDir(SOL_Event*) const; 17 | virtual Bool Get(SOL_Event*) = 0; 18 | virtual Kbd::Mod Modifiers() = 0; 19 | }; 20 | extern KbdMgr * kbdMgr; 21 | 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /INTERP/NETWORK.HPP: -------------------------------------------------------------------------------- 1 | 2 | 3 | enum { 4 | NET_INFO, 5 | NET_CONNECT, 6 | NET_RECONNECT, 7 | NET_SEND, 8 | NET_DOIT, 9 | NET_DISCONNECT, 10 | NET_PUTMEMO, 11 | NET_GETMEMO, 12 | NET_PARENT, 13 | NET_CHAIN, 14 | NET_OUTDONE, 15 | NET_FLUSH, 16 | NET_GETBAUD, 17 | NET_GETMSG, 18 | NET_SENDBE 19 | }; 20 | 21 | enum sidFunc { 22 | SID_INIT, 23 | SID_ADD, 24 | SID_DELETE, 25 | SID_LOOKUP, 26 | SID_GETLIDS, 27 | SID_GETSIDS, 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /INTERP/TIMED.CPP: -------------------------------------------------------------------------------- 1 | // timed.cpp 2 | 3 | #include "sol.hpp" 4 | 5 | #include "timed.hpp" 6 | 7 | ulong sysTicks; 8 | 9 | ulong 10 | TimeMgrDOS::GetTickCount() 11 | { 12 | return sysTicks; 13 | } 14 | 15 | void 16 | TimeMgrDOS::SetTickCount(ulong ticks) 17 | { 18 | sysTicks = ticks; 19 | } 20 | 21 | ulong & 22 | TimeMgrDOS::GetTickRef() 23 | { 24 | return sysTicks; 25 | } 26 | 27 | ulong 28 | TimeMgrDOS::GetMilliSec() 29 | { 30 | return GetDOSMillisec(); 31 | } 32 |  -------------------------------------------------------------------------------- /INTERP/BUFFERD.CPP: -------------------------------------------------------------------------------- 1 | #include "sol.hpp" 2 | #include "bufferd.hpp" 3 | #include "video.hpp" 4 | #include "graphmgr.hpp" 5 | 6 | 7 | 8 | BufferStd::BufferStd(int xdim, int ydim, uchar* addr) : Buffer(xdim, ydim) 9 | { 10 | start = addr; 11 | } 12 | 13 | 14 | BufferStd::BufferStd(const BufferStd& src) : Buffer(src) 15 | { 16 | start = src.start; 17 | } 18 | 19 | BufferStd& 20 | BufferStd::operator=(const BufferStd& src) 21 | { 22 | start = src.start; 23 | return *this; 24 | } 25 | -------------------------------------------------------------------------------- /INTERP/EVENTW.HPP: -------------------------------------------------------------------------------- 1 | // eventw.hpp 2 | 3 | #ifndef EVENTW_HPP 4 | #define EVENTW_HPP 5 | 6 | #ifndef EVENT_HPP 7 | #include "event.hpp" 8 | #endif 9 | 10 | #ifndef KBD_HPP 11 | #include "kbd.hpp" 12 | #endif 13 | 14 | struct EventMgrWin : EventMgr { 15 | EventMgrWin(); 16 | ~EventMgrWin() {}; 17 | 18 | Bool Get(SOL_Event* event, SOL_Event::Type mask); 19 | 20 | protected: 21 | void FlushKeyboard() {}; 22 | Kbd::Mod GetModifiers(); 23 | void Handle(SOL_Event*); 24 | }; 25 | 26 | #endif 27 |  -------------------------------------------------------------------------------- /INTERP/TIME.HPP: -------------------------------------------------------------------------------- 1 | // time.hpp 2 | 3 | #ifndef TIME_HPP 4 | #define TIME_HPP 5 | 6 | #ifndef SAVEABLE_HPP 7 | #include "saveable.hpp" 8 | #endif 9 | 10 | struct TimeMgr : Saveable 11 | { 12 | virtual ~TimeMgr() {} 13 | 14 | virtual ulong GetTickCount() = 0; 15 | virtual ulong GetMilliSec() = 0; 16 | virtual void SetTickCount(ulong) = 0; 17 | uint SysTime(int func); 18 | 19 | void SaveRestore(SaveGame*, Bool save); 20 | 21 | }; 22 | extern TimeMgr * timeMgr; 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /SYSTEM/RELDPATH.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; RELDPATH.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; A DPath class that uses relative points. 10 | ;;;; 11 | ;;;; Classes: 12 | ;;;; RelDPath 13 | 14 | 15 | (script# RELDPATH) 16 | 17 | 18 | (class RelDPath of DPath 19 | (method (setTarget) 20 | (if (!= (points at value) PATHEND) 21 | (+= x (points at value)) 22 | (+= y (points at (++ value))) 23 | (++ value) 24 | ) 25 | ) 26 | );RelDPath 27 | -------------------------------------------------------------------------------- /INTERP/PDEVICE.HPP: -------------------------------------------------------------------------------- 1 | #ifndef PDEVICE_HPP 2 | #define PDEVICE_HPP 3 | 4 | class SOL_Cursor; 5 | class SOL_Point; 6 | class SOL_Rect; 7 | 8 | class PointerDevice 9 | { 10 | public: 11 | virtual ~PointerDevice() {} 12 | virtual Bool Exists() const = 0; 13 | virtual int GlobalPos(SOL_Point*) const = 0; 14 | 15 | virtual void SetRestrictRect(const SOL_Rect&) = 0; 16 | virtual void ClearRestrictRect() = 0; 17 | virtual void SetPos(const SOL_Point&) = 0; 18 | virtual void Setup(SOL_Cursor&) = 0; 19 | }; 20 | 21 | #endif 22 |  -------------------------------------------------------------------------------- /INTERP/PTRDEV.HPP: -------------------------------------------------------------------------------- 1 | #ifndef PTRDEV_HPP 2 | #define PTRDEV_HPP 3 | 4 | class SOL_Cursor; 5 | class SOL_Point; 6 | class SOL_Rect; 7 | 8 | class PointerDevice 9 | { 10 | public: 11 | virtual ~PointerDevice() {} 12 | virtual Bool Exists() const = 0; 13 | virtual int GlobalPos(SOL_Point*) const = 0; 14 | 15 | virtual void SetRestrictRect(const SOL_Rect&) = 0; 16 | virtual void ClearRestrictRect() = 0; 17 | virtual void SetPos(const SOL_Point&) = 0; 18 | virtual void Setup(SOL_Cursor&) = 0; 19 | }; 20 | 21 | #endif 22 |  -------------------------------------------------------------------------------- /INTERP/SCIDLLWS.H: -------------------------------------------------------------------------------- 1 | #define DLL_START_TIMER 201 2 | #define DLL_STOP_TIMER 202 3 | #define DLL_GET_TICK_COUNT 203 4 | #define DLL_SET_TICK_COUNT 204 5 | #define DLL_SET_CHECK_TIME 205 6 | #define DLL_END_CHECK_TIME 206 7 | #define DLL_SET_MIDI_TYPE 207 8 | #define DLL_DOSOUND 208 9 | #define DLL_OPEN_SOUND 209 10 | #define DLL_CLOSE_SOUND 210 11 | #define DLL_ALLOC_MEM 211 12 | #define DLL_FREE_MEM 212 13 | #define DLL_LOCKABLE_PAGES 213 14 | 15 | #define DLL_DOSND_TERMINATE 301 16 | #define DLL_DOSND_PATCHREQ 302 17 |  -------------------------------------------------------------------------------- /INTERP/KBDW.CPP: -------------------------------------------------------------------------------- 1 | // kbdw.cpp 2 | 3 | #include "sciwin.hpp" 4 | #include "sol.hpp" 5 | #include "kbdw.hpp" 6 | 7 | 8 | Kbd::Key 9 | KbdWin::Get() 10 | { 11 | return 0; 12 | } 13 | 14 | Kbd::Mod 15 | KbdWin::Modifiers() 16 | { 17 | // return Kbd::Mod(_bios_keybrd(_KEYBRD_SHIFTSTATUS) & 0x0F); 18 | // return 0; 19 | return ((GetKeyState(VK_MENU) & 0x8000) ? 8 : 0) | 20 | ((GetKeyState(VK_CONTROL) & 0x8000) ? 4 : 0) | 21 | ((GetKeyState(VK_SHIFT) & 0x8000) ? 3 : 0); 22 | } 23 | 24 | void 25 | KbdWin::Reset() 26 | { 27 | } 28 |  -------------------------------------------------------------------------------- /INTERP/MEMMGRD.HPP: -------------------------------------------------------------------------------- 1 | // memmgrd.hpp 2 | 3 | #ifndef MEMMGRD_HPP 4 | #define MEMMGRD_HPP 5 | 6 | #ifndef MEMMGR_HPP 7 | #include "memmgr.hpp" 8 | #endif 9 | 10 | #define MAX_CONV_ALLOCS 12 11 | 12 | struct MemoryMgrDOS : MemoryMgr { 13 | MemoryMgrDOS() : memPtrDOS(0) {} 14 | 15 | size_t GetSysMemAvail(); 16 | char * GetSysMem(size_t); 17 | size_t GetConvMemAvail(); 18 | char* GetConvMem(size_t); 19 | void FreeConvMem(char *base); 20 | 21 | ~MemoryMgrDOS(); 22 | 23 | protected: 24 | char * memPtrDOS; 25 | }; 26 | 27 | #endif 28 |  -------------------------------------------------------------------------------- /SYSTEM/REGPATH.SH: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; REGPATH.SH 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1992 5 | ;;;; 6 | ;;;; Author: J. Mark Hood 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; This header file is used by REGPATH.SC 10 | 11 | 12 | (define NEXTROOM $7FFF ) ; Marks end of path for a given room. 13 | ; Next value in array is room number. 14 | 15 | (define RP_QUIT 0) ; Cue s caller when finished. 16 | (define RP_STARTOVER $0001) ; Starts region path over when finished. 17 | 18 | (define RP_REVERSE $0002) ; Implemented by: Randy MacNeill 19 | -------------------------------------------------------------------------------- /SYSTEM/RESOURCE.CFG: -------------------------------------------------------------------------------- 1 | view =. 2 | palette =. 3 | pic =. 4 | bitmap =. 5 | 6 | script =.; s:. 7 | heap =.; s:. 8 | text =.; s:. 9 | message =.; s:. 10 | vocab =.; s:. 11 | font =.; s:. 12 | 13 | sound =. 14 | patch =. 15 | audio =. 16 | wave =. 17 | 18 | mouse = YES 19 | soundDrv = std.drv 20 | 21 | xvideoDrv = x:\public\tools\drivers\vesa.drv 22 | 23 | [windows] 24 | title=SCI 32 Benchmarks 25 | wwidth=640 26 | synthtype=basesynth 27 | borderpixels=10 28 | maxCursorSize=4 29 |  -------------------------------------------------------------------------------- /INTERP/INTFLAG.HPP: -------------------------------------------------------------------------------- 1 | #ifndef INTFLAG_HPP 2 | #define INTFLAG_HPP 3 | 4 | 5 | extern "C" { 6 | short ReadInterruptAndClear(); 7 | void SetInterruptFlag(short); 8 | short SetESToDS(); 9 | void SetES(short); 10 | void SetStack(void*, short); 11 | void RestoreStack(short); 12 | } 13 | 14 | #pragma aux (PushArgs) ReadInterruptAndClear; 15 | #pragma aux (PushArgs) SetInterruptFlag; 16 | #pragma aux (PushArgs) SetESToDS; 17 | #pragma aux (PushArgs) SetES; 18 | #pragma aux (PushArgs) SetStack; 19 | #pragma aux (PushArgs) RestoreStack; 20 | 21 | #endif 22 | 23 |  -------------------------------------------------------------------------------- /SYSTEM/64994.SHM: -------------------------------------------------------------------------------- 1 | ; 64994.SHM -- Produced by SCI Message Editor 4.321 2 | ; This file should only be edited with ME 3 | 4 | ; NOUNS 5 | 6 | (define CANCEL_BUTTON 4) 7 | (define CAT_READ_ERROR 11) 8 | (define CHG_DIR_BUTTON 5) 9 | (define DISK_FULL 1) 10 | (define GAME_DISK 8) 11 | (define INSERT_DISK 6) 12 | (define INVALID_DIR 9) 13 | (define NO_MESSAGE 12) 14 | (define OK_BUTTON 2) 15 | (define SAVE_DISK 7) 16 | (define SAVE_ERROR 10) 17 | (define WRONG_INTERP 3) 18 | 19 | ; CASES 20 | 21 | -------------------------------------------------------------------------------- /INTERP/SCIDLL.HPP: -------------------------------------------------------------------------------- 1 | #if !defined(SCIDLL_H) 2 | #define SCIDLL_H 3 | 4 | #define DLL_INIT 1 5 | #define DLL_TICK 3 6 | #define DLL_SOUND_A 4 7 | #define DLL_SOUND_B 5 8 | #define DLL_SOUND_C 6 9 | #define DLL_SOUND_D 7 10 | #define DLL_SOUND_E 8 11 | #define DLL_SOUND_F 9 12 | #define DLL_SOUND_G 10 13 | #define DLL_SET_TYPE 11 14 | #define DLL_OPEN_SND 12 15 | #define DLL_CLOSE_SND 13 16 | #define DLL_TICK_SET 14 17 | #define DLL_SET_CHECK_TIME 15 18 | #define DLL_END_CHECK_TIME 16 19 | #define DLL_WEP 17 20 | 21 | #endif 22 |  -------------------------------------------------------------------------------- /INTERP/KBDMGRW.HPP: -------------------------------------------------------------------------------- 1 | #ifndef KBDMGRW_HPP 2 | #define KBDMGRW_HPP 3 | 4 | #ifndef SCIWIN_HPP 5 | #include "sciwin.hpp" 6 | #endif 7 | 8 | #ifndef KBDMGR_HPP 9 | #include "kbdmgr.hpp" 10 | #endif 11 | 12 | #ifndef KBDW_HPP 13 | #include "kbdw.hpp" 14 | #endif 15 | 16 | 17 | 18 | class KbdMgrWin : public KbdMgr 19 | { 20 | public: 21 | Bool Get(SOL_Event*) {return True;} 22 | Kbd::Mod Modifiers() {return keyboard.Modifiers();} 23 | Bool HandleKey(unsigned, WORD, LONG); 24 | 25 | private: 26 | KbdWin keyboard; 27 | void KeyEvent(WORD); 28 | }; 29 | 30 | 31 | #endif 32 |  -------------------------------------------------------------------------------- /INTERP/SAVEABLE.HPP: -------------------------------------------------------------------------------- 1 | // saveable.hpp 2 | 3 | #ifndef SAVEABLE_HPP 4 | #define SAVEABLE_HPP 5 | 6 | class SaveGame; 7 | 8 | struct Saveable { 9 | typedef void (Saveable::*Func)(SaveGame*, Bool); 10 | 11 | virtual ~Saveable() {} 12 | 13 | virtual void Dump(SaveGame* game, Bool) { SaveRestore(game, False); } 14 | virtual void SaveRestoreBefore(SaveGame*, Bool) {} 15 | virtual void SaveRestore(SaveGame*, Bool) {} 16 | virtual void SaveRestoreAfter(SaveGame*, Bool) {} 17 | 18 | virtual void SaveRestoreDo(Func func, SaveGame* saveGame, Bool save) 19 | { (this->*func)(saveGame, save); } 20 | }; 21 | 22 | #endif 23 |  -------------------------------------------------------------------------------- /INTERP/HOTKEY.CPP: -------------------------------------------------------------------------------- 1 | // integ.cpp 2 | 3 | #include "sol.hpp" 4 | 5 | #ifdef DEBUG 6 | 7 | #include "debug.hpp" 8 | #include "hotkey.hpp" 9 | #include "msg.hpp" 10 | #include "window.hpp" 11 | 12 | 13 | Bool hotkeyRequest = False; 14 | 15 | void 16 | HotkeyRequest() 17 | { 18 | debuggerWasOn = debuggerIsOn; 19 | debuggerIsOn = True; 20 | hotkeyRequest = True; 21 | } 22 | 23 | void 24 | Hotkey() 25 | { 26 | // msgMgr->Mono("press ENTER to continue; ESC for DEBUG\n"); 27 | // if (WaitOnUser()) 28 | // EnterDebug(); 29 | if (!msgMgr->Alert("press ENTER to continue; ESC for DEBUG\n")) 30 | EnterDebug(); 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /INTERP/BUFFERD.HPP: -------------------------------------------------------------------------------- 1 | #ifndef BUFFERD_HPP 2 | #define BUFFERD_HPP 3 | 4 | #include 5 | 6 | #ifndef BUFFER_HPP 7 | #include "buffer.hpp" 8 | #endif 9 | 10 | class BufferStd : public Buffer 11 | { 12 | public: 13 | BufferStd(int xdim, int ydim, uchar*); 14 | BufferStd(const BufferStd&); 15 | BufferStd& operator=(const BufferStd&); 16 | 17 | void Clear(uchar c) const {memset(start, c, xDim*yDim);} 18 | Bool IsNull() const {return start == NULL;} 19 | 20 | uchar* Addr(const int x, const int y) const; 21 | }; 22 | 23 | inline uchar* 24 | BufferStd::Addr(const int x, const int y) const 25 | { 26 | return start + (y * xDim) + x; 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /INTERP/GETI.BAT: -------------------------------------------------------------------------------- 1 | call clean 2 | copy i:\sys\sci\vcs.cfg 3 | copy i:\sys\sci\vcscfg.bat 4 | what c "Get Makefiles? " yn 5 | if %what% == N goto SrcFiles 6 | copy i:makefile 7 | copy i:makeinit 8 | :SrcFiles 9 | what c "Get Source files? " yn 10 | if %what% == N goto WinFiles 11 | copy i:\sys\sci\sierra.err 12 | copy i:\sys\sci\*.i 13 | copy i:\sys\sci\*.h 14 | copy i:\sys\sci\*.asm 15 | copy i:\sys\sci\*.?pp 16 | :WinFiles 17 | what c "Get Windows files? " yn 18 | if %what% == N goto ObjFiles 19 | copy i:*.rc 20 | copy i:*.res 21 | copy i:*.rex 22 | copy i:\sys\sci\*.ico 23 | :ObjFiles 24 | what c "Get object files? " yn 25 | if %what% == N goto End 26 | copy i:*.obj 27 | :End 28 | -------------------------------------------------------------------------------- /INTERP/BUFFER.HPP: -------------------------------------------------------------------------------- 1 | #ifndef BUFFER_HPP 2 | #define BUFFER_HPP 3 | 4 | class SOL_Rect; 5 | 6 | class Buffer 7 | { 8 | public: 9 | virtual uchar* Addr(const int x, const int y) const = 0; 10 | virtual void Clear(uchar) const = 0; 11 | virtual Bool IsNull() const = 0; 12 | int XDim() const {return xDim;} 13 | int YDim() const {return yDim;} 14 | #ifdef DEBUG 15 | Bool Assert() const {return xDim > 0 && yDim > 0;} 16 | #endif 17 | 18 | uchar* start; 19 | 20 | protected: 21 | Buffer(int xdim, int ydim) {xDim = xdim; yDim = ydim;} 22 | Buffer(const Buffer& src) {xDim = src.xDim; yDim = src.yDim;} 23 | int xDim; 24 | int yDim; 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /INTERP/INTEG.HPP: -------------------------------------------------------------------------------- 1 | // integ.hpp 2 | #ifdef DEBUG 3 | #ifndef INTEG_HPP 4 | #define INTEG_HPP 5 | 6 | #define CHECK_OFF 0x00000000 7 | #define CHECK_SIGNATURES 0x00000001 8 | #define CHECK_CHECKSUMS 0x00000002 9 | #define CHECK_FREE 0x00000004 10 | #define CHECK_LISTS 0x00000008 11 | #define CHECK_HEAP 0x00000010 12 | #define CHECK_GLOBALS 0x00000020 13 | #define CHECK_ALL 0x0000003F 14 | #define CHECK_MONO_OFF 0x80000000 15 | 16 | void IntegrityChecking(int mask = CHECK_ALL, char* fmt = 0, ...); 17 | Bool CheckIntegrity(char* fmt = 0, ...); 18 | void CheckIntegrityRequest(); 19 | 20 | extern int checkIntegrity; 21 | extern Bool checkIntegrityRequest; 22 | 23 | #endif 24 | #endif 25 | 26 | 27 |  -------------------------------------------------------------------------------- /SYSTEM/DICON.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; DICON.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Bob Heitman 7 | ;;;; Updated: Brian K. Hughes 8 | ;;;; 9 | ;;;; The dialog icon class. 10 | ;;;; 11 | ;;;; Classes: 12 | ;;;; DIcon 13 | 14 | 15 | (script# DICON) 16 | 17 | 18 | (class DIcon kindof DItem 19 | ;;; Icons are simply a view/loop/cel combination created by the view 20 | ;;; editor VE. They are generally not selectable. 21 | 22 | (properties 23 | type dIcon 24 | ) 25 | 26 | (method (setSize &tmp w h) 27 | (= nsLeft x) 28 | (= nsTop y) 29 | (= nsRight (- (+ nsLeft (CelWide view loop cel)) 1)) 30 | (= nsBottom (- (+ nsTop (CelHigh view loop cel)) 1)) 31 | ) 32 | ) 33 | -------------------------------------------------------------------------------- /SYSTEM/NAMEFIND.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; NAMEFIND.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; Procedure for finding an element of the list whose name matches 10 | ;;;; the search criteria. 11 | ;;;; 12 | ;;;; Procedures: 13 | ;;;; NameFind 14 | 15 | 16 | (script# NAMEFIND) 17 | 18 | 19 | (procedure 20 | NameFind 21 | ) 22 | 23 | (public 24 | NameFind 0 25 | ) 26 | 27 | (procedure (NameFind theNearName theList) 28 | (theList firstTrue: #perform NameComp theNearName) 29 | ) 30 | 31 | (instance NameComp of Code 32 | (properties name "NC") 33 | (method (doit theObj theName) 34 | (== 0 (StrCmp (theObj name) theName)) 35 | ) 36 | ) 37 | -------------------------------------------------------------------------------- /INTERP/BUFFERW.HPP: -------------------------------------------------------------------------------- 1 | #ifndef BUFFERW_HPP 2 | #define BUFFERW_HPP 3 | 4 | #include 5 | 6 | #ifndef BUFFER_HPP 7 | #include "buffer.hpp" 8 | #endif 9 | 10 | class BufferWin : public Buffer 11 | { 12 | public: 13 | BufferWin(int xdim, int ydim, uchar*); 14 | BufferWin(const BufferWin&); 15 | BufferWin& operator=(const BufferWin&); 16 | 17 | void Clear(uchar c) const {memset(start, c, xDim * yDim);} 18 | Bool IsNull() const {return start == NULL;} 19 | 20 | uchar* Addr(const int x, const int y) const; 21 | }; 22 | 23 | #ifndef WIN32S 24 | inline uchar* 25 | BufferWin::Addr(const int x, const int y) const 26 | { 27 | return start + ((yDim - y - 1) * xDim) + x; 28 | } 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /INTERP/CELASM.HPP: -------------------------------------------------------------------------------- 1 | #ifndef CELASM_HPP 2 | #define CELASM_HPP 3 | 4 | extern "C" uchar* colorptr; 5 | extern "C" uchar* destptr; 6 | extern "C" uchar* controlptr; 7 | extern "C" int* scaleptr; 8 | extern "C" int pixelcount; 9 | extern "C" int beginindex; 10 | extern "C" uchar skipval; 11 | 12 | #ifndef MACINTOSH 13 | extern "C" { 14 | #endif 15 | void WriteUncompLine(); 16 | void WriteUncompLineBack(); 17 | void WriteUncompLineBackNoSkip(); 18 | void WriteUncompScaleLine(); 19 | void WriteUncompScaleLine2(); 20 | void WriteUncompScaleLine2Mirr(); 21 | void WriteCompSkipLine(); 22 | void WriteCompSkipLineBack(); 23 | void WriteWholeCompSkipLine(); 24 | #ifndef MACINTOSH 25 | }; 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /SYSTEM/LOADMANY.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; LOADMANY.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Pablo Ghenis 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; This procedure allows loading several resources of a single type. 10 | ;;;; 11 | ;;;; Classes: 12 | ;;;; 13 | ;;;; Procedures: 14 | ;;;; LoadMany 15 | 16 | 17 | (script# LOADMANY) 18 | 19 | 20 | (procedure 21 | LoadMany 22 | ) 23 | 24 | (public 25 | LoadMany 0 26 | ) 27 | 28 | (procedure (LoadMany what which &tmp i theRes) 29 | (for 30 | ((-= argc 2)(= i 0)) 31 | (<= i argc) 32 | ((++ i)) 33 | 34 | (= theRes [which i]) 35 | (if what 36 | (Load what theRes) 37 | else 38 | (DisposeScript theRes) 39 | ) 40 | ) 41 | 42 | (DisposeScript LOADMANY) 43 | ) 44 | -------------------------------------------------------------------------------- /INTERP/AUDIOD.CPP: -------------------------------------------------------------------------------- 1 | // audiod.cpp 2 | // DOS specific digital audio sample playback 3 | 4 | #include "sol.hpp" 5 | 6 | #include "audio.hpp" 7 | #include "config.hpp" 8 | #include "memid.hpp" 9 | 10 | MemID audioDrv; 11 | 12 | unsigned 13 | GetDACDefaultSize(void) 14 | { 15 | return DAC_HBUFFSIZE*2; 16 | } 17 | 18 | void * 19 | LoadAudioDrv(void) 20 | { 21 | char* fileName = configMgr->Get("audioDrv"); 22 | if (!fileName || !*fileName) 23 | return 0; 24 | 25 | /* Load the audio driver. 26 | */ 27 | if (!(audioDrv.Load(MemDriver, fileName, PERSIST, AudioDriverHandle))) { 28 | msgMgr->Alert(Msg_NoAudioDrv, fileName); 29 | return 0; 30 | } 31 | 32 | return (*audioDrv); 33 | } 34 | 35 | void 36 | FreeAudioDrv(void) 37 | { 38 | audioDrv.Free(); 39 | } 40 | -------------------------------------------------------------------------------- /INTERP/BUFFERW.CPP: -------------------------------------------------------------------------------- 1 | #include "sol.hpp" 2 | #include "bufferw.hpp" 3 | #include "rect.hpp" 4 | #include "video.hpp" 5 | #include "graphmgr.hpp" 6 | 7 | #ifdef WIN32S 8 | extern Bool bDIBInverted; 9 | 10 | uchar* 11 | BufferWin::Addr(const int x, const int y) const 12 | { 13 | if (bDIBInverted) 14 | return start + ((yDim - y - 1) * xDim) + x; 15 | else 16 | return start + (y * xDim) + x; 17 | } 18 | #endif 19 | 20 | 21 | BufferWin::BufferWin(int xdim, int ydim, uchar* addr) : Buffer(xdim, ydim) 22 | { 23 | start = addr; 24 | } 25 | 26 | 27 | BufferWin::BufferWin(const BufferWin& src) : Buffer(src) 28 | { 29 | start = src.start; 30 | } 31 | 32 | BufferWin& 33 | BufferWin::operator=(const BufferWin& src) 34 | { 35 | start = src.start; 36 | return *this; 37 | } 38 | -------------------------------------------------------------------------------- /INTERP/TIMEW.HPP: -------------------------------------------------------------------------------- 1 | // timew.hpp 2 | 3 | #ifndef TIMEW_HPP 4 | #define TIMEW_HPP 5 | 6 | #ifndef TIME_HPP 7 | #include "time.hpp" 8 | #endif 9 | 10 | #ifndef WIN32S 11 | extern int far *timeToCheck; 12 | #else 13 | extern int *timeToCheck; 14 | #endif 15 | 16 | class TimeMgrWin : public TimeMgr { 17 | public: 18 | TimeMgrWin(); 19 | ~TimeMgrWin(); 20 | ulong GetTickCount(); 21 | void SetTickCount(ulong); 22 | ulong GetMilliSec(); 23 | void EnableTimer(); 24 | void DisableTimer(); 25 | #ifdef WIN32S 26 | int far *SetCheckTime(int); 27 | void EndCheckTime(int far *); 28 | #else 29 | void SetCheckTime(int, int far *); 30 | #endif 31 | 32 | protected: 33 | #ifndef WIN32S 34 | FARPROC lpTimerCallback; 35 | int timerId; 36 | #endif 37 | }; 38 | 39 | #endif 40 | 41 |  -------------------------------------------------------------------------------- /INTERP/SCID.HPP: -------------------------------------------------------------------------------- 1 | // scid.hpp 2 | 3 | #ifndef SCID_HPP 4 | #define SCID_HPP 5 | 6 | #ifndef SCII_HPP 7 | #include "scii.hpp" 8 | #endif 9 | 10 | class ErrorMgr; 11 | 12 | struct SCIDOS : SCIIBM { 13 | ~SCIDOS(); 14 | 15 | void InitAudio(); 16 | void InitExceptions(); 17 | void InitInterrupts(); 18 | void InitPalette(); 19 | void InitSound(); 20 | 21 | ConfigMgr* MakeConfigMgr(int argc, char* argv[]); 22 | CritErrHandler* MakeCritErrHandler(); 23 | EventMgr* MakeEventMgr(); 24 | GraphicsMgr* MakeGraphicsMgr(); 25 | MemoryMgr* MakeMemoryMgr(); 26 | SOL_Mouse* MakeMouse(); 27 | MsgMgr* MakeMsgMgr(); 28 | TimeMgr* MakeTimeMgr(); 29 | ErrorMgr* MakeErrorMgr(); 30 | }; 31 | void EndVESA(); 32 | 33 | #endif 34 |  35 | -------------------------------------------------------------------------------- /INTERP/CRITERR.HPP: -------------------------------------------------------------------------------- 1 | // criterr.hpp 2 | 3 | #ifndef CRITERR_HPP 4 | #define CRITERR_HPP 5 | 6 | class CritErrHandler { 7 | public: 8 | CritErrHandler() : tripped(False) {} 9 | virtual ~CritErrHandler(); 10 | 11 | // how critical error should be handled 12 | enum Method { 13 | Abort, // allow the user to retry or abort program 14 | Retry, // allow the user to retry or return failure to caller 15 | Fail // return failure to the caller without user input 16 | }; 17 | 18 | void Clear() { tripped = False; } 19 | Method SetMethod(Method m) { Method rc = method; method = m; return rc; } 20 | Bool Tripped() { return tripped; } 21 | 22 | protected: 23 | Method method; 24 | volatile Bool tripped; 25 | 26 | }; 27 | extern CritErrHandler * critErrHandler; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /INTERP/BLOB.HPP: -------------------------------------------------------------------------------- 1 | 2 | const int blobListSize = 10; 3 | class BlobRect { 4 | 5 | BlobRect(){}; 6 | 7 | protected: 8 | int top,left,bottom,right; // corner offsets in the source bitmap 9 | int bitmapWidth; 10 | int squareSize; 11 | 12 | public: 13 | BlobRect(int squareSize, int bitmapWidth,int top, int left, int bottom,int right); 14 | ~BlobRect() {}; 15 | void BlobIt(char * bitmap); 16 | }; 17 | 18 | class Blob { 19 | protected: 20 | int bitmapWidth; 21 | int bitmapHeight; 22 | BlobRect * blobRects[blobListSize]; 23 | 24 | public: 25 | Blob(int bitmapWidth,int bitmapHeight); 26 | ~Blob(); 27 | int AddRect(int squareSize, int top, int left,int bottom,int right); // return rect no 28 | void DeleteRect(int rectNo); 29 | void Process(char * bitmap); // do all the blobs in the list 30 | }; 31 |  -------------------------------------------------------------------------------- /INTERP/MESSAGE.HPP: -------------------------------------------------------------------------------- 1 | // message.hpp 2 | 3 | #ifndef MESSAGE_HPP 4 | #define MESSAGE_HPP 5 | 6 | #ifndef SAVEABLE_HPP 7 | #include "saveable.hpp" 8 | #endif 9 | 10 | struct MessageMgr : Saveable { 11 | void SaveRestore(SaveGame*, Bool save); 12 | }; 13 | extern MessageMgr messageMgr; 14 | 15 | const MessageMajorVersion = 4000; 16 | 17 | _Packed struct IndexEntry { 18 | uchar noun; 19 | uchar verb; 20 | uchar cond; 21 | uchar seq; 22 | uchar talker; 23 | UInt16 offset; 24 | uchar refNoun; 25 | uchar refVerb; 26 | uchar refCond; 27 | uchar refSeq; 28 | }; 29 | 30 | _Packed struct MsgData { 31 | UInt32 version; 32 | UInt16 length; // size of file starting at count field, excluding 33 | // comments 34 | UInt16 lastMsgNum; 35 | UInt16 nEntries; 36 | IndexEntry entries[1]; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /SYSTEM/COUNT.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; COUNT.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: Brian K. Hughes 8 | ;;;; 9 | ;;;; This procedure counts how many members of a list return TRUE from 10 | ;;;; performing a piece of code. 11 | ;;;; 12 | ;;;; Classes: 13 | ;;;; 14 | ;;;; Procedures: 15 | ;;;; Count 16 | 17 | 18 | (script# COUNT) 19 | 20 | 21 | (procedure 22 | Count 23 | ) 24 | 25 | (public 26 | Count 0 27 | ) 28 | 29 | (procedure (Count theList theCode &tmp theCount theNode) 30 | (for 31 | ( (= theNode (KList LFirstNode (theList elements))) 32 | (= theCount 0) 33 | ) 34 | theNode 35 | ( (= theNode (KList LNextNode theNode)) 36 | ) 37 | 38 | (if (theCode doit (KList LNodeValue theNode) &rest) 39 | (++ theCount) 40 | ) 41 | ) 42 | (return theCount) 43 | ) 44 | -------------------------------------------------------------------------------- /INTERP/WINCLASS.HPP: -------------------------------------------------------------------------------- 1 | 2 | 3 | class Main 4 | { 5 | public: 6 | static HINSTANCE hInstance; 7 | static HINSTANCE hPrevInstance; 8 | static LPSTR lpszCmdLine; 9 | static int nCmdShow; 10 | static int MessageLoop( void ); 11 | }; 12 | 13 | class Window 14 | { 15 | protected: 16 | HWND hWnd; 17 | public: 18 | // Provide (read) access to the window's handle in case it is needed 19 | // elsewhere. 20 | HWND GetHandle( void ) { return hWnd; } 21 | 22 | // Pure virtual function makes Window an abstract class. 23 | virtual LRESULT WndProc( UINT iMessage, WPARAM wParam, LPARAM lParam ) = 0; 24 | }; 25 | 26 | class MainWindow : public Window 27 | { 28 | public: 29 | 30 | // Do not create unless previously registered. 31 | MainWindow( void ); 32 | LRESULT WndProc( UINT iMessage, WPARAM wParam, LPARAM lParam ); 33 | 34 | }; 35 | 36 |  -------------------------------------------------------------------------------- /INTERP/EVENTD.HPP: -------------------------------------------------------------------------------- 1 | // eventd.hpp 2 | 3 | #ifndef EVENTD_HPP 4 | #define EVENTD_HPP 5 | 6 | #ifndef EVENT_HPP 7 | #include "event.hpp" 8 | #endif 9 | 10 | #ifndef KBD_HPP 11 | #include "kbd.hpp" 12 | #endif 13 | 14 | /* struct JoystickEvent { 15 | ushort type; 16 | ushort message; 17 | ushort modifiers; 18 | };*/ 19 | 20 | // typedef struct JoystickEvent JoystickEvent; 21 | 22 | /* 23 | extern "C" { 24 | Bool JoyInit(); 25 | void PollJoystick(JoystickEvent*); 26 | } 27 | #pragma aux (PushArgs) JoyInit; 28 | #pragma aux (PushArgs) PollJoystick; 29 | */ 30 | 31 | 32 | struct EventMgrDOS : EventMgr { 33 | EventMgrDOS(); 34 | ~EventMgrDOS(); 35 | 36 | Bool Get(SOL_Event* event, SOL_Event::Type mask); 37 | 38 | protected: 39 | void FlushKeyboard(); 40 | Kbd::Mod GetModifiers(); 41 | void Handle(SOL_Event*); 42 | Bool joystickExists; 43 | }; 44 | 45 | #endif 46 |  -------------------------------------------------------------------------------- /SYSTEM/FORCOUNT.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; FORCOUNT.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc., 1993 5 | ;;;; 6 | ;;;; Author: J. Mark Hood 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; Cycles its client a specified number of times. 10 | ;;;; Usage is: 11 | ;;;; 12 | ;;;; (theProp setCycle: ForwardCounter numOfCycles whoCares) 13 | ;;;; 14 | ;;;; Classes: 15 | ;;;; ForwardCounter 16 | 17 | 18 | (script# FORCOUNT) 19 | 20 | 21 | (class ForwardCounter kindof Forward 22 | (properties 23 | count 0 24 | ) 25 | 26 | (method (init theObj num whoCares) 27 | (super init: theObj) 28 | (if (>= argc 2) (= count num) 29 | (if (>= argc 3) (= caller whoCares) 30 | ) 31 | ) 32 | ); init 33 | 34 | (method (cycleDone) 35 | (if (-- count) 36 | (super cycleDone:) 37 | else 38 | (= completed TRUE) 39 | (self motionCue:) 40 | ) 41 | ); cycleDone 42 | 43 | ); ForwardCounter 44 | 45 | 46 | -------------------------------------------------------------------------------- /INTERP/BREAKPT.HPP: -------------------------------------------------------------------------------- 1 | // breakpt.hpp 2 | #ifdef DEBUG 3 | #ifndef BREAKPT_HPP 4 | #define BREAKPT_HPP 5 | 6 | class Breakpoint; 7 | class DebugMenu; 8 | class ObjectID; 9 | 10 | struct Breakpoints { 11 | Breakpoints(); 12 | Bool AreAny() { return nEntries != 0; } 13 | void Clear(); 14 | Bool HandleEvent(int cmd); 15 | void SetPropertyBreakpoint(ObjectID obj, Bool sticky = False); 16 | void StepOver(); 17 | void StepSource(); 18 | void StepOverSource(); 19 | void Test(); 20 | 21 | void Remove(Breakpoint&); // used only by Breakpoint::Clear() 22 | 23 | protected: 24 | void Add(Breakpoint&); 25 | void Set(Breakpoint&, Bool sticky = False); 26 | void StepOut(); 27 | 28 | enum { Size = 20 }; 29 | 30 | Breakpoint* entries[Size]; 31 | int nEntries; 32 | 33 | }; 34 | 35 | extern Breakpoints breakpoints; 36 | 37 | extern DebugMenu breakpointMenu; 38 | 39 | #endif 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /INTERP/MSGD.CPP: -------------------------------------------------------------------------------- 1 | // msgd.cpp 2 | 3 | #include 4 | 5 | #include "sol.hpp" 6 | 7 | #include "config.hpp" 8 | #include "mono.hpp" 9 | #include "msgd.hpp" 10 | 11 | MsgMgrDOS::~MsgMgrDOS() 12 | { 13 | if (*quitStr) { 14 | puts("\n"); 15 | puts(quitStr); 16 | } 17 | if (*fatalStrs) { 18 | // make sure someone's prompt doesn't obscure the message 19 | puts("\n"); 20 | puts(fatalStrs); 21 | 22 | if (*sciFatalStr) 23 | puts(sciFatalStr); 24 | } 25 | } 26 | 27 | void 28 | MsgMgrDOS::MonoOutput(char* str) 29 | { 30 | #ifdef DEBUG 31 | if (configMgr->Get(configMgr->WVIDEO)) 32 | return; 33 | #endif 34 | ::MonoStr(str); 35 | } 36 | 37 | void 38 | MsgMgrDOS::MonoPosition(int row, int col) 39 | { 40 | // position the mono monitor next char output 41 | 42 | #ifdef DEBUG 43 | if (configMgr->Get(configMgr->WVIDEO)) 44 | return; 45 | #endif 46 | MonoSet(row,col); 47 | } 48 |  49 | -------------------------------------------------------------------------------- /INTERP/MEMMGRW.HPP: -------------------------------------------------------------------------------- 1 | // memmgrw.hpp 2 | 3 | #ifndef MEMMGRW_HPP 4 | #define MEMMGRW_HPP 5 | 6 | #ifndef MEMMGR_HPP 7 | #include "memmgr.hpp" 8 | #endif 9 | 10 | #define NOPAGELOCK 0 11 | #define PAGELOCK 1 12 | 13 | #ifndef WIN32S 14 | void far * AllocWinMem(int size, int pageLock); 15 | void FreeWinMem(void far *lpMem, int pageLock); 16 | #else 17 | void * AllocWinMem(int size, int pageLock); 18 | void FreeWinMem(void *lpMem, int pageLock); 19 | #endif 20 | void GetWindowsMemory(void); 21 | 22 | 23 | struct MemoryMgrWin : MemoryMgr { 24 | MemoryMgrWin() : memPtrWin(0) {} 25 | ~MemoryMgrWin(); 26 | size_t GetSysMemAvail(); 27 | char * GetSysMem(size_t); 28 | size_t GetConvMemAvail(); 29 | char* GetConvMem(size_t); 30 | void FreeConvMem(char *base); 31 | 32 | protected: 33 | char * memPtrWin; 34 | unsigned totLockSize; 35 | short linAddrHi; 36 | short linAddrLo; 37 | }; 38 | 39 | #endif 40 |  -------------------------------------------------------------------------------- /SYSTEM/MOVEFWD.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; MOVEFWD.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1990 5 | ;;;; 6 | ;;;; Author: J. Mark Hood 7 | ;;;; Updated: J. Mark Hood 8 | ;;;; 9 | ;;;; Moves an Actor forward depending on his heading. 10 | ;;;; Cues caller when completed as usual for movers. 11 | ;;;; 12 | ;;;; Usage: theActor setMotion: MoveFwd distance whoToCue 13 | ;;;; 14 | ;;;; Modified 4/24/91 to be a kind of PolyPath (JMH) 15 | ;;;; 16 | ;;;; Classes: 17 | ;;;; MoveFwd 18 | ;;;; 19 | 20 | 21 | (script# MOVEFWD) 22 | 23 | 24 | (class MoveFwd kindof PolyPath 25 | (methods 26 | init 27 | ) 28 | 29 | (method (init actor dist toCall) 30 | (if argc 31 | (super init: 32 | actor 33 | (+ (actor x?) (SinMult (actor heading?) dist)) 34 | (- (actor y?) (CosMult (actor heading?) dist)) 35 | (if (>= argc 3) toCall) 36 | ) 37 | else 38 | (super init:) 39 | ) 40 | ) 41 | ) 42 | 43 | -------------------------------------------------------------------------------- /INTERP/GRAPHBUF.HPP: -------------------------------------------------------------------------------- 1 | #ifndef GRAPHBUF_HPP 2 | #define GRAPHBUF_HPP 3 | 4 | #ifndef GRAPHMGR_HPP 5 | #include "graphmgr.hpp" 6 | #endif 7 | 8 | class GraphicsMgrBuffered : public GraphicsMgr 9 | { 10 | public: 11 | GraphicsMgrBuffered(int xdim, int ydim); 12 | ~GraphicsMgrBuffered() {} 13 | 14 | int ScreenCount() const {return 1;} 15 | const Screen& VisibleScreen() const {return last;} 16 | const Screen& NextScreen() const {return next;} 17 | 18 | Bool IsOnMe(const ScreenItemDef&, const SOL_Point&, Bool checkSkip); 19 | void UpdateScreen() {last = next;} 20 | Bool PlaneExistsLast(int planeId) {return last.PlaneExists(planeId);} 21 | void ClearLastScreen() {last.Clear();} 22 | Screen* CurrScreen() {return &last;} 23 | 24 | protected: 25 | void CalcLists(ScreenItemList** draw, IRectList** erase); 26 | 27 | Screen last; 28 | }; 29 | 30 | #endif 31 | 32 |  -------------------------------------------------------------------------------- /SYSTEM/POLYGON.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; POLYGON.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1990 5 | ;;;; 6 | ;;;; Author: J. Mark Hood 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; A Polygon is an obstacle used by the polygon avoider. They can also 10 | ;;;; be used as onMe checks for Features. 11 | ;;;; 12 | ;;;; Classes: 13 | ;;;; Polygon 14 | 15 | 16 | (script# POLYGON) 17 | 18 | 19 | (class Polygon kindof Object 20 | (properties 21 | size 0 22 | points 0 23 | type PNearestAccess 24 | dynamic FALSE 25 | ) 26 | (methods 27 | onMe 28 | ) 29 | 30 | (method (init thePoints &tmp i arg) 31 | (= size (/ argc 2)) 32 | (= points (IntArray with: thePoints &rest)) 33 | (= dynamic TRUE) 34 | ) 35 | 36 | (method (dispose) 37 | (if (and dynamic points) 38 | (points dispose:) 39 | ) 40 | (super dispose:) 41 | ) 42 | (method (onMe oX oY) 43 | (return (InPolygon oX oY self)) 44 | ) 45 | ) 46 | 47 | -------------------------------------------------------------------------------- /INTERP/MAGNIFY.HPP: -------------------------------------------------------------------------------- 1 | 2 | #ifndef MAGNIFY_HPP 3 | #define MAGNIFY_HPP 4 | 5 | #ifndef MEMID_HPP 6 | #include "memid.hpp" 7 | #endif 8 | 9 | #ifndef OBJECT_HPP 10 | #include "object.hpp" 11 | #endif 12 | 13 | #ifndef POINT_HPP 14 | #include "point.hpp" 15 | #endif 16 | 17 | #ifndef RECT_HPP 18 | #include "rect.hpp" 19 | #endif 20 | 21 | #ifndef GRAPHMGR_HPP 22 | #include "graphmgr.hpp" 23 | #endif 24 | 25 | class MagnifyView 26 | { 27 | public: 28 | MagnifyView(ObjectID ID, MagnifyView* theNext); 29 | ~MagnifyView(); 30 | 31 | void FillData(SOL_Point pt); 32 | void Update(); 33 | 34 | ObjectID id, magID; 35 | MemID BMData, FGData, BGData; 36 | int BMWidth, BMHeight, BGWidth, BGHeight; 37 | int view, loop, cel; 38 | SOL_Point org; 39 | SOL_Rect boundry; 40 | uchar remapColor; 41 | uchar skip; 42 | int power; 43 | MagnifyView* next; 44 | ScreenItem* si; 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /INTERP/VOCAB.CPP: -------------------------------------------------------------------------------- 1 | // vocab.cpp 2 | 3 | #include "sol.hpp" 4 | 5 | #include "resource.hpp" 6 | #include "vocab.hpp" 7 | 8 | int 9 | GetVocabStr(int moduleNum, int entryNum, char* dest) 10 | { 11 | // Get a handle to the appropriate resource. 12 | MemID dh = resMgr->Get(MemResVocab, moduleNum); 13 | char* dp = (char*) *dh; 14 | 15 | // Value check the requested entryNum (first int of resource contains 16 | // the maximum directory entry). 17 | if (entryNum > *(SCIWord*) dp) 18 | return 0; 19 | 20 | // Get a pointer to the data by looking up its offset in the directory. 21 | int ofs = ((SCIWord*) dp)[entryNum + 1]; 22 | dp += ofs; 23 | 24 | // Get the length of the data. 25 | int length = *(SCIWord*) dp; 26 | dp += 2; 27 | 28 | // Copy the data to its destination. 29 | for (int i = length; i > 0 ; --i) 30 | *dest++ = *dp++; 31 | *dest = 0; 32 | 33 | // Return the length of the data. 34 | return length; 35 | } 36 |  -------------------------------------------------------------------------------- /SYSTEM/REVERSE.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; REVERSE.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: Greg Tomko-Pavia 8 | ;;;; 9 | ;;;; Cycles client's cel constantly in reverse, wrapping to the last cel 10 | ;;;; in the client's loop when the cel goes below 0. 11 | ;;;; 12 | ;;;; Classes: 13 | ;;;; Reverse 14 | 15 | 16 | (script# REVERSE) 17 | 18 | 19 | (class Reverse kindof Cycle 20 | (properties 21 | name "Rev" 22 | cycleDir -1 23 | ) 24 | 25 | (method (doit &tmp newCel) 26 | (if 27 | (!= (client cel?) (= newCel (self nextCel:))) 28 | ;Do nothing if no change, avoids updating every cycle 29 | (if (< newCel 0) 30 | (self cycleDone:) 31 | else 32 | (client cel: newCel) 33 | ) 34 | ) 35 | ) 36 | 37 | 38 | (method (cycleDone) 39 | ;; When 'done', reset to last cel and keep going. 40 | (client cel: (client lastCel:)) 41 | ) 42 | ) 43 | 44 |  -------------------------------------------------------------------------------- /INTERP/TEXTID.HPP: -------------------------------------------------------------------------------- 1 | // textid.hpp 2 | 3 | #ifndef TEXTID_HPP 4 | #define TEXTID_HPP 5 | 6 | #ifndef MEMID_HPP 7 | #include "memid.hpp" 8 | #endif 9 | 10 | #ifndef MEMTYPE_HPP 11 | #include "memtype.hpp" 12 | #endif 13 | 14 | struct TextID : MemID { 15 | TextID(); 16 | TextID(const MemID&); 17 | TextID(SOL_Handle); 18 | 19 | TextID& operator =(const char*); 20 | char* operator *() { return handle ? (char*) MemID::operator*() : ""; } 21 | 22 | void Add(char c); 23 | void Add(const char* str); 24 | void Add(TextID); 25 | void AddF(const char* fmt, ...); 26 | void Get(size_t size, MemAttrs attrs = MOVEABLE) 27 | { 28 | MemID::Get(MemText, size, attrs); 29 | } 30 | void Get(size_t size, ReservedHandle h, MemAttrs a = 0) 31 | { 32 | MemID::Get(MemText, size, a | PERSIST, 0, 0, 0, h); 33 | } 34 | 35 | char* Lock(); 36 | void Snug(); 37 | 38 | protected: 39 | void AddSize(size_t additionalSize); 40 | }; 41 | 42 | #endif 43 |  -------------------------------------------------------------------------------- /INTERP/LZSS.HPP: -------------------------------------------------------------------------------- 1 | #if !defined LZSS_HPP 2 | #define LZSS_HPP 3 | 4 | class LZSS { 5 | 6 | public: 7 | 8 | LZSS(); 9 | ~LZSS(); 10 | long Encode(char * inBuffer, long remaining, char * outBuffer); 11 | long Decode(char * inBuffer, long remaining, char * outBuffer, long outputLength); 12 | 13 | private: 14 | 15 | int initError; 16 | void InitTree(void); 17 | void InsertNode(short r); 18 | void DeleteNode(short p); 19 | 20 | long textsize; /* text size counter */ 21 | long codesize; /* code size counter */ 22 | 23 | unsigned char * text_buf; /* ring buffer of size N, 24 | with extra F-1 bytes to facilitate string comparison */ 25 | 26 | short match_position; 27 | short match_length; /* of longest match. These are 28 | set by the InsertNode() procedure. */ 29 | 30 | short * lson; 31 | short * rson; 32 | short * dad; /* left & right children & parents -- These constitute binary search trees. */ 33 | 34 | 35 | }; 36 | 37 | 38 | #endif 39 |  -------------------------------------------------------------------------------- /INTERP/LANGUAGE.CPP: -------------------------------------------------------------------------------- 1 | // language.cpp 2 | 3 | #include "sol.hpp" 4 | 5 | #include "config.hpp" 6 | #include "language.hpp" 7 | #include "msg.hpp" 8 | #include "object.hpp" 9 | #include "pmachine.hpp" 10 | #include "selector.hpp" 11 | 12 | // Country codes per the phone book 13 | const ENGLISH = 1; 14 | const JAPANESE = 81; 15 | const GERMAN = 49; 16 | const FRENCH = 33; 17 | const SPANISH = 34; 18 | const ITALIAN = 39; 19 | const PORTUGUESE = 351; 20 | 21 | void 22 | InitLanguage() 23 | { 24 | int language = configMgr->GetNum("language", 0, ENGLISH); 25 | if ((int) pm.game) 26 | switch(language) { 27 | case ENGLISH: 28 | case JAPANESE: 29 | case GERMAN: 30 | case FRENCH: 31 | case SPANISH: 32 | case ITALIAN: 33 | case PORTUGUESE: 34 | //BEW CHANGED pm.game.SetProperty(s_printLang, language); 35 | pmGameSetProp(s_printLang, language); 36 | return; 37 | } 38 | 39 | msgMgr->Fatal(SrcLoc, Msg_UnknownLanguage, language); 40 | } 41 |  -------------------------------------------------------------------------------- /INTERP/HEAPLEAK.HPP: -------------------------------------------------------------------------------- 1 | // heapleak.hpp 11/15/93 2 | // interface to object that checks heap leaks 3 | 4 | #ifndef HEAPLEAK_HPP 5 | #define HEAPLEAK_HPP 6 | 7 | #ifndef DOS_HPP 8 | #include "dos.hpp" 9 | #endif 10 | 11 | // set this define to 1 to turn on heap checking, or 0 for normal 12 | #define CHECKHEAPLEAKS 0 13 | 14 | class HeapLeakChecker { 15 | #if CHECKHEAPLEAKS 16 | public: 17 | HeapLeakChecker() : nEntries(0) {} 18 | ~HeapLeakChecker(); 19 | 20 | private: 21 | friend void* operator new(size_t size, char* file, int line); 22 | friend void* operator new(size_t size); 23 | friend void operator delete(void* p); 24 | 25 | enum { Size = 3000 }; 26 | 27 | struct Allocation { 28 | void* p; 29 | char file[MaxFName + MaxExt + 1]; 30 | int line; 31 | } allocations[Size]; 32 | 33 | void Add(char* file, int line, void* p); 34 | void Delete(void* p); 35 | 36 | int nEntries; 37 | 38 | #endif 39 | }; 40 | extern HeapLeakChecker * heapLeakChecker; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /INTERP/NEWW.HPP: -------------------------------------------------------------------------------- 1 | #if !defined(NEWW_HPP) 2 | #define NEWW_HPP 3 | 4 | void InitLocalCache(void); 5 | void* AllocInLocal(size_t size); 6 | void InitMemoryCache(void); 7 | void* AllocInTables(size_t size,char* file,int line); 8 | void DisplayStats(int cacheNum); 9 | 10 | // define header size and size of local cache 11 | #define HEADERSIZE 4 12 | #define LOCALSIZE 600 13 | 14 | // define cache IDs 15 | #define NEW_CACHE_ONE 1 16 | #define NEW_CACHE_TWO 2 17 | #define NEW_CACHE_THREE 3 18 | #define NEW_CACHE_LOCAL 6 19 | #define NEW_CACHE_RESERVE 7 20 | #define NEW_CACHE_MEMMGR 9 21 | 22 | extern int reserveSize; 23 | extern int cacheSize1; 24 | extern int entrySize1; 25 | extern int cacheSize2; 26 | extern int entrySize2; 27 | extern int cacheSize3; 28 | extern int entrySize3; 29 | 30 | extern void *newCacheAddr; 31 | extern int newState; 32 | 33 | enum newStateVals { 34 | NEW_FIRST_CALL, 35 | NEW_PRE_MEM_CACHE, 36 | NEW_MEM_CACHE_AVAIL, 37 | NEW_USE_MEM_CACHE 38 | }; 39 | 40 | 41 | #endif 42 | 43 |  -------------------------------------------------------------------------------- /SYSTEM/REMAKE.LST: -------------------------------------------------------------------------------- 1 | system 2 | array 3 | rect 4 | string 5 | timer 6 | tutorial 7 | 8 | sound 9 | qsound 10 | 11 | motion 12 | reverse 13 | chase 14 | follow 15 | wander 16 | polygon 17 | polypath 18 | 19 | walktalk 20 | 21 | sync 22 | jump 23 | feature 24 | scaler 25 | actor 26 | cursor 27 | magnify 28 | 29 | styler 30 | ditem 31 | dtext 32 | dbutton 33 | dedit 34 | dicon 35 | dslider 36 | plane 37 | dselectr 38 | filesel 39 | intrface 40 | dialog 41 | 42 | print 43 | 44 | iconbar 45 | invent 46 | 47 | user 48 | ego 49 | block 50 | sort 51 | count 52 | file 53 | save 54 | game 55 | messager 56 | orbit 57 | path 58 | sight 59 | stopwalk 60 | grooper 61 | smooper 62 | cat 63 | dcicon 64 | dpath 65 | reldpath 66 | regpath 67 | loadmany 68 | forcount 69 | track 70 | approach 71 | logger 72 | movefwd 73 | movecyc 74 | randcyc 75 | osc 76 | rangeosc 77 | polyedit 78 | pmouse 79 | pchase 80 | pfollow 81 | pavoid 82 | talker 83 | conv 84 | flippoly 85 | inset 86 | scaleto 87 | door 88 | flags 89 | speedtst 90 | 91 |  -------------------------------------------------------------------------------- /INTERP/CURSOR.HPP: -------------------------------------------------------------------------------- 1 | #ifndef CURSOR_HPP 2 | #define CURSOR_HPP 3 | 4 | #ifndef SAVEABLE_HPP 5 | #include "saveable.hpp" 6 | #endif 7 | 8 | #ifndef CELOBJ_HPP 9 | #include "celobj.hpp" 10 | #endif 11 | 12 | class SOL_Rect; 13 | class SOL_Point; 14 | class PointerDevice; 15 | 16 | 17 | class SOL_Cursor : public Saveable 18 | { 19 | public: 20 | virtual ~SOL_Cursor() {} 21 | virtual void Hide() = 0; 22 | virtual void UnHide() = 0; 23 | virtual void Show() = 0; 24 | virtual void Set(int v, int l, int c) = 0; 25 | virtual Bitmap& Get() = 0; 26 | virtual void DeviceMovedTo(const SOL_Point&) = 0; // Called via interrupts 27 | virtual void ForcePos(SOL_Point) = 0; 28 | virtual void GonnaPaint(SOL_Rect) = 0; 29 | virtual void PaintStarting() = 0; 30 | virtual void DonePainting() = 0; 31 | virtual void SetRestrictRect(const SOL_Rect&) = 0; 32 | virtual void ClearRestrictRect() = 0; 33 | virtual void SetDevice(PointerDevice&) = 0; 34 | virtual int GetHideCount() = 0; 35 | }; 36 | 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /INTERP/PLIST.HPP: -------------------------------------------------------------------------------- 1 | #ifndef PLIST_HPP 2 | #define PLIST_HPP 3 | 4 | #ifndef PLANE_HPP 5 | #include "plane.hpp" 6 | #endif 7 | 8 | #include 9 | 10 | const MAXPLANES = 100; 11 | 12 | class PlaneList 13 | { 14 | public: 15 | // Create & destroy object 16 | PlaneList(); 17 | ~PlaneList(); 18 | PlaneList(const PlaneList&); 19 | const PlaneList& operator=(const PlaneList&); 20 | 21 | // Const Methods 22 | int Length() const {return length;} 23 | int Search(long id) const; // ID BASED 24 | int TopPlane() const; 25 | int TopSCIPlane() const; 26 | const Plane& operator[](int index) const {return *planeArray[index];} 27 | 28 | // Normal methods 29 | Plane& operator[](int index) {return *planeArray[index];} 30 | Plane* Pointer(int index) {return planeArray[index];} 31 | int Add(Plane*); // cant be const 32 | void Delete(int index); 33 | void Clear(); 34 | void Sort(); 35 | 36 | protected: 37 | Plane* planeArray[MAXPLANES]; 38 | int length; 39 | }; 40 | 41 | 42 | #endif 43 |  -------------------------------------------------------------------------------- /INTERP/PLATFRMD.CPP: -------------------------------------------------------------------------------- 1 | // platfrmd.cpp 2 | 3 | #include "sol.hpp" 4 | 5 | #include "config.hpp" 6 | #include "kernel.hpp" 7 | #include "pmachine.hpp" 8 | 9 | enum PlatformType { 10 | Macintosh, 11 | Dos, 12 | Windows, 13 | Amiga 14 | }; 15 | 16 | enum CallType { 17 | WhatAmI, 18 | CDspeed, 19 | ColorDepth, 20 | CDdrive 21 | }; 22 | 23 | enum ColorTypes { 24 | Error, 25 | Colors16, 26 | Colors256, 27 | High16Bit, 28 | True32Bit 29 | }; 30 | 31 | void 32 | KPlatform(argList) 33 | { 34 | pm.acc = 0; 35 | 36 | if (argCount < 1) { 37 | pm.acc = (int) Dos; 38 | return; 39 | } 40 | 41 | switch ((CallType) arg(1)) { 42 | 43 | // Return the platform type that we are 44 | case WhatAmI: 45 | pm.acc = (int) Dos; 46 | break; 47 | case CDspeed: 48 | pm.acc = configMgr->GetNum("CDspeed",0); 49 | break; 50 | case ColorDepth: 51 | pm.acc = Colors256; 52 | break; 53 | case CDdrive: 54 | pm.acc = *configMgr->Get("CDdrive",0); 55 | if (!pm.acc) 56 | pm.acc = *configMgr->Get("resCDisc",0); 57 | break; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /INTERP/STAMPVER.CPP: -------------------------------------------------------------------------------- 1 | // stampver.cpp 2 | 3 | #include "sol.hpp" 4 | 5 | #include "msg.hpp" 6 | #include "stampver.hpp" 7 | 8 | #define VERSTAMPBIAS 0x1234 9 | 10 | int mapStamp = VERSTAMPBIAS - 1; 11 | 12 | // The following data is in a structure in order to maintain order-dependency 13 | struct { 14 | int value; 15 | short stampFlag1; 16 | short stampFlag2; 17 | short stampFlag3; 18 | } interpStamp = { 19 | -VERSTAMPBIAS, 20 | 0x5241, 21 | 0x4552, 22 | 0x5349 23 | }; 24 | 25 | 26 | void 27 | VerifyVerStamp() 28 | { 29 | 30 | // NB: This code must be compiled only for out-of-house interpreters. 31 | 32 | //#if !defined(DEBUG) && !defined(WINDOWS) 33 | #if !defined(DEBUG) 34 | interpStamp.value += VERSTAMPBIAS; 35 | mapStamp -= VERSTAMPBIAS; 36 | if (mapStamp != -1 && interpStamp.value != -1 && 37 | (mapStamp == 0 || mapStamp != interpStamp.value)) 38 | if (!msgMgr->Alert(Msg_VerStampMismatch) || mapStamp != -1) 39 | exit(255); 40 | #endif 41 | } 42 | 43 | int 44 | GetVerStamp() 45 | { 46 | return interpStamp.value + VERSTAMPBIAS; 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /INTERP/KBDMGR.CPP: -------------------------------------------------------------------------------- 1 | #include "sol.hpp" 2 | #include "kbdmgr.hpp" 3 | #include "kbd.hpp" 4 | #include "event.hpp" 5 | 6 | 7 | KbdMgr* kbdMgr; 8 | 9 | void 10 | KbdMgr::MapToDir(SOL_Event* event) const 11 | { 12 | // How about moving this to MapKeyToDir? 13 | 14 | // mapping of keys to directions 15 | struct DirMap { 16 | Kbd::Key key; 17 | Kbd::Key shiftKey; 18 | Direction dir; 19 | }; 20 | 21 | static DirMap dirMap[] = { 22 | Kbd::Up, Kbd::ShiftUp, dirN, 23 | Kbd::PgUp, Kbd::ShiftPgUp, dirNE, 24 | Kbd::Right, Kbd::ShiftRight, dirE, 25 | Kbd::PgDn, Kbd::ShiftPgDn, dirSE, 26 | Kbd::Down, Kbd::ShiftDown, dirS, 27 | Kbd::End, Kbd::ShiftEnd, dirSW, 28 | Kbd::Left, Kbd::ShiftLeft, dirW, 29 | Kbd::Home, Kbd::ShiftHome, dirNW, 30 | Kbd::Center,Kbd::ShiftCenter, dirStop, 31 | 0 32 | }; 33 | 34 | for (int i = 0; dirMap[i].key; i++) { 35 | Kbd::Key key = event->modifiers & Kbd::Shift ? 36 | dirMap[i].shiftKey : dirMap[i].key; 37 | if (key == event->message) { 38 | event->message = dirMap[i].dir; 39 | event->type = SOL_Event::Direction; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /INTERP/DCOMP.H: -------------------------------------------------------------------------------- 1 | /* 2 | * dcs386fc.h 3 | * 4 | * $Header: I:/interp/sci/ibm/sci32/vcs/dcomp.h 1.0 05 Nov 1993 17:29:08 kenk $ 5 | * 6 | * $Log: I:/interp/sci/ibm/sci32/vcs/dcomp.h $ 7 | 8 | Rev 1.0 05 Nov 1993 17:29:08 kenk 9 | Initial revision. 10 | * 11 | * Rev 1.0 18 Oct 1991 12:43:18 ScottK 12 | * Initial revision. 13 | * 14 | * 15 | */ 16 | #define SCRATCHRAM_SIZE 10496 /* Size of required buffer for scratchRAM 17 | This must be 10496 for standard dcsd32 18 | This must be ????? for fast dcsd32 */ 19 | 20 | /*** Prototypes ***/ 21 | extern "C" { 22 | void Initcompress(char *scratchRAM); 23 | void Compress( 24 | char **src, 25 | char **dst, 26 | unsigned long *srcCnt, 27 | unsigned long *dstCnt, 28 | char *scratchRAM 29 | ); 30 | int Decompress( 31 | char **src, 32 | char **dst, 33 | unsigned long *srcCnt, 34 | unsigned long *dstCnt, 35 | char *scratchRAM 36 | ); 37 | 38 | }; 39 | 40 | #pragma aux (PushArgs) Initcompress; 41 | #pragma aux (PushArgs) Compress; 42 | #pragma aux (PushArgs) Decompress; 43 | 44 |  -------------------------------------------------------------------------------- /INTERP/MOVIE.HPP: -------------------------------------------------------------------------------- 1 | // Header file for movie.c -- animated movie display 2 | 3 | #ifndef MOVIE_HPP 4 | #define MOVIE_HPP 5 | 6 | class MemID; 7 | 8 | void RunMovie(char * fileName,int speed,int xOff,int yOff); 9 | void RunMovieX(MemID & buffer,int handle, int speed); 10 | void RunMovieVesa(MemID & buffer,int handle, int speed); 11 | void LoadFrame(char page,int handle, MemID & buffer); 12 | void DisplayFrame(int handle, char * bufferHandle); 13 | void DisplayBlock(char * buffer,int short xOff,int short yOff,int short xDim,int short yDim); 14 | void LoadMoviePalette(int handle); 15 | unsigned short LoadCelCount(int handle); 16 | 17 | extern "C" { 18 | void FillVideoPage(void * xCel,unsigned char * minOffset, unsigned char * maxOffset); 19 | void SetVideoMode(int mode); 20 | void ShowPage(int pageOffset); 21 | void CopyPage(int destPage,int srcPage); 22 | void Copy2VMAP(unsigned char *); 23 | } 24 | 25 | #pragma aux (PushArgs) FillVideoPage; 26 | #pragma aux (PushArgs) SetVideoMode; 27 | #pragma aux (PushArgs) ShowPage; 28 | #pragma aux (PushArgs) CopyPage; 29 | #pragma aux (PushArgs) Copy2VMAP; 30 | 31 | #endif 32 |  -------------------------------------------------------------------------------- /INTERP/MAKEINIT: -------------------------------------------------------------------------------- 1 | srcDir = . 2 | 3 | cpp = wpp386 4 | cppOpts = /3s /j /s /w4 /zp4 5 | 6 | asm = ml 7 | asmOpts = /c /Cp /Zm /Zp4 8 | 9 | .BEFORE 10 | # check to see if a make is already in progress 11 | @set alreadyMaking=0 12 | @if exist *._ @set alreadyMaking=1 13 | @if $(%alreadyMaking)==1 @echo. 14 | @if $(%alreadyMaking)==1 @echo Make in progress by 15 | @if $(%alreadyMaking)==1 @dir *._ 16 | @if $(%alreadyMaking)==1 @echo. 17 | @if $(%alreadyMaking)==1 @%abort 18 | # 19 | @%create $(%vcsid)._ 20 | @fixtime 21 | @set include=$(include) 22 | @set lib=i:\sys\lib\univesa; 23 | 24 | .ERROR 25 | del $(%vcsid)._ 26 | @echo  27 | 28 | .AFTER 29 | @del $(%vcsid)._ 30 | 31 | .EXTENSIONS: 32 | .EXTENSIONS: .obd .obj .asm .cpp .exe 33 | 34 | .asm : $(srcDir) 35 | .asm.obj: 36 | $(asm) $(asmOpts) $(debugAsmOpts) $[@ 37 | 38 | .asm.obd: 39 | $(asm) $(asmOpts) $(debugAsmOpts) /Zi /Zd /Fo$[&.obd $[@ 40 | 41 | .cpp: $(srcDir) 42 | .cpp.obj: .AUTODEPEND 43 | $(cpp) $(cppOpts) /d1 $(debugOpt) /oe /ot /ox $[@ 44 | 45 | .cpp.obd: .AUTODEPEND 46 | $(cpp) $(cppOpts) /d2 $(debugOpt) $[@ /fo$[&.obd 47 |  48 |  -------------------------------------------------------------------------------- /INTERP/PALMGRW.HPP: -------------------------------------------------------------------------------- 1 | #ifndef PALMGRW_HPP 2 | #define PALMGRW_HPP 3 | 4 | #ifndef PALMGRI_HPP 5 | #include "palmgri.hpp" 6 | #endif 7 | 8 | #ifndef PALMGRT_HPP 9 | #include "palmgrt.hpp" 10 | #endif 11 | 12 | void InitPalette(void); 13 | void TermPalette(void); 14 | void UpdatePalette(SOLPalette ¤t, SOLPalette &next, int &gammaValue); 15 | 16 | 17 | class PaletteMgrIWin : public PaletteMgrIndex 18 | { 19 | #define MAXPALETTE 256 /* largest logical palette */ 20 | #define USERPALETTE 236 /* largest user palette (20 reserved) */ 21 | 22 | public: 23 | PaletteMgrIWin() {InitPalette();} 24 | ~PaletteMgrIWin() {TermPalette();} 25 | void UpdateHardware() {UpdatePalette(current,next,gammaValue);} 26 | }; 27 | 28 | 29 | class PaletteMgrTWin : public PaletteMgrTrue 30 | { 31 | #define MAXPALETTE 256 /* largest logical palette */ 32 | #define USERPALETTE 236 /* largest user palette (20 reserved) */ 33 | 34 | public: 35 | PaletteMgrTWin() {InitPalette();} 36 | ~PaletteMgrTWin() {TermPalette();} 37 | void UpdateHardware() {UpdatePalette(current,next,gammaValue);} 38 | }; 39 | 40 | #endif 41 |  -------------------------------------------------------------------------------- /INTERP/MATH.HPP: -------------------------------------------------------------------------------- 1 | // math.hpp 2 | 3 | #ifndef MATH_HPP 4 | #define MATH_HPP 5 | 6 | #ifndef SAVEABLE_HPP 7 | #include "saveable.hpp" 8 | #endif 9 | 10 | struct MathMgr : Saveable { 11 | void SaveRestore(SaveGame*, Bool save); 12 | }; 13 | extern MathMgr mathMgr; 14 | 15 | #define Sign(t) ((t) > 0 ? 1 : (t) < 0 ? -1 : 0) 16 | #define Abs(t) ((t) < 0 ? -(t) : (t)) 17 | 18 | /* n will be under 1000 19 | n*TrigScale must be less than largest long int (2,000,000,000) 20 | so TrigScale<2,000,000 21 | */ 22 | const long TrigScale = 10000; 23 | const TrigStep = 5; 24 | 25 | class SOL_Point; 26 | 27 | uint sqrt(ulong); 28 | ulong LCGRandom(); 29 | int RPtToAngle(SOL_Point*, SOL_Point*); 30 | long ScaledSin(int); 31 | long ScaledCos(int); 32 | int ATan(int,int,int,int); 33 | 34 | inline int SinMult(int a, long n) 35 | { return ((ScaledSin(a) * n) / TrigScale); } 36 | 37 | inline int CosMult(int a, long n) 38 | { return ((ScaledCos(a) * n) / TrigScale); } 39 | 40 | inline int SinDiv(int a, long n) 41 | { return ((TrigScale * n) / ScaledSin(a)); } 42 | 43 | inline int CosDiv(int a, long n) 44 | { return ((TrigScale * n) / ScaledCos(a)); } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /INTERP/SILIST.HPP: -------------------------------------------------------------------------------- 1 | #ifndef SILIST_HPP 2 | #define SILIST_HPP 3 | 4 | #ifndef SI_HPP 5 | #include "si.hpp" 6 | #endif 7 | 8 | 9 | const MAXSI = 250; 10 | class ScreenItemList 11 | { 12 | public: 13 | // Create & destroy object 14 | ScreenItemList(); 15 | ~ScreenItemList(); 16 | ScreenItemList(const ScreenItemList&); 17 | const ScreenItemList& operator=(const ScreenItemList&); 18 | 19 | // Const Methods 20 | int Length() const {return length;} 21 | Bool Exists(int index) const {return (index < length) && (siArray[index] != NULL);} 22 | int Search(const ScreenItem*) const; // ID BASED 23 | int Search(long) const; // ID BASED 24 | const ScreenItem& operator[](int index) const {return *siArray[index];} 25 | 26 | // Normal methods 27 | ScreenItem& operator[](int index) {return *siArray[index];} 28 | int Add(ScreenItem*); // Add in priority order // cant be const 29 | void Delete(const ScreenItem*); 30 | void Delete(int index); 31 | void Clear(); 32 | void Sort(); 33 | void Pack(); 34 | void Unsort(); 35 | 36 | protected: 37 | ScreenItem* siArray[MAXSI]; 38 | int order[MAXSI]; 39 | int length; 40 | }; 41 | 42 | #endif 43 |  -------------------------------------------------------------------------------- /INTERP/NETMGR.HPP: -------------------------------------------------------------------------------- 1 | // netmgr.hpp 2 | 3 | #ifndef NETMGR_HPP 4 | #define NETMGR_HPP 5 | 6 | #ifndef KBD_HPP 7 | #include "kbd.hpp" 8 | #endif 9 | 10 | #ifndef MEMID_HPP 11 | #include "memid.hpp" 12 | #endif 13 | 14 | #ifndef OBJECT_HPP 15 | #include "object.hpp" 16 | #endif 17 | 18 | #ifndef POINT_HPP 19 | #include "point.hpp" 20 | #endif 21 | 22 | #ifndef SAVEABLE_HPP 23 | #include "saveable.hpp" 24 | #endif 25 | 26 | struct Net_Msg { 27 | ulong data; 28 | uint len; 29 | }; 30 | 31 | ///////////////////////////////////////////////////////////////////////////// 32 | 33 | struct NetMsgMgr : Saveable { 34 | NetMsgMgr(); 35 | virtual ~NetMsgMgr(); 36 | 37 | virtual void Flush(); 38 | virtual Bool Get(Net_Msg* msg); 39 | virtual void Handle(Net_Msg* msg); 40 | virtual Bool IsAvail() const; 41 | virtual Bool IsFull(); 42 | virtual void Post(Net_Msg* msg); 43 | 44 | void SaveRestoreAfter(SaveGame*, Bool save); 45 | 46 | protected: 47 | 48 | void Bump(int& ptr) const; 49 | 50 | enum { Size = 32 }; 51 | 52 | Net_Msg entries[Size]; 53 | int head; 54 | int tail; 55 | }; 56 | 57 | extern NetMsgMgr* netMsgMgr; 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /INTERP/DCOMP.HPP: -------------------------------------------------------------------------------- 1 | /* 2 | * dcs386fc.h 3 | * 4 | * $Header: I:/sys/sci/vcs/dcomp.hpp 1.1 29 Dec 1994 14:24:26 jasonh $ 5 | * 6 | * $Log: I:/sys/sci/vcs/dcomp.hpp $ 7 | 8 | Rev 1.1 29 Dec 1994 14:24:26 jasonh 9 | Added DOS linefeeds from Macintosh 10 | 11 | Rev 1.0 05 Nov 1993 17:04:58 kenk 12 | Initial revision. 13 | * 14 | * Rev 1.0 18 Oct 1991 12:43:18 ScottK 15 | * Initial revision. 16 | * 17 | * 18 | */ 19 | #define SCRATCHRAM_SIZE 10496 /* Size of required buffer for scratchRAM 20 | This must be 10496 for standard dcsd32 21 | This must be ????? for fast dcsd32 */ 22 | 23 | /*** Prototypes ***/ 24 | extern "C" { 25 | void Initcompress(char *scratchRAM); 26 | void Compress( 27 | char **src, 28 | char **dst, 29 | unsigned long *srcCnt, 30 | unsigned long *dstCnt, 31 | char *scratchRAM 32 | ); 33 | int Decompress( 34 | char **src, 35 | char **dst, 36 | unsigned long *srcCnt, 37 | unsigned long *dstCnt, 38 | char *scratchRAM 39 | ); 40 | 41 | }; 42 | 43 | #pragma aux (PushArgs) Initcompress; 44 | #pragma aux (PushArgs) Compress; 45 | #pragma aux (PushArgs) Decompress; 46 | -------------------------------------------------------------------------------- /INTERP/DRAWLIST.HPP: -------------------------------------------------------------------------------- 1 | #ifndef DRAWLIST_HPP 2 | #define DRAWLIST_HPP 3 | 4 | #ifndef SI_HPP 5 | #include "si.hpp" 6 | #endif 7 | 8 | const MAXDRAW = 250; 9 | 10 | class DrawItem 11 | { 12 | public: 13 | DrawItem(ScreenItem* theSi,SOL_Rect& rect):onScreen(rect.A,rect.B) 14 | {si = theSi;} 15 | 16 | void Draw(Buffer& dest) {si->Draw(dest,onScreen);} 17 | SOL_Rect& OnScreen() {return onScreen;} 18 | ScreenItem& SI() {return *si;} 19 | 20 | protected: 21 | 22 | ScreenItem* si; 23 | SOL_Rect onScreen; 24 | 25 | friend class DrawList; 26 | }; 27 | 28 | class DrawList 29 | { 30 | public: 31 | // Create & destroy object 32 | DrawList(); 33 | ~DrawList(); 34 | 35 | // Const Methods 36 | int Length() const {return length;} 37 | Bool Exists(int index) const {return (index < length) && (drawArray[index] != NULL);} 38 | 39 | // Normal methods 40 | DrawItem& operator[](int index) {return *drawArray[index];} 41 | int Add(ScreenItem*,SOL_Rect&); // Added in priority order 42 | void Delete(int index); 43 | void Pack(); 44 | void Sort(); 45 | 46 | protected: 47 | int length; 48 | DrawItem* drawArray[MAXDRAW]; 49 | }; 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /INTERP/NEWROOM.HPP: -------------------------------------------------------------------------------- 1 | #ifndef NEWROOM_HPP 2 | #define NEWROOM_HPP 3 | 4 | #include "sol.hpp" 5 | 6 | #ifndef MEMTYPE_HPP 7 | #include "memtype.hpp" 8 | #endif 9 | 10 | #ifndef RESTYPE_HPP 11 | #include "restype.hpp" 12 | #endif 13 | 14 | extern Bool tracking; 15 | extern Bool trackingFrameOut; 16 | 17 | const unsigned RmResListSize = 500; 18 | 19 | typedef _Packed struct { 20 | MemType resourceType; 21 | ResNum resourceID; 22 | int resourceLen; 23 | Bool handsOn; 24 | } resourceInfo; 25 | 26 | class RmResList 27 | { 28 | resourceInfo * theList; 29 | unsigned rmResCount; 30 | Bool rmChange; // has the resource list for the room changed 31 | int room; // which room 32 | char buf[80]; 33 | public: 34 | RmResList(unsigned listSize = RmResListSize); 35 | ~RmResList(); 36 | void Add(MemType resourceType,ResNum resourceID,int length); 37 | void NewRoom(ResNum roomNum); 38 | void Print(); 39 | void Read(); 40 | void InitList(); 41 | private: 42 | void AddEntry(MemType resourceType,ResNum resourceID,int length); 43 | }; 44 | extern RmResList* rmResList; 45 | 46 | extern int roomMaxAloc; 47 | extern int gameMaxAloc; 48 | extern int gameMaxRoom; 49 | extern int currentRoom; 50 | 51 | #endif 52 |  -------------------------------------------------------------------------------- /INTERP/MOUSE.HPP: -------------------------------------------------------------------------------- 1 | // mouse.hpp 2 | 3 | #ifndef MOUSE_HPP 4 | #define MOUSE_HPP 5 | 6 | #ifndef PTRDEV_HPP 7 | #include "ptrdev.hpp" 8 | #endif 9 | 10 | 11 | class SOL_Point; 12 | class SOL_Rect; 13 | 14 | class SOL_Mouse : public PointerDevice 15 | { 16 | protected: 17 | static SCI_Rect * hotRectangles; 18 | static int hotRectangleCount; 19 | static int inRect; 20 | static int hotOn; 21 | 22 | public: 23 | virtual ~SOL_Mouse() {} 24 | 25 | virtual Bool Exists() const = 0; 26 | virtual int GlobalPos(SOL_Point*) const = 0; 27 | virtual int GlobalPosSci(SOL_Point*) const = 0; 28 | virtual int GetSwiftInfo(int*, int*, int*, int*) const {return 0;} 29 | 30 | virtual void SetRestrictRect(const SOL_Rect&) = 0; 31 | virtual void ClearRestrictRect() = 0; 32 | virtual void SetPos(const SOL_Point&) = 0; 33 | virtual void Setup(SOL_Cursor&) = 0; 34 | virtual Bool IsSwift()const {return False;} 35 | virtual void Vibrate(int , int = 1, int = 1) const {} 36 | virtual void SetHotRectangleStatus(int status) 37 | {hotOn = status;} 38 | virtual void SetupHotRectangles(int count,MemID handle); 39 | virtual void CheckHotRectangles(SOL_Point & pos); 40 | Bool HotOn() 41 | {return hotOn;} 42 | }; 43 | 44 | extern SOL_Mouse* mouse; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /SYSTEM/TUTORIAL.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; TUTORIAL.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1992 5 | ;;;; 6 | ;;;; Author: Brian K. Hughes 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; This class is designed for in-game tutorials 10 | ;;;; 11 | ;;;; Classes: 12 | ;;;; Tutorial 13 | 14 | 15 | (script# TUTORIAL) 16 | 17 | 18 | (class Tutorial kindof Script 19 | (properties 20 | nextItem NULL 21 | nextAction NULL 22 | numTries NULL 23 | ) 24 | (methods 25 | waitFor 26 | report 27 | ) 28 | 29 | (method (waitFor obj act nOrMsg v c s m) 30 | ; 31 | ; Set up the conditions by which we will be cued next, where 32 | ; 'obj' is the object to watch for and 'act' is the action 33 | ; required to trigger the object. If 'act' is NULL, any 34 | ; action will trigger. 35 | 36 | (= nextItem obj) 37 | (= nextAction act) 38 | (cond 39 | ((== argc 3) 40 | (Prints nOrMsg) 41 | ) 42 | ((> argc 3) 43 | (messager say: nOrMsg v c s m) 44 | ) 45 | ) 46 | ) 47 | 48 | (method (report objOrVerb) 49 | ; 50 | ; Report a wrong action (negative reinforcement, bad!) 51 | ; 'objOrVerb' will be the object ID (if wrong item) or verb 52 | ; number (if wrong action) 53 | ) 54 | 55 | (method (cue) 56 | (= numTries 0) 57 | (super cue: &rest) 58 | ) 59 | ) 60 | -------------------------------------------------------------------------------- /SYSTEM/0.SC: -------------------------------------------------------------------------------- 1 | (script# 0) 2 | 3 | 4 | (public 5 | Bench 0 6 | ) 7 | 8 | (define vCURSORS 998) 9 | 10 | (instance DummyEgo of Ego) 11 | 12 | (class Bench of Game 13 | (method (init) 14 | (MonoOut "The game init:\n") 15 | (= theCursor theGameCursor) 16 | (= waitCursor theWaitCursor) 17 | (= normalCursor theArrowCursor) 18 | (= userFont 999) 19 | (= bigFont 999) 20 | (= smallFont 999) 21 | 22 | (super init: &rest) 23 | 24 | ;;; SCI32 SPECIFIC 25 | (= systemPlane Plane) 26 | ;** ((= systemPlane (Plane new:)) 27 | ;** init: 28 | ;** ) 29 | (thePlane setRect: 0 0 320 199) 30 | ;;; 31 | 32 | (= ego DummyEgo) 33 | (User 34 | alterEgo: ego, 35 | canControl: TRUE, 36 | canInput: FALSE, 37 | ) 38 | 39 | (Print 40 | back: 74, 41 | fore: 0, 42 | ) 43 | (= ego DummyEgo) 44 | 45 | (self newRoom: 1) 46 | ) 47 | ) 48 | 49 | (instance theGameCursor of Cursor 50 | (properties 51 | view vCURSORS 52 | loop 0 53 | cel 7 54 | ) 55 | ) 56 | 57 | (instance theWaitCursor of Cursor 58 | (properties 59 | view vCURSORS 60 | loop 0 61 | cel 8 62 | ) 63 | ) 64 | 65 | (instance theArrowCursor of Cursor 66 | (properties 67 | view vCURSORS 68 | loop 0 69 | cel 7 70 | ) 71 | ) 72 | 73 | 74 |  -------------------------------------------------------------------------------- /INTERP/UVBELIB.H: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * The Universal VESA VBE 4 | * 5 | * Copyright (C) 1994 SciTech Software. 6 | * All rights reserved. 7 | * 8 | * Filename: $RCSfile$ 9 | * Version: $Revision$ 10 | * 11 | * Language: ANSI C 12 | * Environment: IBM PC (MS DOS) real and protected mode. 13 | * 14 | * Description: Header file for the UVBELib(tm) functions. 15 | * 16 | * $Id$ 17 | * 18 | ****************************************************************************/ 19 | 20 | #ifndef __UVBELIB_H 21 | #define __UVBELIB_H 22 | 23 | #ifndef __DEBUG_H 24 | #include "debug.h" 25 | #endif 26 | 27 | /*-------------------------- Function Prototypes --------------------------*/ 28 | 29 | #ifdef __cplusplus 30 | extern "C" { /* Use "C" linkage when in C++ mode */ 31 | #endif 32 | 33 | /* Routines to install the UVBELib VBE 2.0 device support routines */ 34 | 35 | bool _cdecl UV_install(char *driverDir,bool ignoreVBE); 36 | void _cdecl UV_exit(void); 37 | void _cdecl UV_getDriverPath(char *argv0,char *buf); 38 | 39 | #ifdef __cplusplus 40 | } /* End of "C" linkage for C++ */ 41 | #endif 42 | 43 | #endif /* __UVBELIB_H */ 44 | -------------------------------------------------------------------------------- /SYSTEM/BLOCK.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; BLOCK.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: Brian K. Hughes 8 | ;;;; 9 | ;;;; A Block is a rectangle meant to exclude Actors. 'theActor' is 10 | ;;;; required to stay out of a 'theBlock' by: 11 | ;;;; 12 | ;;;; (theActor observeBlocks: theBlock ...) 13 | ;;;; 14 | ;;;; Similarly, the ignoreBlocks method of Actor will allow him to be 15 | ;;;; inside the block once more. 16 | ;;;; 17 | ;;;; A Cage is a block meant to contain an Actor. 18 | ;;;; 19 | ;;;; Classes: 20 | ;;;; Block 21 | ;;;; Cage 22 | 23 | 24 | (script# BLOCK) 25 | 26 | 27 | (class Block kindof Object 28 | (properties 29 | name "Blk" 30 | left 0 31 | top 0 ;coordinates of block edges 32 | right 0 33 | bottom 0 34 | ) 35 | 36 | (method (doit theObj) 37 | (return 38 | (or 39 | (<= (theObj brBottom?) top) 40 | (> (theObj brTop?) bottom) 41 | (< (theObj brRight?) left) 42 | (>= (theObj brLeft?) right) 43 | ) 44 | ) 45 | ) 46 | ) 47 | 48 | 49 | 50 | (class Cage kindof Block 51 | (method (doit theObj) 52 | (return 53 | (and 54 | (>= (theObj brLeft?) left) 55 | (>= (theObj brTop?) top) 56 | (<= (theObj brRight?) right) 57 | (<= (theObj brBottom?) bottom) 58 | ) 59 | ) 60 | ) 61 | ) 62 | -------------------------------------------------------------------------------- /SYSTEM/INTRFACE.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; INTRFACE.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1992 5 | ;;;; 6 | ;;;; Author: Bob Heitman 7 | ;;;; Updated: Brian K. Hughes 8 | ;;;; 9 | ;;;; Classes and procedures that make up the user interface for SCI. 10 | ;;;; 11 | ;;;; Procedures: 12 | ;;;; StillDown 13 | ;;;; GetNumber 14 | ;;;; MousedOn 15 | 16 | 17 | (script# INTRFACE) 18 | 19 | 20 | (procedure 21 | GetNumber 22 | StillDown 23 | MousedOn 24 | ) 25 | 26 | (public 27 | StillDown 0 28 | GetNumber 1 29 | MousedOn 2 30 | ) 31 | 32 | 33 | (procedure (StillDown &tmp event ret) 34 | ;;; Return true if there is no mouse up in queue. 35 | 36 | (= event (Event new:)) 37 | (= ret (!= (event type?) mouseUp)) 38 | (event dispose:) 39 | (return ret) 40 | ) 41 | 42 | 43 | (procedure (GetNumber string default &tmp theLine theVal) 44 | (= theLine (String newWith: 80 {})) 45 | (if (> argc 1) 46 | (theLine format: {%d} default) 47 | ) 48 | (= theVal 49 | (if (GetInput theLine 5 string) 50 | (theLine asInteger:) 51 | else 52 | -1 53 | ) 54 | ) 55 | (theLine dispose:) 56 | (return theVal) 57 | ) 58 | 59 | (procedure (MousedOn obj event) 60 | (return 61 | (and 62 | (< (obj nsLeft?) (event x?) (obj nsRight?)) 63 | (< (obj nsTop?) (event y?) (obj nsBottom?)) 64 | ) 65 | ) 66 | ) 67 | -------------------------------------------------------------------------------- /SYSTEM/TRACK.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; TRACK.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1989 5 | ;;;; 6 | ;;;; Author: Pablo Ghenis 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; Keeps its client at a certain x and y offset relative to the position 10 | ;;;; of the target object. 11 | ;;;; 12 | ;;;; Usage: (theTracker setMotion: Track theTrackee xOffset yOffset zOffset theCaller) 13 | ;;;; 14 | ;;;; Classes: 15 | ;;;; Track 16 | 17 | 18 | (script# TRACK) 19 | 20 | 21 | (class Track of Motion 22 | (properties 23 | who 0 24 | xOffset 0 25 | yOffset 0 26 | zOffset 0 27 | ) 28 | 29 | (method (init actor w xo yo zo whoCares) 30 | (= client actor) 31 | (= who w) 32 | (if (>= argc 3) (= xOffset xo) 33 | (if (>= argc 4) (= yOffset yo) 34 | (if (>= argc 5) (= zOffset zo) 35 | (if (>= argc 6) (= caller whoCares) 36 | ) 37 | ) 38 | ) 39 | ) 40 | (client 41 | ignoreActors, 42 | illegalBits: 0, 43 | ) 44 | (self doit) 45 | ) 46 | 47 | (method (doit &tmp angle) 48 | (= angle (who heading)) 49 | (client 50 | heading: angle, 51 | x: (+ (who x?) xOffset), 52 | y: (+ (who y?) yOffset), 53 | z: (+ (who z?) zOffset) 54 | ) 55 | (if (client looper?) 56 | ((client looper?) doit: client angle) 57 | else 58 | (DirLoop client angle) 59 | ) 60 | ) 61 | ) 62 | -------------------------------------------------------------------------------- /SYSTEM/APPROACH.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; APPROACH.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: Brian K. Hughes 8 | ;;;; 9 | ;;;; This motion causes its client to approach a point, to within a specified 10 | ;;;; distance. 11 | ;;;; 12 | ;;;; Classes: 13 | ;;;; Approach 14 | 15 | 16 | (script# APPROACH) 17 | 18 | 19 | (class Approach kindof Motion 20 | ;; Try to get near an immobile object. 21 | 22 | (properties 23 | who 0 ;who to approach 24 | distance 20 ;how close to 'who' is considered a 'near' 25 | ) 26 | 27 | 28 | (method (init actor whom howClose whoCares) 29 | (if (>= argc 1) (= client actor) 30 | (if (>= argc 2) (= who whom) 31 | (if (>= argc 3) (= distance howClose) 32 | (if (>= argc 4) (= caller whoCares) 33 | ) 34 | ) 35 | ) 36 | ) 37 | (super init: client (who x?) (who y?) caller) 38 | ) 39 | 40 | 41 | (method (onTarget) 42 | (<= (client distanceTo: who) distance) 43 | ) 44 | 45 | (method (setTarget) 46 | (cond 47 | (argc 48 | (super setTarget: &rest) 49 | ) 50 | ((not (self onTarget?)) 51 | (super setTarget: (who x?) (who y?)) 52 | 53 | ) 54 | ) 55 | ) 56 | 57 | (method (doit) 58 | (if (self onTarget?) 59 | (self moveDone:) 60 | else 61 | (super doit:) 62 | ) 63 | ) 64 | ) 65 | -------------------------------------------------------------------------------- /SYSTEM/CHASE.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; CHASE.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: Brian K. Hughes 8 | ;;;; 9 | ;;;; This motion causes its client to try to catch a specified Actor. 10 | ;;;; 11 | ;;;; Classes: 12 | ;;;; Chase 13 | 14 | 15 | (script# CHASE) 16 | 17 | 18 | (class Chase kindof Motion 19 | (properties 20 | who 0 ;who to chase 21 | distance 0 ;how close to 'who' is considered a 'catch' 22 | ) 23 | 24 | (method (init actor whom howClose whoCares) 25 | (if (>= argc 1) (= client actor) 26 | (if (>= argc 2) (= who whom) 27 | (if (>= argc 3) (= distance howClose) 28 | (if (>= argc 4) (= caller whoCares) 29 | ) 30 | ) 31 | ) 32 | ) 33 | (super init: client (who x?) (who y?) caller) 34 | ; (super doit:) 35 | ) 36 | 37 | (method (onTarget) 38 | (<= (client distanceTo: who) distance) 39 | ) 40 | 41 | (method (setTarget) 42 | (cond 43 | (argc 44 | (super setTarget: &rest) 45 | ) 46 | ((not (self onTarget:)) 47 | (super setTarget: (who x?) (who y?)) 48 | 49 | ) 50 | ) 51 | ) 52 | 53 | (method (doit) 54 | (if (self onTarget?) 55 | (self moveDone:) 56 | else 57 | (super doit:) 58 | (if (== b-moveCnt 0) 59 | (super init: client (who x?) (who y?) caller) 60 | ) 61 | ) 62 | ) 63 | ) 64 | -------------------------------------------------------------------------------- /INTERP/SENDSTAC.HPP: -------------------------------------------------------------------------------- 1 | // sendstac.hpp 2 | 3 | #ifndef SENDSTAC_HPP 4 | #define SENDSTAC_HPP 5 | 6 | #ifndef OBJECT_HPP 7 | #include "object.hpp" 8 | #endif 9 | 10 | #ifndef SAVEABLE_HPP 11 | #include "saveable.hpp" 12 | #endif 13 | 14 | class SOL_Window; 15 | 16 | struct SendStack : Saveable { 17 | ~SendStack() {} 18 | 19 | struct Entry { 20 | ObjectID object; 21 | Selector selector; 22 | }; 23 | 24 | virtual void Clear() {} 25 | virtual void Hide() {} 26 | virtual void Pop() {} 27 | virtual void PushObject(ObjectID) {} 28 | virtual void PushSelector(Selector) {} 29 | virtual void Show() {} 30 | virtual void Toggle() {} 31 | virtual Entry* Top() { return 0; } 32 | }; 33 | 34 | //////////////////////////////////////////////////////////////////////////////// 35 | #ifdef DEBUG 36 | 37 | struct SendStackDebug : SendStack 38 | { 39 | SendStackDebug(); 40 | ~SendStackDebug(); 41 | 42 | void Clear(); 43 | void Hide(); 44 | void Pop(); 45 | void PushObject(ObjectID object); 46 | void PushSelector(Selector selector); 47 | void Show(); 48 | void Toggle(); 49 | Entry* Top(); 50 | 51 | void SaveRestoreBefore(SaveGame*, Bool); 52 | 53 | private: 54 | enum { Size = 100 }; 55 | 56 | Bool on; 57 | int lastPtr; 58 | int ptr; 59 | Entry stack[Size]; 60 | SOL_Window* window; 61 | }; 62 | 63 | #endif 64 | 65 | #endif 66 | 67 |  -------------------------------------------------------------------------------- /INTERP/VIDEO.HPP: -------------------------------------------------------------------------------- 1 | #ifndef ASSEMBLY_HPP 2 | #define ASSEMBLY_HPP 3 | 4 | class SOL_Rect; 5 | class SOL_Point; 6 | 7 | extern "C" 8 | { 9 | void SetVGAPal(const uchar *); 10 | void ShowRect(const SOL_Rect *, uchar *); 11 | void ShowMovieRect(SOL_Rect *,uchar*,int,SOL_Point*); 12 | void ShowMovieRectDbl(SOL_Rect *,uchar*,int,SOL_Point*); 13 | void ShowMovieBlack(SOL_Rect *,uchar*,int,SOL_Point*); 14 | void ShowMovieBlackDbl(SOL_Rect *,uchar*,int,SOL_Point*); 15 | void BlackOutScreen(SOL_Rect *); 16 | 17 | void MemcpyDBL(uchar* ptrD,uchar* ptrS,int s,int sx); 18 | #pragma aux MemcpyDBL parm [EDI] [ESI] [ECX] [EBX]; 19 | void MemcpyBlack(uchar* ptrD,uchar* ptrS,int s); 20 | #pragma aux MemcpyBlack parm [EDI] [ESI] [ECX]; 21 | void ReadVideoRect(const SOL_Rect *,uchar *); 22 | void WriteVideoRect(const SOL_Rect *,uchar *, int); 23 | int SetupVesa(); 24 | int VesaSupport(); 25 | void SetVMapWidth(int width); 26 | void ShakeScreen(int shakeCount, int shakeDir, int *time); 27 | void SetVideoMode(int mode); 28 | } 29 | #pragma aux (PushArgs) SetVGAPal; 30 | #pragma aux (PushArgs) ShowRect; 31 | #pragma aux (PushArgs) ReadVideoRect; 32 | #pragma aux (PushArgs) WriteVideoRect; 33 | #pragma aux (PushArgs) SetupVesa; 34 | #pragma aux (PushArgs) VesaSupport; 35 | #pragma aux (PushArgs) SetVMapWidth; 36 | #pragma aux (PushArgs) SetVideoMode; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /INTERP/SCALE.HPP: -------------------------------------------------------------------------------- 1 | #ifndef SCALE_HPP 2 | #define SCALE_HPP 3 | 4 | #ifndef MSG_HPP 5 | #include "msg.hpp" 6 | #endif 7 | 8 | struct ScaleInfo 9 | { 10 | public: 11 | ScaleInfo(int x, int y, int max, int type); 12 | ScaleInfo(); 13 | Bool operator==(const ScaleInfo&) const; 14 | 15 | 16 | int scaleX; // User specified scaling factor (128 means no scaling) 17 | int scaleY; // User specified scaling factor (128 means no scaling) 18 | int maxScale; 19 | int scaleType; // enum {OFF,MANUAL,VANISHING} 20 | }; 21 | 22 | const SCALE_OFF = 0; // initializer, not for comparisons! 23 | const SCALE_ON_BIT = 1; 24 | const SCALE_MANUAL = 1; 25 | const SCALE_VANISHING = 3; 26 | 27 | inline 28 | ScaleInfo::ScaleInfo(int x, int y, int max, int type) 29 | { 30 | scaleX = x; 31 | scaleY = y; 32 | maxScale = max; 33 | scaleType = type; 34 | if ((scaleType & SCALE_MANUAL) && (!scaleX || !scaleY)) 35 | msgMgr->Fatal("Instructed to scale to zero"); 36 | } 37 | 38 | inline 39 | ScaleInfo::ScaleInfo() 40 | { 41 | scaleX = 128; 42 | scaleY = 128; 43 | maxScale = 100; 44 | scaleType = SCALE_OFF; 45 | } 46 | 47 | inline Bool 48 | ScaleInfo::operator==(const ScaleInfo& src) const 49 | { 50 | return ( 51 | scaleX == src.scaleX && 52 | scaleY == src.scaleY && 53 | maxScale == src.maxScale && 54 | scaleType == src.scaleType 55 | ); 56 | } 57 | 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /INTERP/RATIO.CPP: -------------------------------------------------------------------------------- 1 | #include "sol.hpp" 2 | #include "ratio.hpp" 3 | 4 | Ratio::Ratio(const Ratio& src) 5 | { 6 | numer = src.numer; 7 | denom = src.denom; 8 | } 9 | 10 | void 11 | Ratio::Normalize() 12 | { 13 | if (numer == denom) 14 | { 15 | numer = denom = 1; 16 | return; 17 | } 18 | 19 | while (!(numer & 1) && !(denom & 1)) 20 | { 21 | numer >>= 1; 22 | denom >>= 1; 23 | } 24 | 25 | while (!(numer % 3) && !(denom % 3)) 26 | { 27 | numer /= 3; 28 | denom /= 3; 29 | } 30 | 31 | while (!(numer % 5) && !(denom % 5)) 32 | { 33 | numer /= 5; 34 | denom /= 5; 35 | } 36 | } 37 | 38 | Bool 39 | Ratio::operator==(const Ratio& src) const 40 | { 41 | if (numer == src.numer) 42 | return (denom == src.denom); 43 | 44 | return False; 45 | #if 0 46 | if (numer > src.numer) { 47 | if (!src.numer || !src.denom) 48 | return False; 49 | 50 | return (!(numer % src.numer) && !(denom % src.denom)); 51 | } 52 | 53 | if (!numer || !denom) 54 | return False; 55 | 56 | return (!(src.numer % numer) && !(src.denom % denom)); 57 | #endif 58 | } 59 | 60 | Bool 61 | Ratio::operator!=(const Ratio& src) const 62 | { 63 | return !operator==(src); 64 | } 65 | 66 | 67 | #ifdef DEBUG 68 | Bool 69 | Ratio::Assert() const 70 | { 71 | if (numer < 0 || denom < 0) 72 | return False; 73 | return True; 74 | } 75 | #endif 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /INTERP/EXCEPT.CPP: -------------------------------------------------------------------------------- 1 | // except.cpp 2 | // set up signal and other exception handlers for IBM interpreter 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "sol.hpp" 9 | 10 | #include "debug.hpp" 11 | #include "scii.hpp" 12 | #include "msg.hpp" 13 | 14 | // called from fault.asm 15 | extern "C" { 16 | void AsmPanicReturn(int); 17 | }; 18 | #pragma aux (PushArgs) AsmPanicReturn; 19 | 20 | static void PanicIllegalIns(int signal); 21 | static void PanicMemoryViolation(int signal); 22 | 23 | void 24 | SCIIBM::InitExceptions() 25 | { 26 | // Setup misc error handlers 27 | signal(SIGILL, PanicIllegalIns); 28 | signal(SIGSEGV, PanicMemoryViolation); 29 | } 30 | 31 | void 32 | AsmPanicReturn(int faultNo) 33 | { 34 | switch(faultNo) { 35 | case 1: 36 | msgMgr->Alert(SrcLoc,Msg_DivideByZero,"Divide By Zero!"); 37 | break; 38 | 39 | case 2: 40 | msgMgr->Fatal("General Protection Fault!"); 41 | break; 42 | } 43 | _exit(1); 44 | } 45 | 46 | 47 | static void 48 | PanicIllegalIns(int) 49 | { 50 | msgMgr->Fatal("CPU Exception: Illegal instruction"); 51 | 52 | #ifdef DEBUG 53 | EnterDebug(); 54 | #else 55 | exit(1); 56 | #endif 57 | } 58 | 59 | static void 60 | PanicMemoryViolation(int) 61 | { 62 | msgMgr->Fatal("CPU Exception: Illegal memory access"); 63 | #ifdef DEBUG 64 | EnterDebug(); 65 | #else 66 | exit(1); 67 | #endif 68 | } 69 | -------------------------------------------------------------------------------- /INTERP/SCI.HPP: -------------------------------------------------------------------------------- 1 | // sci.hpp 2 | 3 | #ifndef SCI_HPP 4 | #define SCI_HPP 5 | 6 | class ConfigMgr; 7 | class CritErrHandler; 8 | class EventMgr; 9 | class FontMgr; 10 | class ErrorMgr; 11 | class GraphicsMgr; 12 | class MemoryMgr; 13 | class MsgMgr; 14 | class ResourceMgr; 15 | class SOL_Mouse; 16 | class TimeMgr; 17 | 18 | struct SCI { 19 | virtual ~SCI(); 20 | 21 | virtual void Run(int argc, char* argv[]); 22 | 23 | protected: 24 | virtual void Init(int argc, char* argv[]); 25 | 26 | virtual void InitAudio() = 0; 27 | virtual void InitExceptions() {} 28 | virtual void InitInterrupts() = 0; 29 | virtual void InitPalette() = 0; 30 | virtual void InitPlane(); 31 | virtual void InitSound() = 0; 32 | 33 | virtual ConfigMgr* MakeConfigMgr(int argc, char* argv[]) = 0; 34 | virtual CritErrHandler* MakeCritErrHandler() = 0; 35 | virtual EventMgr* MakeEventMgr() = 0; 36 | virtual FontMgr* MakeFontMgr(); 37 | virtual ErrorMgr* MakeErrorMgr() = 0; 38 | virtual GraphicsMgr* MakeGraphicsMgr() = 0; 39 | virtual MemoryMgr* MakeMemoryMgr() = 0; 40 | virtual SOL_Mouse* MakeMouse() = 0; 41 | virtual MsgMgr* MakeMsgMgr() = 0; 42 | virtual ResourceMgr* MakeResourceMgr(); 43 | virtual TimeMgr* MakeTimeMgr() = 0; 44 | 45 | }; 46 | extern SCI * sci; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /INTERP/PALMGRD.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include "sol.hpp" 3 | #include "graphmgr.hpp" 4 | #include "palmgrd.hpp" 5 | #include "video.hpp" 6 | 7 | 8 | 9 | 10 | /* 11 | * 12 | * UpdateHardware Method 13 | * ===================== 14 | * Could be made faster if we look closer at differences between 15 | * current and next palette. Also, we will need to do assembly 16 | * to wait for vblank before outputting palette 17 | * 18 | */ 19 | 20 | void 21 | PaletteMgrDOS::UpdateHardware() 22 | { 23 | if (current != next) { 24 | current = next; 25 | uchar* buffer = New uchar[MaxColors * 3]; 26 | uchar* ptr = buffer; 27 | if (gammaValue > -1) { 28 | for (int i = 0; i < MaxColors - 1; i++) { 29 | Rgb24 rgb = current[i]; 30 | *ptr++ = (uchar) (gamma[gammaValue][rgb.red] >> 2); 31 | *ptr++ = (uchar) (gamma[gammaValue][rgb.green] >> 2); 32 | *ptr++ = (uchar) (gamma[gammaValue][rgb.blue] >> 2); 33 | } 34 | } 35 | else { 36 | for (int i = 0; i < MaxColors - 1; i++) { 37 | Rgb24 rgb = current[i]; 38 | *ptr++ = (uchar) (rgb.red >> 2); 39 | *ptr++ = (uchar) (rgb.green >> 2); 40 | *ptr++ = (uchar) (rgb.blue >> 2); 41 | } 42 | } 43 | 44 | // Ensure that last color is always white 45 | *ptr++ = 63; 46 | *ptr++ = 63; 47 | *ptr++ = 63; 48 | 49 | SetVGAPal(buffer); 50 | delete buffer; 51 | } 52 | } 53 |  -------------------------------------------------------------------------------- /INTERP/SCIWIN.HPP: -------------------------------------------------------------------------------- 1 | #if !defined(SCIWIN_HPP) 2 | #define SCIWIN_HPP 3 | 4 | #ifndef ___WIN386_INCLUDED__ 5 | #include "winodef.hpp" 6 | #include 7 | #endif 8 | 9 | #define NUMSOUNDNODES 10 10 | #define NUMMIDIBUFFS 10 11 | 12 | extern HWND hMyWnd; 13 | extern HDC hMyDC; 14 | extern HANDLE MyInstance; 15 | extern HPALETTE hPal, hOldPal; 16 | extern HCURSOR hMyCur; 17 | extern HCURSOR hAltCur; 18 | extern HCURSOR hCurCur; 19 | extern HCURSOR hNullCur; 20 | extern int gameWidth, gameHeight; 21 | extern int gameBorder; 22 | extern int vmapWidth; 23 | extern int vmapHeight; 24 | extern BOOL LOCKMAIN; 25 | extern BOOL LOCKAUDIO; 26 | extern BOOL SHOWMEM; 27 | extern BOOL SHOWNEWS; 28 | extern BOOL USEAUDIO; 29 | extern BOOL USEMIDI; 30 | extern BOOL DOPPCTEST; 31 | extern BOOL TRUECOLOR; 32 | extern BOOL COLORCURSOR; 33 | extern int forcePPC; 34 | extern int reserveK; 35 | extern int sciMinK; 36 | extern int sciMaxK; 37 | extern int DACSize; 38 | extern int cursorViewAdd; 39 | extern int maxCursorSize; 40 | extern int asyncCheckFreq; 41 | extern int nColors; 42 | extern char szWinPatchDir[]; 43 | extern char szIniFile[]; 44 | extern char szInfo[]; 45 | 46 | #ifndef WIN32S 47 | extern HINDIR hTickCount; 48 | extern DWORD midiBuffSize[]; 49 | #else 50 | extern int wingMinK; 51 | #endif 52 | 53 | BOOL GetTFOption(LPSTR optionName, BOOL defaultVal); 54 | 55 | #endif 56 | 57 |  -------------------------------------------------------------------------------- /INTERP/DEBUG.HPP: -------------------------------------------------------------------------------- 1 | // debug.hpp 2 | #ifdef DEBUG 3 | #ifndef DEBUG_HPP 4 | #define DEBUG_HPP 5 | 6 | #ifndef SAVEABLE_HPP 7 | #include "saveable.hpp" 8 | #endif 9 | 10 | #ifndef INTEG_HPP 11 | #include "integ.hpp" 12 | #endif 13 | 14 | #ifndef OBJECT_HPP 15 | #include "object.hpp" 16 | #endif 17 | 18 | class ObjectID; 19 | 20 | struct SCIDebugger : Saveable { 21 | ~SCIDebugger(); 22 | void SaveRestoreBefore(SaveGame*, Bool save); 23 | void SaveRestore(SaveGame*, Bool) {} 24 | void SaveRestoreAfter(SaveGame*, Bool save); 25 | }; 26 | extern SCIDebugger* debugger; 27 | 28 | void Debug(); 29 | void EnterDebug(); 30 | void ExitThroughDebug(); 31 | char* OpcodeStr(); 32 | void ResetDebugInfo(); 33 | void PopDebugInfo(); 34 | void PushDebugInfo(); 35 | void RegisterKernelCall(int entry); 36 | void ToggleDebug(); 37 | 38 | const MaxSourceLineLen = 512; 39 | 40 | // internal functions used by other debugging modules 41 | void DebugOn(); 42 | ObjectID FindObject(char* name); 43 | Bool FindSelector(ObjectID id, char* name, Selector& num); 44 | 45 | inline Bool 46 | IsDisplayable(MemID id) 47 | { 48 | return (int) id != 1 && id.IsValid(); 49 | } 50 | 51 | const int MaxKernelCallHistory = 200; 52 | 53 | extern Bool debuggerIsOn; 54 | extern Bool debuggerWasOn; 55 | extern int kernelCallHistory[]; 56 | extern int kernelCallOldest; 57 | extern int kernelCallNewest; 58 | extern Bool singleStep; 59 | 60 | #endif 61 | #endif 62 |  -------------------------------------------------------------------------------- /SYSTEM/DCICON.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; DCICON.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: Brian K. Hughes 8 | ;;;; 9 | ;;;; A DCIcon is a cycling icon that can be used in Dialogs. 10 | ;;;; 11 | ;;;; Classes: 12 | ;;;; DCIcon 13 | 14 | 15 | (script# DCICON) 16 | 17 | 18 | (class DCIcon kindof DIcon 19 | (properties 20 | cycler 0 ; a cycler must be attached dynamically 21 | cycleSpeed 6 ; 60ths second between cels. 22 | signal 0 ; just to satisfy cycler 23 | ) 24 | (methods 25 | lastCel ; required by cycler class 26 | ) 27 | 28 | ;;; Do not pass a caller to this cycler 29 | (method (init) 30 | ((= cycler (Forward new:)) init: self) 31 | ) 32 | 33 | ;;; invoked at 60 times per second by the Dialog doit: loop 34 | (method (cycle &tmp oldCel) 35 | (if cycler 36 | ;; remember current cel 37 | (= oldCel cel) 38 | (cycler doit:) 39 | 40 | ;;; show new cel if it changed 41 | (if (!= cel oldCel) 42 | (self draw:) 43 | ) 44 | ) 45 | ) 46 | 47 | ;;; A completion type cycler may have already disposed of itself 48 | (method (dispose) 49 | (if cycler 50 | (cycler dispose:) 51 | ) 52 | (super dispose:) 53 | ) 54 | 55 | ;; Return the number of the last cel in the current loop of this object. 56 | ;; this method is called by cycler 57 | (method (lastCel) 58 | (return (- (NumCels self) 1)) 59 | ) 60 | ) 61 | -------------------------------------------------------------------------------- /INTERP/DEBUGDSP.HPP: -------------------------------------------------------------------------------- 1 | // debugdsp.hpp 2 | // for use only by debugger 3 | 4 | #ifdef DEBUG 5 | 6 | #ifndef DEBUGDSP_HPP 7 | #define DEBUGDSP_HPP 8 | 9 | // for MemAttrs 10 | #ifndef MEMMGR_HPP 11 | #include "memmgr.hpp" 12 | #endif 13 | 14 | // types of InputValues 15 | enum IV_Type { 16 | IV_None = 0x00, 17 | IV_Number = 0x01, 18 | IV_Object = 0x02, 19 | IV_MemID = 0x04, 20 | IV_MemIDOffset = 0x08, 21 | IV_ScriptOffset= 0x10, 22 | IV_String = 0x20, 23 | IV_ObjectMethod= 0x40, 24 | IV_Value = IV_Number | IV_Object | IV_MemID, 25 | IV_Address = IV_Object | IV_MemID | IV_MemIDOffset 26 | }; 27 | 28 | class EventWindow; 29 | class MemID; 30 | class ObjectID; 31 | class SOL_Window; 32 | 33 | void CycleDisplayMode(); 34 | char* FormatNumber(SCIWord val, Bool showName = True); 35 | Bool InputPropertyName(ObjectID obj, Selector&, char* name); 36 | IV_Type InputValue(int mask, char* prompt, char* buf, int& val, 37 | size_t* ofs = 0); 38 | void ShowTexts(); 39 | void ShowDebugInfo(); 40 | void ShowFreeMemory(); 41 | void ShowMemID(MemID, size_t, EventWindow*&, MemAttrs); 42 | void ShowMemoryList(); 43 | void ShowMemoryStats(); 44 | void ShowObject(ObjectID, EventWindow*&, int level); 45 | void ShowObjects(Bool showIDs = False); 46 | void ShowResources(); 47 | void ShowKernelCalls(); 48 | 49 | extern EventWindow* debugWindow; 50 | extern SOL_Window* sourceWindow; 51 | 52 | #endif 53 | #endif 54 | 55 |  -------------------------------------------------------------------------------- /INTERP/FAULT.ASM: -------------------------------------------------------------------------------- 1 | 2 | .386 3 | .MODEL FLAT,SYSCALL 4 | 5 | .data 6 | 7 | DivideByZero equ 1 8 | GeneralProtection equ 2 9 | 10 | oldPFHandlerOff dd ? 11 | oldPFHandlerCS dd ? 12 | 13 | .code 14 | 15 | AsmPanicReturn proto faultNo:dword 16 | 17 | 18 | 19 | PanicDiv0 proc far 20 | 21 | mov ax, ds 22 | mov ss, ax 23 | invoke AsmPanicReturn, DivideByZero 24 | 25 | PanicDiv0 endp 26 | 27 | PanicGP proc far 28 | 29 | mov ax, ds 30 | mov ss, ax 31 | invoke AsmPanicReturn, GeneralProtection 32 | 33 | PanicGP endp 34 | 35 | public InitPageFaultHandler 36 | InitPageFaultHandler proc 37 | push eax 38 | push ebx 39 | push ecx 40 | push edx 41 | push esi 42 | push edi 43 | push es 44 | push ds 45 | 46 | ;; get the current address of the Page Fault exception handler 47 | xor ecx, ecx 48 | 49 | mov ax, 0202h 50 | mov bl, 14 51 | int 31h 52 | 53 | mov oldPFHandlerCS, ecx 54 | mov oldPFHandlerOff, edx 55 | 56 | ;; set the current address of the Page Fault exception handler 57 | mov ax, 0203h 58 | mov bl, 14 59 | mov cx, cs 60 | mov edx, OFFSET pfHandler 61 | int 31h 62 | 63 | pop ds 64 | pop es 65 | pop edi 66 | pop esi 67 | pop edx 68 | pop ecx 69 | pop ebx 70 | pop eax 71 | 72 | ret 73 | InitPageFaultHandler endp 74 | 75 | pfHandler proc 76 | mov ah, 0 77 | mov al, 3 78 | int 10h 79 | 80 | jmp fword ptr cs:oldPFHandlerOff 81 | 82 | iretd 83 | pfHandler endp 84 | 85 | 86 | end 87 | 88 |  -------------------------------------------------------------------------------- /INTERP/KBDD.CPP: -------------------------------------------------------------------------------- 1 | // kbd.cpp 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "sol.hpp" 9 | #include "kbdd.hpp" 10 | 11 | 12 | /////////////////////////////////////////////////////////////////////////// 13 | ////////////////////////////////////////////////////////////////////////////// 14 | 15 | Kbd::Key 16 | KbdDOS::Get() 17 | { 18 | Key key; 19 | 20 | _disable(); 21 | 22 | if (_bios_keybrd(_KEYBRD_READY)) 23 | key = _bios_keybrd(_KEYBRD_READ); 24 | else 25 | key = 0; 26 | 27 | _enable(); 28 | 29 | return key; 30 | } 31 | 32 | Kbd::Lock 33 | KbdDOS::LockStatus() 34 | { 35 | // this is not the cleanest way to implement this, but I wanted to leave 36 | // Modifiers() alone to avoid changing other code --MW 37 | 38 | return Kbd::Lock(_bios_keybrd(_KEYBRD_SHIFTSTATUS) & 0xF0); 39 | } 40 | 41 | Kbd::Mod 42 | KbdDOS::Modifiers() 43 | { 44 | return Kbd::Mod(_bios_keybrd(_KEYBRD_SHIFTSTATUS) & 0x0F); 45 | } 46 | 47 | void 48 | KbdDOS::Reset() 49 | { 50 | const IntStatReg = 0x20; 51 | const EOI = 0x20; 52 | 53 | // reset the keyboard 54 | int inByte = inp(CtrlPort); //get current control value 55 | inByte |= 0x80; 56 | outp(CtrlPort, inByte); //do reset 57 | inByte &= 0x7F; 58 | outp(CtrlPort, inByte); //restore port to original condition 59 | 60 | // signal the end of the interrupt to the interrupt controller 61 | outp(IntStatReg, EOI); 62 | } 63 | 64 |  -------------------------------------------------------------------------------- /SYSTEM/WANDER.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; WANDER.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; This class causes its client to wander randomly about the screen. 10 | ;;;; 11 | ;;;; Classes: 12 | ;;;; Wander 13 | 14 | 15 | (script# WANDER) 16 | 17 | 18 | (class Wander kindof Motion 19 | (properties 20 | distance 30 ;the max distance to move on any one leg of the wander 21 | ) 22 | 23 | (method (init theObj dist) 24 | (if (>= argc 1) (= client theObj) 25 | (if (>= argc 2) (= distance dist) 26 | ) 27 | ) 28 | (self setTarget) 29 | (super init: client) 30 | ; (super doit:) 31 | ) 32 | 33 | (method (setTarget &tmp diam) 34 | 35 | ;Pick a random position to move to, constrained by 'distance'. 36 | (= x (+ (client x?) (- distance (Random 0 (= diam (* distance 2)))))) 37 | (= y (+ (client y?) (- distance (Random 0 diam)))) 38 | ) 39 | 40 | (method (onTarget) 41 | (return FALSE) ;we're never done wandering 42 | ) 43 | 44 | (method (doit) 45 | ;Take the next step. 46 | (super doit:) 47 | 48 | ;;If the motion is complete or the client is blocked, 49 | ;;we're finished with this leg. 50 | (if (client isStopped:) 51 | (self moveDone:) 52 | ) 53 | ) 54 | 55 | (method (moveDone) 56 | ;;; When done with the current leg of wandering, re-init: the motion 57 | ;;; to continue wandering. 58 | (self init:) 59 | ) 60 | );Wander 61 | -------------------------------------------------------------------------------- /SYSTEM/64990.SHM: -------------------------------------------------------------------------------- 1 | ; 64990.SHM -- Produced by SCI Message Editor 4.321 2 | ; This file should only be edited with ME 3 | 4 | ; NOUNS 5 | 6 | (define BUTTON_CANCEL 22) 7 | (define BUTTON_CHANGE 23) 8 | (define BUTTON_DELETE 24) 9 | (define BUTTON_DOWN 40) 10 | (define BUTTON_NO 31) 11 | (define BUTTON_NODIRCHG 38) 12 | (define BUTTON_OK 27) 13 | (define BUTTON_REPLACE 25) 14 | (define BUTTON_RESTORE 26) 15 | (define BUTTON_SAVE 28) 16 | (define BUTTON_UP 39) 17 | (define BUTTON_YES 32) 18 | (define BUT_REPLACE 9) 19 | (define BUT_RESTORE 7) 20 | (define BUT_SAVE 8) 21 | (define CANCEL_BUTTON 5) 22 | (define CHANGE_BUTTON 18) 23 | (define DELETE_BUTTON 19) 24 | (define DEL_NO 13) 25 | (define DEL_TEXT 12) 26 | (define DEL_YES 14) 27 | (define DIALOG_RESTORE 20) 28 | (define DIALOG_SAVE 21) 29 | (define DIR_INVALID 29) 30 | (define DIR_NOROOM 30) 31 | (define DIR_PROMPT 1) 32 | (define DTEXT_REPLACE 33) 33 | (define DTEXT_WITH 34) 34 | (define INVALID_DIR 2) 35 | (define NOROOM 6) 36 | (define NO_DESC 3) 37 | (define OK_BUTTON 4) 38 | (define REPLACE_BUTTON 15) 39 | (define RESTORE_BUTTON 16) 40 | (define SAVE_BUTTON 17) 41 | (define SELECT_GAME 10) 42 | (define TEXT_REPLACE 37) 43 | (define TEXT_RESTORE 35) 44 | (define TEXT_SAVE 36) 45 | (define TYPE_DESC 11) 46 | 47 | ; CASES 48 | 49 | -------------------------------------------------------------------------------- /SYSTEM/SORT.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; SORT.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1989 5 | ;;;; 6 | ;;;; Author: Pablo Ghenis 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; A Transfer sort. 10 | ;;;; 11 | ;;;; Procedures: 12 | ;;;; Sort 13 | 14 | 15 | (script# SORT) 16 | 17 | 18 | (procedure 19 | Sort 20 | ) 21 | 22 | (public 23 | Sort 0 24 | ) 25 | 26 | (procedure (Sort theList theLTCode &tmp temp node minValue tempList) 27 | 28 | ;;Transfer sort (yeech!), isnt really bad since our lists are 29 | ;;only about 10 elements long. Conserving heap memory is a higher 30 | ;;priority nowadays... 31 | ;; 32 | ;; --Pablo Ghenis 6/9/89 33 | 34 | (= tempList (List new)) 35 | 36 | (while (= node (KList LFirstNode (theList elements))) 37 | 38 | (for 39 | ((= minValue (KList LNodeValue node))) 40 | node 41 | ((= node (KList LNextNode node))) 42 | 43 | (if (theLTCode doit (= temp (KList LNodeValue node)) minValue &rest) 44 | (= minValue temp) 45 | ) 46 | 47 | ) 48 | 49 | ;transfer by appending to destination, deleting from source 50 | 51 | (transferElement doit: minValue theList tempList) 52 | 53 | );while 54 | 55 | (tempList 56 | eachElementDo: #perform transferElement tempList theList, 57 | dispose: 58 | ) 59 | 60 | );Sort 61 | 62 | 63 | (instance transferElement of Code 64 | 65 | (properties name "TE") 66 | 67 | (method (doit e sourceList destinationList) 68 | (destinationList addToEnd e) 69 | (sourceList delete e) 70 | ) 71 | ) 72 |  -------------------------------------------------------------------------------- /INTERP/ASM2CPP.CPP: -------------------------------------------------------------------------------- 1 | #include "pmachine.hpp" 2 | 3 | #include "asm2cpp.hpp" 4 | 5 | void* 6 | pmLock0( void ) { 7 | return( pm.Globals.Lock() ); 8 | } 9 | 10 | void 11 | setupTossRet( void ) { 12 | 13 | // create some special pieces of code that can be substituted for 14 | // code whose script has been disposed 15 | 16 | // create another with just 'toss, ret' in it 17 | MemID tossRetID; 18 | tossRetID.Get(MemSpecialCode, 2, TossRetIPHandle); 19 | tossRetID[0] = 0x3a; // op_toss; 20 | tossRetID[1] = 0x48; // op_ret; 21 | pm.disposeTossRet = tossRetID; 22 | } 23 | 24 | #pragma off (unreferenced); 25 | 26 | void 27 | asm_fatal(int which, int parm1, int parm2, int parm3) { 28 | switch ( which ) { 29 | case 1: 30 | char selectorName[MaxSelectorName + 1]; 31 | GetSelectorName(parm1, selectorName); 32 | msgMgr->Fatal(Msg_BadSelector, selectorName, "object"); 33 | break; 34 | 35 | case 2: 36 | msgMgr->Fatal(Msg_InvalidProperty, parm1); 37 | break; 38 | 39 | case 3: 40 | msgMgr->Fatal(SrcLoc, Msg_DisposedScript, parm1, parm2); 41 | break; 42 | 43 | case 4: 44 | msgMgr->Fatal(SrcLoc, Msg_BadOpcode, parm1); 45 | break; 46 | } 47 | } 48 | 49 | void 50 | pmSaveRestoreBefore(SaveGame* saveGame, Bool save) 51 | { 52 | pm.GlobalPtr = (Property*) pm.Globals.Unlock(); 53 | } 54 | 55 | void 56 | pmSaveRestoreAfter(SaveGame* saveGame, Bool save) 57 | { 58 | if (save) 59 | pm.GlobalPtr = (Property*) pm.Globals.Lock(); 60 | } 61 | 62 | #pragma on (unreferenced); 63 |  -------------------------------------------------------------------------------- /INTERP/DRIVER.HPP: -------------------------------------------------------------------------------- 1 | /* DRIVER.H 2 | * Definitions for drivers. 3 | */ 4 | 5 | /* Magic number to identify drivers. 6 | */ 7 | #define DRIVER 0x87654321L 8 | 9 | /* Driver types. 10 | */ 11 | #define D_VIDEO 0 12 | #define D_MUSIC 1 13 | #define D_VOICE 2 14 | #define D_INPUT 3 15 | #define D_KEYBOARD 4 16 | #define D_COMM 5 17 | #define D_MOUSE 6 18 | #define D_MEMORY 7 /* type used for autodetection purposes only */ 19 | #define D_PRINTER 8 20 | 21 | /* Required driver functions. 22 | */ 23 | #define D_DETECT (0 * sizeof(void *)) 24 | #define D_INIT (1 * sizeof(void *)) 25 | #define D_TERMINATE (2 * sizeof(void *)) 26 | 27 | #define EXTDRV 0xFEDCBA98 28 | 29 | /* extended driver bits */ 30 | 31 | /* video */ 32 | #define MDA_BIT 0x0001 33 | #define HERCULES_BIT 0x0002 34 | #define CGA_BIT 0x0004 35 | #define IBMPCJR_BIT 0x0008 36 | #define TANDY_BIT 0x0010 37 | #define EGA_BIT 0x0020 38 | #define MCGA_BIT 0x0040 39 | #define VGA_BIT 0x0080 40 | #define CGAM_BIT 0x0100 41 | #define CGAC_BIT 0x0200 42 | #define EXPLORER_BIT 0x0400 43 | 44 | /* keyboard */ 45 | #define IBMKBD_BIT 1 46 | #define TANDYKBD_BIT 2 47 | 48 | /* sound */ 49 | #define STD_SPEAKER 0x0001 50 | #define ADLIB 0x0002 51 | #define SBLAST_DAC 0x0004 52 | #define CMS 0x0008 53 | #define TANDY_3VOICE 0x0010 54 | #define TANDY_DAC 0x0020 55 | #define PS1_3VOICE 0x0040 56 | #define PS1_DAC 0x0080 57 | #define IMF 0x0100 58 | #define MPU_MIDI 0x0200 59 | #define DISNEY_DAC 0x0400 60 | #define CDAUDIO_OUT 0x0800 61 | -------------------------------------------------------------------------------- /SYSTEM/MAGNIFY.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; MAGNIFY.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Brian K. Hughes 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; The Magnifier class provides view magnification effects. 10 | ;;;; 11 | ;;;; Classes: 12 | ;;;; Magnifier 13 | 14 | 15 | (script# MAGNIFIER) 16 | 17 | 18 | (class Magnifier kindof Object 19 | ; 20 | ; A Magnifier is an object that contains data about a bitmap to be 21 | ; magnified. A View owns a Magnifier, and the Magnifier must be 22 | ; registered with the magnification list in the interpreter via 23 | ; the setMagnifier method of View. 24 | 25 | (properties 26 | x 0 27 | y 0 28 | view -1 ;\ 29 | loop 0 ; > background bitmap to be magnified 30 | cel 0 ;/ 31 | magPower 0 ;magnification power, in 'n':1 32 | skip 0 ;skip color in client that will show through 33 | client 0 ;owner view 34 | ) 35 | 36 | (method (init who v l c thePower theSkip) 37 | ; 38 | ; Setup the Magnifier 39 | 40 | (= client who) 41 | (if (> argc 1) 42 | (= view v) 43 | (if (> argc 2) 44 | (= loop l) 45 | (if (> argc 3) 46 | (= cel c) 47 | (if (> argc 4) 48 | (= magPower thePower) 49 | (if (> argc 5) 50 | (= skip theSkip) 51 | ) 52 | ) 53 | ) 54 | ) 55 | ) 56 | (AddMagnifier client) 57 | ) 58 | 59 | (method (dispose) 60 | (DeleteMagnifier client) 61 | (client magnifier: 0) 62 | (= client 0) 63 | (super dispose:) 64 | ) 65 | ) 66 |  -------------------------------------------------------------------------------- /SYSTEM/OFFSETS.TXT: -------------------------------------------------------------------------------- 1 | Actor x: 2 | Actor y: 3 | Actor signal: 4 | Actor view: 5 | Actor loop: 6 | Actor cel: 7 | Actor priority: 8 | Actor lsLeft: 9 | Actor nsLeft: 10 | Actor nsTop: 11 | Actor nsRight: 12 | Actor nsBottom: 13 | Actor brLeft: 14 | Actor brTop: 15 | Actor brRight: 16 | Actor brBottom: 17 | Actor xStep: 18 | Actor yStep: 19 | Actor looper: 20 | Actor heading: 21 | Actor mover: 22 | Actor moveSpeed: 23 | Actor illegalBits: 24 | Actor scaleX: 25 | Actor scaleY: 26 | Actor maxScale: 27 | Actor scaleSignal: 28 | Actor bitmap: 29 | Actor plane: 30 | Actor fixPriority: 31 | Actor useInsetRect: 32 | Actor inLeft: 33 | Actor inTop: 34 | Actor inRight: 35 | Actor inBottom: 36 | Actor xLast: 37 | Actor yLast: 38 | Actor z: 39 | 40 | Motion client: 41 | Motion x: 42 | Motion y: 43 | Motion dx: 44 | Motion dy: 45 | Motion b-i1: 46 | Motion b-i2: 47 | Motion b-di: 48 | Motion b-incr: 49 | Motion b-xAxis: 50 | Motion b-moveCnt: 51 | Motion xLast: 52 | Motion yLast: 53 | 54 | Jump xStep: 55 | Jump yStep: 56 | 57 | Event x: 58 | Event y: 59 | Event z: 60 | Event pitch: 61 | Event roll: 62 | Event yaw: 63 | Event type: 64 | Event message: 65 | Event modifiers: 66 | Event claimed: 67 | 68 | Sync syncTime: 69 | Sync syncCue: 70 | 71 | Sound handle: 72 | Sound number: 73 | Sound nodePtr: 74 | Sound loop: 75 | Sound priority: 76 | Sound vol: 77 | Sound signal: 78 | Sound min: 79 | Sound sec: 80 | Sound frame: 81 | Sound flags: 82 | Sound dataInc: 83 | 84 | 85 |  -------------------------------------------------------------------------------- /SYSTEM/MENU.SH: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; MENU.SH 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Al Lowe & Pablo Ghenis 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; This header file is used by SLIDICON.SC 10 | 11 | 12 | ;** Icon bar 13 | (define ICONBAR_X 0) 14 | (define ICONBAR_Y 0) 15 | (define ICONBAR_H 27) 16 | (define ICONBAR_W screenWidth) 17 | (define ICONBAR_BTM (- (- ICONBAR_H ICONBAR_Y) 1)) 18 | (define PIC_OFFSET 10) 19 | (define BAR_COLOR 5) 20 | (define BORDER_COLOR 19) 21 | (define SHADOW_COLOR 0) 22 | (define SELECTOR_BOX_COLOR 12) 23 | 24 | (define SELECTED $0002) 25 | (define INV_ENABLED $0004) 26 | (define HIDE_CURSOR $0010) ;Don't draw cursor on screen 27 | 28 | ;** Inventory window 29 | (define INV_MAX_W 295) 30 | (define INV_MAX_H 170) 31 | (define INV_LEFT 47) 32 | (define INV_TOP 19) 33 | (define INV_RIGHT 273) 34 | (define INV_BOTTOM 188) 35 | (define INV_HORZ_SEG_Y 173) 36 | (define INV_VERT_SEG_X 255) 37 | (define INV_VERT_SEG_Y 34) 38 | (define INV_COLOR 5); WINDOW_BACK) 39 | (define INV_SEL_BOX_COLOR 12); WINDOW_COLOR) 40 | (define INV_TEXT_COLOR 17) 41 | (define INV_ICON_LEFT 48) 42 | (define INV_ICON_TOP 20) 43 | 44 | (define MASK_VIEW vIcons) 45 | (define MASK_LOOP lUserIcons) 46 | (define MASK_CEL cDimMask) 47 | 48 | (enum 49 | NO_DIR 50 | UP 51 | UP_RIGHT 52 | RIGHT 53 | DOWN_RIGHT 54 | DOWN 55 | DOWN_LEFT 56 | LEFT 57 | UP_LEFT 58 | ) 59 | 60 | (define FIVE_KEY $4C00) 61 | (define INS_KEY $5200) 62 | (define DEL_KEY $5300) 63 |  -------------------------------------------------------------------------------- /INTERP/GRAPH.HPP: -------------------------------------------------------------------------------- 1 | // graph.hpp 2 | 3 | #ifndef GRAPH_HPP 4 | #define GRAPH_HPP 5 | 6 | #ifndef MEMID_HPP 7 | #include "memid.hpp" 8 | #endif 9 | 10 | #ifndef GRAPHMGR_HPP 11 | #include "graphmgr.hpp" 12 | #endif 13 | 14 | #ifndef POINT_HPP 15 | #include "point.hpp" 16 | #endif 17 | 18 | #ifndef LIST_HPP 19 | #include "list.hpp" 20 | #endif 21 | 22 | class SOL_Rect; 23 | class ScreenItem; 24 | class RectList; 25 | 26 | void BuildHeader(uchar* bmAddr, int width, int height, int skip, 27 | int xHot = 0, 28 | int yHot = 0, 29 | int xRes = SCIRESX, 30 | int yRes = SCIRESY, 31 | Bool palFlag = False, 32 | Bool remap = False); 33 | 34 | inline void BuildHeader(MemID bm, int width, int height, int skip, 35 | int xHot = 0, 36 | int yHot = 0, 37 | int xRes = SCIRESX, 38 | int yRes = SCIRESY, 39 | Bool palFlag = False, 40 | Bool remap = False) 41 | { 42 | BuildHeader((uchar*) *bm, width, height, skip, xHot, yHot, xRes, yRes, palFlag, remap); 43 | } 44 | 45 | MemID BuildLineBitmap(int x1, 46 | int y1, 47 | int x2, 48 | int y2, 49 | uchar color, 50 | int style, 51 | int pattern, 52 | int thickness, 53 | SOL_Rect& rect); 54 | MemID BuildPolygonBitmap(SOL_ListID theList, 55 | uchar color, 56 | int style, 57 | int pattern, 58 | int thickness, 59 | SOL_Rect& rect, 60 | Bool close); 61 | int GetNumLoops(MemID); 62 | int GetNumCels(MemID,int); 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /INTERP/PALMGRT.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "sol.hpp" 5 | #include "palmgrt.hpp" 6 | #include "graphmgr.hpp" 7 | #include "time.hpp" 8 | 9 | Bool 10 | PaletteMgrTrue::UpdateForFrame() 11 | { 12 | ApplyAll(); 13 | needUpdate = False; 14 | 15 | Bool paletteChanged = (current != next); 16 | return graphMgr->GRemapper().RemapAllTables(paletteChanged); 17 | } 18 | 19 | void 20 | PaletteMgrTrue::ApplyAll() 21 | { 22 | ApplyVary(); 23 | ApplyCycles(); 24 | ApplyFade(); 25 | } 26 | 27 | void 28 | PaletteMgrTrue::ApplyCycles() 29 | { 30 | for (int i = 0; i < MAXCYCLES; i++) { 31 | if (cycle[i]) { 32 | 33 | if (cycle[i]->deltaTime && !(cycle[i]->pause)) { 34 | 35 | while (cycle[i]->lastUpdate + cycle[i]->deltaTime < timeMgr->GetTickCount()) { 36 | if (cycle[i]->forward) 37 | cycle[i]->current = (cycle[i]->current + 1) % cycle[i]->range; 38 | else 39 | cycle[i]->current = ((cycle[i]->current - 1 + cycle[i]->range) % cycle[i]->range); 40 | 41 | cycle[i]->lastUpdate += cycle[i]->deltaTime; 42 | } 43 | } 44 | } 45 | } 46 | } 47 | 48 | 49 | void 50 | PaletteMgrTrue::ApplyVary() 51 | { 52 | while((int)(timeMgr->GetTickCount() - timeLastVary) > deltaTimeVary && varyDirection) { 53 | timeLastVary += deltaTimeVary; 54 | if (varyPercent == targetVaryPercent) 55 | varyDirection = 0; 56 | 57 | varyPercent += varyDirection; 58 | } 59 | 60 | for (int i = 0; i < MaxColors; i++) 61 | next[i] = source[i]; 62 | } 63 | 64 | 65 | void 66 | PaletteMgrTrue::ApplyFade() 67 | { 68 | } 69 | 70 | 71 | 72 | 73 |  -------------------------------------------------------------------------------- /INTERP/RECTLIST.HPP: -------------------------------------------------------------------------------- 1 | /* 2 | The purpose of the RectList class is to keep a list 3 | of IRects that can have "unused" entries in it. An 4 | unused entry is created when a list element is deleted. 5 | 6 | Method summary: 7 | 8 | Add - Adds copy of IRect to the bottom of the list, even 9 | if there are unused entries elsewhere in the list. 10 | This behavior is depended on so that looping from 11 | beginning to end will process newly added items. 12 | 13 | Length- Returns maximum used IRect index + 1. Deleting an 14 | item will not reduce the length, even if its the 15 | last item in the list. 16 | 17 | Exists- Reports whether this lists element has been deleted or not. 18 | 19 | oper [] Returns reference to specified IRect in list. 20 | 21 | 22 | */ 23 | 24 | #if !defined (RECTLIST_HPP) 25 | #define RECTLIST_HPP 26 | 27 | #ifndef RECT_HPP 28 | #include "rect.hpp" 29 | #endif 30 | 31 | 32 | 33 | const MAXIR = 200; 34 | class RectList 35 | { 36 | public: 37 | // Create & destroy object 38 | RectList(); 39 | ~RectList(); 40 | RectList(const RectList&); 41 | const RectList& operator=(const RectList&); 42 | 43 | // Const Methods 44 | const SOL_Rect& operator[](int index) const {return *rectArray[index];} 45 | int Length() const {return length;} 46 | 47 | // Normal methods 48 | SOL_Rect& operator[](int index) {return *rectArray[index];} 49 | void Add(const SOL_Rect&); 50 | void Delete(int index); 51 | int Pack(); 52 | void Clear(); 53 | 54 | protected: 55 | SOL_Rect* rectArray[MAXIR]; 56 | int length; 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /INTERP/WINTHUNK.HPP: -------------------------------------------------------------------------------- 1 | // winthunk.hpp 2 | 3 | #ifndef WINTHUNK_HPP 4 | #define WINTHUNK_HPP 5 | 6 | #ifndef WIN32S 7 | #include "scidll.hpp" 8 | #else 9 | #define W32SUT_32 10 | #include "scidllws.h" 11 | #include "w32sut.h" 12 | #endif 13 | 14 | 15 | void InitThunk(void); 16 | void EndThunk(void); 17 | 18 | #ifndef WIN32S 19 | 20 | extern FARPROC fp; 21 | extern HANDLE hlib32; 22 | extern HINDIR hInitTimeMgr; 23 | extern HINDIR hTermTimeMgr; 24 | extern HINDIR hTickCount; 25 | extern HINDIR hTickSet; 26 | extern HINDIR hSetCheckTime; 27 | extern HINDIR hDoSoundA; 28 | extern HINDIR hDoSoundB; 29 | extern HINDIR hDoSoundC; 30 | extern HINDIR hDoSoundD; 31 | extern HINDIR hDoSoundE; 32 | extern HINDIR hDoSoundF; 33 | extern HINDIR hDoSoundG; 34 | extern HINDIR hSetMIDIType; 35 | extern HINDIR hOpenSnd; 36 | extern HINDIR hCloseSnd; 37 | 38 | #else 39 | 40 | typedef BOOL (WINAPI * PUTREGISTER) ( HANDLE hModule, 41 | LPCSTR lpsz16BitDLL, 42 | LPCSTR lpszInitName, 43 | LPCSTR lpszProcName, 44 | UT32PROC * ppfn32Thunk, 45 | FARPROC pfnUT32Callback, 46 | LPVOID lpBuff 47 | ); 48 | 49 | typedef VOID (WINAPI * PUTUNREGISTER) (HANDLE hModule); 50 | 51 | extern PUTREGISTER pUTRegister; 52 | extern PUTUNREGISTER pUTUnRegister; 53 | extern UT32PROC pfnUTProc; 54 | extern HMODULE hKernel32; 55 | 56 | #endif 57 | 58 | #endif 59 | 60 |  -------------------------------------------------------------------------------- /INTERP/WINGFUNC.HPP: -------------------------------------------------------------------------------- 1 | #if !defined(WINGFUNC_HPP) 2 | #define WINGFUNC_HPP 3 | 4 | #ifndef ___WIN386_INCLUDED__ 5 | #include "winodef.hpp" 6 | #include 7 | #endif 8 | 9 | 10 | BOOL WingInit (int vmapWidth, int vmapHeight); 11 | void WingTerm (void); 12 | 13 | typedef HDC (FAR PASCAL * FPWINGCREATEDC) (void); 14 | typedef BOOL (FAR PASCAL * FPWINGRECOMMENDDIBFORMAT) (BITMAPINFO FAR *pFormat); 15 | typedef HBITMAP (FAR PASCAL * FPWINGCREATEBITMAP) (HDC WingDC, 16 | BITMAPINFO const FAR *pHeader, 17 | void FAR *FAR *ppBits); 18 | typedef BOOL (FAR PASCAL * FPWINGBITBLT) (HDC hdcDest, 19 | int nXOriginDest, 20 | int nYOriginDest, 21 | int nWidthDest, 22 | int nHeightDest, 23 | HDC hdcSrc, 24 | int nXOriginSrc, 25 | int nYOriginSrc); 26 | typedef UINT (FAR PASCAL * FPWINGSETDIBCOLORTABLE) (HDC hWinGDC, 27 | UINT StartIndex, 28 | UINT NumberOfEntries, 29 | RGBQUAD far *pColors); 30 | 31 | extern FPWINGCREATEDC fpWinGCreateDC; 32 | extern FPWINGRECOMMENDDIBFORMAT fpWinGRecommendDIBFormat; 33 | extern FPWINGCREATEBITMAP fpWinGCreateBitmap; 34 | extern FPWINGBITBLT fpWinGBitBlt; 35 | extern FPWINGSETDIBCOLORTABLE fpWinGSetDIBColorTable; 36 | 37 | _Packed struct winGBitmapInfo { 38 | BITMAPINFOHEADER bmih; 39 | RGBQUAD ColorTable[256]; 40 | }; 41 | 42 | extern winGBitmapInfo winGbi; 43 | 44 | extern HMODULE hWinG32; 45 | extern HDC hWinGDC; 46 | extern HBITMAP hWinGBitmap, oldWinGBitmap; 47 | extern void far * pBits; 48 | extern Bool bDIBInverted; 49 | 50 | #endif 51 | 52 |  -------------------------------------------------------------------------------- /INTERP/KBDMGRD.HPP: -------------------------------------------------------------------------------- 1 | #ifndef KBDMGRD_HPP 2 | #define KBDMGRD_HPP 3 | 4 | #ifndef KBDMGR_HPP 5 | #include "kbdmgr.hpp" 6 | #endif 7 | 8 | #ifndef KBDD_HPP 9 | #include "kbdd.hpp" 10 | #endif 11 | 12 | 13 | class KbdMgrISR : public KbdMgr 14 | { 15 | // a manager that uses an ISR to handle special keys (we ship with this) 16 | public: 17 | KbdMgrISR(); 18 | ~KbdMgrISR(); 19 | 20 | Bool Get(SOL_Event*); 21 | Kbd::Mod Modifiers() {return keyboard.Modifiers();} 22 | 23 | protected: 24 | virtual void Post(Kbd::Key, Kbd::Scan scanCode); 25 | 26 | enum { KeyUpFlag = 0x8000 }; 27 | 28 | class Buffer { 29 | public: 30 | Buffer(); 31 | void Add(Kbd::Key); 32 | Kbd::Key Get(); 33 | private: 34 | enum { Size = 20 }; 35 | Kbd::Key keys[Size]; 36 | int head; 37 | int tail; 38 | } buffer; 39 | 40 | static void __interrupt __far ISR(); 41 | void (__interrupt __far *prevISR)(); 42 | 43 | struct KeyDowns { 44 | KeyDowns(); 45 | void Add(Kbd::Key, Kbd::Scan); 46 | Kbd::Key Find(Kbd::Scan scan); 47 | private: 48 | enum { Size = 22 }; 49 | struct { 50 | Kbd::Scan scanCode; 51 | Kbd::Key biosCode; 52 | } entries[Size]; 53 | } keyDowns; 54 | 55 | static KbdDOS keyboard; 56 | }; 57 | 58 | class KbdMgrBIOS : public KbdMgr 59 | { 60 | // This is used for debugging because the Watcom debugger doesn't work 61 | // when we hook keyboard interrupts. It will not generate keyUp events 62 | // or other special keys like unshifted numeric keypad 5 63 | 64 | public: 65 | Bool Get(SOL_Event*); 66 | Kbd::Mod Modifiers() {return keyboard.Modifiers();} 67 | 68 | private: 69 | KbdDOS keyboard; 70 | }; 71 | 72 | 73 | #endif 74 |  -------------------------------------------------------------------------------- /INTERP/STRING.HPP: -------------------------------------------------------------------------------- 1 | // string.hpp 2 | 3 | #ifndef STRING_HPP 4 | #define STRING_HPP 5 | 6 | #include 7 | 8 | #ifndef KERNEL_HPP 9 | #include "kernel.hpp" 10 | #endif 11 | 12 | #ifndef OBJECT_HPP 13 | #include "object.hpp" 14 | #endif 15 | 16 | #ifndef TEXTID_HPP 17 | #include "textid.hpp" 18 | #endif 19 | 20 | // Subfunction codes 21 | enum { 22 | STRNEW, 23 | STRSIZE, 24 | STRAT, 25 | STRATPUT, 26 | STRFREE, 27 | STRFILL, 28 | STRCPY, 29 | STRCMP, 30 | STRDUP, 31 | STRGETDATA, 32 | STRLEN, 33 | STRFORMAT, 34 | STRFORMATAT, 35 | STRTOINT, 36 | STRTRIM, 37 | STRUPR, 38 | STRLWR, 39 | STRTRN, 40 | STRTRNEXCLUDE 41 | }; 42 | 43 | // Defines for whitespace trimming 44 | #define L_TRIM 4 45 | #define C_TRIM 2 46 | #define R_TRIM 1 47 | 48 | inline TextID 49 | StrGetData(MemID id) 50 | { 51 | // following code fails to compile with CodeWarrior 1.1.1.2. 52 | // ObjectID obj(id); 53 | // return (TextID) (obj.IsObject() ? obj.GetProperty(s_data) : obj); 54 | // replaced code with the following... 55 | 56 | ObjectID obj = (ObjectID) (id); 57 | if (obj.IsObject()) 58 | return obj.GetProperty(s_data); 59 | else 60 | return (TextID) id; 61 | } 62 | 63 | char* StrTrim(char* str, int trimFlags = L_TRIM | R_TRIM, char showChar = '\0'); 64 | Bool StrTrn(char* srcID, char* srcPat, char* destPat, char* destID); 65 | Bool StrTrnExclude(char* srcID, char* srcPat, char* destPat, char* destID); 66 | int StrStrCount(char* str, char* pattern); 67 | void StrResize(TextID srcID, uint newSize); 68 | 69 | char* Reverse(char* str); 70 | Bool IsPrintable(char* str); 71 | uchar ToLower(uchar c); 72 | va_list* MakeVprintfArgs(char* fmt, kArgs args); 73 | 74 | #endif 75 |  -------------------------------------------------------------------------------- /INTERP/RGB.HPP: -------------------------------------------------------------------------------- 1 | #ifndef RGB_HPP 2 | #define RGB_HPP 3 | 4 | class Rgb24 5 | { 6 | public: 7 | Rgb24(uchar r, uchar g, uchar b) : red(r), green(g), blue(b) {} 8 | Rgb24() {} 9 | 10 | Bool operator==(const Rgb24&) const; 11 | Bool operator!=(const Rgb24& src) const; 12 | 13 | uchar Lum() const; 14 | int Dist(const Rgb24&) const; 15 | 16 | uchar red; 17 | uchar green; 18 | uchar blue; 19 | }; 20 | 21 | 22 | 23 | class Rgb24F : public Rgb24 24 | { 25 | public: 26 | Rgb24F(uchar r, uchar g, uchar b, uchar f) : Rgb24(r, g, b), flag(f) {} 27 | Rgb24F() {} 28 | 29 | int operator==(const Rgb24F&) const; 30 | int operator!=(const Rgb24F& src) const {return !operator==(src);} 31 | 32 | uchar flag; 33 | }; 34 | 35 | 36 | 37 | 38 | 39 | inline int 40 | Rgb24F::operator==(const Rgb24F& src) const 41 | { 42 | if (flag != src.flag) 43 | return False; 44 | if (red == src.red && green == src.green && blue == src.blue) 45 | return True; 46 | return False; 47 | } 48 | 49 | inline Bool 50 | Rgb24::operator==(const Rgb24& src) const 51 | { 52 | return red == src.red && green == src.green && blue == src.blue; 53 | } 54 | 55 | inline Bool 56 | Rgb24::operator!=(const Rgb24& src) const 57 | { 58 | return red != src.red || green != src.green || blue != src.blue; 59 | } 60 | 61 | inline uchar 62 | Rgb24::Lum() const 63 | { 64 | return ((red * 77L) + (green * 151L) + (blue * 28L)) >> 8; 65 | } 66 | 67 | inline int 68 | Rgb24::Dist(const Rgb24& src) const 69 | { 70 | int dif = red - src.red; 71 | int total = dif * dif; 72 | dif = green - src.green; 73 | total += dif * dif; 74 | dif = blue - src.blue; 75 | total += dif * dif; 76 | 77 | return total; 78 | } 79 | 80 | #endif 81 |  -------------------------------------------------------------------------------- /INTERP/SOL.HPP: -------------------------------------------------------------------------------- 1 | // sol.hpp 5/25/93 2 | // standard header for all Sierra On-Line C++ programs 3 | 4 | #ifndef SOL_HPP 5 | #define SOL_HPP 6 | 7 | // for size_t 8 | #include 9 | 10 | // establish compiler-dependent types and other information 11 | #include "compiler.hpp" 12 | 13 | // abbreviations 14 | typedef unsigned char uchar; 15 | typedef unsigned short ushort; 16 | typedef unsigned int uint; 17 | typedef unsigned long ulong; 18 | 19 | // data types for interfacing to the SCI language, in which all values 20 | // are 16 bits 21 | typedef Int16 SCIWord; 22 | typedef UInt16 SCIUWord; 23 | 24 | #if !defined(_TV_VERSION) && !defined(__TCOLLECT_H) 25 | const Bool True = 1; 26 | const Bool False = 0; 27 | #endif 28 | 29 | template 30 | inline S Max(S a, T b) 31 | { 32 | return a > b ? a : b; 33 | } 34 | 35 | template 36 | inline S Min(S a, T b) 37 | { 38 | return a < b ? a : b; 39 | } 40 | 41 | // calculate the number of elements in an array whose size is known 42 | #define NEls(array) (sizeof (array) / sizeof *(array)) 43 | 44 | // checks for success, and aborts if fails 45 | void* operator new(size_t size, char*, int); 46 | void* operator new[](size_t size, char*, int); 47 | #define New new(__FILE__, __LINE__) 48 | 49 | // Each implementation should define its own AssertFail(). 50 | // Normally, it will simply call the msgMgr, but we give it its own function 51 | // so anyone can use assert() without having to drag MSG.HPP around. 52 | int AssertFail(char* file, int line, char* expression); 53 | 54 | #ifdef DEBUG 55 | #define assert(expr) (expr) || AssertFail(__FILE__, __LINE__, #expr) 56 | #else 57 | #define assert(expr) 58 | #endif 59 | 60 | #endif 61 |  -------------------------------------------------------------------------------- /INTERP/RATIO.HPP: -------------------------------------------------------------------------------- 1 | #ifndef RATIO_HPP 2 | #define RATIO_HPP 3 | 4 | class Ratio 5 | { 6 | public: 7 | Ratio() : numer(1), denom(1) {} 8 | Ratio(int num) : numer(num), denom(1) {} 9 | Ratio(int num, int denom) : numer(num), denom(denom) {} 10 | Ratio(const Ratio&); 11 | 12 | Bool IsOne() const {return numer == denom;} 13 | Bool operator==(const Ratio&) const; 14 | Bool operator!=(const Ratio&) const; 15 | Ratio operator*(const Ratio&) const; 16 | #ifdef DEBUG 17 | Bool Assert() const; 18 | #endif 19 | 20 | void Normalize(); 21 | 22 | int numer; 23 | int denom; 24 | }; 25 | 26 | inline Ratio 27 | Ratio::operator*(const Ratio& r) const 28 | { 29 | Ratio r2; 30 | r2.numer = numer * r.numer; 31 | r2.denom = denom * r.denom; 32 | return r2; 33 | } 34 | 35 | inline int 36 | operator/(int i, const Ratio& r) 37 | { 38 | int val = (i * r.denom) / r.numer; 39 | return val; 40 | } 41 | 42 | inline int 43 | operator/(const Ratio& r, int i) 44 | { 45 | int val = (i * r.denom) / r.numer; 46 | return val; 47 | } 48 | 49 | inline int 50 | operator*(int i, const Ratio& ratio) 51 | { 52 | int total = i * ratio.numer; 53 | int val = total / ratio.denom; 54 | if (total > ratio.denom && total % ratio.denom) 55 | val++; 56 | return val; 57 | } 58 | 59 | inline int 60 | operator*(const Ratio& ratio, int i) 61 | { 62 | int total = i * ratio.numer; 63 | int val = total / ratio.denom; 64 | if (total > ratio.denom && total % ratio.denom) 65 | val++; 66 | return val; 67 | } 68 | 69 | 70 | inline int 71 | operator^(int i, const Ratio& ratio) 72 | { 73 | return (i * ratio.numer) / ratio.denom; 74 | } 75 | 76 | inline int 77 | operator^(const Ratio& ratio, int i) 78 | { 79 | return (i * ratio.numer) / ratio.denom; 80 | } 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /SYSTEM/FLAGS.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; FLAGS.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc., 1992 5 | ;;;; 6 | ;;;; Author: Brian K. Hughes 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; The Flags class manages an area of memory on a bit level. 10 | ;;;; 11 | ;;;; Classes: 12 | ;;;; Flag 13 | 14 | 15 | (script# FLAGS) 16 | 17 | 18 | (class Flags kindof Object 19 | (properties 20 | size 0 ; number of bits desired (will be bumped to even mult of 16) 21 | array 0 ; pointer to bit array 22 | ) 23 | (methods 24 | setSize 25 | set 26 | clear 27 | test 28 | ) 29 | 30 | (method (init) 31 | (if (and size (not array)) 32 | (self setSize: size) 33 | ) 34 | ) 35 | (method (setSize howMany &tmp numWords i) 36 | (= numWords (/ howMany 16)) 37 | (if (mod howMany 16) 38 | (++ numWords) 39 | ) 40 | (= size (* numWords 16)) 41 | 42 | ; Allocate & clear the flags array 43 | (= array (IntArray new: (* numWords 2))) 44 | (array fill: 0 (* numWords 2)) 45 | ) 46 | (method (dispose) 47 | (if array 48 | (array dispose:) 49 | (= array 0) 50 | ) 51 | (super dispose:) 52 | ) 53 | (method (set flags &tmp theWord offset) 54 | (while argc 55 | (= offset (* (/ [flags (-- argc)] 16) 2)) 56 | (= theWord (array at: offset)) 57 | (|= theWord (>> $8000 (mod [flags argc] 16))) 58 | (array at: offset theWord) 59 | ) 60 | ) 61 | (method (clear flags &tmp theWord offset) 62 | (while argc 63 | (= offset (* (/ [flags (-- argc)] 16) 2)) 64 | (= theWord (array at: offset)) 65 | (&= theWord (~ (>> $8000 (mod [flags argc] 16)))) 66 | (array at: offset theWord) 67 | ) 68 | ) 69 | (method (test theFlag &tmp theWord offset) 70 | (= offset (* (/ theFlag 16) 2)) 71 | (= theWord (array at: offset)) 72 | (return (& theWord (>> $8000 (mod theFlag 16)))) 73 | ) 74 | ) 75 | -------------------------------------------------------------------------------- /INTERP/CONFIG.HPP: -------------------------------------------------------------------------------- 1 | // config.hpp 2 | 3 | #ifndef CONFIG_HPP 4 | #define CONFIG_HPP 5 | 6 | #ifndef DOS_HPP 7 | #include "dos.hpp" 8 | #endif 9 | 10 | #ifndef RESTYPE_HPP 11 | #include "restype.hpp" 12 | #endif 13 | 14 | class ConfigEntry; 15 | 16 | class ConfigMgr { 17 | public: 18 | ConfigMgr(const char* defaultFilename, int argc, char** argv); 19 | enum Flag { 20 | #ifdef DEBUG 21 | None, 22 | AudioMonitor, 23 | DiskCursor, 24 | ExtractResource, 25 | IntegrityChecking, 26 | KernelIntegCheck, 27 | MemAllocate, 28 | MonoEcho, 29 | PriScreen, 30 | PlayAudio, 31 | RoomMinK, 32 | Translation, 33 | WVIDEO, 34 | OldNames, 35 | vmdReport 36 | #else 37 | None, 38 | OldNames, 39 | vmdReport 40 | #endif 41 | }; 42 | 43 | Bool Arg(Flag n); 44 | Bool Claimed(char* name); 45 | char* Get(char* name, int tokenNum = 0); 46 | char* Get(MemType type, int tokenNum = 0); 47 | Bool Get(Flag n); 48 | char* GetLine(char* name); 49 | int GetNum(char* name, int tokenNum = 0, int defalt = 0); 50 | const char* GetFileName() const { return fileName; } 51 | int Val(Flag n); 52 | char* Str(Flag n); 53 | 54 | int GetNTokens(char* name); 55 | int GetNTokens(MemType type); 56 | 57 | void AddTokenToFront(char* name, char* token); 58 | 59 | static Bool FindConfigFile(char* fileName, const char* defaultFileName); 60 | 61 | protected: 62 | void ReadCommandLine(const char* defaultFileName, int argc,char** argv); 63 | void ShowUsage() const; 64 | Flag IsFlag(char flag); 65 | void MakeFileName(const char* rootName); 66 | void ReadFile(); 67 | int Tokenize(char* buf); 68 | ConfigEntry* GetEntry(char* name); 69 | ConfigEntry* GetEntry(MemType type); 70 | 71 | char fileName[MaxPath + 1]; 72 | }; 73 | 74 | extern ConfigMgr* configMgr; 75 | 76 | #endif 77 |  -------------------------------------------------------------------------------- /INTERP/EVENTW.CPP: -------------------------------------------------------------------------------- 1 | // event.cpp 2 | 3 | #include "sol.hpp" 4 | 5 | #include "debug.hpp" 6 | #include "event.hpp" 7 | #include "eventw.hpp" 8 | #include "hotkey.hpp" 9 | #include "integ.hpp" 10 | #include "kbdmgrw.hpp" 11 | #include "mouse.hpp" 12 | #include "sciwin.hpp" 13 | 14 | EventMgrWin::EventMgrWin() 15 | { 16 | kbdMgr = New KbdMgrWin; 17 | } 18 | 19 | Bool 20 | EventMgrWin::Get(SOL_Event* event, SOL_Event::Type mask) 21 | { 22 | // (poll joystick) 23 | 24 | // first, see if anything in Windows' event queue 25 | AsyncEventCheck(); 26 | Bool rc = EventMgr::Get(event, mask); 27 | 28 | return rc; 29 | } 30 | 31 | Kbd::Mod 32 | EventMgrWin::GetModifiers() 33 | { 34 | return ((GetKeyState(VK_MENU) & 0x8000) ? 8 : 0) | 35 | ((GetKeyState(VK_CONTROL) & 0x8000) ? 4 : 0) | 36 | ((GetKeyState(VK_SHIFT) & 0x8000) ? 3 : 0); 37 | } 38 | 39 | void 40 | EventMgrWin::Handle(SOL_Event* event) 41 | { 42 | EventMgr::Handle(event); 43 | 44 | if (event->type == SOL_Event::Null) 45 | return; 46 | 47 | if(mouse) { 48 | mouse->GlobalPosSci(&(event->where)); 49 | mouse->GetSwiftInfo( 50 | &(event->zaxis), 51 | &(event->pitch), 52 | &(event->roll), 53 | &(event->yaw) 54 | ); 55 | } else 56 | event->where = SOL_Point(0,0); 57 | 58 | Kbd::Mod mods = GetModifiers(); 59 | // event->modifiers |= mods; 60 | event->modifiers = mods; 61 | 62 | #ifdef DEBUG 63 | if (event->type == SOL_Event::KeyDown && event->message == '`') { 64 | ToggleDebug(); 65 | return; 66 | } 67 | 68 | if (event->type == SOL_Event::KeyDown && event->message == '~') { 69 | CheckIntegrityRequest(); 70 | return; 71 | } 72 | 73 | if (event->type == SOL_Event::KeyDown && event->message == '@') { 74 | HotkeyRequest(); 75 | return; 76 | } 77 | #endif 78 | 79 | Post(event); 80 | } 81 | 82 |  -------------------------------------------------------------------------------- /SYSTEM/SPEEDTST.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; SPEEDTST.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Steve Conrad 7 | ;;;; 8 | ;;;; SpeedTest returns a value from 0 to 10 which signifies the 9 | ;;;; relative speed of a machine's graphics processing power. 10 | ;;;; It must be run in a room that has a black background. 11 | ;;;; 12 | ;;;; The fastest value is 0 and the slowest is 10. The detailLevel 13 | ;;;; can be set to whatever is appropriate. However, even if the 14 | ;;;; speed of the interpreter/graphics changes, this will be updated 15 | ;;;; appropriately to stay consistent. 16 | ;;;; 17 | ;;;; The following list relates values to machines: 18 | ;;;; 19 | ;;;; 3 - 486 DX 66 (Local Bus) 20 | ;;;; 4 - 486 DX 66 21 | ;;;; 5 - 486 DX 50 22 | ;;;; 6 - 486 DX 33 23 | ;;;; 7 - 486 SX 25 24 | ;;;; 7 - 486 SLC 50 25 | ;;;; 7 - 386 DX 40 26 | ;;;; 7 - 386 DX 33 27 | ;;;; 8 - 386 DX 25 28 | ;;;; 9 - 386 SX 16 29 | ;;;; 30 | ;;;; Procedure: 31 | ;;;; SpeedTest 32 | 33 | (script# SPEEDTEST_ROOM) 34 | 35 | 36 | (procedure 37 | SpeedTest 38 | ) 39 | 40 | (public 41 | SpeedTest 0 42 | ) 43 | 44 | (procedure (SpeedTest &tmp endTime distance speedRating) 45 | 46 | (fred 47 | init: , 48 | posn: 0 100 49 | ) 50 | 51 | (= endTime (+ (GetTime) 60)) 52 | 53 | (while (< (GetTime) endTime) 54 | (fred doit:) 55 | (UpdateScreenItem fred) 56 | (FrameOut) 57 | ) 58 | 59 | (= distance (fred x?)) 60 | 61 | (fred dispose:) 62 | 63 | (if (>= distance 100) 64 | (= speedRating 0) 65 | else 66 | (= speedRating (- 10 (/ distance 10))) 67 | ) 68 | 69 | (DisposeScript SPEEDTEST_ROOM speedRating) 70 | ) 71 | 72 | (instance fred of Actor 73 | (properties 74 | view 64980 75 | loop 0 76 | cel 0 77 | ) 78 | 79 | (method (doit) 80 | (++ x) 81 | ) 82 | ) 83 | 84 | -------------------------------------------------------------------------------- /INTERP/ARRAY.HPP: -------------------------------------------------------------------------------- 1 | // array.hpp 2 | 3 | #ifndef ARRAY_HPP 4 | #define ARRAY_HPP 5 | 6 | #ifndef MEMID_HPP 7 | #include "memid.hpp" 8 | #endif 9 | 10 | enum ArrayType { 11 | INTARRAY, 12 | IDARRAY, 13 | BYTEARRAY, 14 | STRARRAY 15 | }; 16 | 17 | _Packed struct Array { 18 | SCIUWord elementSize; 19 | SCIUWord size; 20 | }; 21 | 22 | FakeTemplateID(FakeArrayID, Array, MemArray) 23 | struct ArrayID : FakeArrayID { 24 | ArrayID() {} 25 | ArrayID(MemID& id) : FakeArrayID(id) {} 26 | ArrayID(SOL_Handle h) : FakeArrayID(h) {} 27 | 28 | void 29 | Get(size_t size) 30 | { 31 | // initialize arrays to 0 32 | 33 | // include defaulted args because CodeWarrior 1.1.1.2 doesn't 34 | // consider enums a separate type and so can't distinguish between 35 | // overloaded Get()s. 36 | FakeArrayID::Get(size, MOVEABLE | INITMEMORY, 0, 0, 0, IllegalHandle); 37 | } 38 | 39 | void* Data() { return (int) *this ? **this + 1 : 0; } 40 | }; 41 | 42 | // Subfunction codes 43 | enum { 44 | ARRAYNEW, 45 | ARRAYSIZE, 46 | ARRAYAT, 47 | ARRAYATPUT, 48 | ARRAYFREE, 49 | ARRAYFILL, 50 | ARRAYCPY, 51 | ARRAYCMP, 52 | ARRAYDUP, 53 | ARRAYGETDATA 54 | }; 55 | 56 | 57 | MemID ArrayNew(uint n, int type); 58 | SCIWord ArrayAt(void* data, int esize, uint n); 59 | void* ArrayAtPut(void* data, int esize, uint at, uint n, char* args); 60 | void* ArrayFill(void* data, int esize, uint from, size_t length, int value); 61 | void* ArrayCopy(void* data, int esize, uint to, void* src, uint from, size_t length); 62 | MemID ArrayDup(MemID source); 63 | SCIWord ArrayOpLen(uint size, uint n, size_t l); 64 | void* ArrayData(void* ptr, uint at, int esize); 65 | void CheckArrayResizeBounds(char* str, uint in1, uint in2); 66 | void ArrayResize(ArrayID id, uint newSize); 67 | void ArrayVerify(ArrayID data, int operation); 68 | 69 | #endif 70 |  -------------------------------------------------------------------------------- /INTERP/TEXTID.CPP: -------------------------------------------------------------------------------- 1 | // textid.cpp 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "sol.hpp" 8 | 9 | #include "textid.hpp" 10 | 11 | TextID::TextID() 12 | { 13 | } 14 | 15 | TextID::TextID(const MemID& id) : MemID(id) 16 | { 17 | } 18 | 19 | TextID::TextID(SOL_Handle h) : MemID(h) 20 | { 21 | } 22 | 23 | TextID& 24 | TextID::operator =(const char* str) 25 | { 26 | size_t size = strlen(str) + 1; 27 | if (!handle) 28 | Get(size); 29 | else 30 | Realloc(size); 31 | strcpy(**this, str); 32 | 33 | return *this; 34 | } 35 | 36 | void 37 | TextID::Add(char c) 38 | { 39 | // add character 40 | 41 | char buf[] = { c, 0 }; 42 | Add(buf); 43 | } 44 | 45 | void 46 | TextID::Add(const char* str) 47 | { 48 | // add text, which should not be a dereferenced TextID itself 49 | 50 | AddSize(strlen(str)); 51 | strcat(**this, str); 52 | } 53 | 54 | void 55 | TextID::Add(TextID id) 56 | { 57 | // add text from id 58 | 59 | AddSize(strlen(*id)); 60 | strcat(**this, *id); 61 | } 62 | 63 | void 64 | TextID::AddF(const char* fmt, ...) 65 | { 66 | // add formatted text 67 | 68 | char buf[240]; 69 | va_list args; 70 | va_start(args, fmt); 71 | vsprintf(buf, fmt, args); 72 | va_end(args); 73 | 74 | Add(buf); 75 | } 76 | 77 | void 78 | TextID::AddSize(size_t additionalSize) 79 | { 80 | // increase the size 81 | 82 | if (!handle) { 83 | Get(additionalSize + 1); 84 | ***this = 0; 85 | } else 86 | Realloc(strlen(**this) + additionalSize + 1); 87 | } 88 | 89 | char* 90 | TextID::Lock() 91 | { 92 | return (char*) MemID::Lock(); 93 | } 94 | 95 | void 96 | TextID::Snug() 97 | { 98 | // realloc to just the right size 99 | 100 | if (handle) 101 | Realloc(strlen(**this) + 1); 102 | } 103 |  -------------------------------------------------------------------------------- /INTERP/DOS.HPP: -------------------------------------------------------------------------------- 1 | // dos.hpp 2 | 3 | #ifndef DOS_HPP 4 | #define DOS_HPP 5 | 6 | #ifndef SOL_HPP 7 | #include "sol.hpp" 8 | #endif 9 | 10 | // the following system files are included here to give access to 11 | // the defines that functions like Creat() and LSeek() use 12 | #ifndef _DOS_H_INCLUDED 13 | #include 14 | #endif 15 | #ifndef _STDLIB_H_INCLUDED 16 | #include 17 | #endif 18 | #ifndef _FCNTL_H_INCLUDED 19 | #include 20 | #endif 21 | 22 | // map some compiler-specific constants and types onto our own 23 | #define MaxPath _MAX_PATH 24 | #define MaxDrive _MAX_DRIVE 25 | #define MaxDir _MAX_DIR 26 | #define MaxFName _MAX_FNAME 27 | #define MaxExt _MAX_EXT 28 | 29 | #ifndef FA_HIDDEN 30 | #define FA_HIDDEN _A_HIDDEN 31 | #define FA_SYSTEM _A_SYSTEM 32 | #define FA_DIREC _A_SUBDIR 33 | #endif 34 | typedef find_t FindBuffer; 35 | 36 | class MemID; 37 | 38 | Bool Exists(const char*); 39 | ulong FileLength(int handle); 40 | Bool Unlink(const char* name); 41 | Bool FirstFile(const char* spec, uint atr, FindBuffer*); 42 | Bool NextFile(FindBuffer*); 43 | char* GetCWD(char* dir); 44 | Bool ExistDrive(char); 45 | char* FullPath(char* dest, const char* fileName); 46 | void ResetDisk(); 47 | ulong RGetFreeSpace(char drive); 48 | Bool IsDriveAOrB(const char*); 49 | long LSeek(int handle, long offset, int mode); 50 | int Creat(const char* name, uint mode); 51 | int Open(const char* name, uint mode); 52 | int ReadMemID(int file, MemID id, int length); 53 | int Read(int file, void* buffer, int length); 54 | int Write(int handle, void* buffer, int length); 55 | int Close(int handle); 56 | int Rename(const char* oldName, const char* newName); 57 | char* ReadString(char* str, int len, int fd); 58 | int OpenFileInPath(char* file, uint mode, char* dest = 0); 59 | char* RemoveTrailingSlash(char* dir); 60 | char* AddSlash(char*); 61 | 62 | #endif 63 |  -------------------------------------------------------------------------------- /SYSTEM/PFOLLOW.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; PFOLLOW.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1992 5 | ;;;; 6 | ;;;; Author: J. Mark Hood 7 | ;;;; Updated: Brian K. Hughes 8 | ;;;; 9 | ;;;; This is a PolyPath-based follow mover 10 | ;;;; 11 | ;;;; Classes: 12 | ;;;; PFollow 13 | 14 | 15 | (script# PFOLLOW) 16 | 17 | 18 | (class PFollow kindof PolyPath 19 | (properties 20 | who NULL 21 | distance 0 22 | targetX 0 23 | targetY 0 24 | ) 25 | 26 | (method (init actor whom howClose theObst &tmp obstList) 27 | (if argc 28 | (= obstList 29 | (if (>= argc 4) 30 | theObst 31 | else 32 | (curRoom obstacles?) 33 | ) 34 | ) 35 | (if (>= argc 1) (= client actor) 36 | (if (>= argc 2) (= who whom) (= targetX (who x?))(= targetY (who y?)) 37 | (if (>= argc 3) (= distance howClose)) 38 | ) 39 | ) 40 | (super init: client targetX targetY 0 TRUE obstList) 41 | else 42 | (super init:) 43 | ) 44 | ) 45 | 46 | (method (doit &tmp theDistance angle) 47 | (return 48 | (cond 49 | ((> (GetDistance targetX targetY (who x?) (who y?)) distance) 50 | ;; start again 51 | (if points 52 | (points dispose:) 53 | ) 54 | (= points 0) 55 | (= value 2) 56 | (self init: client who) 57 | FALSE 58 | ) 59 | ((<= (= theDistance (client distanceTo:who)) distance) 60 | ;; close enough, so don't move, just face. 61 | (= angle (GetAngle (client x?) (client y?) (who x?) (who y?))) 62 | (if (!= (client heading?) angle) 63 | (client setHeading: angle) 64 | ) 65 | (= xLast (client x?)) 66 | (= yLast (client y?)) 67 | (= b-moveCnt gameTime) 68 | FALSE 69 | ) 70 | (else 71 | (super doit:) 72 | ) 73 | ) 74 | ) 75 | ) 76 | 77 | (method (moveDone) 78 | ;; start again.. this mover never dies by itself 79 | (self 80 | setTarget:, 81 | init: 82 | ) 83 | ) 84 | ) 85 | -------------------------------------------------------------------------------- /INTERP/PALMGR.HPP: -------------------------------------------------------------------------------- 1 | #ifndef PALMGR_HPP 2 | #define PALMGR_HPP 3 | 4 | #ifndef PALETTE_HPP 5 | #include "palette.hpp" 6 | #endif 7 | 8 | #ifndef SAVEABLE_HPP 9 | #include "saveable.hpp" 10 | #endif 11 | 12 | class PaletteMgr : public Saveable 13 | { 14 | public: 15 | virtual ~PaletteMgr() {} 16 | 17 | virtual void Submit(HunkPalette&) = 0; 18 | virtual void Submit(const SOLPalette&) = 0; 19 | virtual const SOLPalette& Current() const = 0; 20 | virtual const SOLPalette& Source() const = 0; 21 | virtual const SOLPalette& Next() const = 0; 22 | virtual const uchar* CycleMap() const = 0; 23 | virtual Bool UpdateForFrame() = 0; 24 | virtual Bool UpdateFFrame() = 0; 25 | 26 | 27 | virtual void SetCycle(int begin, int end, int direction = 1, int ticks = 0) = 0; 28 | virtual void DoCycle(int which, int steps = 1) = 0; 29 | virtual void CycleOn(int which) = 0; 30 | virtual void CyclePause(int which) = 0; 31 | virtual void CycleAllOn() = 0; 32 | virtual void CycleAllPause() = 0; 33 | virtual void CycleOff(int which) = 0; 34 | virtual void CycleAllOff() = 0; 35 | 36 | virtual void SetTarget(const SOLPalette&) = 0; 37 | virtual void MergeTarget(const SOLPalette&) = 0; 38 | virtual void SetStart(const SOLPalette&) = 0; 39 | virtual void MergeStart(const SOLPalette&) = 0; 40 | virtual void SetVary(const SOLPalette&, int percent = 100, int ticks = 0, int start = -1, int end = -1) = 0; 41 | virtual void SetVaryPercent(int percent, int ticks = 0, int start = -1, int end = -1) = 0; 42 | virtual void SetVaryTime(int ticks) = 0; 43 | virtual int VaryPercent() const = 0; 44 | virtual void VaryOff() = 0; 45 | virtual void VaryOn() = 0; 46 | virtual void VaryPause() = 0; 47 | virtual void SetFade(int percent, int begin = 0, int end = 255) = 0; 48 | virtual void FadeOff() = 0; 49 | 50 | virtual void SaveRestore(SaveGame* saveGame, Bool save) = 0; 51 | virtual void UpdateHardware() = 0; 52 | }; 53 | 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /INTERP/MILLISEC.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; 3 | ; 4 | ; 5 | 6 | .386 7 | .MODEL FLAT,SYSCALL 8 | .DATA 9 | extern sysTicks:DWORD 10 | dwLowTickCount dd 0 11 | .CODE 12 | GetDOSMillisec PROC 13 | 14 | ; /*--- Disable interrupts; Issue read-back command for counter 0 ---*/ 15 | push ebx 16 | push ecx 17 | push edx 18 | push esi 19 | 20 | start: mov al, 0C2h ;; read back command 21 | cli 22 | out 43h, al ;; send command to 8254 23 | nop 24 | 25 | ; /*--- Set carry flag to counter 0 OUT pin status ---*/ 26 | in al, 40h ;; OUT status is in bit 7 27 | nop 28 | shl al, 1 ;; carry = OUT status 29 | 30 | ; /*--- Set CX to where in interval we are ---*/ 31 | in al, 40h ;; read counter low 32 | nop 33 | movzx ecx, al ;; save counter low 34 | 35 | in al, 40h ;; read counter high 36 | nop 37 | mov ch, al ;; save counter high 38 | jcxz restart ;; restart if counter is zero 39 | jc xxx 40 | add cx, 19886 41 | xxx: 42 | mov eax, 39772 43 | sub eax, ecx 44 | mov ebx, 25 45 | mul ebx 46 | mov ebx, 59658 47 | div ebx 48 | mov esi, eax 49 | 50 | ; /*--- Convert ticks to milliseconds (1/60 to 1/1000 count) ---*/ 51 | mov eax, sysTicks 52 | mov ebx, 50 53 | mul ebx 54 | mov bx, 3 55 | div ebx 56 | add eax, esi 57 | 58 | ; /*--- Assure tick count is equal or advancing ---*/ 59 | cmp eax, DWORD PTR [dwLowTickCount] 60 | jb restart 61 | 62 | ; /*--- Save last tick count obtained ---*/ 63 | done: mov DWORD PTR [dwLowTickCount], eax 64 | sti 65 | pop esi 66 | pop edx 67 | pop ecx 68 | pop ebx 69 | ret 70 | 71 | ; /*--- Restart procedure ---*/ 72 | restart: sti 73 | jmp start 74 | 75 | GetDOSMillisec ENDP 76 | 77 | END 78 |  -------------------------------------------------------------------------------- /SYSTEM/SCALER.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; SCALER.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1990 5 | ;;;; 6 | ;;;; Author: Brian K. Hughes 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; A Scaler changes the scaling factors of its client based on specified 10 | ;;;; criteria. Default criteria is y position within a range. 11 | ;;;; 12 | ;;;; Classes: 13 | ;;;; Scaler 14 | 15 | 16 | (script# SCALER) 17 | 18 | 19 | (class Scaler kindof Code 20 | (properties 21 | client 0 ; who we are attached to 22 | frontY 190 ; y coordinate to stop scaling up 23 | backY 0 ; y coordinate to stop scaling down 24 | frontSize 100 ; % size at frontY 25 | backSize 0 ; % size at backY 26 | slopeNum 0 ; numerator of slope - difference in % 27 | slopeDen 0 ; denominator of slope - difference in y 28 | const 0 ; constant adjustement for result % 29 | 30 | ) 31 | (method (init who fs bs fy by) 32 | (if argc 33 | (= client who) 34 | (= frontSize fs) 35 | (= backSize bs) 36 | (= frontY fy) 37 | (= backY by) 38 | ) 39 | (= slopeNum (- frontSize backSize)) 40 | (if (not (= slopeDen (- frontY backY))) 41 | (Prints { frontY cannot be equal to backY}) 42 | (return FALSE) 43 | ) 44 | (= const (- backSize (/ (* slopeNum backY) slopeDen) )) 45 | (self doit:) 46 | ) 47 | (method (doit &tmp Y scale oldScaleX oldScaleY) 48 | (= oldScaleX (client scaleX?)) 49 | (= oldScaleY (client scaleY?)) 50 | (= Y (client y?)) 51 | (cond 52 | ((< Y backY) 53 | (= scale backSize) 54 | ) 55 | ((> Y frontY) 56 | (= scale frontSize) 57 | ) 58 | (else 59 | (= scale (+ (/ (* slopeNum Y) slopeDen) const)) 60 | ) 61 | ) 62 | (= scale (/ (* scale scaleBase) 100)) 63 | 64 | ; Only update if scale factors have changed because scaleX and 65 | ; scaleY are critical properties 66 | (if (or (!= oldScaleX scale) (!= oldScaleY scale)) 67 | (client 68 | scaleX: scale, 69 | scaleY: scale 70 | ) 71 | ) 72 | ) 73 | ) 74 | -------------------------------------------------------------------------------- /SYSTEM/DPATH.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; DPATH.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1989 5 | ;;;; 6 | ;;;; Author: Pablo Ghenis 7 | ;;;; Updated: Steve Conrad 8 | ;;;; 9 | ;;;; D(ynamic)PATH uses a dynamically created list to keep path 10 | ;;;; points. 11 | ;;;; 12 | ;;;; Usage is like other motion classes: 13 | ;;;; 14 | ;;;; (anActor setMotion: DPath x1 y1 x2 y2 ... anOptionalCaller) 15 | ;;;; 16 | ;;;; (also see PATH.SC for static path class) 17 | ;;;; 18 | ;;;; Classes: 19 | ;;;; DPath 20 | 21 | 22 | (script# DPATH) 23 | 24 | 25 | (class DPath of Motion 26 | 27 | (properties 28 | points NULL ;dynamic array to hold path points 29 | value 0 ;index into path array 30 | ) 31 | 32 | (method (init theClient thePoints &tmp i j) 33 | 34 | (if (not points) ;create only once 35 | (= points (IntArray newWith: (- argc 1) PATHEND)) 36 | ) 37 | 38 | (if argc 39 | 40 | (= client theClient) 41 | 42 | (= j (- (points indexOf: PATHEND) 1)) 43 | (for 44 | ((= i 0)) 45 | (<= i (- argc 3)) 46 | ((++ i)) 47 | 48 | (points at: (++ j) [thePoints i]) 49 | (points at: (++ j) [thePoints (++ i)]) 50 | ) 51 | 52 | 53 | ;final odd argument, if present, is caller 54 | (if (<= i (- argc 2)) 55 | (= caller [thePoints i]) 56 | ) 57 | ) 58 | 59 | (points at: (++ j) PATHEND) ; terminate array 60 | 61 | (self setTarget:) 62 | (super init:) 63 | 64 | ;; eliminate pause at each node of path. 65 | (if (not argc) 66 | (self doit:) 67 | ) 68 | ) 69 | 70 | (method (dispose) 71 | (if points (points dispose:)) 72 | (super dispose:) 73 | ) 74 | 75 | (method (setTarget) 76 | (if (!= (points at: value) PATHEND) 77 | (= x (points at: value)) 78 | (= y (points at: (++ value))) 79 | (++ value) 80 | ) 81 | ) 82 | 83 | (method (moveDone) 84 | (if (== (points at: value) PATHEND) 85 | (super moveDone:) 86 | else 87 | (self init:) 88 | ) 89 | ) 90 | );DPath 91 | 92 | 93 | -------------------------------------------------------------------------------- /INTERP/CURSORD.HPP: -------------------------------------------------------------------------------- 1 | #ifndef CURSORD_HPP 2 | #define CURSORD_HPP 3 | 4 | #ifndef CURSOR_HPP 5 | #include "cursor.hpp" 6 | #endif 7 | 8 | #ifndef RECT_HPP 9 | #include "rect.hpp" 10 | #endif 11 | 12 | #ifndef BUFFERD_HPP 13 | #include "bufferd.hpp" 14 | #endif 15 | 16 | class PointerDevice; 17 | 18 | 19 | class CursorDOS : public SOL_Cursor 20 | { 21 | public: 22 | CursorDOS(const BufferStd&); 23 | ~CursorDOS(); 24 | 25 | void Hide(); 26 | void UnHide(); 27 | void Show(); 28 | void Set(int v, int l, int c); 29 | Bitmap& Get() {return bitmap;} 30 | void SetDevice(PointerDevice&); 31 | void DeviceMovedTo(const SOL_Point&); 32 | void ForcePos(SOL_Point); 33 | void GonnaPaint(SOL_Rect); 34 | void PaintStarting(); 35 | void DonePainting(); 36 | void SetRestrictRect(const SOL_Rect&); 37 | void ClearRestrictRect(); 38 | void SaveRestore(SaveGame*, Bool); 39 | void SaveRestoreAfter(SaveGame*, Bool); 40 | int GetHideCount() {return hideCount;} 41 | 42 | 43 | protected: 44 | struct Info { 45 | uchar* buffer; 46 | SOL_Rect rect; 47 | uchar skip; 48 | }; 49 | 50 | void PushAndDisableInterrupts(); 51 | void PopInterrupts(); 52 | void Paint(const Info& dest, const Info& src); 53 | void Copy(const Info& dest, const Info& src); 54 | void Move(); 55 | void DrawToHardware(const Info&); 56 | void ReadVideo(const Info&); 57 | void ReadVideoFromVMAP(const Info&); 58 | void ReadVideoFromHardware(const Info&); 59 | void RevealCursor(); 60 | 61 | 62 | 63 | Bool gonnaPaint; 64 | Bool putCursorInVMAP; 65 | int hideCount; 66 | Bitmap bitmap; 67 | int xhot, yhot; 68 | Info cursorData; 69 | Info cursorBack; 70 | Info saveVmap; 71 | Info vmapData; 72 | Info drawBuff1; 73 | Info drawBuff2; 74 | 75 | SOL_Rect restrict; 76 | SOL_Point nextPos; 77 | short interruptState; 78 | int disableCount; 79 | PointerDevice* posDevice; 80 | 81 | int restoreHideCount; 82 | SOL_Rect restoreRestrict; 83 | }; 84 | 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /INTERP/GRAPHBUF.CPP: -------------------------------------------------------------------------------- 1 | // graphmd.cpp 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "sol.hpp" 10 | 11 | #include "graphbuf.hpp" 12 | #include "msg.hpp" 13 | #include "si.hpp" 14 | 15 | 16 | 17 | 18 | GraphicsMgrBuffered::GraphicsMgrBuffered(int xdim, int ydim) : GraphicsMgr(xdim, ydim), 19 | last(xdim, ydim) {} 20 | 21 | 22 | 23 | void 24 | GraphicsMgrBuffered::CalcLists(ScreenItemList** drawLists,IRectList** eraseLists) 25 | { 26 | next.CalcLists(last,drawLists,eraseLists); 27 | last = next; 28 | } 29 | 30 | /* 31 | * 32 | * Point tested needs to be Plane-relative, simRes scale 33 | * 34 | */ 35 | 36 | Bool 37 | GraphicsMgrBuffered::IsOnMe(const ScreenItemDef& sid, const SOL_Point& p, Bool checkSkip) 38 | { 39 | int i = last.Planes().Search(sid.PlaneId()); 40 | if (i == -1) 41 | msgMgr->Fatal(SrcLoc, Msg_CantFindPlaneID); 42 | 43 | int j = last.Planes()[i].SIList().Search(sid.Id()); 44 | if (j == -1) 45 | return False; 46 | 47 | Ratio scaleX(graphMgr->Xdim(), SCIRESX); 48 | Ratio scaleY(graphMgr->Ydim(), SCIRESY); 49 | 50 | SOL_Point pScreen; 51 | pScreen.x = (p.x * scaleX) + last.Planes()[i].DefRect().x1; 52 | pScreen.y = (p.y * scaleY) + last.Planes()[i].DefRect().y1; 53 | 54 | ScreenItem si = last.Planes()[i].SIList()[j]; 55 | if (!si.OnScreen().Intersect(pScreen.x, pScreen.y)) 56 | return False; 57 | 58 | if (!checkSkip) 59 | return True; 60 | 61 | SOL_Point pCel; 62 | pCel.x = (pScreen.x / scaleX) - (si.X1() / scaleX); 63 | pCel.y = (pScreen.y / scaleY) - (si.Y1() / scaleY); 64 | 65 | // pCel = "Un User Scaled" offset 66 | si.DoUpdate(last.Planes()[i]); 67 | 68 | if (si.scale.scaleType != SCALE_OFF) { 69 | if (si.scale.scaleX && si.scale.scaleY) { 70 | pCel.x = pCel.x / Ratio(si.scale.scaleX, 128); 71 | pCel.y = pCel.y / Ratio(si.scale.scaleY, 128); 72 | } 73 | } 74 | 75 | uchar result = si.ReadPix(pCel.x, pCel.y); 76 | return result != si.GetSkip(); 77 | } 78 | 79 | 80 | 81 | 82 | 83 |  84 | -------------------------------------------------------------------------------- /INTERP/NETMGR.CPP: -------------------------------------------------------------------------------- 1 | // netmgr.cpp 2 | 3 | #include 4 | #include 5 | 6 | #include "sol.hpp" 7 | 8 | #include "config.hpp" 9 | #include "debug.hpp" 10 | #include "netmgr.hpp" 11 | #include "intrpt.hpp" 12 | #include "kernel.hpp" 13 | #include "pmachine.hpp" 14 | #include "selector.hpp" 15 | #include "time.hpp" 16 | #include "msg.hpp" 17 | // #include "graphmgr.hpp" 18 | 19 | NetMsgMgr* netMsgMgr; 20 | 21 | NetMsgMgr::NetMsgMgr() 22 | { 23 | head = tail = 0; 24 | } 25 | 26 | NetMsgMgr::~NetMsgMgr() 27 | { 28 | } 29 | 30 | void 31 | NetMsgMgr::Bump(int& ptr) const 32 | { 33 | // move pointer to next slot 34 | 35 | if (++ptr == Size) 36 | ptr = 0; 37 | } 38 | 39 | void 40 | NetMsgMgr::Flush() 41 | { 42 | // flush all events specified by mask from buffer 43 | 44 | Net_Msg msg; 45 | 46 | while (Get(&msg)); 47 | } 48 | 49 | Bool 50 | NetMsgMgr::Get(Net_Msg* msg) 51 | { 52 | if (IsAvail()) { 53 | // msgMgr->MonoStr("NetMsgMgr::Get Msg Is Avail\n"); 54 | *msg = entries[head]; 55 | Bump(head); 56 | return 1; 57 | } else { 58 | msg->len = 0; 59 | msg->data = 0; 60 | } 61 | return 0; 62 | } 63 | 64 | void 65 | NetMsgMgr::Handle(Net_Msg *) 66 | { 67 | } 68 | 69 | Bool 70 | NetMsgMgr::IsAvail(void) const 71 | { 72 | // return but don't remove 73 | return head != tail; 74 | } 75 | 76 | void 77 | NetMsgMgr::Post(Net_Msg* msg) 78 | { 79 | // msgMgr->MonoStr("NetMsgMgr::Get Msg Post\n"); 80 | entries[tail] = *msg; 81 | 82 | Bump(tail); 83 | if (tail == head) { // throw away oldest 84 | Bump(head); 85 | msgMgr->Alert("Net Message Buffer overflow.\n"); 86 | } 87 | } 88 | 89 | Bool 90 | NetMsgMgr::IsFull() 91 | { 92 | int saveTail = tail; 93 | Bump(tail); 94 | int ret = (tail == head); 95 | tail = saveTail; 96 | return ret; 97 | } 98 | 99 | void 100 | NetMsgMgr::SaveRestoreAfter(SaveGame*, Bool save) 101 | { 102 | if (!save) 103 | Flush(); 104 | } 105 | 106 | -------------------------------------------------------------------------------- /SYSTEM/PATH.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; PATH.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1992 5 | ;;;; 6 | ;;;; Author: Jeff Stephenson 7 | ;;;; Updated: Brian K. Hughes 8 | ;;;; 9 | ;;;; Motion classes for a path -- i.e. moving to a series of pre-defined 10 | ;;;; points. 11 | ;;;; 12 | ;;;; Classes: 13 | ;;;; Path 14 | ;;;; RelPath 15 | 16 | 17 | (script# PATH) 18 | 19 | 20 | (class Path of MoveTo 21 | (properties 22 | intermediate 0 ;object to cue at intermediate endpoints 23 | value 0 ;index into path array 24 | ) 25 | 26 | (methods 27 | at ;return nth element of control array 28 | next ;move to next point in path 29 | atEnd ;are we at the end of the path? 30 | ) 31 | 32 | 33 | 34 | (method (init actor toCall inter) 35 | (if argc 36 | (= client actor) 37 | (= caller (if (>= argc 2) toCall else 0)) 38 | (= intermediate (if (== argc 3) inter else 0)) 39 | (= value -1) 40 | (= x (client x?)) 41 | (= y (client y?)) 42 | ) 43 | 44 | (if (self atEnd:) 45 | (self moveDone:) 46 | else 47 | (self next:) 48 | (super init: client x y) 49 | ) 50 | ) 51 | 52 | 53 | 54 | (method (moveDone) 55 | (if (self atEnd:) 56 | (super moveDone:) 57 | else 58 | (if intermediate 59 | (intermediate cue: (/ value 2)) 60 | ) 61 | (self next:) 62 | (super init: client x y) 63 | ) 64 | ) 65 | 66 | 67 | (method (next) 68 | (= x (self at: (++ value))) 69 | (= y (self at: (++ value))) 70 | ) 71 | 72 | 73 | (method (atEnd) 74 | (return 75 | (or 76 | (== (self at: (+ value 1)) PATHEND) 77 | (== (self at: (+ value 2)) PATHEND) 78 | ) 79 | ) 80 | ) 81 | 82 | 83 | (method (at n &tmp [buffer 20]) 84 | (Print 85 | addTextF: {%s needs an 'at:' method.} name, 86 | init: 87 | ) 88 | (return 0) 89 | ) 90 | ) 91 | 92 | 93 | 94 | 95 | (class RelPath of Path 96 | (method (next) 97 | (+= x (self at: (++ value))) 98 | (+= y (self at: (++ value))) 99 | ) 100 | ) 101 | 102 | -------------------------------------------------------------------------------- /INTERP/W32SUT.H: -------------------------------------------------------------------------------- 1 | /*** 2 | *w32sut.h - 3 | * 4 | * Copyright (c) 1987-1992, Microsoft Corporation. All rights reserved. 5 | * 6 | *Purpose: 7 | * This file declares the constants, structures, and functions 8 | * used for accessing and using the Universal Thunk mechanism. 9 | * 10 | * This file should be compiled either with constants W32SUT_16 or 11 | * W32SUT_32 defined. 12 | * 13 | ****/ 14 | 15 | /* Check that one of the 2 constants is defined */ 16 | #ifdef W32SUT_16 17 | #ifdef W32SUT_32 18 | #error W32SUT_16 and W32SUT_32 cannot be defined simultaneously 19 | #endif 20 | #endif 21 | 22 | #ifndef W32SUT_16 23 | #ifndef W32SUT_32 24 | #error Either W32SUT_16 or W32SUT_32 should be defined 25 | #endif 26 | #endif 27 | 28 | 29 | /**** Prototypes for 32 bit DLL ***********/ 30 | #ifdef W32SUT_32 31 | 32 | typedef DWORD ( WINAPI * UT32PROC)( LPVOID lpBuff, 33 | DWORD dwUserDefined, 34 | LPVOID *lpTranslationList 35 | ); 36 | 37 | BOOL WINAPI UTRegister( HANDLE hModule, 38 | LPCSTR lpsz16BitDLL, 39 | LPCSTR lpszInitName, 40 | LPCSTR lpszProcName, 41 | UT32PROC * ppfn32Thunk, 42 | FARPROC pfnUT32Callback, 43 | LPVOID lpBuff 44 | ); 45 | 46 | 47 | VOID WINAPI UTUnRegister(HANDLE hModule); 48 | 49 | #endif 50 | 51 | 52 | /**** Prototypes for 16 bit DLL ***********/ 53 | #ifdef W32SUT_16 54 | 55 | typedef DWORD (FAR PASCAL * UT16CBPROC)( LPVOID lpBuff, 56 | DWORD dwUserDefined, 57 | LPVOID FAR *lpTranslationList 58 | ); 59 | 60 | 61 | LPVOID WINAPI UTLinearToSelectorOffset(LPBYTE lpByte); 62 | LPVOID WINAPI UTSelectorOffsetToLinear(LPBYTE lpByte); 63 | 64 | #endif 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /INTERP/LIST.HPP: -------------------------------------------------------------------------------- 1 | // list.hpp 2 | 3 | #ifndef LIST_HPP 4 | #define LIST_HPP 5 | 6 | #ifndef MEMID_HPP 7 | #include "memid.hpp" 8 | #endif 9 | 10 | #ifndef SAVEABLE_HPP 11 | #include "saveable.hpp" 12 | #endif 13 | 14 | typedef SCIWord SOL_NodeKey; 15 | 16 | struct SOL_Node { 17 | MemID& Next() { return next; } 18 | MemID& Prev() { return prev; } 19 | SOL_NodeKey& Key() { return key; } 20 | 21 | Bool IsFirst() { return !Prev(); } 22 | Bool IsLast() { return !Next(); } 23 | 24 | protected: 25 | MemID next; 26 | MemID prev; 27 | SOL_NodeKey key; 28 | }; 29 | 30 | FakeTemplateID(SOL_NodeID, SOL_Node, MemListNode); 31 | 32 | struct KNode : SOL_Node { 33 | SCIWord val; 34 | }; 35 | 36 | FakeTemplateID(KNodeID, KNode, MemListKNode); 37 | 38 | /////////////////////////////////////////////////////////////////////////////// 39 | 40 | class SOL_List : public Saveable { 41 | public: 42 | SOL_List() : nextPtr(0) {} 43 | 44 | SOL_NodeID& First() { return head; } 45 | SOL_NodeID& Last() { return tail; } 46 | SOL_NodeID& Next() { return nexts[nextPtr]; } 47 | Bool IsEmpty() { return !First(); } 48 | 49 | SOL_NodeID At(int i); 50 | SOL_NodeID AddAfter(SOL_NodeID, SOL_NodeID, SOL_NodeKey = 0); 51 | SOL_NodeID AddBefore(SOL_NodeID, SOL_NodeID, SOL_NodeKey = 0); 52 | SOL_NodeID AddToFront(SOL_NodeID, SOL_NodeKey = 0); 53 | SOL_NodeID AddToEnd(SOL_NodeID, SOL_NodeKey = 0); 54 | void CheckIntegrity(char* msg); 55 | SOL_NodeID DeleteKey(SOL_NodeKey); 56 | Bool Delete(SOL_NodeID); 57 | void Dump(char* msg = ""); 58 | SOL_NodeID FindKey(SOL_NodeKey); 59 | void MoveToFront(SOL_NodeID); 60 | void MoveToEnd(SOL_NodeID); 61 | void PushNext() { nextPtr++; } 62 | void PopNext() { nextPtr--; } 63 | void Sort(int criterion, Bool descending); 64 | 65 | void SaveRestore(SaveGame*, Bool save); 66 | 67 | protected: 68 | SOL_NodeID head; 69 | SOL_NodeID tail; 70 | SOL_NodeID nexts[10]; // nextNode stack for iteration safety 71 | int nextPtr; 72 | }; 73 | 74 | FakeTemplateID(SOL_ListID, SOL_List, MemList) 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /SYSTEM/PCHASE.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; PCHASE.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1992 5 | ;;;; 6 | ;;;; Author: J. Mark Hood 7 | ;;;; Updated: Brian K. Hughes 8 | ;;;; 9 | ;;;; This is a PolyPath-based chase mover 10 | ;;;; 11 | ;;;; Classes: 12 | ;;;; PChase 13 | 14 | 15 | (script# PCHASE) 16 | 17 | 18 | (class PChase kindof PolyPath 19 | (properties 20 | who NULL 21 | distance 0 22 | targetX 0 23 | targetY 0 24 | ) 25 | 26 | (method (init actor whom howClose whoCares theObst) 27 | (if argc 28 | (cond 29 | ((>= argc 5) 30 | (= obstacles theObst) 31 | ) 32 | ((not obstacles) 33 | (= obstacles (curRoom obstacles?)) 34 | ) 35 | ) 36 | (if (>= argc 1) (= client actor) 37 | (if (>= argc 2) (= who whom) (= targetX (who x?)) (= targetY (who y?)) 38 | (if (>= argc 3) (= distance howClose) 39 | (if (>= argc 4) (= caller whoCares) 40 | ) 41 | ) 42 | ) 43 | ) 44 | (super init: client targetX targetY caller TRUE obstacles) 45 | else 46 | (super init:) 47 | ) 48 | ) 49 | 50 | (method (doit &tmp theDistance) 51 | (cond 52 | ((> (GetDistance targetX targetY (who x?) (who y?)) distance) 53 | ;; start again 54 | (if points 55 | (points dispose:) 56 | ) 57 | (= points 0) 58 | (= value 2) 59 | (self init: client who) 60 | ) 61 | ((<= (= theDistance (client distanceTo: who)) distance) 62 | ;; got close enough... 63 | (self moveDone:) 64 | ) 65 | (else 66 | (super doit:) 67 | ) 68 | ) 69 | ) 70 | 71 | (method (moveDone &tmp theDistance) 72 | (cond 73 | ((<= (= theDistance (client distanceTo: who)) distance) 74 | ;; really done 75 | (super moveDone:) 76 | ) 77 | ((== (points at: value) $7777) 78 | ;; at the end of a path so start over 79 | (if points 80 | (points dispose:) 81 | ) 82 | (= points 0) 83 | (= value 2) 84 | (self init: client who) 85 | ) 86 | (else 87 | ;; just at a node, so keep going 88 | (self 89 | setTarget:, 90 | init: 91 | ) 92 | ) 93 | ) 94 | ) 95 | ) 96 | -------------------------------------------------------------------------------- /SYSTEM/QSOUND.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; QSOUND.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Pablo Ghenis 7 | ;;;; Updated: Brian K. Hughes 8 | ;;;; 9 | ;;;; This class of sound is meant to monitor sequentially-numbered cues 10 | ;;;; and cue its client as many times as necessary to maintain the sequence, 11 | ;;;; regardless of whether or not the machine is keeping up with the sound. 12 | ;;;; 13 | ;;;; This class assumes that the absolute values of the cues it receives 14 | ;;;; form a sequence, i.e. 128, 129, 130... 15 | ;;;; 16 | ;;;; A Cue of 0 indicates "no news". Ad-hoc cues are 1 to 127, and the check 17 | ;;;; method must be overridden to handle them. Sequential cues are from 128 18 | ;;;; to 65536. 19 | ;;;; 20 | ;;;; From Pablo: "QueuedSounds eliminate the risk of having the animation loop 21 | ;;;; overrun by rapid sound cues since it catches up by cueing its client as 22 | ;;;; many times as the latest increment in signal, thus faking a 'queue of 23 | ;;;; cues' (Sorry, I can't resist a pun!)" 24 | ;;;; 25 | ;;;; Classes: 26 | ;;;; QueuedSound 27 | 28 | 29 | (script# QSOUND) 30 | 31 | 32 | (class QueuedSound kindof Sound 33 | (properties 34 | name "QSnd" 35 | ) 36 | 37 | (method (check &tmp cues theSignal [str 100]) 38 | ;; Used by the main game loop to determine if an animation 39 | ;; cue or sound completion has occurred. If so, cue:s the client. 40 | 41 | (DoSound SndUpdateCues self) 42 | 43 | (if (or (== signal -1) (u< signal 128)) 44 | (if signal 45 | (= prevSignal signal) 46 | (= signal 0) 47 | (if client 48 | (client cue: self) 49 | ) 50 | ) 51 | (return) 52 | ) 53 | 54 | (while (!= (= theSignal signal) prevSignal) 55 | 56 | ;;loop body 57 | ;;--------- 58 | 59 | (if client 60 | (for 61 | ( (= cues (- theSignal (or prevSignal 127))) 62 | ) 63 | cues 64 | ( (-- cues) 65 | ) 66 | 67 | ;;loop body 68 | ;;--------- 69 | (client cue: self) 70 | ) 71 | ) 72 | (= prevSignal theSignal) 73 | ) 74 | (= signal 0) 75 | (return TRUE) 76 | ) 77 | ) 78 | -------------------------------------------------------------------------------- /SYSTEM/DEDIT.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; DEDIT.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Bob Heitman 7 | ;;;; Updated: Brian K. Hughes 8 | ;;;; 9 | ;;;; The dialog edit field class. 10 | ;;;; 11 | ;;;; Classes: 12 | ;;;; DEdit 13 | 14 | 15 | (script# DEDIT) 16 | 17 | 18 | (class DEdit kindof DText 19 | ; 20 | ; A text field which is editable by the user. 21 | 22 | (properties 23 | type dEdit 24 | state dActive 25 | width 0 ; maximum number of characters allowed in field 26 | title 0 27 | titleFore 0 28 | titleBack 0 29 | titleFont 0 30 | frameOut TRUE ; should a FrameOut be done after editing? 31 | lastKey 0 ; last event during edit 32 | borderColor 0 33 | ) 34 | 35 | (method (dispose) 36 | ; 37 | ; Overridden to tell DText that we don't want to kill the text 38 | 39 | (super dispose: TRUE) 40 | ) 41 | 42 | (method (hilite tOrF &tmp origBM) 43 | (if (and argc tOrF) 44 | (= origBM bitmap) 45 | (= bitmap 0) 46 | (DeleteScreenItem self) 47 | (if (EditText self) 48 | (Bitmap MapDispose origBM) 49 | (self draw:) 50 | else 51 | (= bitmap origBM) 52 | ) 53 | (AddScreenItem self) 54 | ) 55 | ) 56 | 57 | (method (setSize &tmp r margin w) 58 | ; 59 | ; Calculate the size of the nsRect if there is no bitmap associated 60 | ; with us. 61 | 62 | (= margin (if (!= borderColor -1) 2 else 0)) 63 | 64 | (= nsLeft 0) 65 | (= nsTop 0) 66 | (= textLeft margin) 67 | (= textTop margin) 68 | (if (== view -1) 69 | (= r (IntArray with: 0 0 0 0)) 70 | (KText TextSize 71 | (r data?) 72 | {M} 73 | font 74 | 0 75 | ) 76 | (= w (* (+ (r at: 2) 1) width)) 77 | (= nsRight (+ nsLeft w (* margin 2))) 78 | (= nsBottom (+ nsTop (r at: 3) (- (* margin 2) 1))) 79 | (= textRight (+ textLeft w)) 80 | (= textBottom (+ textTop (r at: 3))) 81 | (r dispose:) 82 | else 83 | (= nsRight (+ nsLeft (CelWide view loop cel))) 84 | (= nsBottom (+ nsTop (CelHigh view loop cel))) 85 | (= textRight (- nsRight margin)) 86 | (= textBottom (- nsBottom margin)) 87 | ) 88 | ) 89 | ) 90 | 91 | -------------------------------------------------------------------------------- /SYSTEM/SCALETO.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; SCALETO.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc., 1992 5 | ;;;; 6 | ;;;; Author: Robert W. Lindsley & Randy MacNeill 7 | ;;;; Updated: Robert W. Lindsley -- 8/17/93 Parameter list is no longer variable 8 | ;;;; 9 | ;;;; A scaler class that scales an object from its current size 10 | ;;;; to a target size. 11 | ;;;; 12 | ;;;; Usage: 13 | ;;;; (object SetScale: ScaleTo targetSize stepSize ticks caller) 14 | ;;;; 15 | ;;;; Classes: 16 | ;;;; ScaleTo 17 | 18 | 19 | (script# SCALETO) 20 | 21 | 22 | (class ScaleTo kindof Scaler 23 | (properties 24 | caller 0 ;who to cue 25 | endScale 0 ;where to scale to 26 | step 6 ;step size, parameter passed to init 27 | waitCount 1 ;for real time 28 | scaleDir NULL ;which way to scale 29 | saveWaitCount NULL ;save for wait count 30 | ) 31 | (method (init who whereToScale theStep theTime whoCares) 32 | (if argc 33 | (= client who) 34 | (if (>= argc 2) 35 | (= endScale whereToScale) 36 | (if (>= argc 3) 37 | (= step theStep) 38 | (if (>= argc 4) 39 | (= waitCount theTime) 40 | (if (>= argc 5) 41 | (= caller whoCares) 42 | ) 43 | ) 44 | ) 45 | ) 46 | ) 47 | (= saveWaitCount waitCount) 48 | (= scaleDir (if (<= (client maxScale?) endScale) 1)) ;0 - backward / 1 - forward 49 | ) 50 | (method (doit &tmp theValue) 51 | (if (> (- gameTime waitCount) 0) 52 | (= theValue (if scaleDir (+ (client maxScale?) step) else (- (client maxScale?) step))) 53 | (client 54 | maxScale: theValue, 55 | scaleX: theValue, 56 | scaleY: theValue, 57 | ) 58 | (= waitCount (+ saveWaitCount gameTime)) 59 | (if scaleDir 60 | (if (>= (client maxScale?) endScale) (self dispose:)) ;if it's done kill it 61 | else 62 | (if (<= (client maxScale?) endScale) (self dispose:)) 63 | ) 64 | ) 65 | ) 66 | (method (dispose &tmp whoToCue) 67 | (= endScale 0) 68 | (= step 6) 69 | (= waitCount 1) 70 | (client scaler: 0) 71 | (if caller 72 | (= whoToCue caller) 73 | (= caller 0) 74 | (whoToCue cue:) 75 | ) 76 | (super dispose:) 77 | ) 78 | ) 79 |  -------------------------------------------------------------------------------- /INTERP/MOVIEW.HPP: -------------------------------------------------------------------------------- 1 | #if !defined(MOVIEW_HPP) 2 | #define MOVIEW_HPP 3 | 4 | extern "C" { 5 | unsigned int AviOpen(int movieNo,char * filename); 6 | unsigned int AviClose(int movieNo); 7 | unsigned int AviPut(int movieNo,int x1, int y1, int x2, int y2); 8 | unsigned int AviPutDouble(int movieNo,int x1, int y1); 9 | unsigned int AviPlay(int movieNo,int from, int to, int PlayStyle, int cue); 10 | unsigned int AviStop(int movieNo); 11 | unsigned int AviPause(int movieNo); 12 | unsigned int AviResume(int movieNo); 13 | unsigned int AviSetPalette(int movieNo); 14 | unsigned int AviGetLength(int movieNo); 15 | unsigned int AviGetPosition(int movieNo); 16 | unsigned int AviGetStatus(int movieNo); 17 | unsigned int AviCue(int movieNo,int frameNo); 18 | unsigned int AviSeek(int movieNo, int frameNo); 19 | unsigned int AviGetFramesSkipped(int movieNo); 20 | unsigned int AviWaitEvent(int,int events); 21 | void AviNotify(WPARAM,LPARAM); 22 | 23 | enum avi_error { 24 | AVI_NO_ERROR = 0, 25 | AVI_DEVICE_NOT_OPEN, 26 | AVI_OPEN_FAIL, 27 | AVI_CLOSE_FAIL, 28 | AVI_WHERE_FAIL, 29 | AVI_PUT_FAIL, 30 | AVI_PLAY_FAIL, 31 | AVI_STOP_FAIL, 32 | AVI_PAUSE_FAIL, 33 | AVI_RESUME_FAIL, 34 | AVI_NOT_PLAYING, 35 | AVI_PALETTE_FAIL, 36 | AVI_CUE_FAIL 37 | }; 38 | 39 | // the 3 consts following are bit flags for the AVI_ 40 | const WORD AVI_COMPLETED = 1; 41 | const WORD AVI_ESC_PRESSED = 2; 42 | const WORD AVI_MOUSE_DOWN = 4; 43 | const WORD AVI_HOT_RECTANGLE = 8; 44 | 45 | enum avi_play_type { 46 | PLAY_DEFAULT = 0, 47 | PLAY_FULLSCREEN, 48 | SCI_WINDOW 49 | }; 50 | 51 | enum avi_status { 52 | statusNotOpen, 53 | statusOpen, 54 | statusPlaying, 55 | statusPaused, 56 | statusStopped, 57 | statusDone, 58 | }; 59 | 60 | enum avi_command_list { 61 | AVI_OPEN = 0, 62 | AVI_PUT, 63 | AVI_PLAY, 64 | AVI_STOP, 65 | AVI_PAUSE, 66 | AVI_RESUME, 67 | AVI_CLOSE, 68 | AVI_SETPALETTE, 69 | AVI_GET_LENGTH, 70 | AVI_GET_POSITION, 71 | AVI_GET_STATUS, 72 | AVI_CUE, 73 | AVI_SEEK, 74 | AVI_FRAMES_SKIPPED, 75 | AVI_WAIT_EVENT, 76 | AVI_PUT_DOUBLE 77 | }; 78 | 79 | } 80 | #endif 81 | 82 |  -------------------------------------------------------------------------------- /SYSTEM/FOLLOW.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; FOLLOW.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc., 1993 5 | ;;;; 6 | ;;;; Author: Unknown 7 | ;;;; Updated: 8 | ;;;; 9 | ;;;; This motion moves its client in such a way as to try to stay within 10 | ;;;; a certain distance of another object. 11 | ;;;; 12 | ;;;; Classes: 13 | ;;;; Follow 14 | 15 | 16 | (script# FOLLOW) 17 | 18 | 19 | (class Follow kindof Motion 20 | (properties 21 | who 0 ;who to follow 22 | distance 20 ;try to stay at least this close to 'who' 23 | ) 24 | 25 | (method (init theObj whom dist) 26 | 27 | (if (>= argc 1) (= client theObj) 28 | (if (>= argc 2) (= who whom) 29 | (if (>= argc 3) (= distance dist) 30 | ) 31 | ) 32 | ) 33 | 34 | 35 | ;If the client is too far from the object being followed, start 36 | ;moving toward it. 37 | (if (> (client distanceTo: who) distance) 38 | (super init: client (who x?) (who y?)) 39 | ; (super doit:) 40 | ) 41 | ) 42 | 43 | (method (onTarget) 44 | (<= (client distanceTo: who) distance) 45 | ) 46 | 47 | (method (setTarget) 48 | (cond 49 | (argc 50 | (super setTarget: &rest) 51 | ) 52 | ((not (self onTarget:)) 53 | (super setTarget: (who x?) (who y?)) 54 | ) 55 | ) 56 | ) 57 | 58 | (method (doit &tmp angle) 59 | (if (> (client distanceTo: who) distance) 60 | (if (== b-moveCnt 0) 61 | (super init: client (who x?) (who y?)) 62 | ) 63 | ;If too far from the object being followed, move toward it. 64 | (super doit:) 65 | else 66 | ;The client is just standing around near its destination. Pick 67 | ;the loop which faces in the destination's direction. 68 | (= xLast (client x?)) 69 | (= yLast (client y?)) 70 | (= angle (GetAngle xLast yLast (who x?) (who y?))) 71 | (if (!= angle (client heading?)) 72 | (client heading: angle) 73 | (if (client looper?) 74 | ((client looper?) doit: client angle) 75 | else 76 | (DirLoop client angle) 77 | ) 78 | ) 79 | ) 80 | ) 81 | 82 | (method (moveDone) 83 | ;;; When done with the current leg of wandering, re-init: the motion 84 | ;;; to continue wandering. 85 | ; (self init: client distance) 86 | ) 87 | ) 88 | -------------------------------------------------------------------------------- /INTERP/MOUSED.HPP: -------------------------------------------------------------------------------- 1 | // mouse.hpp 2 | 3 | #ifndef MOUSED_HPP 4 | #define MOUSED_HPP 5 | 6 | #ifndef MOUSE_HPP 7 | #include "mouse.hpp" 8 | #endif 9 | 10 | 11 | class MouseDOS : public SOL_Mouse 12 | { 13 | public: 14 | MouseDOS(Bool use); 15 | ~MouseDOS(); 16 | 17 | Bool Exists() const; 18 | int GlobalPos(SOL_Point*) const; 19 | int GlobalPosSci(SOL_Point*) const; 20 | int GetSwiftInfo(int* z, int* pitch, int* roll, int* yaw) const; 21 | 22 | void SetRestrictRect(const SOL_Rect&); 23 | void ClearRestrictRect(); 24 | void SetPos(const SOL_Point&); 25 | void Setup(SOL_Cursor&); 26 | Bool IsSwift() const; 27 | void Vibrate(int duration, int on = 1, int off = 1) const; 28 | 29 | protected: 30 | void InitMouse(); 31 | void InstallMouseInterrupt(); 32 | void ReleaseMouseInterrupt(); 33 | void SetMouseDriverPos(const SOL_Point&); 34 | 35 | friend void __loadds __far HndlMouse(int, int, int, int, int, int); 36 | 37 | static SOL_Cursor* cursor; 38 | static SOL_Rect restrict; 39 | static Bool useMouse; 40 | static Bool isSwift; 41 | static Bool entered; 42 | static SOL_Point pos, posScale; 43 | static short zaxis; 44 | static short pitch; 45 | static short roll; 46 | static short yaw; 47 | static int buttonState; 48 | static SOL_Event event; 49 | static int exists; 50 | static uchar* stackBuff; 51 | }; 52 | 53 | typedef struct { 54 | short x; 55 | short y; 56 | short z; 57 | short pitch; 58 | short roll; 59 | short yaw; 60 | short buttons; 61 | } SWIFT_3DStatus; 62 | 63 | 64 | const short lButDown = 0x02; 65 | const short lButUp = 0x04; 66 | const short rButDown = 0x08; 67 | const short rButUp = 0x10; 68 | const short cButDown = 0x20; 69 | const short cButUp = 0x40; 70 | const short cYAxis = 0x800; 71 | const short cPitch = 0x1000; 72 | const short cRoll = 0x2000; 73 | const short cYaw = 0x4000; 74 | 75 | const short butDown = lButDown | rButDown | cButDown; 76 | const short butUp = lButUp | rButUp | cButUp; 77 | const short lButton = lButDown | lButUp; 78 | const short rButton = rButDown | rButUp; 79 | const short cButton = cButDown | cButUp; 80 | const short swiftFunc = cYAxis | cPitch | cRoll | cYaw; 81 | 82 | 83 | #endif 84 | 85 | 86 |  -------------------------------------------------------------------------------- /INTERP/PMACHINE.HPP: -------------------------------------------------------------------------------- 1 | // pmachine.hpp 2 | // interface to the pmachine 3 | 4 | #ifndef PMACHINE_HPP 5 | #define PMACHINE_HPP 6 | 7 | #ifndef GLOBALS_HPP 8 | #include "globals.hpp" 9 | #endif 10 | 11 | #ifndef MEMID_HPP 12 | #include "memid.hpp" 13 | #endif 14 | 15 | #ifndef OBJECT_HPP 16 | #include "object.hpp" 17 | #endif 18 | 19 | #ifndef SAVEABLE_HPP 20 | #include "saveable.hpp" 21 | #endif 22 | 23 | #ifndef SCRIPT_HPP 24 | #include "script.hpp" 25 | #endif 26 | 27 | typedef long Acc; 28 | 29 | extern "C" { 30 | 31 | void pmRun(); 32 | void pmEnd(); 33 | 34 | void pmRestartBuf(); 35 | void pmTossMemID( unsigned, unsigned ); 36 | #pragma aux pmTossMemID parm [ECX] [EAX]; 37 | 38 | Property& pmGameSetProp(Selector select, unsigned int value); 39 | #pragma aux pmGameSetProp parm [EAX] [EDX]; 40 | 41 | Property& pmGlobal(GlobalNum); 42 | #pragma aux pmGlobal parm [EDX]; 43 | 44 | Bool pmCheckIntegrity(char* note); 45 | 46 | void pmDispatch(unsigned scriptNum, unsigned entryNum, unsigned nArgChars); 47 | 48 | Acc invokeMethod(unsigned Obj, unsigned select, unsigned nArgChars, void * a); 49 | #pragma aux invokeMethod parm [EBX] [EDX] [ECX] [EDI]; 50 | 51 | void pmQuickMessage(unsigned Obj, unsigned nArgChars, void * a); 52 | #pragma aux pmQuickMessage parm [EBX] [ECX] [EDI]; 53 | 54 | void pmPushMany(Selector select, unsigned nArgs, short* ptrs); 55 | #pragma aux pmPushMany parm [EDX] [ECX] [ESI]; 56 | 57 | void pmSaveRestoreBefore(SaveGame*, Bool); 58 | void pmSaveRestoreAfter(SaveGame*, Bool); 59 | } 60 | 61 | //static void Messager(const ObjectID&); 62 | 63 | _Packed struct PMachine { 64 | Int16 game; 65 | Int16 object; 66 | 67 | Int32 acc; 68 | Int32 prevAcc; 69 | 70 | Property* StackPtr; 71 | Property* TempPtr; 72 | Property* GlobalPtr; 73 | Property* ParmPtr; 74 | 75 | VariableID Locals; 76 | VariableID Globals; 77 | 78 | Int16 disposeTossRet; 79 | unsigned RestArgs; 80 | 81 | Int16 curScriptNum; 82 | char curSourceFile[256]; 83 | Int16 curSourceLineNum; 84 | Int32 restart[4]; 85 | }; 86 | 87 | const uchar OP_BYTE = 0x01; // char operation if set, int otw 88 | 89 | extern "C" PMachine pm; 90 | 91 | #endif 92 | 93 |  -------------------------------------------------------------------------------- /INTERP/INTFLAG.ASM: -------------------------------------------------------------------------------- 1 | 2 | .486 3 | .MODEL FLAT,SYSCALL 4 | 5 | .DATA 6 | newstack dq 10 dup(?) 7 | oldstack dq 10 dup(?) 8 | gotoaddr dd 10 dup(?) 9 | savereg dd 10 dup(?) 10 | 11 | .CODE 12 | 13 | public SetInterruptFlag 14 | 15 | SetInterruptFlag proc val:WORD 16 | mov ax, val 17 | push ax 18 | popf 19 | ret 20 | SetInterruptFlag endp 21 | 22 | 23 | 24 | 25 | public ReadInterruptAndClear 26 | 27 | ReadInterruptAndClear proc 28 | pushf 29 | pop ax 30 | cli 31 | cld 32 | ret 33 | ReadInterruptAndClear endp 34 | 35 | 36 | 37 | 38 | 39 | public SetESToDS 40 | 41 | SetESToDS proc 42 | cld 43 | push es 44 | mov ax, ds 45 | mov es, ax 46 | pop eax 47 | ret 48 | SetESToDS endp 49 | 50 | 51 | 52 | 53 | public SetStack 54 | SetStack proc 55 | 56 | movzx eax, WORD PTR 8[esp] 57 | mov savereg[eax*4], ebx 58 | 59 | ; Save off the current "old" stack less return address 60 | ; ---------------------------------------------------- 61 | mov bx, ss 62 | mov WORD PTR oldstack + 4[eax*8], bx 63 | mov ebx, esp 64 | add ebx, 8 ; Param and return address 65 | mov DWORD PTR oldstack[eax*8], ebx 66 | 67 | ; Initialize variable to new stack 68 | ; -------------------------------- 69 | mov bx, ds 70 | mov WORD PTR newstack + 4[eax*8], bx 71 | mov ebx, 4[esp] 72 | mov DWORD PTR newstack[eax*8], ebx 73 | 74 | ; Set new stack, return 75 | ; --------------------- 76 | mov ebx, [esp] 77 | mov gotoaddr[eax*4], ebx 78 | lss esp, FWORD PTR newstack[eax*8] 79 | mov ebx, savereg[eax*4] 80 | jmp DWORD PTR gotoaddr[eax*4] 81 | SetStack endp 82 | 83 | 84 | 85 | 86 | public RestoreStack 87 | RestoreStack proc 88 | 89 | ; Recover old stack, return 90 | ; ------------------------- 91 | movzx eax, WORD PTR 4[esp] 92 | mov savereg[eax*4], ebx 93 | mov ebx, [esp] 94 | mov gotoaddr[eax*4], ebx 95 | mov ebx, savereg[eax*4] 96 | lss esp, FWORD PTR oldstack[eax*8] 97 | jmp DWORD PTR gotoaddr[eax*4] 98 | 99 | RestoreStack endp 100 | 101 | 102 | 103 | 104 | public SetES 105 | 106 | SetES proc val:WORD 107 | mov ax, val 108 | mov es, ax 109 | ret 110 | SetES endp 111 | END 112 |  -------------------------------------------------------------------------------- /SYSTEM/CURSOR.SC: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ;;;; CURSOR.SC 3 | ;;;; 4 | ;;;; (c) Sierra On-Line, Inc, 1993 5 | ;;;; 6 | ;;;; Author: Jeff Stephenson 7 | ;;;; Updated: Brian K. Hughes 8 | ;;;; 9 | ;;;; General purpose 'system' classes, presumably not adventure-game 10 | ;;;; specific. Defines the base class, Object, and all Collection 11 | ;;;; classes. Probably should be broken up into several modules. 12 | ;;;; 13 | ;;;; Classes: 14 | ;;;; Cursor 15 | ;;;; 16 | 17 | 18 | (script# CURSOR) 19 | 20 | 21 | (class Cursor kindof View 22 | ;;; The Cursor class is an object used to control the user's cursor. 23 | ;;; (Written by Robert W. Lindsley, July, 1991) 24 | 25 | (properties 26 | view NULL 27 | loop NULL 28 | cel NULL 29 | x 0 30 | y 0 31 | hidden FALSE ;private 32 | ) 33 | (methods 34 | posn ;move cursor to a set of screen coordinates 35 | setView ;set cursor's view 36 | setLoop ;set cursor's loop 37 | setCel ;set cursor's cel 38 | show 39 | hide 40 | ) 41 | 42 | (method (init) 43 | ; 44 | ; Set the game cursor to us, setting the hot spot as well (if indicated) 45 | 46 | (SetCursor view loop cel) 47 | (return self) 48 | ) 49 | 50 | (method (posn theX theY) 51 | ; 52 | ; Move the cursor to a specific set of coordinates 53 | 54 | (SetCursor theX theY) 55 | (= x (= mouseX theX)) 56 | (= y (= mouseY theY)) 57 | ) 58 | 59 | (method (setView whichView) 60 | ; 61 | ; Set the view of the cursor 62 | 63 | (= view whichView) 64 | (self init:) 65 | ) 66 | 67 | (method (setLoop whichLoop) 68 | ; 69 | ; Set the loop of the cursor 70 | 71 | (= loop whichLoop) 72 | (self init:) 73 | ) 74 | 75 | (method (setCel whichCel) 76 | ; 77 | ; Set the cel of the cursor 78 | 79 | (= cel whichCel) 80 | (self init:) 81 | ) 82 | 83 | (method (show) 84 | ; 85 | ; Show the cursor 86 | 87 | (if hidden 88 | (SetCursor TRUE) 89 | (= hidden FALSE) 90 | ) 91 | ) 92 | 93 | (method (hide) 94 | ; 95 | ; Hide the cursor 96 | 97 | (if (not hidden) 98 | (SetCursor FALSE) 99 | (= hidden TRUE) 100 | ) 101 | ) 102 | ) 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /INTERP/GRAPHMD.HPP: -------------------------------------------------------------------------------- 1 | #ifndef GRAPHMD_HPP 2 | #define GRAPHMD_HPP 3 | 4 | #ifndef GRAPHMGR_HPP 5 | #include "graphmgr.hpp" 6 | #endif 7 | 8 | #ifndef VGA_HPP 9 | #include "vga.hpp" 10 | #endif 11 | 12 | #ifndef PALMGRD_HPP 13 | #include "palmgrd.hpp" 14 | #endif 15 | 16 | #ifndef CURSORD_HPP 17 | #include "cursord.hpp" 18 | #endif 19 | 20 | #ifndef BUFFERD_HPP 21 | #include "bufferd.hpp" 22 | #endif 23 | 24 | #ifndef TIMED_HPP 25 | #include "timed.hpp" 26 | #endif 27 | 28 | #ifndef VIDEO_HPP 29 | #include "video.hpp" 30 | #endif 31 | 32 | class GraphicsMgrDOS : public GraphicsMgr 33 | { 34 | public: 35 | GraphicsMgrDOS(int xdim,int ydim,int vesaMode,Bool usePri); 36 | ~GraphicsMgrDOS(); 37 | 38 | void ClearLastScreen() {last.Clear();} 39 | SOL_Cursor& GCursor() {return *cursor;} 40 | PaletteMgr& GPalette() {return palmgr;} 41 | void NewScreenDim(int xdim,int ydim); 42 | void PlayMovie(char* filename,int tickCount,int x = 0,int y = 0); 43 | Buffer& PriMap() {return pmap;} 44 | void Repaint(const SOL_Rect&); 45 | int ScreenCount() const {return 1;} 46 | void SetVideoForMovies(); 47 | void SetVideoForSpeed(); 48 | void ShakeScreen(int num,int dir) 49 | {::ShakeScreen(num,dir,(int *)&(((TimeMgrDOS *)timeMgr)->GetTickRef()));} 50 | #ifdef DEBUG 51 | char* SnapShot(char* filename); 52 | #endif 53 | void UpdateScreen() {last = next;} 54 | Screen& VisibleScreen() {return last;} 55 | 56 | void AlterVMAP(const SOLPalette* myPal, const SOLPalette* newPal, int palIndex, char* palArray); 57 | 58 | protected: 59 | void CalcLists(DrawList** drawLists,RectList** eraseLists,SOL_Rect& dirtyRect) 60 | {next.CalcLists(last,drawLists,eraseLists,dirtyRect);} 61 | void CreatePriMap(); 62 | Buffer* CurrBuffer() {return &buffer;} 63 | void DeletePriMap(); 64 | void ResizeVmap(int xdim,int ydim); 65 | void ShowBits(); 66 | void TimingTest(const BufferStd&); 67 | 68 | BufferStd buffer; // VMAP 69 | CursorDOS* cursor; 70 | Screen last; 71 | Bool modeX; 72 | PaletteMgrDOS palmgr; 73 | BufferStd pmap; // PMAP 74 | MemID pmapID; 75 | Bool vesa; 76 | Vga vga; 77 | MemID vmapID; 78 | uchar* vmapPtr; 79 | }; 80 | #endif 81 |  -------------------------------------------------------------------------------- /INTERP/MEMID.CPP: -------------------------------------------------------------------------------- 1 | // memid.cpp 2 | 3 | #include "sol.hpp" 4 | 5 | #include "dos.hpp" 6 | #include "memid.hpp" 7 | 8 | MemAttrs 9 | MemID::Attrs() const 10 | { 11 | return memMgr->GetMemAttrs(*this); 12 | } 13 | 14 | MemType 15 | MemID::GetMemType() const 16 | { 17 | return memMgr->GetMemType(*this); 18 | } 19 | 20 | const char* 21 | MemID::GetMemTypeStr() const 22 | { 23 | return memMgr->GetMemTypeStr(*this); 24 | } 25 | 26 | void 27 | MemID::Clear() const 28 | { 29 | Fill(0); 30 | } 31 | 32 | void 33 | MemID::Critical(Bool on) const 34 | { 35 | memMgr->Critical(handle, on); 36 | } 37 | 38 | void 39 | MemID::Fill(uchar c) const 40 | { 41 | memset(**this, c, (size_t) memMgr->GetSize(*this)); 42 | } 43 | 44 | void* 45 | MemID::Lock() const 46 | { 47 | return memMgr->Lock(*this); 48 | } 49 | 50 | void* 51 | MemID::Unlock() const 52 | { 53 | return memMgr->Unlock(*this); 54 | } 55 | 56 | void 57 | MemID::SetDiscardable() const 58 | { 59 | memMgr->SetDiscardable(*this); 60 | } 61 | 62 | void 63 | MemID::SetNotDiscardable() const 64 | { 65 | memMgr->SetNotDiscardable(*this); 66 | } 67 | 68 | void* 69 | MemID::Realloc(size_t size) const 70 | { 71 | memMgr->Realloc(*this, size); 72 | return **this; 73 | } 74 | 75 | int 76 | MemID::Read(int fd) const 77 | { 78 | return ReadMemID(fd, *this, Size()); 79 | } 80 | 81 | int 82 | MemID::Read(int fd, size_t ofs, size_t size) const 83 | { 84 | return ::Read(fd, &(*this)[ofs], size); 85 | } 86 | 87 | int 88 | MemID::Load(MemType type, char* fileName, MemAttrs attrs, ReservedHandle h) 89 | { 90 | int fd; 91 | 92 | if ((fd = Open(fileName, O_RDONLY | O_BINARY)) == -1) 93 | return 0; 94 | 95 | int size = FileLength(fd); 96 | Get(type, size, h, attrs); 97 | 98 | int rc = Read(fd); 99 | if (rc != size) { 100 | Free(); 101 | rc = 0; 102 | } 103 | 104 | Close(fd); 105 | 106 | return rc; 107 | } 108 | 109 | size_t 110 | MemID::Size() const 111 | { 112 | return handle ? (size_t) memMgr->GetSize(*this) : 0; 113 | } 114 | 115 | #ifdef DEBUG 116 | void 117 | MemID::SetChecksum(Bool onoff) const 118 | { 119 | memMgr->SetChecksum(*this, (int)onoff); 120 | } 121 | #endif 122 | 123 | 124 |  125 | --------------------------------------------------------------------------------