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);
}