> > ;"CONSTANTS FOR SAVE-RESTORE UVECTOR" ;"Length of ROOMS block" ;"Length of DEMONS block" ;"Length of > block" ;"Starting offset of CLOCKER slots" ;"Length of CEVENT slots (33 CEVENTS x 3 slots)" ;"Length of ACTORs block" ;"Length of WINNER block" ;"Length of MONAD GVAL block" ;"Length of ROOM GVAL block" ;"Length of OBJECT GVAL block" ;"# of slots for OBJECTs" > ;"# of slots for ROOMs" ;"# of slots for CEVENT" ;"Names of slots to be saved from OBJECTS" ;"Types of these slots (rested once)" ;"Names of slots to be saved from ROOMS" ;"Types of these slots (rested once)" ;"Names of slots to be saved from CEVENTS" ;"Types of these slots" > ) > <+ 1 <- >>>> ; "Get the FIX code for any item." > ) 10223616) ( 2883584) ( 0) ( ) (<==? WORD> ) ( >) ( >) (> >> <1 .RI>>) (5505024)>> ;"Get an object from any FIX code (inverse of SCODE)" ) ) (<==? .FX *13000000*> <>) (<==? .FX *25000000*> #FALSE (1)) (<==? > #WORD *14*> > FIX> > FIX>>>) (<==? .TYP OBJECT> <>) (>)>) (<==? .TYP ROOM> <>) ( ,ROOM-POBL>> ) (>)>) (<==? .TYP CEVENT> <>) ( >> ,.ATM)>) ()>> ; "Save elements from a list of items: Arg 1: The code UVECTOR Arg 2: The list of items (e.g. ,ROOMS ,OBJECTS) Arg 3: Number of elements to REST off Arg 1 when finished Arg 4: A UVECTOR of offsets for each item to be saved Arg 5: The number of slots to be used for each item in the UVECTOR" (NUVEC) ) (U) ) > > >> .NUVEC> >> .L> > ; "Restore elements from an object Arg 1: The code UVECTOR Arg 2: The object Arg 3: A UVECTOR of offsets into the object Arg 4: A UVECTOR of types for these offsets (ATOMs)" (TUVEC NUVEC) (OBJ) (M) >) .TYP>> > )> >> .NUVEC .TUVEC>> (SLT) ATOM (HOW) APPLICABLE) FIX>> ) (<==? .SLT OID> ) ()>> (SLT) ATOM (VAL) ANY (HOW) APPLICABLE (M) >) > .SLT> >)>)> FIX>> ) ()>> ; "Save GVALs Arg 1: The code UVECTOR Arg 2: A UVECTOR of ATOMS (which must have GVALs! Arg 3: Number of times to rest UVECTOR when done" (GV) (RST) FIX) (VEC) ) >>>> .GV .V> > ; "Restore GVALs Args 1-3: As above Arg 4: The type (ATOM) to restore" (GV) (RST) FIX (TYP) ATOM) >> .GV .V> > ; "Restore a LIST of OBJECTs Arg 1: The code UVECTOR Stops when a 0 is encountered" ) ) ()>> .V>> ; "Restore ROOMS/OBJECTS Arg 1: The code UVECTOR Arg 2: A UVECTOR of offsets into the objects (FIX) Arg 3: A UVECTOR of types of the offsets (ATOM) Arg 4: The length of each record Arg 5: OBJECT/ROOM flag Gets the item (ROOM or OBJECT) from the ID slot and then calls UNRESTFUL-CODE to fill the elements (note that this function is called with names = This function also fixes up OCONTENTS and OROOM slots." (TYPES NAMES) (RECLEN) FIX (TYPE) ATOM (C) > (D) ) >) .TYPE>> .OBJ .NAMES .TYPES> > )>) (> )> >> > )>)>)>)> >) ()>>> ) > ,SRUV> ,SRUV) (> >)>> ; "Save the game -- linear sequence of calls to above" (C H) HACK (CH) CHANNEL) > ;"Save objects" > > ;"Save rooms" > ;"Save robber's booty" ,HOBJSVLN '![OID] 1>> ;"Save robber stuff" >>> >> >> 1) (0)>> 1) (0)>> ;"Save clocker" ,CEVSVLN ,CSNAMES ,CRECLN>> >> ;"Save winners" >> ,ACTORS> > ;"Save GVALs (MONAD, ROOM, OBJECT)" > > > .CH> "DONE"> (BUCK) FIX) > ,SAVLENGTH> >> > > >> .LST> >> ,CPOBJS>)>> (OBJS) (WHR) FIX) > ,SAVLENGTH> > ) > .OBJS> > ) (> ( OBJECT> !)>)> >> ,ROBJS >>)>> (W) ADV) >> >> >> >> >> ,WSVLN '![OID!] 1>> (C H) HACK (CSNAMES CSTYPES) UVECTOR (CNT) FIX (RG) ACTIVATION) > ,SAVE-VERSION> .RG>)> > ; "Clear slots" > ,OBJECTS> > ,ROOMS> ; "Retrieve clocker first!" ) 3>>> CEVENT>> .CV .CSTYPES> ) ()>) ()>> >>> ; "Get objects" ,OSTYPES ,ORECLN OBJECT> ; "Get rooms" > ,RSTYPES ,RRECLN ROOM> ; "Get robber" >>> > ROOM> ,ROOMS>> ROOM>> FIX>> > ,ROBBER) (ROBBER)>>) (T >)> > ,SWORD-GLOW) (SWORD-GLOW)>>)> >> ; "Get winner" >> ,ACTORS> > ; "Get GVALS" > > > "DONE")>> (W) ADV (T) OBJECT) ROOM>> FIX>> OBJECT>> OBJECT>> OACTOR .W>> FIX>> >>> > >