! ----------------------------------------------------------------------------- ! "phxdefs.h" ! Definitions and variables for Phoenix-compiled games ! (c) Graham Nelson, 990818 ! ----------------------------------------------------------------------------- ! Movement instruction types Constant TO__M = 1; Constant DESTROY__M = 2; Constant VIAEXIT__M = 3; Constant DIR__M = 4; Constant RANDOM__M = 5; Constant RANDADJ__M = 6; ! Return value states Constant RETRY__RV = $1000; Constant DEST__RV = $2000; Constant PASS__RV = $3000; Constant ABORT__RV = $4000; Constant LOOK__RV = $5000; Constant NEXTCOMM__RV = $6000; Constant LEAVE__RV = $7000; Constant NONE__RV = $100; Constant IGNORE__RV = $200; Constant OBJECT__RV = $300; Constant OBEY__RV = $400; Constant PRINT__RV = $500; Constant SAVE__RV = $600; Constant SAVEND__RV = $700; Constant RESTART__RV = $800; Constant FINISH__RV = $900; Constant MOVE__RV = $a00; Constant RETURN__RV = $b00; Constant MAY__RV = $10; Constant REQUEST__RV = $20; Constant MUST__RV = $30; Constant CANT__RV = $40; Constant REC__RV = $2; Constant ANY__RV = $4; Constant DIR__RV = $6; Constant OBJ__RV = $8; Constant SPECIAL__RV = $a; Global Return_State; ! The return state of the current program Global Pass_State; ! The state returned from the most recent exit ! program Global Leave_StackFrame; ! Stack frame allowing for RETURN LEAVE to ! exit the current subroutine nest ! Word slots: short arrays containing the meanings of the two words of ! the current command Array Word1_Slot --> 8; Array Word2_Slot --> 8; Constant Meaning_LX = 0; ! NONE/IGNORE/OBJECT/OBEY/PRINT/SAVE/SAVEND/ ! RESTART/FINISH/MOVE/RETURN (action if typed ! as a first word) Constant Label_LX = 1; ! Routine to call, if OBEY, or string to print, ! if PRINT Constant Second_LX = 2; ! MAY/MUST/CANT/REQUEST (take a second word) Constant Second2_LX = 3; ! REC/ANY/DIR/OBJ/SPECIAL (kind of second word) Constant Reference_LX = 4; ! Reference to object or room, or 0 Constant Direction_LX = 5; ! Exit property, or 0 if no direction Constant Special_LX = 6; ! Special meaning constant, or 0 if no special Array SWText -> 32; ! Text of second word (which need not always be ! in the dictionary, hence the need to store its ! text verbatim) ! The text variable contents Array TheTextVar --> 1024; ! Object and room data ! Meaning for items Meaning for rooms Property state; ! state (S) state (S) Property message__1; ! if unheld if unvisited Property message__2; ! if held by PLAYER if visited Property message__3; ! if held by third party ! Meaning for items Meaning for rooms Attribute attribute_0; ! light source lit Attribute attribute_1; ! invisible visited Attribute attribute_2; ! opaque disoriented Attribute attribute_3; ! remainder free for designer's use Attribute attribute_4; Attribute attribute_5; Attribute attribute_6; Attribute attribute_7; Attribute attribute_8; Attribute attribute_9; Attribute attribute_10; Attribute attribute_11; Attribute attribute_12; Attribute attribute_13; Attribute attribute_14; Attribute attribute_15; Attribute held_at_start; ! used by the system Class Room with state; Class Item with state; ! Random number generation Ifdef DEBUGV; Global RNG_TYPE = 2; ! use software RNG model 2 for testing Ifnot; Global RNG_TYPE = 0; ! use native Z-machine RNG Endif; Global rng_seed; ! seed for the software random-number generators Ifdef DEBUGV; Global tr__m; ! true if source code being traced Global tr__rng; ! true if RNG output being traced Endif; ! Arrays for Z-machine parsing Array buffer -> 121; ! Buffer for parsing main line of input Array parse -> 65; ! Parse table mirroring it Array buffer2 -> 121; ! Buffers for supplementary questions Array parse2 -> 65; ! Array buffer3 -> 121; ! Buffers for additional parsing Array parse3 -> 65; ! ! "undo" state Global undo_flag; Global just_undone; ! Command transcription state Global xcommsdir; ! Misc Global start_of_command_room; Global debug_flag; ! To keep the Inform veneer happy