FSO.HIT.HITThread.ReadVar C# (CSharp) Method

ReadVar() public method

public ReadVar ( int location ) : int
location int
return int
        public int ReadVar(int location)
        {
            if (location < 0x10)
            {
                return Registers[location];
            }
            else if (location < 0x46)
            {
                return LocalVar[location - 0x10];
            }
            else if (location < 0x64)
            {
                return 0; //not mapped
            }
            else if (location < 0x88)
            {
                return VM.ReadGlobal(location - 0x64);
            }
            else if (location < 0x271a)
            {
                return 0; //not mapped
            }
            else if (location < 0x2737)
            {
                return ObjectVar[location - 0x271a];
            }
            return 0;
        }

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Compare two variables and set the flags.
        /// </summary>
        public static HITResult Cmp(HITThread thread) //same as sub, but does not set afterwards.
        {
            var dest = thread.ReadByte();
            var src  = thread.ReadByte();

            var result = thread.ReadVar(dest) - thread.ReadVar(src);

            thread.SetFlags(result);

            return(HITResult.CONTINUE);
        }
All Usage Examples Of FSO.HIT.HITThread::ReadVar