C-Sheep
 
Crossbow VM Binary File Format Intrinsics

Home
About C-Sheep
About "The Meadow"
Gallery
Documentation
Publications
Downloads
These are the intrinsic functions of the Crossbow VM that can be called using the "call intrinsic function" virtual machine instruction. The numerical order of instructions might appear illogical, which is due to the fact that the Crossbow VM retains backwards compatibility to the ZBL/0 virtual machine.

All function parameters are taken (popped) from the top of the stack and results are stored (pushed) on the top of the stack.

 Function  Code  Return 
Value
 Parameters Effect
backstep0x03--move the sheep entity backwards by 1 unit
blocked0x04*1directionchecks if the sheep entity's path is blocked in the given direction (relative to the its current alignment)

valid parameter values are:
front - 1.0
right - 2.0
back - 3.0
left - 4.0

returns 1.0 if the path is blocked or 0.0 if the path is free

initialise0x0F-2x coord,
y coord 
set the position of the sheep entity on the "The Meadow" to the positions given by the x and y parameters (should only be invoked once at the start of the program).
random0x1D*-returns a random number (note: the instruction data value must be set to 1.0 for this intrinsic function)
step0x20--move the sheep entity forward by 1 unit
turn left0x29--turn the shee entity left by 90 degrees
turn right0x2A--turn the sheep entity right by 90 degrees
found0x65*1objectchecks if given object is located at the sheep entity's current position

valid parameter values are:
ball - 1.0

returns 1.0 if the object is found or 0.0 if there is no object

query0x68*1subjectqueries the given state (subject) of the virtual environment

valid parameter values are:
weather - 1.0
      returns one of perfect (4.0), good (3.0),
      changing (2.0), bad (1.0) and horrible (0.0)
time - 2.0
      returns the current time as a value between 0.0 and 23.9

root0x6C* 1  numerical 
value
calculates the sqare root of the given parameter

 
www.OpenGl.org

www.lua.org

www.libsdl.org

  http://developer.nvidia.com/object/cg_toolkit.html

developed at the NCCA



© 2006,2007 by Eike Anderson, Steffen Engel & Leigh McLoughlin, NCCA, Bournemouth University