home *** CD-ROM | disk | FTP | other *** search
/ Fun Online 1997 April / FOL0497.iso / tvmlsa / play4.exe / 1033 / STTEXT / 104
Text File  |  1997-05-27  |  104KB  |  2,132 lines

  1. // Built-in filing system access
  2. enum
  3. fileaccessmode read write append;
  4.  
  5. enumrange
  6. filecheckmode 0 32767 exists=%x0 writable=%x2 writeable=%x02 readable=%x4 ;
  7. boolean 0 1 false true;
  8.  
  9.  
  10. command
  11. chdir#12,1 filename : a0 <= $1;                                  //change the working directory
  12. mkdir#12,2 filename : a0 <= $1;                                  //make a new directory as specified by the path
  13. rmdir#12,3 filename : a0 <= $1;                                  //remove a directory as specified by the path
  14.  
  15. remove#12,4 filename : a0 <= $1;                                 //remove a file as specified by the path
  16. rename#12,5 filename=(old) filename=(new) : a0 <= $1 a1 <= $2;   //rename the final component of old file or directory name
  17.  
  18. function
  19. getcwd#12,6    =filename              : a0=>$0;                    //return the current working directory
  20. syserror#12,7  =int                   : d0=>$0;                    //return the status of the last file system call
  21. strerror#12,8  =string posint=(errno) : d0<=$1 a0=>$0;            //return system error message for errno
  22. ferror#12,9    =int fileref           : a0<=$1 d0=>$0;            //return TRUE if an error has occurred on the given file
  23. feof#12,10     =int fileref           : a0<=$1 d0=>$0;            //return TRUE if an EOF has been reached on the given file
  24.  
  25. input$#12,11    =string BUFSIZ=(n) fileref: a0=>$0 d0<=$1 a0<=$2;  //read at most n characters from fileref and return as a string
  26. inputline$#12,12=string fileref        : a0<=$1 a0=>$0;            //return the remainder of the current line as a string
  27.  
  28. checkfile#12,13 =int filename filecheckmode : d0=>$0 a0<=$1 d0<=$2 ; //return TRUE if the specified file satisfies the given filecheckmode
  29.  
  30. command
  31. FailOnIOError#12,14 boolean : d0<=$1 ;
  32.  
  33.  
  34. // Standard primitives
  35. intrange
  36.  
  37. animstyle 0 0;
  38. clearspeed 0 1280;
  39. rgbvalue 0 255;
  40. pagenumber 0 255;
  41. groupnumber 0 31;
  42.  
  43. iconbank 0 31;
  44.  
  45. hour 0 23;
  46. minute 0 59;
  47. second 0 59;
  48. centisecond 0 99;
  49.  
  50. enumrange
  51.  
  52. //ensure clearmode matches the clearscreen primitive
  53. clearmode 0 23 fan fade fadeout=1 fadein=1
  54.     wipeleft wiperight wipeup wipedown
  55.     explode implode sparkle standard blind vblind=10 mosaic
  56.     pushleft pushright pushup pushdown
  57.  
  58.     revealleft revealright revealup revealdown
  59.     truepushleft truepushright truepushup truepushdown;
  60.  
  61. clearto 0 1 ClearToPencolour ClearToVisual;
  62.  
  63. linestyletype 0 65535 solid=%xffff smalldots=%xaaaa dots=%xcccc
  64.                       bigdots=%x7e7e dashed=%x3c3c none=%x0000;
  65.  
  66. fillmasktype 0 3 none colour icon file;
  67.  
  68. month 1 12 January February March April May June
  69.            July August September October November December;
  70.  
  71. objectstate 0 1 disabled enabled;
  72.  
  73. LabelOptions 0 63 centre=1 center=1 left=2 right=4 tabs=8 wrap=16 singleline=32 ;
  74.  
  75. PrintOptions  0 31 centred=1 centered=1 Scaled=2 preview=4 setup=8 UserScale=18;
  76. PrintOptions2 0  3 header=1 footer=2;
  77.  
  78. enum
  79. animformat=(,"Format of animation file") FLI FLC;
  80. audioformat=(,"Format of audio file") WAV RMI MID;
  81. imageformat=(,"Format of image file") BMP PCX JPG GIF;
  82. rasterop raster_none raster_and raster_or raster_xor;
  83. buttonspecial NONE DEFAULT CANCEL;
  84. //objectstate disabled enabled;
  85. videotype=(,"Format of video data") AVI MOV MPEG1 MPEG2;
  86. animationtype oneshot pingpong looped;
  87.  
  88. TextJustify left centre right ;
  89.  
  90. command
  91.  
  92. activepage#16,1 pagenumber : d0<=$1;
  93.  
  94. animation#16,2 TLPOINT SIZE_T POSINT=(startframe) POSINT=(endframe)
  95.     boolean=(memoryload) INT=(repeatcount) animformat FILENAME
  96.         : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2
  97.           d4<=$3 d5<=$4 d6<=$5 d7<=$6 d8<=$7 a0<=$8;
  98.  
  99. arc#16,3 TLPOINT SIZE_T POINT POINT  : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 d4<=$3.1 d5<=$3.2 d6<=$4.1 d7<=$4.2 ;
  100. audio#16,7 audioformat FILENAME      : d0<=$1 a0<=$2;
  101.  
  102. bezier#16,4 POINT>=4                         : a0<=$1;
  103. button#16,5#pushbutton TLPOINT SIZE_T STRING=(Caption) objectstate buttonspecial SCRIPTREF
  104.     : d0<=-1 d1<=$1.1 d2<=$1.2 d3<=$2.1 d4<=$2.2
  105.       a0<=$3 d5<=$4 d6<=$5 a1<=$6 ;
  106.  
  107. buttonid#16,5#pushbutton posint TLPOINT SIZE_T STRING=(Caption) objectstate buttonspecial SCRIPTREF
  108.     : d0<!>$1 d1<=$2.1 d2<=$2.2 d3<=$3.1 d4<=$3.2
  109.       a0<=$4 d5<=$5 d6<=$6 a1<=$7 ;
  110.  
  111. buttonlink POSINT*5 : d0<=$1 d1<=$2 d2<=$3 d3<=$4 d4<=$5;
  112.  
  113. circle#16,6 POINT POSINT : d0<=$1.1 d1<=$1.2 d2<=$2;
  114. clearscreen#16,8 TLPOINT SIZE_T clearmode clearto clearspeed
  115.     : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 
  116.       d4<=$3 d5<=$4 d6<=$5;
  117.  
  118. combobox#16,9 TLPOINT SIZE_T STRING>=1 objectstate STRING=(Value) int=(index) SCRIPTREF=(AcceptAction)
  119.             : d1<=$1.1 d2<=$1.2 d3<=$2.1 d4<=$2.2
  120.               d5<=$4 d0!>$6 a1<=$3 a0<!>$5 a2<=$7;
  121.  
  122.  
  123. // defsprite passes first param last
  124. defsprite#16,10 POSINT TLPOINT SIZE_T
  125.     : d0<=$2.1 d1<=$2.2 d2<=$3.1 d3<=$3.2 d4<=$1;
  126.  
  127. definesprite#16,10 POSINT TLPOINT SIZE_T
  128.     : d0<=$2.1 d1<=$2.2 d2<=$3.1 d3<=$3.2 d4<=$1;
  129.  
  130.  
  131. editbox#16,11 TLPOINT SIZE_T objectstate STRING=(Value) SCRIPTREF=(AcceptAction)
  132.             : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2
  133.               d4<=$3 a0<!>$4 a1<=$5;
  134.  
  135.  
  136. ellipse#16,12 TLPOINT SIZE_T            : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2;
  137.  
  138. fillmask0#16,13                       : d0<=0;
  139. fillmask1#16,14 rgbvalue*3            : d0<=1 d1<=$1 d2<=$2 d3<=$3;
  140. fillmask2#16,15 POSINT=(IconNumber)   : d0<=2 d1<=$1 d2<=0;
  141. fillmask2b#16,15 POSINT=(IconNumber) iconbank : d0<=2 d1<=$1 d2<=$2;
  142. fillmask3#16,16 imageformat FILENAME  : d0<=3 d1<=$1 a0<=$2;
  143.  
  144. SetNoFill#16,13                                : d0<=0;
  145. SetColorFill#16,14 rgbvalue*3                  : d0<=1 d1<=$1 d2<=$2 d3<=$3;
  146. SetColourFill#16,14 rgbvalue*3                 : d0<=1 d1<=$1 d2<=$2 d3<=$3;
  147. SetIconFill#16,15 POSINT=(IconNumber) iconbank : d0<=2 d1<=$1 d2<=$2;
  148. SetFillTexture#16,16 imageformat FILENAME      : d0<=3 d1<=$1 a0<=$2;
  149.  
  150. floodfill#16,17 POINT               : d0<=$1.1 d1<=$1.2;
  151. font#16,18 STRING=(FontName) SIZE_T : a0<=$1 d0<=$2.1 d1<=$2.2;
  152.  
  153. getactivepage#16,93 pagenumber : d0=>$1 d7<=0;
  154. getdate #9,1 POSINT=(year) month POSINT=(day)
  155.             : d0=>$1 d1=>$2 d2=>$3;
  156.  
  157. getfillmask#16,93 fillmasktype rgbvalue*3 POSINT=(IconNumber) imageformat FILENAME=(ImageFile)
  158.             : d0=>$1 d1=>$2 d2=>$3 d3=>$4 d4=>$5 d5=>$6 a0=>$7 d7<=1;
  159. getfont#16,93 STRING=(FontName) SIZE_T
  160.             : a0=>$1 d0=>$2.1 d1=>$2.2 d7<=2;
  161.  
  162. gethilight#16,93 posint : d0=>$1 d7<=5;
  163.  
  164. gethilightcolour#16,93 posint rgbvalue*3
  165.         : d0=>$2 d1=>$3 d2=>$4 d3=>$1 d7<=3;
  166.  
  167. GetHilightColor#16,93 rgbvalue*3
  168.         : d0=>$1 d1=>$2 d2=>$3 d7<=3;
  169.  
  170. getlinestyle#16,93 linestyletype : d0=>$1 d7<=4;
  171.  
  172. getpencolour#16,93 posint rgbvalue*3
  173.         : d0=>$2 d1=>$3 d2=>$4 d4=>$1 d7<=6;
  174.  
  175. GetPenColor#16,93 rgbvalue*3
  176.         : d0=>$1 d1=>$2 d2=>$3 d7<=6;
  177.  
  178. getpenwidth#16,93 POSINT=(PenWidth) : d0=>$1 d7<=7;
  179.  
  180. gettime #9,2 hour minute second centisecond
  181.         : d0=>$1 d1=>$2 d2=>$3 d3=>$4;
  182.  
  183. gettransparentcolour#16,93 posint rgbvalue*3
  184.         : d0=>$2 d1=>$3 d2=>$4 d3=>$1 d7<=8;
  185.  
  186. GetTransparentColor#16,93 rgbvalue*3
  187.         : d0=>$1 d1=>$2 d2=>$3 d7<=8;
  188.  
  189. getvisualpage#16,93 pagenumber : d0=>$1 d7<=9;
  190.  
  191. hilight#16,112 boolean : d0<=$1;
  192.  
  193. hilightcolour#16,19 POSINT rgbvalue*3 : d0<=$1 d1<=$2 d2<=$3 d3<=$4;
  194.  
  195. HiLightColor#16,19 rgbvalue*3 : d2<=$1 d3<=$2 d4<=$3 ;
  196.  
  197. hotspot#16,20 TLPOINT SIZE_T objectstate SCRIPTREF=(AcceptAction)
  198.     : d0<=-1 d1<=$1.1 d2<=$1.2 d3<=$2.1 d4<=$2.2 d5<=$3 a0<=$4;  // code shared with HOTSPOTID
  199.  
  200. hotspotid#16,20#hotspot posint TLPOINT SIZE_T objectstate SCRIPTREF=(AcceptAction)
  201.     : d0<!>$1 d1<=$2.1 d2<=$2.2 d3<=$3.1 d4<=$3.2 d5<=$4 a0<=$5 ;
  202.  
  203. HotBox#16,20#hotspot posint TLPOINT SIZE_T objectstate SCRIPTREF=(AcceptAction)
  204.     : d0<!>$1 d1<=$2.1 d2<=$2.2 d3<=$3.1 d4<=$3.2 d5<=$4 a0<=$5 ;
  205.  
  206. hotregion#16,21 posint boolean=(clickable) POINT>=3 boolean=(over) SCRIPTREF=(OverAction) SCRIPTREF=(ClickAction)
  207.     : d0<!>$1 d2<=$2 d1!>$4 a0<=$3 a1<=$5 a2<=$6 ;
  208.  
  209. icon#16,22 TLPOINT SIZE_T iconbank POSINT=(IconNumber) rasterop
  210.     : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 d4<=$3 d5<=$4 d6<=$5;
  211.  
  212. iconbutton#16,23 TLPOINT SIZE_T objectstate buttonspecial iconbank
  213.     POSINT=(EnableIcon) POSINT=(DisableIcon) POSINT=(ClickIcon)
  214.     SCRIPTREF=(AcceptAction)
  215.     : d0<=-1 d1<=$1.1 d2<=$1.2 d3<=$2.1 d4<=$2.2
  216.       d5<=$3 d6<=$4 d7<=$5 d8<=$6 d9<=$7 d10<=$8 a0<=$9 ;
  217.  
  218. iconbuttonid#16,23#iconbutton posint TLPOINT SIZE_T objectstate buttonspecial iconbank
  219.     POSINT=(EnableIcon) POSINT=(DisableIcon) POSINT=(ClickIcon)
  220.     SCRIPTREF=(AcceptAction)
  221.     : d0<!>$1 d1<=$2.1 d2<=$2.2 d3<=$3.1 d4<=$3.2
  222.       d5<=$4 d6<=$5 d7<=$6 d8<=$7 d9<=$8 d10<=$9 a0<=$10 ;
  223.  
  224. AnimatedButton#16,23#iconbutton posint TLPOINT SIZE_T objectstate buttonspecial iconbank
  225.     POSINT=(EnableIcon) POSINT=(DisableIcon) POSINT=(ClickIcon)
  226.     SCRIPTREF=(AcceptAction)
  227.     : d0<!>$1 d1<=$2.1 d2<=$2.2 d3<=$3.1 d4<=$3.2
  228.       d5<=$4 d6<=$5 d7<=$6 d8<=$7 d9<=$8 d10<=$9 a0<=$10 ;
  229.  
  230. line#16,24 POINT>=2                                   : a0<=$1;
  231. linestyle#16,25 linestyletype                 : d0<=$1;
  232.  
  233. listbox#16,26 TLPOINT SIZE_T STRING>=1 objectstate STRING=(Value) int=(index) SCRIPTREF=(AcceptAction)
  234.             : d1<=$1.1 d2<=$1.2 d3<=$2.1 d4<=$2.2
  235.               d5<=$4 a1<=$3 a0!>$5 a2<=$7 d0!>$6;
  236.  
  237. loadicon#16,27 FILENAME : a0<=$1;
  238. loadimage#16,28#image TLPOINT BRPOINT imageformat FILENAME
  239.     : d1<=$1.1 d2<=$1.2 d3<=$2.1 d4<=$2.2 d5<=$3 a0<=$4 a1<=0 a2<=0 d6<=0 d7<=0  d8<=0  d9<=0 ;
  240.  
  241. loadtransimage#16,28#image TLPOINT BRPOINT imageformat FILENAME rgbvalue*3
  242.     : d1<=$1.1 d2<=$1.2 d3<=$2.1 d4<=$2.2 d5<=$3 a0<=$4 a1<=0 a2<=0 d6<=1 d7<=$5 d8<=$6 d9<=$7 ;
  243.  
  244.  
  245. menu#16,29 TLPOINT SIZE_T MENULIST
  246.     : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 a0<=$3;
  247.  
  248. origin#16,30 POINT                                    : d0<=$1.1 d1<=$1.2;
  249. setscale#16,31  FLOAT*2                                  : d0<=$1   d1<=$2;
  250.  
  251. function
  252. gsave#16,76=int    : d0=>$0 ;
  253. grestore#16,77=int : d0=>$0 ;
  254.  
  255. command
  256. pencolour#16,32 POSINT rgbvalue*3 : d0<=$1 d1<=$2 d2<=$3 d3<=$4;
  257. pencolor#16,32 rgbvalue*3         : d1<=$1 d2<=$2 d3<=$3 ;
  258.  
  259. penwidth#16,33 POSINT                                 : d0<=$1;
  260. point#16,34 POINT                                     : d0<=$1.1 d1<=$1.2;
  261. polygon#16,35 POINT>=2                                : a0<=$1;
  262.  
  263. rectangle#16,36 TLPOINT SIZE_T                  : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2;
  264.  
  265. saveimage#16,37#image TLPOINT BRPOINT imageformat FILENAME FILENAME int=(LoadStatus) SCRIPTREF=(LoadedAction)
  266.     : d1<=$1.1 d2<=$1.2 d3<=$2.1 d4<=$2.2 d5<=$3 d6<=0 a0<=$4 a1<=$5 d0!>$6 a2<=$7;
  267.  
  268. savetransimage#16,37#image TLPOINT BRPOINT imageformat FILENAME rgbvalue*3 FILENAME int=(LoadStatus) SCRIPTREF=(LoadedAction)
  269.     : d1<=$1.1 d2<=$1.2 d3<=$2.1 d4<=$2.2 d5<=$3 d6<=1 a0<=$4 a1<=$8 d0!>$9 a2<=$10 d7<=$5 d8<=$6 d9<=$7 ;
  270.  
  271. //scrollkeys POSINT*5
  272. //    : d0<=$1 d1<=$2 d2<=$3 d3<=$4 d4<=$5;
  273.  
  274. spritebank#16,38 iconbank                             : d0<=$1;
  275. spritefile#16,39 imageformat FILENAME : d0<=$1 a0<=$2;
  276.  
  277. StaticBox#16,40 posint=(id) TLPOINT SIZE_T TextJustify STRING=(Value)
  278.             : d0<=$1 d1<=$2.1 d2<=$2.2 d3<=$3.1 d4<=$3.2 d5<=$4 a0<=$5 ;
  279.  
  280. label#16,41#text posint=(id) TLPOINT SIZE_T LabelOptions STRING=(Value)
  281.             : d0<=$2.1 d1<=$2.2 d2<=$3.1 d3<=$3.2 d4<=$1 d5<=$4 a0<=$5 ;
  282.  
  283. SetText#16,42 posint=(id) string=(value) : d0<=$1 a0<=$2 ;
  284.  
  285. SetLabelText#16,42 posint=(id) string=(value) : d0<=$1 a0<=$2 ;
  286.  
  287. text#16,43 POINT STRING                               : d0<=$1.1 d1<=$1.2 a0<=$2;
  288.  
  289. textwindow#16,44#htmlbox TLPOINT SIZE_T filename
  290.     : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 a0<=$3;
  291.  
  292. customtextwindow#16,44#htmlbox TLPOINT SIZE_T filename posint=(upid) posint=(downid)
  293.     : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 a0<=$3 d4<=$4 d5<=$5 ;
  294.  
  295. tile#16,45 TLPOINT SIZE_T imageformat FILENAME
  296.     : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 d4<=$3 a0<=$4;
  297.  
  298. transparentcolour#16,46 POSINT rgbvalue*3 : d0<=$1 d1<=$2 d2<=$3 d3<=$4;
  299. transparentcolor#16,46 rgbvalue*3         : d1<=$1 d2<=$2 d3<=$3 d0<=-1;
  300.  
  301. //unloadspritefile /*no params */  :  ;
  302.  
  303. video#16,47 TLPOINT SIZE_T videotype FILENAME : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 d4<=$3 a0<=$4;
  304. visualpage#16,48 pagenumber                   : d0<=$1;
  305.  
  306. // waitlastdone is an example of a command with no parameters or associations
  307. // The colon is required otherwise no primitive will be called.
  308. waitlastdone#16,49 /* no params*/ : ;
  309. waitsample#16,50 boolean : d0<=$1 ;
  310.  
  311. transparency#16,51 posint: d0<=$1;
  312.  
  313.  
  314. // !!!! DEBUG Frazz - 15/08/95
  315. sound#16,52 filename : a0<=$1;
  316.  
  317. enumrange
  318. snd_flags 0 3 looped=1 override=2;
  319.  
  320. command
  321. PlaySound#16,113 filename snd_flags : a0<=$1 d0<=$2;
  322. StopSound#16,114 : ;
  323.  
  324. function
  325. MCI#16,53    =int filename filename=(result): d0=>$0 a1<=$1 a0=>$2 ;
  326.  
  327.  
  328. enumrange
  329. SpriteMotionControl 0 15 unbound=0 bound_x=1 wrapped_x=2 fixed_x=3 bound_y=4 wrapped_y=8 fixed_y=12 bound=5 wrapped=10;
  330.  
  331. //enumrange
  332. //SpriteMotionControl 0 2 unbound bound wrapped;
  333.  
  334. enumrange
  335. UserSpriteType 0 30 ;
  336.  
  337. enumrange
  338. SpriteType 0 31 ;
  339.  
  340. enumrange
  341. SpriteFlagBits 0 31 enabled=1 visible=2 dragable=4 popup=8 clickable=16 ;
  342.  
  343. command
  344. // Sprite ID,X,Y,AnimationType,StartFrame,FrameRate,[SpriteFrameList]
  345. sprite#16,54 posint=(id) tlpoint animationtype posint=(startframe) posint=(framerate,"Frames per ms") posint>=1 
  346.                                 : d0<=$1 d1<=$2.1 d2<=$2.2 d3<=$3 d4<=$4 d5<=$5 d6<=0 a0<=$6;
  347.  
  348. CreateSprite#16,54#sprite posint=(id) tlpoint animationtype posint=(startframe) posint=(framerate,"Frames per ms") iconbank posint>=1 
  349.                                 : d0<=$1 d1<=$2.1 d2<=$2.2 d3<=$3 d4<=$4 d5<=$5 d6<=$6 a0<=$7;
  350. spriteb#16,54#sprite posint=(id) tlpoint animationtype posint=(startframe) posint=(framerate,"Frames per ms") iconbank posint>=1 
  351.                                 : d0<=$1 d1<=$2.1 d2<=$2.2 d3<=$3 d4<=$4 d5<=$5 d6<=$6 a0<=$7;
  352.  
  353. delsprite#16,55 posint=(id) : d0<=$1;
  354.  
  355. DeleteSprite#16,55 posint=(id) : d0<=$1;
  356.  
  357. MoveSprite#16,56   posint tlpoint : d0<=$1 d1<=$2.1 d2<=$2.2;
  358. MoveSpriteTo#16,57 posint tlpoint : d0<=$1 d1<=$2.1 d2<=$2.2;
  359. SpriteMechanics#16,58 posint=(id) float=(vx) float=(vy) float=(ax) float=(ay) float=(E) : d0<=$1 d1<=$2 d2<=$3 d3<=$4 d4<=$5 d5<=$6 ;
  360.  
  361. SpriteBBox#16,59   posint=(id) tlpoint size_t : d0<=$1 d1<=$2.1 d2<=$2.2 d3<=$3.1 d4<=$3.2;
  362. SpriteFlags#16,60  posint=(id) boolean=(enabled) boolean=(visible) boolean=(dragable) boolean=(popup) SpriteMotionControl : d0<=$1 d1<=$2 d2<=$3 d3<=$4 d4<=$5 d5<=$6 ;
  363. SpritePopup#16,61  posint=(id) posint=(delay) boolean=(shownow) : d0<=$1 d1<=$2 d2<=$3 ;
  364.  
  365. SpriteFlags2#16,62  posint=(id) SpriteFlagBits SpriteMotionControl : d0<=$1 d1<=$2 d2<=$3 ;
  366.  
  367. SetSpriteFlags#16,62  posint=(id) SpriteFlagBits SpriteMotionControl : d0<=$1 d1<=$2 d2<=$3 ;
  368.  
  369. // on_sprite_* and off_sprite_* use d4 as internal event number
  370. on_sprite_collision#16,63 posint=(id1) posint=(id2) scriptref : d0!>$1 d1!>$2 a0<=$3 d4<=0;
  371. on_sprite_move#16,63      posint=(id) point=(where) scriptref : d0!>$1 d1!>$2.1 d2!>$2.2 a0<=$3 d4<=1;
  372. on_sprite_drop#16,63      posint=(id) point=(where) scriptref : d0!>$1 d1!>$2.1 d2!>$2.2 a0<=$3 d4<=2;
  373. on_sprite_popup#16,63        posint=(id) boolean=(visible) scriptref : d0!>$1 d1!>$2 a0<=$3 d4<=3;
  374. on_sprite_animstop#16,63    posint=(id) scriptref : d0!>$1 a0<=$2 d4<=4;
  375.  
  376. off_sprite_collision#16,63 : a0<=0 d4<=0;
  377. off_sprite_move#16,63      : a0<=0 d4<=1;
  378. off_sprite_drop#16,63      : a0<=0 d4<=2;
  379. off_sprite_popup#16,63     : a0<=0 d4<=3;
  380. off_sprite_animstop#16,63  : a0<=0 d4<=4;
  381.  
  382. function
  383. SpriteGetData#16,67=int       posint=(id) tlpoint=(where) float=(vx) float=(vy) float=(ax) float=(ay)
  384.     : d0=>$0 d0<=$1 d1=>$2.1 d2=>$2.2 d3=>$3 d4=>$4 d5=>$5 d6=>$6 ;
  385.  
  386. SpriteGetData2#16,67=int       posint=(id) tlpoint=(where) float=(vx) float=(vy) float=(ax) float=(ay) int=(frame)
  387.     : d0=>$0 d0<=$1 d1=>$2.1 d2=>$2.2 d3=>$3 d4=>$4 d5=>$5 d6=>$6 d7=>$7 ;
  388.  
  389. GetSpriteData#16,67=int       posint=(id) tlpoint=(where) float=(vx) float=(vy) float=(ax) float=(ay) int=(frame)
  390.     : d0=>$0 d0<=$1 d1=>$2.1 d2=>$2.2 d3=>$3 d4=>$4 d5=>$5 d6=>$6 d7=>$7 ;
  391.  
  392. command
  393. SpriteCollision#16,68     posint=(id) UserSpriteType int=(CollisionOffset) SpriteType>=0 SpriteType>=0 : d0<=$1 d1<=$2 d2<=$3 a0<=$4 a1<=$5 ;
  394.  
  395. animstop#16,69    posint=(id) : d0<=$1;
  396. animstart#16,70   posint=(id) : d0<=$1;
  397. animrestart#16,71 posint=(id) : d0<=$1;
  398.  
  399. togglebutton#16,72 tlpoint size_t string : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 a0<=$3;
  400.  
  401. //all html commands use the same code
  402. htmltextbox#16,73#htmlbox tlpoint size_t filename : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 a0<=$3 d4<=-1 d5<=-1 d6<=0;
  403. htmltextboxb#16,73#htmlbox tlpoint size_t filename iconbank : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 a0<=$3 d4<=-1 d5<=-1 d6<=$4;
  404.  
  405. customhtmltextbox#16,73#htmlbox tlpoint size_t filename posint=(upid) posint=(downid)
  406.     : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 a0<=$3 d4<=$4 d5<=$5 d6<=0;
  407.  
  408. customhtmltextboxb#16,73#htmlbox tlpoint size_t filename posint=(upid) posint=(downid) iconbank
  409.     : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 a0<=$3 d4<=$4 d5<=$5 d6<=$6;
  410.  
  411. LoadWMF#16,74#wmfimage tlpoint size_t filename :  d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 a0<=$3;
  412.  
  413. Browser#16,110#browser         tlpoint size_t filename :  d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 a0<=$3;
  414.  
  415. printscreen#16,75 TLPOINT SIZE_T PrintOptions float : d0<=$1.1 d1<=$1.2 d2<=$2.1 d3<=$2.2 d4<=$3 d5<=$4;
  416. printsetup#16,98  PrintOptions2 string*7 : d0<=$1 a0<=$2 a1<=$3 a2<=$4 a3<=$5 a4<=$6 a5<=$7 a6<=$8 ;
  417.  
  418.  
  419. //Simple "dirty" object manipulation functions
  420.  
  421. command
  422. //Get/SetXXXProperty calls use d1 internally for the property number
  423. SetIntProperty#16,78         posint=(id) string=(property) int=(value)        : d0<=$1 a0<=$2 d2<=$3 ;
  424. SetFloatProperty#16,79         posint=(id) string=(property) float=(value)    : d0<=$1 a0<=$2 d2<=$3 ;
  425. SetBoolProperty#16,80         posint=(id) string=(property) boolean=(value)    : d0<=$1 a0<=$2 d2<=$3 ;
  426. SetStringProperty#16,81         posint=(id) string=(property) string=(value)    : d0<=$1 a0<=$2 a1<=$3 ;
  427. SetFilenameProperty#16,81     posint=(id) string=(property) filename=(value) : d0<=$1 a0<=$2 a1<=$3 ;
  428. SetRGBProperty#16,82         posint=(id) string=(property) rgbvalue*3        : d0<=$1 a0<=$2 d2<=$3   d3<=$4 d4<=$5 ;
  429. SetPointProperty#16,83         posint=(id) string=(property) POINT=(value)    : d0<=$1 a0<=$2 d2<=$3.1 d3<=$3.2 ;
  430. SetFloatPointProperty#16,84  posint=(id) string=(property) float*2            : d0<=$1 a0<=$2 d2<=$3   d3<=$4 ;
  431.  
  432. SetScriptProperty#16,85         posint=(id) string=(property) scriptref=(value): d0<=$1 a0<=$2 a1<=$3 ;
  433. SetIntArrayProperty#16,86     posint=(id) string=(property) int>=1            : d0<=$1 a0<=$2 a1<=$3 ;
  434. SetFloatArrayProperty#16,87     posint=(id) string=(property) float>=1            : d0<=$1 a0<=$2 a1<=$3 ;
  435. SetStringArrayProperty#16,88 posint=(id) string=(property) string>=1        : d0<=$1 a0<=$2 a1<=$3 ;
  436. SetPointArrayProperty#16,89     posint=(id) string=(property) point>=1            : d0<=$1 a0<=$2 a1<=$3 ;
  437. SetProperty#16,90             posint=(id) string=(property)                    : d0<=$1 a0<=$2 ;
  438.  
  439. DeleteObject#16,91             posint=(id) : d0<=$1 ;
  440.  
  441. SetDelayedUpdate#16,92         boolean : d0<=$1 ;
  442.  
  443. GetIntProperty#16,103         posint=(id) string=(property) int=(value)        : d0<=$1 a0<=$2 d2=>$3 ;
  444. GetFloatProperty#16,104         posint=(id) string=(property) float=(value)    : d0<=$1 a0<=$2 d2=>$3 ;
  445. GetBoolProperty#16,105         posint=(id) string=(property) boolean=(value)    : d0<=$1 a0<=$2 d2=>$3 ;
  446. GetStringProperty#16,106     posint=(id) string=(property) string=(value)    : d0<=$1 a0<=$2 a1=>$3 ;
  447. GetFilenameProperty#16,106     posint=(id) string=(property) string=(value)    : d0<=$1 a0<=$2 a1=>$3 ;
  448. GetRGBProperty#16,107         posint=(id) string=(property) rgbvalue*3        : d0<=$1 a0<=$2 d2=>$3   d3=>$4 d4=>$5 ;
  449. GetPointProperty#16,108         posint=(id) string=(property) point=(value)    : d0<=$1 a0<=$2 d2=>$3.1 d3=>$3.2 ;
  450. GetFloatPointProperty#16,109 posint=(id) string=(property) float*2            : d0<=$1 a0<=$2 d2=>$3   d3=>$4 ;
  451.  
  452. function
  453. FGetIntProperty#16,103        =int        posint=(id) string=(property) : d0<=$1 a0<=$2 d2=>$0 ;
  454. FGetFloatProperty#16,104    =float        posint=(id) string=(property) : d0<=$1 a0<=$2 d2=>$0 ;
  455. FGetBoolProperty#16,105        =boolean    posint=(id) string=(property) : d0<=$1 a0<=$2 d2=>$0 ;
  456. FGetStringProperty#16,106    =string        posint=(id) string=(property) : d0<=$1 a0<=$2 a1=>$0 ;
  457. FGetFilenameProperty#16,106    =filename    posint=(id) string=(property) : d0<=$1 a0<=$2 a1=>$0 ;
  458.  
  459.  
  460. function
  461. GetNextObjectID#16,94         =int              : d0=>$0 ;
  462. CreateObject#16,102             =anyobject string : d0=>$0 a0<=$1 ;        //d1 used internally for object number
  463.  
  464. command
  465. DestroyAllObjects#13,21 : d0<=1 ;
  466. DestroyAllGlobalObjects#13,21 : d0<=2 ;
  467.  
  468. command
  469. InitClick#16,95 filename : a0<=$1;
  470. Click#16,96     : ;
  471.  
  472. on_video_finished#16,97        posint=(id) scriptref : d0!>$1 a0<=$2 d4<=0 ;
  473. off_video_finished#16,97    : a0<=0 d4<=0 ;
  474.  
  475. BorderColour#16,99 rgbvalue*3 : d0<=$1 d1<=$2 d2<=$3;
  476.  
  477. SetActiveGroups#16,100    groupnumber>=0 groupnumber>=0 : a0<=$1 a1<=$2;
  478. SetDefaultGroup#16,101  groupnumber    : d0<=$1;
  479.  
  480. function
  481. // These are the built-in maths functions
  482. sin   #6,1  =float float : d0<=$1 d0=>$0;
  483. cos   #6,2  =float float : d0<=$1 d0=>$0;
  484. tan   #6,3  =float float : d0<=$1 d0=>$0;
  485. asin  #6,4  =float float : d0<=$1 d0=>$0;
  486. acos  #6,5  =float float : d0<=$1 d0=>$0;
  487. atan  #6,6  =float float : d0<=$1 d0=>$0;
  488. log   #6,7  =float float : d0<=$1 d0=>$0;              //log base e
  489. log10 #6,8  =float float : d0<=$1 d0=>$0;              //log base 10
  490. exp   #6,9  =float float : d0<=$1 d0=>$0;              //e to the power x
  491. sqrt  #6,10 =float float : d0<=$1 d0=>$0;
  492. pow   #6,11 =float float=(x) float=(y) : d0<=$1 d1<=$2 d0=>$0;         //x to the power y
  493. float #6,12 =float int   : d0<=$1 d0=>$0;              //float the integer parameter
  494. int   #6,13 =int   float : d0<=$1 d0=>$0;              //convert the float parameter to the nearest integer
  495.  
  496. random#6,14 =float       : d0=>$0;                     //return a pseudo-random number 0.0<=N<=1.0
  497.  
  498. command
  499. // The built-in maths command for setting the random number seed. 1=>reset seed to default
  500. randomise#6,15 int       : d0<=$1;
  501.  
  502. function
  503. max   #6,16 =int     int>=2   : d0=>$0 a0<=$1;        //return the maximum value in the list
  504. min   #6,17 =int     int>=2   : d0=>$0 a0<=$1;        //return the minimum value in the list
  505. fmax  #6,18 =float float>=2   : d0=>$0 a0<=$1;        //return the maximum value in the list
  506. fmin  #6,19 =float float>=2   : d0=>$0 a0<=$1;        //return the minimum value in the list
  507.  
  508. abs   #6,20 =int     int      : d0=>$0 d0<=$1;        //return the absolute value
  509. fabs  #6,21 =float float      : d0=>$0 d0<=$1;        //return the absolute value
  510.  
  511.  
  512. enum sortorder ascending descending;
  513.  
  514. command
  515. sortint     #6,22 int[]      sortorder : a0<=>$1 d0<=$2;
  516. sortfloat   #6,23 float[]    sortorder : a0<=>$1 d0<=$2;
  517. sortstring  #6,24 string[]   sortorder : a0<=>$1 d0<=$2;
  518. sortfilename#6,24 filename[] sortorder : a0<=>$1 d0<=$2;
  519. sortuser    #6,25 void[]     void void int=(cbfunc) : a0<=>$1 a1!>$2 a2!>$3 a4<!$4;
  520. sortintuser #6,26 int[]      int int int=(cbfunc)   : a0<=>$1 d0!>$2 d1!>$3 a4<!$4;
  521.  
  522. enumrange
  523. // Type for TIDY$ string function
  524. //lower    => convert to lowercase
  525. //upper    => convert to uppercase. If neither or both lower and upper are specified neither is performed
  526. //ltrim    => remove leading whitespace
  527. //rtrim    => remove trailing whitespace
  528. //compress => compress all sequences of whitespace to a single space
  529. //whitespace is taken to be characters with ASCII codes 0-32 and 127
  530.  
  531.  
  532. tidymode 0 31 lower=1 upper=2 ltrim=4 rtrim=8 compress=16;
  533.  
  534.  
  535.  
  536. function
  537. // These are the built-in string functions - all pretty BASIC-like.
  538. // Index 0 is the first character in a string.
  539.  
  540. LEFT$    #7,1 =STRING STRING BUFSIZ=(n)             : a0<=$1 d0<=$2 a0=>$0;        //return the leftmost n chars
  541. MID$     #7,2 =STRING STRING INT=(first) BUFSIZ=(n) : a0<=$1 d0<=$2 d1<=$3 a0=>$0; //return the n chars beginning with first
  542. RIGHT$   #7,3 =STRING STRING BUFSIZ=(n)             : a0<=$1 d0<=$2 a0=>$0;        //return the rightmost n chars
  543. len      #7,4 =int    string                        : a0<=$1 d0=>$0;               //return the length of the string
  544. string$  #7,5 =string BUFSIZ=(n) string=(str)       : d0<=$1 a0<=$2 a0=>$0;        //return a string consisting of n copies of the first char of str
  545. substr$  #7,6 =string string=(start) string=(source): a0<=$1 a1<=$2 a0=>$0;        //return the sub-string in source beginning with start
  546. substring$#7,6=string string=(source) string=(start): a1<=$1 a0<=$2 a0=>$0;        //return the sub-string in source beginning with start
  547.  
  548. tidy$    #7,7 =string string tidymode               : a0<=$1 d0<=$2 a0=>$0;        //return a tidied version of the input string 
  549. instr    #7,8 =int    string=(source) string=(start) int=(startat) : a0<=$1 a1<=$2 d0<=$3 d0=>$0;
  550.  
  551. insert$  #7,9 =string string=(source) string=(target) BUFSIZ=(pos) : a0<=$1 a1<=$2 d0<=$3 a0=>$0;    //return target with source inserted at pos
  552.  
  553. replace$ #7,10=string string=(source) string=(target) BUFSIZ=(pos) : a0<=$1 a1<=$2 d0<=$3 a0=>$0;    //return target with source replaced at pos
  554.  
  555. snipleft$ #7,11=string string POSINT=(n)            : a0<=$1 d0<=$2 a0=>$0;            //return target with n chars removed from start
  556. snipmid$  #7,12=string string BUFSIZ=(first) INT=(n): a0<=$1 d0<=$2 d1<=$3 a0=>$0;    //return target with n chars removed from first
  557. snipright$#7,13=string string POSINT=(n)            : a0<=$1 d0<=$2 a0=>$0;            //return target with n chars removed from end
  558.  
  559. command
  560. replacein$#7,14 string=(source) string=(target) BUFSIZ=(pos) : a0<=$1 a1<=>$2 d0<=$3;    //modify target with source replaced at pos
  561.  
  562. function
  563. // These are the built-in type conversion functions
  564.  
  565. STRING   #8,1 =STRING FILENAME                   : a0<=$1 a0=>$0;                    //convert FILENAME to STRING
  566. FILENAME #8,2 =FILENAME STRING                   : a0<=$1 a0=>$0;                    //convert STRING to FILENAME
  567.  
  568. ftostr   #8,3  =string float string : d0<=$1 a0<=$2 a0=>$0;   //convert float to string using C format string
  569. itostr   #8,4  =string int        : d0<=$1 a0=>$0;            //convert integer to string
  570. strtof   #8,5  =float  string     : a0<=$1 d0=>$0;            //convert string to float
  571. strtoi   #8,6  =int    string     : a0<=$1 d0=>$0;            //convert string to integer
  572. chr$     #8,7  =string int        : d0<=$1 a0=>$0;            //convert char code to single char string
  573. asc      #8,8  =int    string     : a0<=$1 d0=>$0;            //convert first char of string to char code
  574. hex$     #8,9  =string int        : d0<=$1 a0=>$0;            //convert integer to hex string
  575. oct$     #8,10 =string int        : d0<=$1 a0=>$0;            //convert integer to octal string
  576. bstrtoi  #8,11 =int    string int : a0<=$1 d0=>$0 d0<=$2;     //convert base 2 or 16 string to integer
  577.  
  578. date$    #9,3  =string            :        a0=>$0;            //return the date as a string "Wed Jan 02 1995"
  579. time$    #9,4  =string            :        a0=>$0;            //return the time as a string "15:30:22"
  580.  
  581.  
  582.  
  583.  
  584. //TIMER and EVENT functions
  585. /*    
  586. enum event_type timer;          // MAX_EVENT in timer.c must match the range here
  587.  
  588. enum timer_type one_shot periodic;
  589.  
  590. command
  591.     on_event  #11,1 event_type scriptref : d0<=$1 a0<=$2;
  592.     off_event #11,3 event_type           : d0<=$1 ;
  593.     timer     #11,2 posint=(period, "Interval in 1/10s") timer_type : d0<=$1 d1<=$2;
  594. */
  595.  
  596.  
  597.  
  598. //NOTE : printfinished is a special case!!!!!!!!!
  599.  
  600. enum event_type keydown keyup timer mouseclick rmouseclick printfinished mousedown mousemove;    //NPET in primitiv.h related to the range here
  601. enum timer_type timer_off one_shot periodic;        //TimerState in primitiv.h must match the definition here
  602. enumrange timer_id 0 1 timer0 timer1;
  603. enumrange priority 0 4 lowest lower normal higher highest;
  604.  
  605. command
  606.     on_event#13,8    event_type posint posint scriptref : d2<=$1 d0!>$2 d1!>$3 a0<=$4;
  607.     timer#13,9        timer_id posint=(period, "Interval in 1/1000s") timer_type : d0<=$1 d1<=$2 d2<=$3;
  608.     off_event#13,10    event_type : d0<=$1;
  609.  
  610. on_print_finished#13,8 string scriptref : d2<=5 a1!>$1 a0<=$2 ;
  611. off_print_finished#13,10 : d0<=5 ;
  612.  
  613. function
  614. BrowserSetPriority#13,11 =int priority : d0<=$1 d0=>$0;
  615.  
  616. command
  617. BrowserSetImageCache#13,12 objectstate posint=(NImages) posint=(NKBytes) : d0<=$1 d1<=$2 d2<=$3 ;
  618. SetReadOnlyCache#13,15 objectstate filename filename : d0<=$1 a0<=$2 a1<=$3 ;
  619.  
  620. BrowserSetCursorBusy#13,16 boolean : d0<=$1 ;
  621. BrowserShowCursor#13,17 boolean : d0<=$1 ;
  622. BrowserSetHelpCursor#13,19 boolean : d0<=$1 ;
  623.  
  624. BrowserSetStatus#13,22 string : a0<=$1 ;
  625.  
  626. function
  627. BrowserSetDisplayMode#13,18 =int posint filename : d0=>$0 d0<=$1 a0<=$2;
  628.  
  629. //END
  630.  
  631.  
  632.  
  633. // RenderWare(TM) Graphics Library 
  634. // TVML(TM) Script Interface definitions
  635.  
  636. private
  637.     RwCamera RwClump RwLight RwMaterial RwMatrix4d RwPolygon3d
  638.     RwRaster RwScene RwSpline RwStream RwTexture RwUserDraw RwPalette;
  639.  
  640. enum
  641. RwAxisAlignment     rwNAAXISALIGNMENT rwNOAXISALIGNMENT rwALIGNAXISZORIENTX rwALIGNAXISZORIENTY rwALIGNAXISXYZ ;
  642. RwCameraProjection    rwNACAMERAPROJECTION rwPERSPECTIVE rwPARALLEL ;
  643. RwCombineOperation    rwNACOMBINEOPERATION rwREPLACE rwPRECONCAT rwPOSTCONCAT ;
  644. RwDebugSeverity        rwNADEBUGMESSAGESEVERITY rwINFORM rwWARNING rwERROR ;
  645. RwGeometrySampling    rwNAGEOMETRYSAMPLING rwPOINTCLOUD rwWIREFRAME rwPOLYLINE rwSOLID ;
  646. RwLightType            rwNALIGHTTYPE rwDIRECTIONAL rwPOINT rwCONICAL ;
  647. RwLightSampling        rwNALIGHTSAMPLING rwFACET rwVERTEX ;
  648. RwPickObject        rwNAPICKOBJECT rwPICKCLUMP rwPICKVERTEX ;
  649. RwSearchMode        rwNASEARCHMODE rwLOCAL rwGLOBAL ;
  650. RwSplineType         rwNASPLINETYPE rwOPENLOOP rwCLOSEDLOOP ;
  651. RwSplinePath        rwNASPLINEPATH rwSMOOTH rwNICEENDS ;
  652. RwState                rwNASTATE rwOFF rwON ;
  653.  
  654. RwStreamType        rwNASTREAM rwSTREAMFILE rwSTREAMFILENAME rwSTREAMMEMORY ;
  655. RwStreamAccess        rwNASTREAMACCESS rwSTREAMREAD rwSTREAMWRITE rwSTREAMAPPEND ;
  656.  
  657. RwTextureDitherMode    rwNATEXTUREDITHER rwDITHERON rwDITHEROFF rwAUTODITHER ;
  658. RwUserDrawType        rwNAUSERDRAWTYPE rwCLUMPALIGN rwVERTEXALIGN rwBBOXALIGN rwVPALIGN ;
  659.  
  660. /*        
  661. RwSystemInfo
  662.     rwNASYSTEMINFO
  663.     rwVERSIONSTRING
  664.     rwVERSIONMAJOR
  665.     rwVERSIONMINOR
  666.     rwVERSIONRELEASE
  667.     rwFIXEDPOINTLIB
  668.     rwDEBUGGINGLIB ;
  669. */
  670.  
  671. enumrange
  672. RwClumpHints     0 32767 rwCONTAINER=1 rwHS=2 rwEDITABLE=4 ;
  673. RwTextureModes   0 32767 rwLIT=1 rwFORESHORTEN=2 rwFILTER=4 ;
  674. RwRasterOptions  0 32767 rwAUTODITHERRASTER=%x0001 rwDITHERRASTER=%x0002 rwFITRASTER=%x0004
  675.                          rwINDEXRASTER=%x0008 rwGAMMARASTER=%x0010 rwOFFSETRASTER=%x0020 ;
  676.  
  677. RwPaletteOptions 0 32767 rwGAMMAPALETTE=%x0001 ;
  678. RwUserDrawAlignmentTypes 0 32767
  679.     rwALIGNTOP=%x0001 rwALIGNBOTTOM=%x0002
  680.     rwALIGNLEFT=%x0004 rwALIGNRIGHT=%x0008
  681.     rwALIGNTOPLEFT=%x0005 rwALIGNBOTTOMRIGHT=%x000a ;
  682.  
  683. RwMaterialModes  0 32767 rwDOUBLE=8 ;
  684.  
  685. RwDeviceInfo 0 32767 
  686.     rwNADEVICEINFO=0
  687.     rwRENDERDEPTH=1 
  688.     rwINDEXEDREBDERING=2
  689.     rwPALETTEBASED=3
  690.     rwPALETTE=4
  691.     rwPALETTESIZE=5
  692.     rwFIRSTPALETTEENTRY=6
  693.     rwLASTPALETTEENTRY=7
  694.     rwDEVICESPECIFICINFO=1000 ;
  695.  
  696. RwDeviceAction 0 32767
  697.     rwNADEVICEACTION=0
  698.     rwDEVICESPECIFICACTION=1000 rwWINSETOUTPUTSIZE=1000 ;
  699. /*
  700. RwOpenOption 0 32767
  701.     rwNAOPENACTION=0
  702.     rwNOOPENOPTION=1
  703.     rwGAMMACORECT=2
  704.     rwDEVICESPECIFICOPEN=1000 ;
  705. */
  706.  
  707. enum RwErrorCode
  708.  E_RW_NOERROR
  709.  E_RW_NULLP
  710.  E_RW_INVCOP
  711.  E_RW_NOMEM
  712.  E_RW_RSPARSE
  713.  E_RW_RSREAD
  714.  E_RW_WSWRITE
  715.  E_RW_DEGEN
  716.  E_RW_INVLIGHT
  717.  E_RW_SHPPATH
  718.  E_RW_READ
  719.  E_RW_RANGE
  720.  E_RW_WRITE
  721.  E_RW_NOFILE
  722.  E_RW_BADOPEN
  723.  E_RW_NOTROOT
  724.  E_RW_INVSPP
  725.  E_RW_INVSPT
  726.  E_RW_INVDEVICE
  727.  E_RW_INVMATERIAL
  728.  E_RW_INVFRAME
  729.  E_RW_INVFRAMESTEP
  730.  E_RW_INVTEXTUREWIDTH
  731.  E_RW_INVTEXTUREHEIGHT
  732.  E_RW_INVTEXTUREDEPTH
  733.  E_RW_INVVERTEXINDEX
  734.  E_RW_DEFSCENE
  735.  E_RW_INVGEOMETRYSAMPLING
  736.  E_RW_RSINVGEOMETRYSAMPLING
  737.  E_RW_INVLIGHTSAMPLING
  738.  E_RW_RSINVLIGHTSAMPLING
  739.  E_RW_NOPROTOTYPEFOUND
  740.  E_RW_ZEROVEC
  741.  E_RW_NESTEDMODEL
  742.  E_RW_NOMATCHBEGIN
  743.  E_RW_NOMATCHEND
  744.  E_RW_NESTEDPROTOTYPE
  745.  E_RW_NOMODELBEGIN
  746.  E_RW_INVPROTOTYPE
  747.  E_RW_NOCLUMP
  748.  E_RW_NOCLUMPBUILT
  749.  E_RW_DEGENPOLYGON
  750.  E_RW_COMPLEXPOLYGON
  751.  E_RW_TEXTURENOTFOUND
  752.  E_RW_INVTEXTURENAME
  753.  E_RW_INVCAMERAPROJECTION
  754.  E_RW_INVSTATE
  755.  E_RW_INVSEARCHMODE
  756.  E_RW_INVHINT
  757.  E_RW_USER
  758.  E_RW_INVAXISALIGNMENT
  759.  E_RW_INVUSERDRAWTYPE
  760.  E_RW_INVUSERDRAWALIGN
  761.  E_RW_RSINVTRACESTATE
  762.  E_RW_RSINVHINT
  763.  E_RW_RSINVAXISALIGNMENT
  764.  E_RW_INVSYSTEMINFO
  765.  E_RW_INVTEXTUREMODE
  766.  E_RW_RSINVTEXTUREMODE
  767.  E_RW_RSNOHINTS
  768.  E_RW_RSNOTEXTUREMODES
  769.  E_RW_INVRASTEROPTIONS
  770.  E_RW_INVTEXTUREDITHERMODE
  771.  E_RW_INVRASTERSIZE
  772.  E_RW_INVDEVICEINFO
  773.  E_RW_INVDEVICEACTION
  774.  E_RW_INVOPENOPTION
  775.  E_RW_RASTERINUSE
  776.  E_RW_RSINVDITHERMODE
  777.  E_RW_RSINVGAMMAMODE
  778.  E_RW_INVIMAGEFILE
  779.  E_RW_INVBUFFERSIZE
  780.  E_RW_INVMATERIALMODE
  781.  E_RW_RSINVMATERIALMODE
  782.  E_RW_RSNOMATERIALMODES
  783.  E_RW_INVPOLYGONINDEX
  784.  E_RW_CLUMPHASCOMPLEXPOLYGONS
  785.  E_RW_DEVICENOTFOUND
  786.  E_RW_DEVICEALREADYSTARTED
  787.  E_RW_UNABLETOSTARTDEVICE
  788.  E_RW_DEVICEINCORRECTVERSION
  789.  E_RW_DEVICENOTSTARTED
  790.  E_RW_NODEVICESPECIFIED
  791.  E_RW_NOSUITABLEDEVICE
  792.  E_RW_NODEVICESAVAILABLE
  793.  E_RW_LIBRARYNOTINITIALIZED
  794.  E_RW_INVSTREAMACCESSTYPE
  795.  E_RW_INVSTREAMTYPE
  796.  E_RW_ENDOFSTREAM
  797.  E_RW_INVALIDCHUNKTYPE
  798.  E_RW_INVALIDCHUNKSTRUCTURE
  799.  E_RW_NOTAUSERCREATEDRASTER
  800.  E_RW_ENVMAPOUTSIDECAMERAUPDATE
  801.  
  802.  E_RW_TEXTUREHASNONAME
  803.  E_RW_TEXTURENOTINDICTIONARY
  804.  
  805.  E_RW_INTERNAL
  806.  E_RW_MAXERROR ;
  807.  
  808.  
  809. function
  810.  
  811. RwAddChildToClump#4,1     = RwClump RwClump =(clump) RwClump =(child) : a0=>$0 a0<=$1 a1<=$2 ;
  812. RwAddClumpToScene#2,6     = RwScene RwScene =(scene) RwClump =(clump) : a0=>$0 a0<=$1 a1<=$2 ;
  813. RwAddHint#4,2             = BOOL RwClumpHints =(hint) : d0=>$0 d0<=$1 ;
  814. RwAddHintToClump#4,3     = RwClump RwClump =(clump) RwClumpHints =(hint) : a0=>$0 a0<=$1 d0<=$2 ;
  815. RwAddLightToScene#2,7     = RwScene RwScene =(scene) RwLight =(light) : a0=>$0 a0<=$1 a1<=$2 ;
  816. RwAddPolygonToClump#4,4 = RwPolygon3d RwClump =(clump) INT =(sides) INT>=3 : a0=>$0 a0<=$1 d0<=$2 a1<=$3 ;
  817. RwAddPolygonsToClump#4,5 = RwClump RwClump =(dst) RwClump =(src) : a0=>$0 a0<=$1 a1<=$2 ;
  818. RwAddTextureModeToMaterial#4,6 = RwMaterial RwMaterial =(m) RwTextureModes =(mode) : a0=>$0 a0<=$1 d0<=$2 ;
  819. RwAddTextureModeToPolygon#4,7  = RwPolygon3d RwPolygon3d =(pol) RwTextureModes =(mode) : a0=>$0 a0<=$1 d0<=$2 ;
  820. RwAddTextureModeToSurface#4,8  = BOOL RwTextureModes =(mode) : d0=>$0 d0<=$1;
  821. //RwAddUserDrawToClump  = RwClump RwClump =(clump) RwUserDraw =(userdraw) : a0=>$0 a0<=$1 a1<=$2 ;
  822. RwAddVector#4,10         = BOOL RwReal>=3 RwReal>=3 RwReal[3] : d0=>$0 a0<=$1 a1<=$2 a2<=>$3 ;
  823. RwAddVertexToClump#4,11 = INT RwClump =(clump) RwReal =(x) RwReal =(y) RwReal =(z) : d0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  824. RwBeginCameraUpdate#2,8 = RwCamera RwCamera =(cam) : a0=>$0 a0<=$1 ;
  825. //RwBitmapRaster         = RwRaster void =(bitmap) RwRasterOptions =(options) : a0=>$0 ;
  826. RwBlock#4,13             = BOOL RwReal =(width) RwReal =(height) RwReal =(depth) : d0=>$0 d0<=$1 d1<=$2 d2<=$3 ;
  827. RwCalculateClumpVertexNormal#4,14 = RwClump RwClump =(clump) INT =(vindex) : a0=>$0 a0<=$1 d0<=$2 ;
  828. RwClearCameraViewport#2,9 = RwCamera RwCamera =(cam) : a0=>$0 a0<=$1 ;
  829. RwClumpBegin#4,15         = BOOL : d0=>$0 ;
  830. RwClumpDistance#4,16     = RwReal RwClump =(clump) RwReal>=3 : d0=>$0 a0<=$1 a1<=$2 ;
  831. RwRootClumpEnd#4,17     = RwClump RwClump =(instance) : a0=>$0 a1=>$1 ;
  832. RwChildClumpEnd#4,419     = RwClump : a0=>$0 ;
  833. RwCone#4,18             = BOOL RwReal =(height) RwReal =(radius) INT =(sides) : d0=>$0 d0<=$1 d1<=$2 d2<=$3 ;
  834. RwCopyMaterial#4,19     = RwMaterial RwMaterial =(src) RwMaterial =(dst) : a0=>$0 a0<=$1 a1<=$2 ;
  835. RwCopyMatrix#4,20         = RwMatrix4d RwMatrix4d =(src) RwMatrix4d =(dst) : a0=>$0 a0<=$1 a1<=$2 ;
  836. RwCreateCamera#2,10     = RwCamera INT =(maxw) INT =(maxh) : a0=>$0 d0<=$1 d1<=$2 ;
  837. RwCreateClump#4,21         = RwClump INT =(vcount) INT =(pcount) : a0=>$0 d0<=$1 d1<=$2 ;
  838. RwCreateLight#2,11         = RwLight RwLightType =(kind) RwReal =(x) RwReal =(y) RwReal =(z) RwReal =(lum) : a0=>$0 d0<=$1 d1<=$2 d2<=$3 d3<=$4 d4<=$5 ;
  839. RwCreateMaterial#4,22     = RwMaterial : a0=>$0 ;
  840. RwCreateMatrix#2,12     = RwMatrix4d : a0=>$0 ;
  841. RwCreateRaster#4,23     = RwRaster INT =(w) INT =(h) : a0=>$0 d0<=$1 d1<=$2 ;
  842. RwCreateScene#2,13         = RwScene : a0=>$0 ;
  843. RwCreateSpline#4,24         = RwSpline INT =(npoints) RwSplineType =(type) RwReal[][3] : a0=>$0 d0<=$1 d1<=$2 a1<=>$3 ;
  844. RwCreateSprite#4,25         = RwClump RwTexture =(texture) : a0=>$0 a0<=$1 ;
  845. RwCreateTexture#4,26        = RwTexture RwRaster =(raster) : a0=>$0 a0<=$1 ;
  846. //RwCreateUserDraw            = RwUserDraw RwUserDrawType =(type) RwUserDrawAlignmentTypes =(align) INT =(x) INT =(y) INT =(width) INT =(height) RwUserDrawCallBack =(callback) : a0=>$0 ;
  847. RwCrossProduct#4,28         = BOOL RwReal>=3 RwReal>=3 RwReal[3] : d0=>$0 a0<=$1 a1<=$2 a2<=>$3 ;
  848. RwCubicTexturizeClump#4,29    = RwClump RwClump =(clump) : a0=>$0 a0<=$1 ;
  849. RwCurrentMaterial#4,30         = RwMaterial : a0=>$0 ;
  850. RwCylinder#4,31             = BOOL RwReal =(height) RwReal =(minrad) RwReal =(maxrad) INT =(sides) : d0=>$0 d0<=$1 d1<=$2 d2<=$3 d3<=$4 ;
  851. RwDamageCameraViewport#4,32 = RwCamera RwCamera =(cam) INT =(x) INT =(y) INT =(w) INT =(h) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 d3<=$5 ;
  852. RwDefaultScene#4,33         = RwScene : a0=>$0 ;
  853. RwDestroyCamera#2,14     = BOOL RwCamera =(cam)    : d0=>$0 a0<=$1 ;
  854. RwDestroyClump#4,34     = BOOL RwClump =(clump)   : d0=>$0 a0<=$1 ;
  855. RwDestroyLight#2,15        = BOOL RwLight =(light)   : d0=>$0 a0<=$1 ;
  856. RwDestroyMaterial#4,35     = BOOL RwMaterial =(m)    : d0=>$0 a0<=$1 ;
  857. RwDestroyMatrix#2,16     = BOOL RwMatrix4d =(mat)  : d0=>$0 a0<=$1 ;
  858. RwDestroyPolygon#4,36     = BOOL RwPolygon3d =(pol) : d0=>$0 a0<=$1 ;
  859. RwDestroyRaster#4,37     = BOOL RwRaster =(ras)    : d0=>$0 a0<=$1 ;
  860. RwDestroyScene#2,17     = BOOL RwScene =(scene)   : d0=>$0 a0<=$1 ;
  861. RwDestroySpline#4,38     = BOOL RwSpline =(spline) : d0=>$0 a0<=$1 ;
  862. RwDestroyTexture#4,39     = BOOL RwTexture =(t)     : d0=>$0 a0<=$1 ;
  863. RwDestroyUserDraw#4,40     = BOOL RwUserDraw =(userdraw)  : d0=>$0 a0<=$1;
  864. RwDeviceControl#2,18     = INT RwDeviceAction =(action) RwCamera INT =(param1) INT =(param2) : d0=>$0 d0<=$1 a0<=$2 d1<=$3 d2<=$4 ;
  865. RwDisc#4,41                = BOOL RwReal =(height) RwReal =(radius) INT =(sides) : d0=>$0 d0<=$1 d1<=$2 d2<=$3 ;
  866. RwDotProduct#4,42         = RwReal RwReal>=3 RwReal>=3   : d0=>$0 a0<=$1 a1<=$2 ;
  867. RwDuplicateCamera#4,43     = RwCamera RwCamera =(cam)     : a0=>$0 a0<=$1 ;
  868. RwDuplicateClump#2,19     = RwClump RwClump =(clump)     : a0=>$0 a0<=$1 ;
  869. RwDuplicateLight#2,20     = RwLight RwLight =(light)     : a0=>$0 a0<=$1 ;
  870. RwDuplicateMaterial#2,21= RwMaterial RwMaterial =(src) : a0=>$0 a0<=$1 ;
  871. RwDuplicateMatrix#2,22     = RwMatrix4d RwMatrix4d =(mat) : a0=>$0 a0<=$1 ;
  872. RwDuplicateRaster#2,23     = RwRaster RwRaster =(ras)     : a0=>$0 a0<=$1 ;
  873. RwDuplicateSpline#2,24     = RwSpline RwSpline =(spline)  : a0=>$0 a0<=$1 ;
  874. RwDuplicateUserDraw#4,44= RwUserDraw RwUserDraw =(userdraw) : a0=>$0 a0<=$1 ;
  875. RwEndCameraUpdate#2,25     = RwCamera RwCamera =(cam) : a0=>$0 a0<=$1 ;
  876. RwEnvMapClump#4,45         = RwClump RwClump =(clump) : a0=>$0 a0<=$1 ;
  877.  
  878. RwFindClump#4,46        = RwClump RwClump =(clump) BOOL=(predicatefunc) RwClump =(cbclump)        : a0=>$0 a0<=$1 a1<!$2 a2!>$3 ;
  879. RwFindClumpInt#4,47        = RwClump RwClump =(clump) BOOL=(predicatefunc) RwClump =(cbclump) INT    : a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  880. RwFindClumpLong#4,48    = RwClump RwClump =(clump) BOOL=(predicatefunc) RwClump =(cbclump) INT    : a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  881. RwFindClumpPointer#4,49    = RwClump RwClump =(clump) BOOL=(predicatefunc) RwClump =(cbclump) VOID   : a0=>$0 a0<=$1 a1<!$2 a2!>$3 a3<!>$4 ;
  882. RwFindClumpReal#4,50    = RwClump RwClump =(clump) BOOL=(predicatefunc) RwClump =(cbclump) RwReal : a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  883.  
  884. RwFindNamedTexture#4,51 = RwTexture STRING =(name) : a0=>$0 a0<=$1 ;
  885. RwFindTaggedClump#4,52     = RwClump RwClump =(clump) INT =(tag) : a0=>$0 a0<=$1 d0<=$2 ;
  886. RwFindTaggedPolygon#4,53= RwPolygon3d RwClump =(clump) INT =(tag) : a0=>$0 a0<=$1 d0<=$2 ;
  887.  
  888. RwForAllClumpsInHierarchy#4,54         = RwClump RwClump =(clump) RwClump =(func) RwClump=(cbclump)       : a0=>$0 a0<=$1 a1<!$2 a2!>$3 ;
  889. RwForAllClumpsInHierarchyInt#4,55      = RwClump RwClump =(clump) RwClump =(func) RwClump=(cbclump) INT   : a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  890. RwForAllClumpsInHierarchyLong#4,56     = RwClump RwClump =(clump) RwClump =(func) RwClump=(cbclump) INT   : a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  891. RwForAllClumpsInHierarchyPointer#4,57  = RwClump RwClump =(clump) RwClump =(func) RwClump=(cbclump) VOID  : a0=>$0 a0<=$1 a1<!$2 a2!>$3 a3<!>$4 ;
  892. RwForAllClumpsInHierarchyReal#4,58     = RwClump RwClump =(clump) RwClump =(func) RwClump=(cbclump) RwReal: a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  893.  
  894. RwForAllClumpsInScene#4,59         = RwScene RwScene =(scene) RwClump =(func) RwClump=(cbclump)       : a0=>$0 a0<=$1 a1<!$2 a2!>$3 ;
  895. RwForAllClumpsInSceneInt#4,60      = RwScene RwScene =(scene) RwClump =(func) RwClump=(cbclump) INT   : a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  896. RwForAllClumpsInSceneLong#4,61     = RwScene RwScene =(scene) RwClump =(func) RwClump=(cbclump) INT   : a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  897. RwForAllClumpsInScenePointer#4,62  = RwScene RwScene =(scene) RwClump =(func) RwClump=(cbclump) VOID  : a0=>$0 a0<=$1 a1<!$2 a2!>$3 a3<!>$4 ;
  898. RwForAllClumpsInSceneReal#4,63     = RwScene RwScene =(scene) RwClump =(func) RwClump=(cbclump) RwReal: a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  899.  
  900. RwForAllLightsInScene#4,64         = RwScene RwScene =(scene) RwLight =(func) RwLight=(cblight)       : a0=>$0 a0<=$1 a1<!$2 a2!>$3 ;
  901. RwForAllLightsInSceneInt#4,65      = RwScene RwScene =(scene) RwLight =(func) RwLight=(cblight) INT   : a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  902. RwForAllLightsInSceneLong#4,66     = RwScene RwScene =(scene) RwLight =(func) RwLight=(cblight) INT   : a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  903. RwForAllLightsInScenePointer#4,67  = RwScene RwScene =(scene) RwLight =(func) RwLight=(cblight) VOID  : a0=>$0 a0<=$1 a1<!$2 a2!>$3 a3<!>$4 ;
  904. RwForAllLightsInSceneReal#4,68     = RwScene RwScene =(scene) RwLight =(func) RwLight=(cblight) RwReal: a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  905.  
  906. RwForAllNamedTextures#4,69        = BOOL RwTexture =(func) RwTexture=(cbtexture)       : d0=>$0 a1<!$1 a2!>$2 ;
  907. RwForAllNamedTexturesInt#4,70     = BOOL RwTexture =(func) RwTexture=(cbtexture) INT   : d0=>$0 a1<!$1 a2!>$2 d1<!>$3;
  908. RwForAllNamedTexturesLong#4,71    = BOOL RwTexture =(func) RwTexture=(cbtexture) INT   : d0=>$0 a1<!$1 a2!>$2 d1<!>$3;
  909. RwForAllNamedTexturesPointer#4,72 = BOOL RwTexture =(func) RwTexture=(cbtexture) VOID  : d0=>$0 a1<!$1 a2!>$2 a3<!>$3;
  910. RwForAllNamedTexturesReal#4,73    = BOOL RwTexture =(func) RwTexture=(cbtexture) RwReal: d0=>$0 a1<!$1 a2!>$2 d1<!>$3;
  911.  
  912. RwForAllPolygonsInClump#4,74         = RwClump RwClump =(clump) RwPolygon3d =(func) RwPolygon3d=(cbpoly)        : a0=>$0 a0<=$1 a1<!$2 a2!>$3 ;
  913. RwForAllPolygonsInClumpInt#4,75      = RwClump RwClump =(clump) RwPolygon3d =(func) RwPolygon3d=(cbpoly) INT    : a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  914. RwForAllPolygonsInClumpLong#4,76     = RwClump RwClump =(clump) RwPolygon3d =(func) RwPolygon3d=(cbpoly) INT    : a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  915. RwForAllPolygonsInClumpPointer#4,77  = RwClump RwClump =(clump) RwPolygon3d =(func) RwPolygon3d=(cbpoly) VOID   : a0=>$0 a0<=$1 a1<!$2 a2!>$3 a3<!>$4 ;
  916. RwForAllPolygonsInClumpReal#4,78     = RwClump RwClump =(clump) RwPolygon3d =(func) RwPolygon3d=(cbpoly) RwReal : a0=>$0 a0<=$1 a1<!$2 a2!>$3 d1<!>$4 ;
  917.  
  918. RwGetCameraBackColor#4,79        = BOOL RwCamera =(cam) RwReal*3 : d0=>$0 a0<=$1 d1=>$2 d2=>$3 d3=>$4 ;
  919. RwGetCameraBackdrop#4,80        = RwRaster RwCamera =(cam) : a0=>$0 a0<=$1 ;
  920. RwGetCameraBackdropOffset#2,29    = RwCamera RwCamera =(cam) INT =(x) INT =(y) : a0=>$0 a0<=$1 d0=>$2 d1=>$3 ;
  921. RwGetCameraBackdropViewportRect#4,81 = RwCamera RwCamera =(cam) INT =(x) INT =(y) INT =(w) INT =(h) : a0=>$0 a0<=$1 d0=>$2 d1=>$3 d2=>$4 d3=>$5 ;
  922.  
  923. RwGetCameraLookAt#2,30        = BOOL RwCamera =(cam) RwReal[3] : d0=>$0 a0<=$1 a1<=>$2 ;
  924. RwGetCameraLookRight#4,82    = BOOL RwCamera =(cam) RwReal[3] : d0=>$0 a0<=$1 a1<=>$2 ;
  925. RwGetCameraLookUp#4,83        = BOOL RwCamera =(cam) RwReal[3] : d0=>$0 a0<=$1 a1<=>$2 ;
  926.  
  927. RwGetCameraNearClipping#4,84= RwReal RwCamera =(cam) : d0=>$0 a0<=$1 ;
  928. RwGetCameraFarClipping#4,85    = RwReal RwCamera =(cam) : d0=>$0 a0<=$1 ;
  929. RwGetCameraPosition#2,31    = BOOL RwCamera =(cam) RwReal[3] : d0=>$0 a0<=$1 a1<=>$2 ;
  930. RwGetCameraProjection#4,86    = RwCameraProjection RwCamera =(cam) : d0=>$0 a0<=$1 ;
  931. RwGetCameraViewOffset#4,87    = BOOL RwCamera =(cam) RwReal[3] : d0=>$0 a0<=$1 a1<=>$2 ;
  932. RwGetCameraViewport#2,32    = RwCamera RwCamera =(cam) INT =(x) INT =(y) INT =(w) INT =(h) : a0=>$0 a0<=$1 d0=>$2 d1=>$3 d2=>$4 d3=>$5 ;
  933. //RwGetCameraViewportRaster#4,88 = RwRaster RwCamera =(cam) RwRaster =(ras) : a0=>$0 a0<=$1 a1=>$2 ;
  934. RwGetCameraViewwindow#4,89    = RwCamera RwCamera =(cam) RwReal =(w) RwReal =(h) : a0=>$0 a0<=$1 d0=>$2 d1=>$3 ;
  935. RwGetClumpBBox#4,90            = RwClump RwClump =(clump) RwReal[3] RwReal[3] : a0=>$0 a0<=$1 a1<=>$2 a2<=>$3 ;
  936. RwGetClumpAxisAlignment#4,91= RwAxisAlignment RwClump =(clump) : d0=>$0 a0<=$1 ;
  937. RwGetClumpDataInt#2,33      = INT    RwClump=(clump) : d0=>$0 a0<=$1 ;
  938. RwGetClumpDataReal#4,92     = RwReal RwClump=(clump) : d0=>$0 a0<=$1 ;
  939. RwGetClumpHints#4,93        = RwClumpHints RwClump =(clump) : d0=>$0 a0<=$1 ;
  940. RwGetClumpJointMatrix#4,94     = RwMatrix4d RwClump =(clump) RwMatrix4d =(mat) : a0=>$0 a0<=$1 a1<=$2 ;
  941. RwGetClumpLocalBBox#4,95     = RwClump RwClump =(clump) RwReal[3] RwReal[3]  : a0=>$0 a0<=$1 a1<=>$2 a2<=>$3 ;
  942. RwGetClumpLTM#4,96             = RwMatrix4d RwClump =(clump) RwMatrix4d =(mat) : a0=>$0 a0<=$1 a1<=$2 ;
  943. RwGetClumpMatrix#4,97         = RwMatrix4d RwClump =(clump) RwMatrix4d =(mat) : a0=>$0 a0<=$1 a1<=$2 ;
  944. RwGetClumpNumChildren#4,98     = INT RwClump =(clump) : d0=>$0 a0<=$1 ;
  945. RwGetClumpNumPolygons#4,99     = INT RwClump =(clump) : d0=>$0 a0<=$1 ;
  946. RwGetClumpNumUserDraws#4,100= INT RwClump =(clump) : d0=>$0 a0<=$1 ;
  947. RwGetClumpNumVertices#4,101 = INT RwClump =(clump) : d0=>$0 a0<=$1 ;
  948. RwGetClumpOrigin#4,102         = BOOL  RwClump RwReal[3]  : d0=>$0 a0<=$1 a1<=>$2 ;
  949. RwGetClumpOwner#4,103         = RwScene RwClump =(clump) : a0=>$0 a0<=$1 ;
  950. RwGetClumpParent#4,104         = RwClump RwClump =(clump) : a0=>$0 a0<=$1 ;
  951. RwGetClumpRoot#4,105         = RwClump RwClump =(clump) : a0=>$0 a0<=$1 ;
  952.  
  953. RwGetClumpState#4,106         = RwState RwClump =(clump) : d0=>$0 a0<=$1 ;
  954. RwGetClumpTag#4,107         = INT     RwClump =(clump) : d0=>$0 a0<=$1 ;
  955. RwGetClumpVertex#4,108         = BOOL RwClump =(clump) INT =(index) RwReal[3] : d0=>$0 a0<=$1 d1<=$2 a1<=>$3 ;
  956. RwGetClumpVertexNormal#4,109= BOOL RwClump =(clump) INT =(index) RwReal[3] : d0=>$0 a0<=$1 d1<=$2 a1<=>$3 ;
  957.  
  958. RwGetClumpVertexUV#4,110         = BOOL RwClump =(clump) INT =(index) RwReal*2 : d0=>$0 a0<=$1 d0<=$2 d1=>$3 d2=>$4 ;
  959. RwGetClumpVertexViewportPosition#4,111 = BOOL RwClump =(clump) INT =(vindex) RwCamera =(camera) INT =(px) INT =(py) BOOL =(visible) : d0=>$0 a0<=$1 d0<=$2 a1<=$3 d1=>$4 d2=>$5 d3=>$6 ;
  960. RwGetClumpViewportRect#4,112     = RwClump RwClump =(clump) RwCamera =(cam) INT =(x) INT =(y) INT =(w) INT =(h) : a0=>$0 a0<=$1 a1<=$2 d0=>$3 d1=>$4 d2=>$5 d3=>$6;
  961.  
  962. RwGetDebugAssertionState#4,113     = RwState : d0=>$0 ;
  963. RwGetDebugMessageState#4,114     = RwState : d0=>$0 ;
  964. RwGetDebugScriptState#4,115         = RwState : d0=>$0 ;
  965. RwGetDebugSeverity#4,116         = RwDebugSeverity : d0=>$0 ;
  966. RwGetDebugTraceState#4,117         = RwState : d0=>$0 ;
  967. RwGetDeviceInfo#4,118              = BOOL RwDeviceInfo =(info) INT =(value) : d0=>$0 d0<=$1 d1=>$2 ;
  968.  
  969. RwGetError#2,68               = RwErrorCode : d0=>$0 ;
  970.  
  971. RwGetFirstChildClump#4,119      = RwClump RwClump =(clump) : a0=>$0 a0<=$1 ;
  972. RwGetLightBrightness#4,120      = RwReal RwLight =(light) : d0=>$0 a0<=$1 ;
  973. RwGetLightColor#4,121         = BOOL   RwLight =(light) RwReal*3 : d0=>$0 a0<=$1 d1=>$2 d2=>$3 d3=>$4 ;
  974. RwGetLightConeAngle#4,122      = RwReal RwLight =(light) : d0=>$0 a0<=$1 ;
  975. RwGetLightDataInt#4,123         = INT    RwLight =(light) : d0=>$0 a0<=$1 ;
  976. RwGetLightDataReal#4,124     = RwReal RwLight =(light) : d0=>$0 a0<=$1 ;
  977.  
  978. RwGetLightOwner#4,125          = RwScene RwLight =(light)           : a0=>$0 a0<=$1 ;
  979. RwGetLightPosition#4,126      = BOOL    RwLight =(light) RwReal[3] : d0=>$0 a0<=$1 a1<=>$2 ;
  980. RwGetLightState#4,127          = RwState RwLight =(light)           : d0=>$0 a0<=$1 ;
  981. RwGetLightType#4,349          = RwLightType RwLight =(light)       : d0=>$0 a0<=$1 ;
  982. RwGetLightVector#4,128          = BOOL    RwLight =(light) RwReal[3] : d0=>$0 a0<=$1 a1<=>$2 ;
  983.  
  984. RwGetMaterialAmbient#4,129      = RwReal          RwMaterial =(m) : d0=>$0 a0<=$1 ;
  985. RwGetMaterialColor#4,130      = BOOL            RwMaterial =(m) RwReal*3 : d0=>$0 a0<=$1 d1=>$2 d2=>$3 d3=>$4 ;
  986. RwGetMaterialDataInt#4,131     = INT             RwMaterial =(m) : d0=>$0 a0<=$1 ;
  987. RwGetMaterialDataReal#4,132     = RwReal          RwMaterial =(m) : d0=>$0 a0<=$1 ;
  988. RwGetMaterialDiffuse#4,133      = RwReal          RwMaterial =(m) : d0=>$0 a0<=$1 ;
  989. RwGetMaterialGeometrySampling#4,134 = RwGeometrySampling RwMaterial =(m) : d0=>$0 a0<=$1 ;
  990. RwGetMaterialLightSampling#4,135 = RwLightSampling RwMaterial =(m) : d0=>$0 a0<=$1 ;
  991. RwGetMaterialOpacity#4,136      = RwReal          RwMaterial =(m) : d0=>$0 a0<=$1 ;
  992. RwGetMaterialSpecular#4,137  = RwReal          RwMaterial =(m) : d0=>$0 a0<=$1 ;
  993. RwGetMaterialTexture#4,138      = RwTexture       RwMaterial =(m) : a0=>$0 a0<=$1;
  994. RwGetMaterialTextureModes#4,139  = RwTextureModes  RwMaterial =(m) : d0=>$0 a0<=$1;
  995.  
  996.  
  997. RwGetMatrixElement#4,140         = RwReal     RwMatrix4d =(mat) INT =(i) INT =(j) : d0=>$0 a0<=$1 d0<=$2 d1<=$3 ;
  998. RwGetMatrixElements#4,141         = BOOL RwMatrix4d =(mat) RwReal[][] : d0=>$0 a0<=$1 a1<=>$2;
  999. RwGetNamedTexture#4,142         = RwTexture STRING =(name) : a0=>$0 a0<=$1 ;
  1000. RwGetNextClump#4,143             = RwClump RwClump =(clump) : a0=>$0 a0<=$1 ;
  1001. RwGetNumNamedTextures#4,144     = INT : d0=>$0 ;
  1002. //RwGetPaletteEntries#4,145     = RwPaletteEntry INT =(n) INT =(length) RwPaletteEntry =(rgb) : a0=>$0 ;
  1003.  
  1004. RwGetPolygonAmbient#4,146     = RwReal     RwPolygon3d =(pol) : d0=>$0 a0<=$1 ;
  1005. RwGetPolygonCenter#4,147    = BOOL       RwPolygon3d =(pol) RwReal[3] : d0=>$0 a0<=$1 a1<=>$2 ;
  1006. RwGetPolygonColor#4,148     = BOOL       RwPolygon3d =(pol) RwReal[3] : d0=>$0 a0<=$1 a1<=>$2 ;
  1007. RwGetPolygonDataInt#4,149    = INT        RwPolygon3d =(pol) : d0=>$0 a0<=$1 ;
  1008. RwGetPolygonDataReal#4,150    = RwReal     RwPolygon3d =(pol) : d0=>$0 a0<=$1 ;
  1009. RwGetPolygonDiffuse#4,151     = RwReal     RwPolygon3d =(pol) : d0=>$0 a0<=$1 ;
  1010. RwGetPolygonGeometrySampling#4,152 = RwGeometrySampling RwPolygon3d =(pol) : d0=>$0 a0<=$1 ;
  1011. RwGetPolygonLightSampling#4,153    = RwLightSampling    RwPolygon3d =(pol) : d0=>$0 a0<=$1 ;
  1012. RwGetPolygonMaterial#4,154     = RwMaterial RwPolygon3d =(pol) : a0=>$0 a0<=$1 ;
  1013. RwGetPolygonNormal#4,155     = BOOL       RwPolygon3d =(pol) RwReal[3] : d0=>$0 a0<=$1 a1<=>$2 ;
  1014. RwGetPolygonNumSides#4,156     = INT        RwPolygon3d =(pol) : d0=>$0 a0<=$1 ;
  1015. RwGetPolygonOpacity#4,157     = RwReal     RwPolygon3d =(pol) : d0=>$0 a0<=$1 ;
  1016. RwGetPolygonOwner#4,158     = RwClump    RwPolygon3d =(pol) : a0=>$0 a0<=$1 ;
  1017. RwGetPolygonSpecular#4,159     = RwReal     RwPolygon3d =(pol) : d0=>$0 a0<=$1 ;
  1018. RwGetPolygonTag#4,160         = INT        RwPolygon3d =(pol) : d0=>$0 a0<=$1 ;
  1019. RwGetPolygonTexture#4,161     = RwTexture  RwPolygon3d =(pol) : a0=>$0 a0<=$1 ;
  1020. RwGetPolygonTextureModes#4,162 = RwTextureModes RwPolygon3d =(pol) : d0=>$0 a0<=$1 ;
  1021. RwGetPolygonUV#4,163         = BOOL       RwPolygon3d =(pol) RwReal*2 : d0=>$0 a0<=$1 d1=>$2 d2=>$3 ;
  1022. //RwGetPolygonVertices#4,164= INT        RwPolygon3d =(pol) INT =(varray) : d0=>$0 a0<=$1 ;
  1023.  
  1024. RwGetRasterDataInt#4,165     = INT    RwRaster =(ras) : d0=>$0 a0<=$1 ;
  1025. RwGetRasterDataReal#4,166     = RwReal RwRaster =(ras) : d0=>$0 a0<=$1 ;
  1026. RwGetRasterDepth#4,167         = INT    RwRaster =(ras) : d0=>$0 a0<=$1 ;
  1027. RwGetRasterHeight#4,168     = INT    RwRaster =(ras) : d0=>$0 a0<=$1 ;
  1028. //RwGetRasterPixels#4,169     = STRING RwRaster =(ras) : a0=>$0 a0<=$1 ;
  1029. RwGetRasterStride#4,170     = INT    RwRaster =(ras) : d0=>$0 a0<=$1 ;
  1030. RwGetRasterWidth#4,171         = INT    RwRaster =(ras) : d0=>$0 a0<=$1 ;
  1031.  
  1032. RwGetSceneDataInt#4,172     = INT    RwScene =(scene) : d0=>$0 a0<=$1 ;
  1033. RwGetSceneDataReal#4,173     = RwReal RwScene =(scene) : d0=>$0 a0<=$1 ;
  1034. RwGetSceneNumClumps#4,174     = INT    RwScene =(scene) : d0=>$0 a0<=$1 ;
  1035. RwGetSceneNumLights#4,175     = INT    RwScene =(scene) : d0=>$0 a0<=$1 ;
  1036.  
  1037. RwGetShapePath#4,176         = BOOL   FILENAME =(path) : d0=>$0 a0=>$1 ;
  1038.  
  1039. RwGetSplineDataInt#4,177     = INT    RwSpline =(spline) : d0=>$0 a0<=$1 ;
  1040. RwGetSplineDataReal#4,178     = RwReal RwSpline =(spline) : d0=>$0 a0<=$1 ;
  1041. RwGetSplineNumPoints#4,179     = INT    RwSpline =(spline) : d0=>$0 a0<=$1 ;
  1042. RwGetSplinePoint#4,180         = BOOL   RwSpline =(spline) INT =(index) RwReal[3] : d0=>$0 a0<=$1 d0<=$2 a1<=>$3 ;
  1043.  
  1044. RwGetSystemInfo#4,181         = BOOL   STRING =(verstring) INT=(major) INT=(minor) STRING=(rel) INT=(fixed) INT=(debug) : d0=>$0 a0=>$1 d1=>$2 d2=>$3 a1=>$4 d3=>$5 d4=>$6 ;
  1045.  
  1046. RwGetTextureDataInt#4,182     = INT      RwTexture =(t) : d0=>$0 a0<=$1 ;
  1047. RwGetTextureDataReal#4,183     = RwReal   RwTexture =(t) : d0=>$0 a0<=$1 ;
  1048. RwGetTextureDictSearchMode#4,184 = RwSearchMode : d0=>$0 ;
  1049. RwGetTextureDithering#4,185 = RwTextureDitherMode : d0=>$0 ;
  1050. RwGetTextureFrame#4,186     = INT      RwTexture =(t) : d0=>$0 a0<=$1 ;
  1051. RwGetTextureFrameStep#4,187 = INT      RwTexture =(t) : d0=>$0 a0<=$1 ;
  1052. RwGetTextureGammaCorrection#4,350 = RwState : d0=>$0 ;
  1053. RwGetTextureName#4,188         = BOOL     RwTexture =(t) STRING =(name) : d0=>$0 a0<=$1 a1=>$2 ;
  1054. RwGetTextureNumFrames#4,189 = INT      RwTexture =(t) : d0=>$0 a0<=$1 ;
  1055. RwGetTextureRaster#4,190     = RwRaster RwTexture =(t) : a0=>$0 a0<=$1 ;
  1056.  
  1057. //RwGetUserDrawAlignment     = RwUserDrawAlignmentTypes RwUserDraw =(userdraw) : d0=>$0 ;
  1058. ////RwGetUserDrawCallback     = RwUserDrawCallBack RwUserDraw =(userdraw) : a0=>$0 ;
  1059. //RwGetUserDrawOffset         = RwUserDraw RwUserDraw =(userdraw) INT =(x) INT =(y) : a0=>$0 ;
  1060. //RwGetUserDrawOwner         = RwClump RwUserDraw =(userdraw) : a0=>$0 ;
  1061. //RwGetUserDrawParentAlignment = RwUserDrawAlignmentTypes RwUserDraw =(userdraw) : d0=>$0 ;
  1062. //RwGetUserDrawSize         = RwUserDraw RwUserDraw =(userdraw) INT =(width) INT =(height) : a0=>$0 ;
  1063. //RwGetUserDrawType         = RwUserDrawType RwUserDraw =(userdraw) : d0=>$0 ;
  1064. //RwGetUserDrawVertexIndex  = INT RwUserDraw=(userdraw) : d0=>$0 ;
  1065.  
  1066. RwHemisphere#4,191             = BOOL RwReal =(radius) INT =(sides) : d0=>$0 d0<=$1 d1<=$2 ;
  1067. RwIdentityCTM#4,192         = BOOL : d0=>$0 ;
  1068. RwIdentityJointTM#4,193     = BOOL : d0=>$0 ;
  1069. RwIdentityMatrix#4,194         = RwMatrix4d RwMatrix4d =(mat) : a0=>$0 a0<=$1 ;
  1070. RwInclude#4,195             = BOOL RwClump =(clump) : d0=>$0 a0<=$1 ;
  1071. RwIncludeGeometry#4,196     = BOOL RwClump =(clump) : d0=>$0 a0<=$1 ;
  1072. RwInvalidateCameraViewport#2,35 = RwCamera RwCamera =(cam) : a0=>$0 a0<=$1 ;
  1073. RwInvertMatrix#4,197        = RwMatrix4d RwMatrix4d =(src) RwMatrix4d =(dst) : a0=>$0 a0<=$1 a1<=$2 ;
  1074. RwJointTransformBegin#4,198 = BOOL : d0=>$0 ;
  1075. RwJointTransformEnd#4,199     = BOOL : d0=>$0 ;
  1076. RwMaskTexture#4,200         = RwTexture RwTexture =(texture) RwRaster =(mask) : a0=>$0 a0<=$1 a1<=$2 ;
  1077. RwMaterialBegin#4,201         = BOOL : d0=>$0 ;
  1078. RwMaterialEnd#4,202         = BOOL : d0=>$0 ;
  1079. RwModelBegin#4,203             = BOOL : d0=>$0 ;
  1080. RwModelEnd#4,204             = BOOL : d0=>$0 ;
  1081.  
  1082. RwMultiplyMatrix#4,205         = RwMatrix4d RwMatrix4d =(a) RwMatrix4d =(b) RwMatrix4d =(c) : a0=>$0 a0<=$1 a1<=$2 a2<=$3 ;
  1083. RwNormalize#4,206             = BOOL RwReal[3] : d0=>$0 a1<=>$1 ;
  1084. RwNormalizeClump#4,207         = RwClump RwClump =(clump) : a0=>$0 a0<=$1 ;
  1085.  
  1086. //RwOpen                     = BOOL FILENAME =(devname) /*void =(param)*/ : d0=>$0 ;
  1087. RwOpenDebugStream#4,208     = BOOL FILENAME =(filename) : d0=>$0 a0<=$1 ;
  1088. //RwOpenExt                 = BOOL FILENAME =(devname) /*void =(param) INT =(numargs) RwOpenArgument =(args)*/ : d0=>$0 ;
  1089.  
  1090. RwOrthoNormalizeMatrix#2,36 = RwMatrix4d RwMatrix4d =(src) RwMatrix4d =(dst) : a0=>$0 a0<=$1 a1<=$2 ;
  1091.  
  1092. RwPanCamera#4,209             = RwCamera RwCamera =(cam) RwReal =(theta) : a0=>$0 a0<=$1 d0<=$2 ;
  1093. RwPickClump#4,210             = RwClump RwClump =(clump) INT =(x) INT =(y) RwCamera =(cam) RwPickObject RwClump =(clump) RwPolygon3d INT=(vindex) INT=(d2) RwReal*3 :
  1094.             a0=>$0 a0<=$1 d0<=$2 d1<=$3 a1<=$4 d2=>$5 a2=>$6 a3=>$7 d4=>$8 d5=>$9 d6=>$10 d7=>$11 d8=>$12 ;
  1095. RwPickScene#4,211             = RwScene RwScene =(scene) INT =(x) INT =(y) RwCamera =(cam) RwPickObject RwClump =(clump) RwPolygon3d INT=(vindex) INT=(d2) RwReal*3 : 
  1096.             a0=>$0 a0<=$1 d0<=$2 d1<=$3 a1<=$4 d2=>$5 a2=>$6 a3=>$7 d4=>$8 d5=>$9 d6=>$10 d7=>$11 d8=>$12 ;
  1097. RwPointCamera#4,212         = RwCamera RwCamera =(cam) RwReal =(x) RwReal =(y) RwReal =(z) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  1098. RwPolygon#4,213             = BOOL INT >=1 : d0=>$0 a0<=$1 ;
  1099. RwPolygonExt#4,214             = BOOL INT >=1 INT =(tag) : d0=>$0 a0<=$1 d1<=$2 ;
  1100. RwPopCurrentMaterial#4,215     = RwMaterial : a0=>$0 ;
  1101. RwPopScratchMatrix#2,37     = RwMatrix4d : a0=>$0 ;
  1102.  
  1103. RwProtoBegin#4,216               = BOOL STRING =(name) : d0=>$0 a0<=$1 ;
  1104. RwProtoEnd#4,217               = BOOL : d0=>$0 ;
  1105. RwProtoInstance#4,218           = BOOL STRING =(name) : d0=>$0 a0<=$1 ;
  1106. RwProtoInstanceGeometry#4,219 = BOOL STRING =(name) : d0=>$0 a0<=$1 ;
  1107.  
  1108. RwPushCurrentMaterial#4,220 = RwMaterial : a0=>$0 ;
  1109. RwPushScratchMatrix#2,38     = RwMatrix4d : a0=>$0 ;
  1110.  
  1111. RwQuad#4,221                 = BOOL INT =(v1) INT =(v2) INT =(v3) INT =(v4) : d0=>$0 d0<=$1 d1<=$2 d2<=$3 d3<=$4 ;
  1112. RwQuadExt#4,222             = BOOL INT =(v1) INT =(v2) INT =(v3) INT =(v4) INT =(tag) : d0=>$0 d0<=$1 d1<=$2 d2<=$3 d3<=$4 d4<=$5 ;
  1113. RwQueryRotateMatrix#4,223     = RwMatrix4d RwMatrix4d =(mat) RwReal[3] RwReal =(degrees) RwReal[3] : a0=>$0 a0<=$1 a1<=>$2 d1=>$3 a2<=>$4 ;
  1114.  
  1115. RwRandom#2,39                 = INT : d0=>$0 ;
  1116. RwReadMaskRaster#4,224         = RwRaster  FILENAME=(name) : a0=>$0 a0<=$1 ;
  1117. RwReadNamedTexture#4,225     = RwTexture FILENAME=(name) : a0=>$0 a0<=$1 ;
  1118. RwReadRaster#2,40             = RwRaster  FILENAME=(name) RwRasterOptions =(options) : a0=>$0 a0<=$1 d0<=$2 ;
  1119. RwReadShape#2,41             = RwClump   FILENAME=(name) : a0=>$0 a0<=$1 ;
  1120. RwReadTexture#4,226         = RwTexture STRING  =(name) : a0=>$0 a0<=$1 ;
  1121.  
  1122. //RwReleaseRasterPixels     = RwRaster RwRaster =(raster) INT=(pixels) : a0=>$0 ;
  1123.  
  1124. RwRemoveChildFromClump#4,227= RwClump RwClump =(clump) : a0=>$0 a0<=$1 ;
  1125. RwRemoveClumpFromScene#4,228= RwClump RwClump =(clump) : a0=>$0 a0<=$1 ;
  1126. RwRemoveHint#4,229             = BOOL    RwClumpHints =(hint) : d0=>$0 d0<=$1 ;
  1127. RwRemoveHintFromClump#4,230 = RwClump RwClump =(clump) RwClumpHints =(hint) : a0=>$0 a0<=$1 d0<=$2 ;
  1128. RwRemoveLightFromScene#4,231= RwLight RwLight =(light) : a0=>$0 a0<=$1 ;
  1129. RwRemoveTextureModeFromMaterial#4,232    = RwMaterial RwMaterial =(m) RwTextureModes =(mode) : a0=>$0 a0<=$1 d0<=$2 ;
  1130. RwRemoveTextureModeFromPolygon#4,233    = RwPolygon3d RwPolygon3d =(pol) RwTextureModes =(mode) : a0=>$0 a0<=$1 d0<=$2 ;
  1131. RwRemoveTextureModeFromSurface#4,234    = BOOL RwTextureModes =(mode) : d0=>$0 d0<=$1 ;
  1132. //RwRemoveUserDrawFromClump    = RwUserDraw RwUserDraw =(userdraw) : a0=>$0 a0<=$1 ;
  1133.  
  1134. RwRenderClump#2,42             = RwClump RwClump =(clump) : a0=>$0 a0<=$1 ;
  1135. RwRenderScene#2,67             = RwScene RwScene =(scene) : a0=>$0 a0<=$1 ;
  1136. RwResetCamera#4,235         = RwCamera RwCamera =(cam) : a0=>$0 a0<=$1 ;
  1137. RwReversePolygonFace#4,236     = RwPolygon3d RwPolygon3d =(pol) : a0=>$0 a0<=$1 ;
  1138.  
  1139. RwRevolveCamera#4,237         = RwCamera RwCamera =(cam) RwReal =(theta) : a0=>$0 a0<=$1 d0<=$2 ;
  1140. RwRotateCTM#4,238             = BOOL RwReal =(ax) RwReal =(ay) RwReal =(az) RwReal =(theta) : d0=>$0 d0<=$1 d1<=$2 d2<=$3 d3<=$4 ;
  1141. RwRotateJointTM#4,239         = BOOL RwReal =(ax) RwReal =(ay) RwReal =(az) RwReal =(theta) : d0=>$0 d0<=$1 d1<=$2 d2<=$3 d3<=$4 ;
  1142. RwRotateMatrix#2,43         = RwMatrix4d RwMatrix4d =(mat) RwReal =(vx) RwReal =(vy) RwReal =(vz) RwReal =(theta) RwCombineOperation =(op) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 d3<=$5 d4<=$6 ;
  1143. RwRotateMatrixCos#4,240     = RwMatrix4d RwMatrix4d =(mat) RwReal =(vx) RwReal =(vy) RwReal =(vz) RwReal =(ctheta) RwReal =(dir) RwCombineOperation =(op) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 d3<=$5 d4<=$6 d5<=$7 ;
  1144. RwScaleCTM#4,241             = BOOL RwReal =(sx) RwReal =(sy) RwReal =(sz) : d0=>$0 d0<=$1 d1<=$2 d2<=$3 ;
  1145. RwScaleMatrix#2,44             = RwMatrix4d RwMatrix4d =(mat) RwReal =(sx) RwReal =(sy) RwReal =(sz) RwCombineOperation =(op) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 d3<=$5 ;
  1146. RwScaleVector#4,242         = BOOL RwReal>=3 RwReal =(scale) RwReal[3] : d0=>$0 a0<=$1 d1<=$2 a1<=>$3 ;
  1147. RwScratchMatrix#2,45         = RwMatrix4d : a0=>$0 ;
  1148. RwSetCameraBackColor#2,46     = RwCamera RwCamera =(cam) RwReal =(r) RwReal =(g) RwReal =(b) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  1149. //RwSetCameraBackColorStruct= RwCamera RwCamera =(cam) RwRGBColor =(color) : a0=>$0 ;
  1150. RwSetCameraBackdrop#2,47     = RwCamera RwCamera =(cam) RwRaster =(ras) : a0=>$0 a0<=$1 a1<=$2 ;
  1151. RwSetCameraBackdropOffset#2,48          = RwCamera RwCamera =(cam) INT =(x) INT =(y) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 ;
  1152. RwSetCameraBackdropViewportRect#2,49 = RwCamera RwCamera =(cam) INT =(x) INT =(y) INT =(w) INT =(h) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 d3<=$5 ;
  1153. //
  1154. RwSetCameraDataInt#4,243     = RwCamera RwCamera =(cam) INT=(value) : a0=>$0 a0<=$1 d1<=$2 ;
  1155. RwSetCameraDataReal#4,244    = RwCamera RwCamera =(cam) RwReal=(value) : a0=>$0 a0<=$1 d1<=$2 ;
  1156. RwSetCameraLookAt#2,50         = RwCamera RwCamera =(cam) RwReal =(x) RwReal =(y) RwReal =(z) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  1157. RwSetCameraLookUp#2,51         = RwCamera RwCamera =(cam) RwReal =(x) RwReal =(y) RwReal =(z) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  1158. RwSetCameraNearClipping#4,245 = RwCamera RwCamera =(cam) RwReal =(neard) : a0=>$0 a0<=$1 d0<=$2 ;
  1159. RwSetCameraFarClipping#4,246= RwCamera RwCamera =(cam) RwReal =(fard)  : a0=>$0 a0<=$1 d0<=$2 ;
  1160. RwSetCameraPosition#2,52     = RwCamera RwCamera =(cam) RwReal =(x) RwReal =(y) RwReal =(z) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  1161. RwSetCameraProjection#4,247 = RwCamera RwCamera =(cam) RwCameraProjection =(kind) : a0=>$0 a0<=$1 d0<=$2 ;
  1162. RwSetCameraViewOffset#4,248 = RwCamera RwCamera =(cam) RwReal =(x) RwReal =(y) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 ;
  1163. RwSetCameraViewport#2,53     = RwCamera RwCamera =(cam) INT =(x) INT =(y) INT =(w) INT =(h) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 d3<=$5 ;
  1164. RwSetCameraViewwindow#2,54     = RwCamera RwCamera =(cam) RwReal =(w) RwReal =(h) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 ;
  1165.  
  1166. RwSetClumpDataInt#2,55        = RwClump RwClump =(clump) int    =(value)                : a0=>$0 a0<=$1 d0<=$2 ;
  1167. RwSetClumpDataReal#4,249    = RwClump RwClump =(clump) RwReal =(value)                : a0=>$0 a0<=$1 d0<=$2 ;
  1168. RwSetClumpAxisAlignment#4,250 = RwClump RwClump =(clump) RwAxisAlignment            : a0=>$0 a0<=$1 d0<=$2 ;
  1169. RwSetClumpHints#4,251         = RwClump RwClump =(clump) RwClumpHints =(hints)        : a0=>$0 a0<=$1 d0<=$2 ;
  1170. RwSetClumpState#4,252         = RwClump RwClump =(clump) RwState =(onoff)              : a0=>$0 a0<=$1 d0<=$2 ;
  1171. RwSetClumpTag#4,253         = RwClump RwClump =(clump) INT =(tag)                    : a0=>$0 a0<=$1 d0<=$2 ;
  1172. RwSetClumpVertex#4,254         = RwClump RwClump =(clump) INT =(index) RwReal>=3        : a0=>$0 a0<=$1 d0<=$2 a1<=$3 ;
  1173. RwSetClumpVertexNormal#4,255= RwClump RwClump =(clump) INT =(index) RwReal>=3        : a0=>$0 a0<=$1 d0<=$2 a1<=$3 ;
  1174. RwSetClumpVertexUV#4,256     = RwClump RwClump =(clump) INT =(index) RwReal*2        : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4;
  1175. RwSetClumpVertices#4,257     = RwClump RwClump =(clump) INT>=1 RwReal[][3] INT =(n)    : a0=>$0 a0<=$1 a1<=$2 a2<=>$3 d0<=$4 ;
  1176.  
  1177. //RwSetDebugStream#4,258     = BOOL FILE =(stream)                    : d0=>$0 a0<=$1 ;
  1178. RwSetAxisAlignment#4,259    = BOOL RwAxisAlignment =(alignment)      : d0=>$0 d0<=$1 ;
  1179. RwSetHints#4,260             = BOOL RwClumpHints =(hints)             : d0=>$0 d0<=$1 ;
  1180. RwSetLightBrightness#4,261     = RwLight RwLight =(light) RwReal =(lum) : a0=>$0 a0<=$1 d0<=$2 ;
  1181. RwSetLightColor#4,262         = RwLight RwLight =(light) RwReal =(r) RwReal =(g) RwReal =(b) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  1182. //RwSetLightColorStruct     = RwLight RwLight =(light) RwRGBColor =(color) : a0=>$0 a0<=$1 ;
  1183. RwSetLightConeAngle#4,263     = RwLight RwLight =(light) RwReal =(theta) : a0=>$0 a0<=$1 d0<=$2 ;
  1184. RwSetLightDataInt#4,264     = RwLight RwLight =(light) INT=(value)      : a0=>$0 a0<=$1 d0<=$2 ;
  1185. RwSetLightDataReal#4,265    = RwLight RwLight =(light) RwReal=(value)   : a0=>$0 a0<=$1 d0<=$2 ;
  1186. RwSetLightPosition#4,266     = RwLight RwLight =(light) RwReal =(x) RwReal =(y) RwReal =(z) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  1187. RwSetLightState#4,267         = RwLight RwLight =(light) RwState =(state)                    : a0=>$0 a0<=$1 d0<=$2 ;
  1188. RwSetLightVector#4,268         = RwLight RwLight =(light) RwReal =(x) RwReal =(y) RwReal =(z) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  1189.  
  1190. RwSetMaterialAmbient#4,269     = RwMaterial RwMaterial =(m) RwReal =(ka) : a0=>$0 a0<=$1 d0<=$2 ;
  1191. RwSetMaterialColor#4,270     = RwMaterial RwMaterial =(m) RwReal =(r) RwReal =(g) RwReal =(b) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  1192. //RwSetMaterialColorStruct     = RwMaterial RwMaterial =(m) RwRGBColor =(color) : a0=>$0 ;
  1193. RwSetMaterialDataInt#4,271     = RwMaterial RwMaterial =(m) INT=(value)    : a0=>$0 a0<=$1 d0<=$2 ;
  1194. RwSetMaterialDataReal#4,272 = RwMaterial RwMaterial =(m) RwReal=(value) : a0=>$0 a0<=$1 d0<=$2 ;
  1195. RwSetMaterialDiffuse#4,273     = RwMaterial RwMaterial =(m) RwReal =(kd)  : a0=>$0 a0<=$1 d0<=$2 ;
  1196.  
  1197. RwSetMaterialGeometrySampling#4,274 = RwMaterial RwMaterial =(m) RwGeometrySampling =(t) : a0=>$0 a0<=$1 d0<=$2 ;
  1198. RwSetMaterialLightSampling#4,275    = RwMaterial RwMaterial =(m) RwLightSampling =(t)    : a0=>$0 a0<=$1 d0<=$2 ;
  1199. RwSetMaterialOpacity#4,276             = RwMaterial RwMaterial =(m) RwReal =(opacity)       : a0=>$0 a0<=$1 d0<=$2 ;
  1200. RwSetMaterialSpecular#4,277         = RwMaterial RwMaterial =(m) RwReal =(ks)            : a0=>$0 a0<=$1 d0<=$2 ;
  1201. RwSetMaterialSurface#4,278             = RwMaterial RwMaterial =(m) RwReal =(ka) RwReal =(kd) RwReal =(ks) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4;
  1202. RwSetMaterialTexture#4,279             = RwMaterial RwMaterial =(m) RwTexture =(what)       : a0=>$0 a0<=$1 a1<=$2 ;
  1203. RwSetMaterialTextureModes#4,280        = RwMaterial RwMaterial =(m) RwTextureModes =(modes) : a0=>$0 a0<=$1 d0<=$2 ;
  1204.  
  1205. RwSetMatrixElement#4,281     = RwMatrix4d RwMatrix4d =(mat) INT =(i) INT =(j) RwReal =(val) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  1206. RwSetMatrixElements#4,282     = RwMatrix4d RwMatrix4d =(mat) RwReal[][] : a0=>$0 a0<=$1 a1<=>$2 ;
  1207.  
  1208. //RwSetPaletteEntries#4,284     = INT INT =(n) INT =(length) POSINT>=4 RwPaletteOptions =(options) : d0=>$0 ;
  1209.  
  1210. RwSetPolygonAmbient#4,284         = RwPolygon3d RwPolygon3d =(p) RwReal =(Ka)             : a0=>$0 a0<=$1 d0<=$2 ;
  1211. RwSetPolygonColor#4,285         = RwPolygon3d RwPolygon3d =(p) RwReal =(r) RwReal =(g) RwReal =(b) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  1212. //RwSetPolygonColorStruct       = RwPolygon3d RwPolygon3d =(p) RwRGBColor =(color)      : a0=>$0 a0<=$1 d0<=$2 ;
  1213. RwSetPolygonDataInt#4,286         = RwPolygon3d RwPolygon3d =(p) INT   =(value)            : a0=>$0 a0<=$1 d0<=$2 ;
  1214. RwSetPolygonDataReal#4,287         = RwPolygon3d RwPolygon3d =(p) RwReal=(value)            : a0=>$0 a0<=$1 d0<=$2 ;
  1215. RwSetPolygonDiffuse#4,288         = RwPolygon3d RwPolygon3d =(p) RwReal=(Kd)              : a0=>$0 a0<=$1 d0<=$2 ;
  1216. RwSetPolygonGeometrySampling#4,289 = RwPolygon3d RwPolygon3d =(p) RwGeometrySampling =(t) : a0=>$0 a0<=$1 d0<=$2 ;
  1217. RwSetPolygonLightSampling#4,290 = RwPolygon3d RwPolygon3d =(p) RwLightSampling =(t)     : a0=>$0 a0<=$1 d0<=$2 ;
  1218. RwSetPolygonMaterial#4,291         = RwPolygon3d RwPolygon3d =(p) RwMaterial =(m)          : a0=>$0 a0<=$1 a1<=$2 ;
  1219. RwSetPolygonOpacity#4,292         = RwPolygon3d RwPolygon3d =(p) RwReal =(opacity)        : a0=>$0 a0<=$1 d0<=$2 ;
  1220. RwSetPolygonSpecular#4,293         = RwPolygon3d RwPolygon3d =(p) RwReal =(Ks)             : a0=>$0 a0<=$1 d0<=$2 ;
  1221. RwSetPolygonSurface#4,294         = RwPolygon3d RwPolygon3d =(p) RwReal =(ka) RwReal =(kd) RwReal =(ks) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  1222. RwSetPolygonTag#4,295             = RwPolygon3d RwPolygon3d =(p) INT =(tag)               : a0=>$0 a0<=$1 d0<=$2 ;
  1223. RwSetPolygonTexture#4,296         = RwPolygon3d RwPolygon3d =(p) RwTexture =(t)           : a0=>$0 a0<=$1 a1<=$2 ;
  1224. RwSetPolygonTextureModes#4,297  = RwPolygon3d RwPolygon3d =(p) RwTextureModes =(modes)  : a0=>$0 a0<=$1 d0<=$2 ;
  1225. RwSetPolygonUV#4,298             = RwPolygon3d RwPolygon3d =(p) RwReal*2                 : a0=>$0 a0<=$1 d0<=$2 d1<=$3 ;
  1226.  
  1227. ////RwSetRasterData            = RwRaster RwRaster =(ras) void  =(value)        : a0=>$0 ;
  1228. RwSetSceneDataInt#4,299        = RwScene RwScene =(scene) INT   =(value)        : a0=>$0 a0<=$1 d0<=$2 ;
  1229. RwSetSceneDataReal#4,300    = RwScene RwScene =(scene) RwReal=(value)        : a0=>$0 a0<=$1 d0<=$2 ;
  1230. RwSetShapePath#2,57            = BOOL FILENAME =(path) RwCombineOperation =(op) : d0=>$0 a0<=$1 d0<=$2 ;
  1231. RwSetSplineDataInt#4,301    = RwSpline RwSpline =(spline) INT   =(user)      : a0=>$0 a0<=$1 d0<=$2 ;
  1232. RwSetSplineDataReal#4,302    = RwSpline RwSpline =(spline) RwReal=(user)      : a0=>$0 a0<=$1 d0<=$2 ;
  1233. RwSetSplinePoint#4,351        = RwSpline RwSpline =(sp) INT =(index) RwReal>=3 : a0=>$0 a0<=$1 d0<=$2 a1<=$3 ;
  1234.  
  1235. RwSetSurface#4,303             = BOOL RwReal =(ka) RwReal =(kd) RwReal =(ks)   : d0=>$0 d0<=$1 d1<=$2 d2<=$3 ;
  1236. RwSetSurfaceAmbient#4,304     = BOOL RwReal =(ka)                             : d0=>$0 d0<=$1 ;
  1237. RwSetSurfaceColor#4,305     = BOOL RwReal =(r) RwReal =(g) RwReal =(b)      : d0=>$0 d0<=$1 d1<=$2 d2<=$3 ;
  1238. RwSetSurfaceDiffuse#4,306     = BOOL RwReal =(kd)                             : d0=>$0 d0<=$1 ;
  1239. RwSetSurfaceGeometrySampling#4,307 = BOOL RwGeometrySampling =(sampling)           : d0=>$0 d0<=$1 ;
  1240. RwSetSurfaceLightSampling#4,308    = BOOL RwLightSampling =(sampling)              : d0=>$0 d0<=$1 ;
  1241. RwSetSurfaceOpacity#4,309             = BOOL RwReal =(opacity)                        : d0=>$0 d0<=$1 ;
  1242. RwSetSurfaceSpecular#4,310            = BOOL RwReal =(ks)                             : d0=>$0 d0<=$1 ;
  1243. RwSetSurfaceTexture#4,311             = BOOL STRING =(name)                           : d0=>$0 a0<=$1 ;
  1244. RwSetSurfaceTextureNull#4,420        = BOOL                                            : d0=>$0 ;
  1245. RwSetSurfaceTextureExt#4,312        = BOOL STRING =(texturename) STRING =(maskname) : d0=>$0 a0<=$1 a1<=$2 ;
  1246. RwSetSurfaceTextureModes#4,313        = BOOL RwTextureModes =(modes)                  : d0=>$0 d0<=$1 ;
  1247. RwSetTag#4,314                         = BOOL INT =(tag)                               : d0=>$0 d0<=$1 ;
  1248.  
  1249. RwSetTextureDataInt#4,315           = RwTexture RwTexture =(texture) INT   =(value)  : a0=>$0 a0<=$1 d0<=$2 ;
  1250. RwSetTextureDataReal#4,316           = RwTexture RwTexture =(texture) RwReal=(value)  : a0=>$0 a0<=$1 d0<=$2 ;
  1251. RwSetTextureDictSearchMode#4,317  = BOOL RwSearchMode =(mode)                      : d0=>$0 d0<=$1 ;
  1252. RwSetTextureDithering#4,318         = BOOL RwTextureDitherMode =(mode)             : d0=>$0 d0<=$1 ;
  1253. RwSetTextureFrame#4,319             = RwTexture RwTexture =(t) INT =(index)        : a0=>$0 a0<=$1 d0<=$2 ;
  1254. RwSetTextureFrameStep#4,320         = RwTexture RwTexture =(t) INT =(val)          : a0=>$0 a0<=$1 d0<=$2 ;
  1255. RwSetTextureGammaCorrection#4,321   = BOOL RwState =(state)                        : d0=>$0 d0<=$1 ;
  1256. RwSetTextureRaster#4,322             = RwTexture RwTexture =(texture) RwRaster =(ras) : a0=>$0 a0<=$1 a1<=$2 ;
  1257.  
  1258. //RwSetUserDrawAlignment        = RwUserDraw RwUserDraw =(userdraw) RwUserDrawAlignmentTypes =(align) : a0=>$0 ;
  1259. //RwSetUserDrawCallback            = RwUserDraw RwUserDraw =(userdraw) RwUserDrawCallBack =(callback) : a0=>$0 ;
  1260. //RwSetUserDrawData             = RwUserDraw RwUserDraw =(userdraw) void =(value) : a0=>$0 ;
  1261. //RwSetUserDrawOffset             = RwUserDraw RwUserDraw =(userdraw) INT =(x) INT =(y) : a0=>$0 ;
  1262. //RwSetUserDrawParentAlignment  = RwUserDraw RwUserDraw =(userdraw) RwUserDrawAlignmentTypes =(align) : a0=>$0 ;
  1263. //RwSetUserDrawSize             = RwUserDraw RwUserDraw =(userdraw) INT =(width) INT =(height) : a0=>$0 ;
  1264. //RwSetUserDrawType             = RwUserDraw RwUserDraw =(userdraw) RwUserDrawType =(type) : a0=>$0 ;
  1265. //RwSetUserDrawVertexIndex        = RwUserDraw RwUserDraw =(userdraw) INT =(index) : a0=>$0 ;
  1266. RwShowCameraImage#2,58             = RwCamera RwCamera =(cam) : a0=>$0 a0<=$1 ;
  1267. RwSphere#4,323                     = BOOL RwReal =(radius) INT =(sides) : d0=>$0 d0<=$1 d1<=$2 ;
  1268. RwSphericalTexturizeClump#4,324 = RwClump RwClump =(clump) : a0=>$0 a0<=$1 ;
  1269.  
  1270. RwSplinePoint#4,325             = BOOL   RwSpline =(spline) RwSplinePath =(path) RwReal =(where) RwReal[3] RwReal[3] : 
  1271.             d0=>$0 a0<=$1 d0<=$2 d1<=$3 a1<=>$4 a2<=>$5 ;
  1272. RwSplineTransform#4,326         = RwReal RwSpline =(spline) RwSplinePath =(path) RwReal =(where) RwReal>=3 RwMatrix4d =(mat) :
  1273.             d0=>$0 a0<=$1 d0<=$2 d1<=$3 a1<=$4 a2<=$5 ;
  1274.  
  1275. RwSubtractVector#4,328         = BOOL RwReal>=3 RwReal>=3 RwReal[3] : d0=>$0 a0<=$1 a1<=$2 a2<=>$3 ;
  1276. RwTextureDictBegin#4,329     = BOOL : d0=>$0 ;
  1277. RwTextureDictEnd#4,330         = BOOL : d0=>$0 ;
  1278. RwTextureNextFrame#2,59     = RwTexture RwTexture =(t) : a0=>$0 a0<=$1 ;
  1279. RwTiltCamera#2,60             = RwCamera RwCamera =(cam) RwReal =(theta) : a0=>$0 a0<=$1 d0<=$2 ;
  1280. RwTransformBegin#4,331         = BOOL : d0=>$0 ;
  1281. RwTransformCTM#4,332         = BOOL RwMatrix4d =(mat) : d0=>$0 a0<=$1 ;
  1282. RwGetLightLTM#4,333         = RwMatrix4d RwLight =(light) RwMatrix4d =(m) : a0=>$0 a0<=$1 a1<=$2 ;
  1283. RwTransformLight#2,61         = RwLight RwLight =(light) RwMatrix4d =(m) RwCombineOperation =(op) : a0=>$0 a0<=$1 a1<=$2 d0<=$3 ;
  1284. RwGetCameraLTM#4,334         = RwMatrix4d RwCamera =(camera) RwMatrix4d =(m) : a0=>$0 a0<=$1 a1<=$2 ;
  1285. RwTransformCameraOrientation#2,62 = RwCamera RwCamera =(c) RwMatrix4d =(m) : a0=>$0 a0<=$1 a1<=$2 ;
  1286. RwTransformCamera#4,335     = RwCamera RwCamera =(camera) RwMatrix4d =(m) RwCombineOperation =(op) : a0=>$0 a0<=$1 a1<=$2 d0<=$3 ;
  1287. RwTransformClump#2,63         = RwClump  RwClump =(clump) RwMatrix4d =(mat) RwCombineOperation =(op) : a0=>$0 a0<=$1 a1<=$2 d0<=$3 ;
  1288. RwTransformClumpJoint#2,64     = RwClump  RwClump =(clump) RwMatrix4d =(mat) RwCombineOperation =(op) : a0=>$0 a0<=$1 a1<=$2 d0<=$3 ;
  1289. RwTransformEnd#4,336         = BOOL : d0=>$0 ;
  1290.  
  1291. RwTransformJointTM#4,337     = BOOL RwMatrix4d =(mat) : d0=>$0 a0<=$1 ;
  1292. RwTransformMatrix#4,338     = RwMatrix4d RwMatrix4d =(m) RwMatrix4d =(mat) RwCombineOperation =(op) : a0=>$0 a0<=$1 a1<=$2 d0<=$3 ;
  1293. RwTransformPoint#4,339         = BOOL RwReal[3] RwMatrix4d =(mat) : d0=>$0 a0<=>$1 a1<=$2 ;
  1294. RwTransformVector#4,340     = BOOL RwReal[3] RwMatrix4d =(mat) : d0=>$0 a0<=>$1 a1<=$2 ;
  1295.  
  1296. RwTranslateCTM#4,341         = BOOL RwReal =(tx) RwReal =(ty) RwReal =(tz) : d0=>$0 d0<=$1 d1<=$2 d2<=$3 ;
  1297. RwTranslateMatrix#2,65         = RwMatrix4d RwMatrix4d =(mat) RwReal =(tx) RwReal =(ty) RwReal =(tz) RwCombineOperation =(op) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 d3<=$5 ;
  1298. RwTriangle#4,342             = BOOL INT =(v1) INT =(v2) INT =(v3) : d0=>$0 d1<=$1 d2<=$2 d3<=$3 ;
  1299. RwTriangleExt#4,343         = BOOL INT =(v1) INT =(v2) INT =(v3) INT =(tag) : d0=>$0 d1<=$1 d2<=$2 d3<=$3 d4<=$4 ;
  1300.  
  1301. RwUndamageCameraViewport#4,344 = RwCamera RwCamera =(cam) INT =(x) INT =(y) INT =(w) INT =(h) : a0=>$0 a0<=$1 d1<=$2 d2<=$3 d3<=$4 d4<=$5 ;
  1302. RwVCMoveCamera#4,345            = RwCamera RwCamera =(cam) RwReal =(x) RwReal =(y) RwReal =(z) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4 ;
  1303.  
  1304. RwVertex#4,346                 = INT RwReal =(x) RwReal =(y) RwReal =(z) : d0=>$0 d1<=$1 d2<=$2 d3<=$3 ;
  1305. RwVertexExt#4,347             = INT RwReal =(x) RwReal =(y) RwReal =(z) RwReal*2 RwReal>=3 : d0=>$0 d1<=$1 d2<=$2 d3<=$3 d4<=$4 d5<=$5 a0<=$6 ;
  1306. RwWCMoveCamera#2,66         = RwCamera RwCamera =(cam) RwReal =(x) RwReal =(y) RwReal =(z) : a0=>$0 a0<=$1 d0<=$2 d1<=$3 d2<=$4;
  1307. RwWriteShape#4,348             = BOOL FILENAME =(filename) RwClump =(clump) : d0=>$0 a0<=$1 a1<=$2 ;
  1308.  
  1309. RwVertexUV#4,418             = INT RwReal =(x) RwReal =(y) RwReal =(z) RwReal*2 : d0=>$0 d1<=$1 d2<=$2 d3<=$3 d4<=$4 d5<=$5 ;
  1310.  
  1311. // RenderWare 2.0 additional commands/functions 
  1312.  
  1313.  
  1314. enumrange rwCHUNKTYPE 0 1013
  1315.     rwCHUNKCAMERA rwCHUNKMATRIX rwCHUNKMATERIAL rwCHUNKPALETTE rwCHUNKRASTER rwCHUNKTEXTURE rwCHUNKCLUMP 
  1316.      rwCHUNKLIGHT  rwCHUNKSCENE  rwCHUNKDATA     rwCHUNKRECT    rwCHUNKV3D    rwCHUNKSTRING  rwCHUNKUSER;
  1317.  
  1318.  enumrange rwCHUNKFLAGS 0 %x1f
  1319.      rwSAVECHUNKNORMALS    =%x01 rwSAVECHUNKUVS =%x02 rwSAVECHUNKLUMINANCES =%x4 rwSAVECHUNKRASTERS =%x8 
  1320.      rwSAVECHUNKTAGS     =%x10 rwSAVECHUNKALL =%x1f rwLOADCHUNKRASTERS    =%x8 ;
  1321.  
  1322.  
  1323. function
  1324. RwAddMaterialModeToMaterial#4,370    = RwMaterial  RwMaterial  RwMaterialModes : a0=>$0 a0<=$1 d0<=$2 ;
  1325. RwAddMaterialModeToPolygon#4,371    = RwPolygon3d RwPolygon3d RwMaterialModes : a0=>$0 a0<=$1 d0<=$2 ;
  1326. RwAddMaterialModeToSurface#4,372    = BOOL RwMaterialModes                    : d0=>$0 d0<=$1 ;
  1327. RwAddTextureToDict#4,373            = RwTexture STRING=(name) RwTexture : a0=>$0 a0<=$1 a1<=$2 ;
  1328. RwCloseStreamFile#4,374                = BOOL RwStream : d0=>$0 a0<=$1 ;
  1329. RwCloseStreamMemory#4,375            = BOOL RwStream Memory : d0=>$0 a0<=$1 a1<=>$2 ;
  1330. RwFindStreamChunk#4,376                = BOOL RwStream rwCHUNKTYPE         : d0=>$0 a0<=$1 d0<=$2 ;
  1331. RwGetChunkSize#4,377                = INT rwCHUNKTYPE VOID rwCHUNKFLAGS : d0=>$0 d0<=$1 a0<=$2 d1<=$3 ;
  1332. RwGetClumpLightSampleRate#4,378        = RwReal RwCLump : d0=>$0 a0<=$1 ;
  1333. RwGetDisplayDevices#4,379            = STRING : a0=>$0 ;
  1334. RwGetInternalError#4,380            = BOOL : d0=>$0 ;
  1335. RwGetLightRadius#4,381                = RwReal RwLight : d0=>$0 a0<=$1 ;
  1336. RwExtract#4,382                        = BOOL string int string : d0=>$0 a0<=$1 d1<=$2 a1=>$3 ;
  1337.  
  1338. RwGetMaterialModes#4,384            = RwMaterialModes RwMaterial : d0=>$0 a0<=$1 ;
  1339. RwGetPolygonMaterialModes#4,385        = RwMaterialModes RwPolygon3d: d0=>$0 a0<=$1 ;
  1340. RwGetSceneDepthCueDistance#4,386    = RwReal  RwScene : d0=>$0 a0<=$1 ;
  1341. RwGetSceneDepthCueState#4,387        = RwState RwScene : d0=>$0 a0<=$1 ;
  1342. RwOpenStreamFile#4,388                = RwStream RwStreamAccess FILEREF  : a0=>$0 d0<=$1 a0<=$2 ;
  1343. RwOpenStreamFilename#4,389            = RwStream RwStreamAccess FILENAME : a0=>$0 d0<=$1 a0<=$2 ;
  1344. RwOpenStreamMemory#4,390            = RwStream RwStreamAccess Memory   : a0=>$0 d0<=$1 a0<=$2 ;
  1345.  
  1346. RwReadStream#4,391                    = BOOL RwStream STRING BUFSIZ=(length)         : d0=>$0 a0<=$1 a1=>$2 d0<=$3 ;
  1347. RwReadStreamChunk#4,392                = BOOL RwStream rwCHUNKTYPE VOID rwCHUNKFLAGS: d0=>$0 a0<=$1 d0<=$2 a1=>$3 d1<=$4 ;
  1348. RwReadStreamChunkHeader#4,393        = INT  RwStream                                 : d0=>$0 a0<=$1 ;
  1349. RwReadStreamChunkType#4,394            = BOOL RwStream rwCHUNKTYPE                     : d0=>$0 a0<=$1 d1=>$2 ;
  1350. RwReadStreamInt#4,395                = BOOL RwStream INT[]    INT=(length)         : d0=>$0 a0<=$1 a1<=>$2 d0<=$3 ;
  1351. RwReadStreamReal#4,396                = BOOL RwStream RwReal[] INT=(length)         : d0=>$0 a0<=$1 a1<=>$2 d0<=$3 ;
  1352. RwRemoveMaterialModeFromMaterial#4,397 = RwMaterial  RwMaterial  RwMaterialModes : a0=>$0 a0<=$1 d0<=$2 ;
  1353. RwRemoveMaterialModeFromPolygon#4,398  = RwPolygon3d RwPolygon3d RwMaterialModes : a0=>$0 a0<=$1 d0<=$2 ;
  1354. RwRemoveMaterialModeFromSurface#4,399  = BOOL RwMaterialModes                     : d0=>$0 d0<=$1 ;
  1355. RwSeekStream#4,400                    = BOOL RwStream INT=(offset)                 : d0=>$0 a0<=$1 d0<=$2 ;
  1356. RwSetClumpLightSampleRate#4,401        = RwReal RwClump RwReal                         : d0=>$0 a0<=$1 d0<=$2 ;
  1357. RwSetClumpLocalBBox#4,402            = RwClump RwClump RwReal>=3 RwReal>=3         : a0=>$0 a0<=$1 a1<=$2 a2<=$3 ;
  1358. RwSetLightRadius#4,403                = RwLight RwLight RwReal                     : a0=>$0 a0<=$1 d0<=$2 ;
  1359. RwSetMaterialModes#4,406            = RwMaterial RwMaterial RwMaterialModes         : a0=>$0 a0<=$1 d0<=$2 ;
  1360. RwSetPolygonMaterialModes#4,407        = RwPolygon3d RwPolygon3d RwMaterialModes     : a0=>$0 a0<=$1 d0<=$2 ;
  1361. RwSetSceneDepthCueDistance#4,408    = BOOL RwScene RwReal  : d0=>$0 a0<=$1 d0<=$2 ;
  1362. RwSetSceneDepthCueState#4,409        = BOOL RwScene RwState : d0=>$0 a0<=$1 d0<=$2 ;
  1363. RwSetSurfaceMaterialModes#4,410        = BOOL RwMaterialModes : d0=>$0 d0<=$1 ;
  1364. RwSkipStreamChunk#4,411                = BOOL RwStream           : d0=>$0 a0<=$1 ;
  1365. RwWriteStream#4,412                    = BOOL RwStream STRING=(value) INT=(length)           : d0=>$0 a0<=$1 a1<=$2 d0<=$3 ;
  1366. RwWriteStreamChunk#4,413            = BOOL RwStream rwCHUNKTYPE VOID=(value) rwCHUNKFLAGS : d0=>$0 a0<=$1 d0<=$2 a1<=$3 d1<=$4 ;
  1367. RwWriteStreamChunkHeader#4,414        = BOOL RwStream rwCHUNKTYPE INT=(size) : d0=>$0 a0<=$1 d0<=$2 d1<=$3 ;
  1368. RwWriteStreamInt#4,415                = BOOL RwStream INT>=1    INT=(length) : d0=>$0 a0<=$1 a1<=$2 d0<=$3 ;
  1369. RwWriteStreamReal#4,416                = BOOL RwStream RwReal>=1 INT=(length) : d0=>$0 a0<=$1 a1<=$2 d0<=$3 ;
  1370.  
  1371. RwStrError#4,417                    = STRING RwErrorCode : a0=>$0 d0<=$1 ;
  1372.  
  1373.  
  1374.  
  1375.  
  1376. // RenderWare 3ds model converters
  1377.  
  1378. enumrange RwConvertOptions 0 %x0fff
  1379. optNONE     =%x0000
  1380. optANIMATION=%x0001 optHEADER =%x0002 
  1381. /*optAPIFILE=%x0004 not implemented */
  1382. optPROTOTYPE=%x0008 optFLAT   =%x0010 optCOMBINE =%x0020 
  1383. optSPLIT  =%x0040 optNORMALIZE=%x0080 optCENTRE =%x0100 
  1384. /*optINLINE   =%x0200 clump/file output via different functions */
  1385. optOPACITY=%x0400 optCOMMENTS=%x0800;
  1386.  
  1387. RwConvertTexture 0 %x1f
  1388. optNONE =%x0000 optTEXTURE=%x0001 optTEXTUREEXT=%x0002 optLIT=%x0004 optFILTER=%x0008 optFORESHORTEN=%x0010;
  1389.  
  1390. RwConvertHints 0 %x3
  1391. optNONE =%x0000 optHS=%x0001  optEDITABLE=%x0002;
  1392.  
  1393. enum
  1394. RwConvertSeverity    rwCONVERTFATAL rwCONVERTERROR  rwCONVERTWARN; 
  1395. RwConvertVerbosity   rwCONVERTBRIEF rwCONVERTNORMAL rwCONVERTVERBOSE;
  1396.  
  1397.  
  1398. function
  1399. Rw3dsReadShape#4,352    =RwClump FILENAME : a0=>$0 a1<=$1 ;
  1400. Rw3dsOutputFile#4,353    =BOOL    FILENAME=(infile) FILENAME=(outfile) : d0=>$0 a0<=$1 a1<=$2 ;
  1401. //RwDxfReadShape#4,356    =RwClump FILENAME : a0=>$0 a1<=$1 ;
  1402. //RwDxfOutputFile#4,357    =BOOL    FILENAME=(infile) FILENAME=(outfile) : d0=>$0 a0<=$1 a1<=$2 ;
  1403.  
  1404. command
  1405. Set3dsConvertOptions#4,354    RwConvertOptions RwConvertTexture RwConvertHints RwReal=(scale) RwReal=(normalize) RwReal*3 RwReal=(opacity)
  1406.                             : d0<=$1 d1<=$2 d2<=$3 d3<=$4 d4<=$5 d5<=$6 d6<=$7 d7<=$8 d8<=$9 ;
  1407. Use3dsConvertDefault#4,355    : ;
  1408.  
  1409. //SetDxfConvertOptions#4,358    RwConvertOptions RwConvertHints RwReal=(scale) RwReal=(normalize) RwReal*3 RwReal=(opacity)
  1410. //                            : d0<=$1 d1<=$2 d2<=$3 d3<=$4 d4<=$5 d5<=$6 d6<=$7 d7<=$8 ;
  1411. //UseDxfConvertDefault#4,359    : ;
  1412.  
  1413. SetConvertErrorLevel#4,360        objectstate RwConvertSeverity  : d0<=$1 d1<=$2 ;
  1414. SetConvertMessageLevel#4,361    objectstate RwConvertVerbosity : d0<=$1 d1<=$2 ;
  1415.  
  1416.  
  1417. /* Windows interfaces for RenderWare apps */
  1418.  
  1419. enum
  1420.  
  1421. MouseEvent MOUSEMOVE
  1422.            LBUTTONDOWN LBUTTONUP LBUTTONDBLCLK
  1423.            RBUTTONDOWN RBUTTONUP RBUTTONDBLCLK
  1424.            MBUTTONDOWN MBUTTONUP MBUTTONDBLCLK;
  1425.  
  1426. WinEvent   WM_CREATE WM_DESTROY WM_MOVE WM_SIZE WM_PAINT WM_TIMER WM_CHAR WM_KEYDOWN WM_KEYUP WM_ACTIVATE;
  1427.  
  1428. // Keycodes for special keys
  1429. enumrange
  1430. Keycode 0 127   KEY_PGUP=33 KEY_PGDN KEY_END KEY_HOME KEY_LEFT KEY_UP KEY_RIGHT KEY_DOWN   KEY_INS=45 KEY_DEL
  1431.                 KEY_F1=112 KEY_F2 KEY_F3 KEY_F4 KEY_F5 KEY_F6 KEY_F7 KEY_F8 KEY_F9 KEY_F10 KEY_F11 KEY_F12;
  1432.  
  1433. enumrange
  1434. Window    0 4 ;
  1435.  
  1436. // Mouse key bit defs exactly as Windows NT/95 defines them
  1437. enumrange
  1438. MK_DEFS       0 31 MK_LBUTTON=%x01 MK_RBUTTON=%x02 MK_SHIFT=%x04 MK_CONTROL=%x08 MK_MBUTTON=%x10;
  1439.  
  1440. // Window styles as Windows NT/95 shifted right 16 bits
  1441. enumrange
  1442. WSTYLE    0 %xffff WS_OVERLAPPED=0 WS_MAXIMIZEBOX=1 WS_MINIMIZEBOX=2 WS_THICKFRAME=4 WS_SYSMENU=8 WS_CAPTION=%x00c0 WS_CHILD=%x4000 WS_POPUP=%x8000;
  1443.  
  1444. BrowserShowStyle 0 11 MAXIMIZE=3 MINIMIZE=6 RESTORE=9 FULLSCREEN=11;
  1445.  
  1446. WindowShowStyle 0 11 HIDE=0 NORMAL=1 SHOWMINIMIZED=2 SHOWMAXIMIZED=3 MAXIMIZE=3 SHOWNOACTIVATE=4 SHOW=5
  1447.                      MINIMIZE=6 SHOWMINNOACTIVE=7 SHOWNA=8 RESTORE=9;
  1448.  
  1449. /* WM_SIZE message wParam values - first event param for OnWinEvent for WM_SIZE */
  1450. SIZE_REASON 0 4  SIZE_RESTORED=0  SIZE_MINIMIZED=1  SIZE_MAXIMIZED=2  SIZE_MAXSHOW=3  SIZE_MAXHIDE=4;
  1451.  
  1452. ACTIVATE_REASON 0 2 WA_INACTIVE WA_ACTIVE WA_CLICKACTIVE;
  1453.  
  1454. /* ShowBrowserInterfaces flags */
  1455. SBI_FLAGS 0 15 BI_OUTPUT=%x01 BI_STATUS=%x02 BI_TOOLBAR=%x04 BI_MENU=%x08 ;
  1456.  
  1457. // GetInfo and GetDiskInfo items are handled by the same function
  1458. TVML_INFO 0 26
  1459. CDROMS                    //string of device names e.g. E:\
  1460. BrowserVersion            //e.g 201
  1461. BrowserType                //APP, OCX
  1462. MemoryLoad                //0-100%
  1463. MemoryTotalPhysical        //int
  1464. MemoryFreePhysical        //int
  1465. MemoryTotalPagefile        //int
  1466. MemoryFreePagefile        //int
  1467.  
  1468. OSPlatform                //INFO_Platform
  1469. OSMajorVersion            //int
  1470. OSMinorVersion            //int
  1471. OSBuildNumber            //int
  1472. OSStringData            //string
  1473.  
  1474. ProcessorArchitecture    //INFO_ProcessorArchitecture
  1475. ProcessorLevel            //int - architecture specific
  1476.  
  1477. CompanyName                //string
  1478. LegalCopyright            //string
  1479. PrivateBuild            //string
  1480. SpecialBuild            //string
  1481.  
  1482. DisplayDepth            //int
  1483. BrowserDepth            //int
  1484.  
  1485. FixedDrives                //string e.g. "C:\D:\
  1486.  
  1487. CommandLine                //string
  1488. ScriptFile                //string
  1489. InstallDir                //string
  1490.  
  1491. ActiveWidth                //int
  1492. ActiveHeight            //int
  1493. ;
  1494.  
  1495. // GetInfo and GetDiskInfo items are handled by the same function
  1496. TVML_DISKINFO 100 103
  1497. DiskTotal                //int MBytes
  1498. DiskFree                //int MBytes
  1499. DiskClusterSize            //int bytes
  1500. DiskType                //int    INFO_DiskType
  1501.                         //        "UNKNOWN, ERROR, REMOVABLE, FIXED, REMOTE, CDROM, RAM"
  1502. ;
  1503.  
  1504. //GetFileInfo items
  1505. TVML_FILEINFO 0 3
  1506. FileCreate                //date
  1507. FileAccess                //date
  1508. FileWrite                //date
  1509. FileSize                //int bytes
  1510. ;
  1511.  
  1512.  
  1513. INFO_Platform 0 2
  1514.     WIN32S WINDOWS NT ;
  1515.  
  1516. INFO_ProcessorArchitecture 0 3
  1517.     INTEL MIPS ALPHA PPC ;
  1518.  
  1519. INFO_DiskType 0 6
  1520.     DISK_UNKNOWN DISK_ERROR DISK_REMOVABLE DISK_FIXED DISK_REMOTE DISK_CDROM DISK_RAM ;
  1521.  
  1522. /* GetSystemMetrics items */
  1523. SM_ITEM 0 75 
  1524.  
  1525. SM_CXSCREEN   
  1526. SM_CYSCREEN   
  1527. SM_CXVSCROLL  
  1528. SM_CYHSCROLL  
  1529. SM_CYCAPTION  
  1530. SM_CXBORDER   
  1531. SM_CYBORDER   
  1532. SM_CXDLGFRAME 
  1533. SM_CYDLGFRAME 
  1534. SM_CYVTHUMB   
  1535. SM_CXHTHUMB   
  1536. SM_CXICON     
  1537. SM_CYICON     
  1538. SM_CXCURSOR   
  1539. SM_CYCURSOR   
  1540. SM_CYMENU     
  1541. SM_CXFULLSCREEN  
  1542. SM_CYFULLSCREEN  
  1543. SM_CYKANJIWINDOW 
  1544. SM_MOUSEPRESENT  
  1545. SM_CYVSCROLL     
  1546. SM_CXHSCROLL     
  1547. SM_DEBUG         
  1548. SM_SWAPBUTTON    
  1549. SM_RESERVED1     
  1550. SM_RESERVED2     
  1551. SM_RESERVED3     
  1552. SM_RESERVED4     
  1553. SM_CXMIN         
  1554. SM_CYMIN         
  1555. SM_CXSIZE        
  1556. SM_CYSIZE        
  1557. SM_CXFRAME       
  1558. SM_CYFRAME       
  1559. SM_CXMINTRACK    
  1560. SM_CYMINTRACK    
  1561. SM_CXDOUBLECLK   
  1562. SM_CYDOUBLECLK   
  1563. SM_CXICONSPACING 
  1564. SM_CYICONSPACING 
  1565. SM_MENUDROPALIGNMENT 
  1566. SM_PENWINDOWS        
  1567. SM_DBCSENABLED       
  1568. SM_CMOUSEBUTTONS     
  1569.  
  1570. SM_SECURE 
  1571. SM_CXEDGE 
  1572. SM_CYEDGE 
  1573. SM_CXMINSPACING
  1574. SM_CYMINSPACING
  1575. SM_CXSMICON    
  1576. SM_CYSMICON    
  1577. SM_CYSMCAPTION 
  1578. SM_CXSMSIZE    
  1579. SM_CYSMSIZE    
  1580. SM_CXMENUSIZE  
  1581. SM_CYMENUSIZE  
  1582. SM_ARRANGE     
  1583. SM_CXMINIMIZED 
  1584. SM_CYMINIMIZED 
  1585. SM_CXMAXTRACK  
  1586. SM_CYMAXTRACK  
  1587. SM_CXMAXIMIZED 
  1588. SM_CYMAXIMIZED 
  1589. SM_NETWORK
  1590. // 64-66 not used
  1591.  
  1592. SM_CLEANBOOT=67
  1593. SM_CXDRAG      
  1594. SM_CYDRAG      
  1595. SM_SHOWSOUNDS  
  1596. SM_CXMENUCHECK 
  1597. SM_CYMENUCHECK 
  1598. SM_SLOWMACHINE 
  1599. SM_MIDEASTENABLED   
  1600. SM_CMETRICS 
  1601.  
  1602. SM_CXFIXEDFRAME=7
  1603. SM_CYFIXEDFRAME=8
  1604. SM_CXSIZEFRAME=32
  1605. SM_CYSIZEFRAME=33
  1606. ;
  1607.  
  1608.  
  1609. command
  1610. RwClose#1,1 : ;
  1611. //LocalInitDoneRw#1,2        ShowStyle : d0<=$1 ;        // Called by script when its ready to reveal window and accept messages
  1612. LocalInitDoneRw#1,2                  : ;        // Called by script when its ready to reveal window and accept messages
  1613. RwCloseDebugStream#1,3 : ;
  1614. RwSetDebugAssertionState#1,4 RwState : d0<=$1 ;
  1615. RwSetDebugMessageState#1,5     RwState : d0<=$1 ;
  1616. RwSetDebugOutputState#1,6     RwState : d0<=$1 ;
  1617. RwSetDebugScriptState#1,7     RwState : d0<=$1 ;
  1618. RwSetDebugSeverity#1,8         RwDebugSeverity : d0<=$1 ;
  1619. RwSetDebugTraceState#1,9     RwState : d0<=$1 ;
  1620. RwSRandom#1,10                 INT : d0<=$1 ;
  1621. RwSetUserError#1,12    : ;
  1622.  
  1623. DestroyAnimation#2,69        RwClump : a0<=$1 ;
  1624.  
  1625. function
  1626.  
  1627. // Rw library startup and create window
  1628. InitRw#2,1   =INT STRING=(title) WSTYLE TLPOINT SIZE_T SIZE_T
  1629.     : d7=>$0 a0<=$1 d0<=$2 d1<=$3.1 d2<=$3.2 d3<=$4.1 d4<=$4.2 d5<=$5.1 d6<=$5.2 
  1630.       d8<=0 d9<=0 d10<=0 ;
  1631.  
  1632. // Rw library startup and create window
  1633. InitRwExt#2,1   =INT STRING=(title) WSTYLE TLPOINT SIZE_T SIZE_T int=(width) int=(height) int=(depth)
  1634.     : d7=>$0 a0<=$1 d0<=$2 d1<=$3.1 d2<=$3.2 d3<=$4.1 d4<=$4.2 d5<=$5.1 d6<=$5.2 
  1635.       d8<=$6 d9<=$7 d10<=$8 ;
  1636.  
  1637. // Rw shutdown and close window
  1638. DeinitRw#2,2 =INT : d0=>$0 ;
  1639.  
  1640. // Support common code 
  1641.  
  1642. CheckAndReadPalette#2,3 = INT FILENAME         : d0=>$0 a0<=$1 ;
  1643. LoadAnimation#2,4       = INT RwClump FILENAME : d0=>$0 a0<=$1 a1<=$2 ;
  1644. AnimateClump#2,5        = RwClump RwClump      : a0=>$0 a0<=$1 ;
  1645. SetPalette#2,70            = INT RwStream         : d0=>$0 a0<=$1 ;
  1646.  
  1647.  
  1648. command
  1649.  
  1650. OnMouseEvent#3,1 MouseEvent INT=(xpos) INT=(ypos) INT=(vkeys) SCRIPTREF : d0<=$1 d1!>$2 d2!>$3 d3!>$4 a0<=$5 ;
  1651. OnWinEvent#3,2   WinEvent INT=(w) INT=(l) SCRIPTREF                     : d0<=$1 d1!>$2 d2!>$3 a0<=$4 ;
  1652.  
  1653. WinSetCapture#3,3 :;
  1654. WinReleaseCapture#3,4 :;
  1655.  
  1656. WinInvalidateRect#3,5 :;
  1657. WinClientToScreen#3,6 INT INT : d0<=>$1 d1<=>$2;
  1658.  
  1659. WinSetTimer#3,7 INT=(timer) INT=(period) : d0<=$1 d1<=$2 ;
  1660. WinKillTimer#3,8 INT=(timer) : d0<=$1 ;
  1661.  
  1662. WinBeginPaint#3,9 :;
  1663. WinEndPaint#3,10  :;
  1664. WinGetClientRect#3,11 INT=(width) INT=(height) : d0=>$1 d1=>$2;
  1665. WinClose#3,12 :;
  1666.  
  1667. OffMouseEvent#3,13 MouseEvent : d0<=$1 ;
  1668. OffWinEvent#3,14   WinEvent   : d0<=$1 ;
  1669.  
  1670. // Extended multiple window handling interface
  1671. OnMouseEvent2      #3,15    Window MouseEvent INT=(xpos) INT=(ypos) INT=(vkeys) BOOL : d0!>$3 d1!>$4 d2!>$5 a0<!$6 d4<=$1 d5<=$2 ;
  1672. OnWinEvent2          #3,16    Window WinEvent   INT=(w)    INT=(l)                BOOL : d0!>$3 d1!>$4        a0<!$5 d4<=$1 d5<=$2 ;
  1673.  
  1674. OffMouseEvent2      #3,17    Window MouseEvent : d0<=$1 d1<=$2 ;
  1675. OffWinEvent2      #3,18    Window WinEvent   : d0<=$1 d1<=$2 ;
  1676.  
  1677. WinShowWindow     #3,20    Window WindowShowStyle : d0<=$1 d1<=$2 ;
  1678. WinSetWindowPos   #3,21    Window TLPOINT : d0<=$1 d1<=$2.1 d2<=$2.2 ;
  1679. WinDestroyWindow  #3,22    Window : d0<=$1 ;
  1680.  
  1681. WinSetCapture2      #3,23    Window : d0<=$1 ;
  1682.  
  1683. WinInvalidateRect2#3,24    Window : d0<=$1 ;
  1684. WinClientToScreen2#3,25 Window INT INT : d0<=$1 d1<=>$2 d2<=>$3 ;
  1685.  
  1686. WinSetTimer2      #3,26    Window INT=(timer) INT=(period) : d0<=$1 d1<=$2 d2<=$3 ;
  1687. WinKillTimer2      #3,27    Window INT=(timer) : d0<=$1 d1<=$2 ;
  1688.  
  1689. WinBeginPaint2      #3,28    Window : d0<=$1 ;
  1690. WinEndPaint2      #3,29    Window : d0<=$1 ;
  1691. WinGetClientRect2 #3,30    Window INT=(width) INT=(height) : d0<=$1 d1=>$2 d2=>$3 ;
  1692.  
  1693. WinSetActiveWindow#3,31 Window : d0<=$1 ;
  1694.  
  1695. function
  1696. WinCreateWindow      #3,19    =INT Window STRING=(title) WSTYLE TLPOINT SIZE_T SIZE_T
  1697.     : d7=>$0 a0<=$2 d0<=$3 d1<=$4.1 d2<=$4.2 d3<=$5.1 d4<=$5.2 d5<=$6.1 d6<=$6.2 d8<=$1 ;
  1698.  
  1699. RwBeginCameraUpdate2 #3,32    = RwCamera Window RwCamera =(cam) : a0=>$0 d0<=$1 a0<=$2 ;
  1700. RwShowCameraImage2     #3,33    = RwCamera Window RwCamera =(cam) : a0=>$0 d0<=$1 a0<=$2 ;
  1701.  
  1702. // Browser / Windows support commands/functions
  1703.  
  1704. command
  1705. ShowBrowserWindow#13,1 BrowserShowStyle : d0<=$1 ;
  1706. BrowserExit#13,2 : ;
  1707.  
  1708. SetBrowserWindowPos#13,3  TLPOINT : d0<=$1.1 d1<=$1.2 ;
  1709. SetBrowserWindowSize#13,4 SIZE_T  : d0<=$1.1 d1<=$1.2 ;
  1710. SetBrowserInterfaces#13,5 INT     : d0<=$1 ;
  1711.  
  1712. function
  1713.  
  1714. GetSystemMetrics#13,6    =INT SM_ITEM  : d0=>$0 d0<=$1 ;
  1715. launch#13,7                =INT filename : d0=>$0 a0<=$1 ;
  1716. GetInfo#13,14            =STRING TVML_INFO : a0=>$0 a1<=0 d0<=$1;
  1717. GetDiskInfo#13,14        =STRING filename TVML_DISKINFO : a0=>$0 a1<=$1 d0<=$2;
  1718. GetFileInfo#13,20        =STRING filename TVML_FILEINFO : a0=>$0 a1<=$1 d0<=$2;
  1719.  
  1720. //<shellapi.h> ShellExecute
  1721.  
  1722. // File compress utility
  1723.  
  1724. enum
  1725.  
  1726. compress_type NONE AHUFF;
  1727. check_type    NONE SUMCHECK CRC_16 CRC_32;
  1728. file_format   TEXT SYMBOl_1;
  1729. compress_error ERR_NONE ERR_OPEN ERR_SUMCHECK ERR_CRC_FAIL ERR_COMP_UNKNOWN ERR_FORMAT_UNKNOWN ERR_BAD_HEADER;
  1730.  
  1731. function
  1732. compress#5,1    =compress_error   FILENAME=(infile) FILENAME=(outfile) file_format compress_type check_type :
  1733.     d0=>$0 a0<=$1 a1<=$2 d0<=$3 d1<=$4 d2<=$5;
  1734.  
  1735. filecopy#13,13    =compress_error   FILENAME=(infile) FILENAME=(outfile) :
  1736.     d0=>$0 a0<=$1 a1<=$2 ;
  1737.  
  1738.  
  1739. //timeline support
  1740.  
  1741. enumrange
  1742.     tlid 1 50 ;
  1743.  
  1744.     tlcontrolcode 0 5 start pause restart reset single_step resume ;
  1745.  
  1746. enum
  1747.     tlseekmode absolute relative ;
  1748.  
  1749. command
  1750. add_timeline#15,1        tlid boolean=(manualstart) boolean=(looped) timeline : d0<=$1 d1<=$2 d2<=$3 a0<=$4 ;
  1751. remove_timeline#15,2    tlid : d0<=$1 ;
  1752.  
  1753. timeline_control#15,3    tlid tlcontrolcode : d0<=$1 d1<=$2 ;
  1754. timeline_delay#15,4        tlid float=(delay) : d0<=$1 d2<=$2 ;
  1755. timeline_seek#15,5        tlid tlseekmode float=(offset) : d0<=$1 d1<=$2 d2<=$3 ;
  1756.  
  1757. timeline_timer#15,6        posint=(interval) posint=(stepsize) : d0<=$1 d1<=$2 ;        //interval and stepsize in ms
  1758. all_timelines#15,7        tlcontrolcode  : d0<=$1 ;
  1759. all_timelines_delay#15,8 float=(delay) : d2<=$1 ;
  1760.  
  1761.  
  1762.  
  1763. // Direct X interface
  1764.  
  1765. private  GUID ;
  1766.  
  1767. //enumrange dpid 0 32767 ;
  1768.  
  1769. enum
  1770. DirectPlayError
  1771.  DP_OK                     
  1772.  DPERR_ALREADYINITIALIZED  
  1773.  DPERR_ACCESSDENIED        
  1774.  DPERR_ACTIVEPLAYERS       
  1775.  DPERR_BUFFERTOOSMALL      
  1776.  DPERR_CANTADDPLAYER       
  1777.  DPERR_CANTCREATEGROUP     
  1778.  DPERR_CANTCREATEPLAYER    
  1779.  DPERR_CANTCREATESESSION   
  1780.  DPERR_CAPSNOTAVAILABLEYET 
  1781.  DPERR_EXCEPTION           
  1782.  DPERR_GENERIC             
  1783.  
  1784.  DPERR_INVALIDFLAGS        
  1785.  DPERR_INVALIDOBJECT       
  1786.  DPERR_INVALIDPARAM        
  1787.  DPERR_INVALIDPARAMS       
  1788.  DPERR_INVALIDPLAYER       
  1789.  DPERR_NOCAPS              
  1790.  DPERR_NOCONNECTION        
  1791.  DPERR_NOMEMORY            
  1792.  DPERR_OUTOFMEMORY         
  1793.  DPERR_NOMESSAGES          
  1794.  DPERR_NONAMESERVERFOUND   
  1795.  DPERR_NOPLAYERS           
  1796.  DPERR_NOSESSIONS          
  1797.  DPERR_SENDTOOBIG          
  1798.  DPERR_TIMEOUT             
  1799.  DPERR_UNAVAILABLE         
  1800.  DPERR_UNSUPPORTED         
  1801.  DPERR_BUSY                
  1802.  DPERR_USERCANCEL          
  1803.  DPERR_NOINTERFACE            
  1804.  DPERR_CANNOTCREATESERVER    
  1805.  DPERR_PLAYERLOST            
  1806.  DPERR_SESSIONLOST            
  1807.  DPERR_BUFFERTOOLARGE       
  1808.  DPERR_CANTCREATEPROCESS    
  1809.  DPERR_APPNOTSTARTED        
  1810.  DPERR_INVALIDINTERFACE     
  1811.  DPERR_NOSERVICEPROVIDER    
  1812.  DPERR_UNKNOWNAPPLICATION   
  1813.  DPERR_NOTLOBBIED           ;
  1814.  
  1815.  
  1816. enumrange
  1817. DPSendFlags 0 31 
  1818.     DPSEND_GUARANTEED   =1
  1819.     DPSEND_HIGHPRIORITY =2
  1820.     DPSEND_OPENSTREAM    =8
  1821.     DPSEND_CLOSESTREAM    =16 ;
  1822.  
  1823. DPCapsFlags 0 127
  1824.     DPCAPS_ISHOST            =2
  1825.     DPCAPS_GROUPOPTIMIZED    =8
  1826.     DPCAPS_KEEPALIVEOPTIMIZED    =%X10
  1827.     DPCAPS_GUARANTEEDOPTIMIZED    =%X20
  1828.     DPCAPS_GUARANTEEDSUPPORTED    =%X40 ;
  1829.  
  1830. DPEnumFlags 0 3
  1831.     DPENUMSESSIONS_AVAILABLE =1
  1832.     DPENUMSESSIONS_ALL       =2    ;
  1833.  
  1834. DPESCFlags 0 1
  1835.     DPESC_TIMEDOUT =1;
  1836.  
  1837. DPEnumPlayerFlags 0 %xff
  1838.     DPENUMPLAYERS_ALL       = %x00
  1839.     DPENUMPLAYERS_LOCAL     = %x08
  1840.     DPENUMPLAYERS_REMOTE    = %x10
  1841.     DPENUMPLAYERS_GROUP     = %x20
  1842.     DPENUMPLAYERS_SESSION   = %x80 ;
  1843.  
  1844. DPGetCapsFlags 0 1
  1845.     DPGETCAPS_GUARANTEED    =1 ;
  1846.  
  1847. DPGetFlags 0 1
  1848.     DPGET_REMOTE        =0
  1849.     DPGET_LOCAL            =1 ;
  1850.  
  1851. DPSetFlags 0 3
  1852.     DPSET_REMOTE        =0
  1853.     DPSET_LOCAL            =1
  1854.     DPSET_GUARANTEED    =2 ;
  1855.  
  1856. enum
  1857. DPSYSMESS
  1858.     DPSYS_CREATEPLAYER
  1859.     DPSYS_DELETEPLAYER
  1860.     DPSYS_CREATEGROUP
  1861.     DPSYS_DELETEGROUP
  1862.     DPSYS_ADDPLAYERTOGROUP
  1863.     DPSYS_DELETEPLAYERFROMGROUP
  1864.     DPSYS_SETPLAYERDATA
  1865.     DPSYS_SETGROUPDATA
  1866.     DPSYS_SETPLAYERNAME
  1867.     DPSYS_SETGROUPNAME
  1868.     DPSYS_HOST
  1869.     DPSYS_SESSIONLOST ;
  1870.  
  1871. enumrange
  1872. DPOPENFLAGS 0 255
  1873.     DPSESSION_NEWPLAYERSDISABLED=1
  1874.     DPSESSION_MIGRATEHOST=4
  1875.     DPSESSION_NOMESSAGEID=8
  1876.     DPSESSION_JOINDISABLED=%X20
  1877.     DPSESSION_KEEPALIVE=%X40
  1878.     DPSESSION_NODATAMESSAGES=%X80 ;
  1879.  
  1880.  
  1881. function
  1882.  
  1883. DPCreate#17,1=DirectPlayError    GUID : d0=>$0 a0<=$1 ;
  1884.  
  1885. DPEnumerate#17,2=DirectPlayError    GUID string BOOL*2 BOOL : d4=>$0 a0!>$1 a1!>$2 d0!>$3 d1!>$4 a4<!$5 ;
  1886.  
  1887. DPAddPlayerToGroup#17,3=DirectPlayError    BOOL=(group) BOOL=(player)    : d0=>$0 d1<=$1 d2<=$2;
  1888.  
  1889. DPClose#17,4=DirectPlayError : d0=>$0;
  1890.  
  1891. DPCreateGroup#17,5=DirectPlayError BOOL string=(friendly) string=(formal) : d0=>$0 d1=>$1 a0<=$2 a1<=$3 ;
  1892.  
  1893. DPCreatePlayer#17,6=DirectPlayError BOOL string=(friendly) string=(formal) : d0=>$0 d1=>$1 a0<=$2 a1<=$3 ;
  1894.  
  1895. DPDeletePlayerFromGroup#17,7=DirectPlayError BOOL=(group) BOOL=(player) : d0=>$0 d1<=$1 d2<=$2 ;
  1896.  
  1897. DPDestroyGroup#17,8=DirectPlayError BOOL=(group) : d0=>$0 d1<=$1 ;
  1898.  
  1899. DPDestroyPlayer#17,9=DirectPlayError BOOL=(player) : d0=>$0 d1<=$1 ;
  1900.  
  1901. //DPEnableNewPlayers#17,10=DirectPlayError boolean : d0=>$0 d0<=$1 ;
  1902.  
  1903. DPEnumGroupPlayers#17,11=DirectPlayError BOOL=(group) guid=(session) DPEnumPlayerFlags BOOL=(player) string=(friendly) string=(formal) BOOL :
  1904.                             d4=>$0       d5<=$1       a5<=$2         d6<=$3            d0!>$4        a0!>$5            a1!>$6          a4<!$7 ;
  1905.  
  1906. DPEnumGroups#17,12=DirectPlayError       guid=(session) DPEnumPlayerFlags BOOL=(player) string=(friendly) string=(formal) BOOL :
  1907.                             d4=>$0      a5<=$1         d6<=$2            d0!>$3          a0!>$4            a1!>$5           a4<!$6 ;
  1908.  
  1909. DPEnumPlayers#17,13=DirectPlayError      guid=(session) DPEnumPlayerFlags BOOL=(player) string=(friendly) string=(formal) BOOL :
  1910.                             d4=>$0      a5<=$1         d6<=$2            d0!>$3          a0!>$4            a1!>$5           a4<!$6 ;
  1911.  
  1912. DPEnumSessions#17,14=DirectPlayError
  1913.         string=(strguid) string=(password) DPEnumFlags int=(timeout) 
  1914.         guid string=(session_name) int[8] DPESCflags BOOL :
  1915.  
  1916.         d4=>$0 a5<=$1 a6<=$2 d5<=$3 d6<=$4 a0!>$5 a1!>$6 a2<!>$7 d0!>$8 a4<!$9 ;
  1917.  
  1918. //DPGetMessageCount=DirectPlayError BOOL int : 
  1919. //        d0=>$0 d1<=$1 d2=>$2 ;
  1920.  
  1921. DPGetPlayerCaps#17,15=DirectPlayError BOOL int[9] DPGetCapsFlags : d0=>$0 d1<=$1 a0<=>$2 d2<=$3 ;
  1922.  
  1923. DPGetCaps#17,16=DirectPlayError int[9] DPGetCapsFlags : d0=>$0 a0<=>$1 d1<=$2 ;
  1924.  
  1925. DPGetPlayerName#17,17=DirectPlayError BOOL string=(friendly) string=(formal) : d0=>$0 d1<=$1 a0=>$2 a1=>$3 ;
  1926.  
  1927. DPGetGroupName#17,26=DirectPlayError BOOL string=(friendly) string=(formal) : d0=>$0 d1<=$1 a0=>$2 a1=>$3 ;
  1928.  
  1929. DPOpenExistingSession#17,18=DirectPlayError guid string=(password) : d0=>$0 a0<=$1 a1<=$2 ;
  1930.  
  1931. DPCreateNewSession#17,19=DirectPlayError string=(strguid) string=(password) int=(maxplayers) string=(name) DPOPENFLAGS int>=4
  1932.                             : d0=>$0     a0<=$1           a1<=$2            d1<=$3           a2<=$4        d2<=$5      a4<=$6 ;
  1933.  
  1934. DPSend#17,20=DirectPlayError BOOL=(dpidfrom) BOOL=(dpidto) DPSendFlags string : //RwMemory structure
  1935.                 d0=>$0 d1<=$1           d2<=$2         d3<=$3       a0<=$4 ;
  1936. //DPSend#17,20=DirectPlayError BOOL=(dpidfrom) BOOL=(dpidto) DPSendFlags memory : //RwMemory structure
  1937. //                d0=>$0 d1<=$1           d2<=$2         d3<=$3       a0<=$4 ;
  1938.  
  1939. DPSetPlayerName#17,21=DirectPlayError BOOL string=(friendly) string=(formal) DPSetFlags : d0=>$0 d1<=$1 a0<=$2 a1<=$3 d2<=$4 ;
  1940.  
  1941. DPSetGroupName#17,27=DirectPlayError  BOOL string=(friendly) string=(formal) DPSetFlags : d0=>$0 d1<=$1 a0<=$2 a1<=$3 d2<=$4 ;
  1942.  
  1943. DPlayErrorString#17,22=string int : a0=>$0 d0<=$1 ;
  1944.  
  1945. command
  1946. //only works within the DPEnumSessionsCallback
  1947. ResetEnumSessionsTimeout#17,23 int : d0<=$1 ;
  1948.  
  1949.  
  1950.  
  1951. //Event handlers
  1952.  
  1953. on_directplay_sysevent#17,24 DPSYSMESS=(etype) BOOL=(player) BOOL=(extra) scriptref :
  1954.                              d0!>$1            d1!>$2        d2!>$3      a4<=$4 ;
  1955.  
  1956. on_directplay_userevent#17,25 BOOL=(fromdpid) BOOL=(todpid) string=(message) scriptref :
  1957.                               d0!>$1          d1!>$2        a0!>$3           a4<=$4 ;
  1958.  
  1959.  
  1960. off_directplay_sysevent#17,24 : a0<=0 ;
  1961.  
  1962. off_directplay_userevent#17,25 : a0<=0 ;
  1963.  
  1964.  
  1965.  
  1966.  
  1967. //client/server functions
  1968.  
  1969. enumrange WinSockError 10000 11004
  1970.  
  1971. // All Windows Sockets error constants are biased by WSABASEERR from the "normal" (WSABASEERR = 10000)
  1972. // Windows Sockets definitions of regular Microsoft C error constants
  1973.  
  1974.  WSAEINTR                =10004
  1975.  WSAEBADF                =10009
  1976.  WSAEACCES               =10013
  1977.  WSAEFAULT               =10014
  1978.  WSAEINVAL               =10022
  1979.  WSAEMFILE               =10024
  1980.  WSAEWOULDBLOCK          =10035
  1981.  WSAEINPROGRESS          =10036
  1982.  WSAEALREADY             =10037
  1983.  WSAENOTSOCK             =10038
  1984.  WSAEDESTADDRREQ         =10039
  1985.  WSAEMSGSIZE             =10040
  1986.  WSAEPROTOTYPE           =10041
  1987.  WSAENOPROTOOPT          =10042
  1988.  WSAEPROTONOSUPPORT      =10043
  1989.  WSAESOCKTNOSUPPORT      =10044
  1990.  WSAEOPNOTSUPP           =10045
  1991.  WSAEPFNOSUPPORT         =10046
  1992.  WSAEAFNOSUPPORT         =10047
  1993.  WSAEADDRINUSE           =10048
  1994.  WSAEADDRNOTAVAIL        =10049
  1995.  WSAENETDOWN             =10050
  1996.  WSAENETUNREACH          =10051
  1997.  WSAENETRESET            =10052
  1998.  WSAECONNABORTED         =10053
  1999.  WSAECONNRESET           =10054
  2000.  WSAENOBUFS              =10055
  2001.  WSAEISCONN              =10056
  2002.  WSAENOTCONN             =10057
  2003.  WSAESHUTDOWN            =10058
  2004.  WSAETOOMANYREFS         =10059
  2005.  WSAETIMEDOUT            =10060
  2006.  WSAECONNREFUSED         =10061
  2007.  WSAELOOP                =10062
  2008.  WSAENAMETOOLONG         =10063
  2009.  WSAEHOSTDOWN            =10064
  2010.  WSAEHOSTUNREACH         =10065
  2011.  WSAENOTEMPTY            =10066
  2012.  WSAEPROCLIM             =10067
  2013.  WSAEUSERS               =10068
  2014.  WSAEDQUOT               =10069
  2015.  WSAESTALE               =10070
  2016.  WSAEREMOTE              =10071
  2017.  WSASYSNOTREADY          =10091
  2018.  WSAVERNOTSUPPORTED      =10092
  2019.  WSANOTINITIALISED       =10093
  2020.  
  2021.  WSAEDISCON              =10101
  2022.  WSAHOST_NOT_FOUND       =11001
  2023.  WSATRY_AGAIN            =11002
  2024.  WSANO_RECOVERY          =11003
  2025.  WSANO_DATA              =11004
  2026.  WSANO_ADDRESS           =11004
  2027.  
  2028. ;
  2029.  
  2030. enumrange
  2031. TCPChannel 0 10;
  2032. ServerConnection 0 100;
  2033. TCPPort 0 32767;
  2034.  
  2035. DGChannel  0 10;
  2036. DGPort  0 32767;
  2037.  
  2038.  
  2039. //TCP functions
  2040.  
  2041. function
  2042. TCPGetHostByAddr#10,1 = WinSockError string=(addr) string=(name)    : d0=>$0 a0<=$1 a1=>$2 ;
  2043. TCPGetHostByName#10,2 = WinSockError string=(name) string=(addr)    : d0=>$0 a0<=$1 a1=>$2 ;
  2044. TCPGetHost#10,3          = WinSockError string=(name) string=(addr)    : d0=>$0 a0=>$1 a1=>$2 ;
  2045.  
  2046. function
  2047. CreateTCPServer#10,4 =WinSockError TCPPort ServerConnection=(limit) TCPChannel        : d0=>$0 d1<=$1 d2<=$2 d3=>$3 d4<=1 ;
  2048. CreateTCPClient#10,5 =WinSockError filename=(host) TCPPort TCPChannel                : d0=>$0 a0<=$1 d1<=$2 d3=>$3 d4<=1 ;
  2049.  
  2050. CreateTCPStreamServer#10,4 =WinSockError TCPPort ServerConnection=(limit) TCPChannel: d0=>$0 d1<=$1 d2<=$2 d3=>$3 d4<=0 ;
  2051. CreateTCPStreamClient#10,5 =WinSockError filename=(host) TCPPort TCPChannel            : d0=>$0 a0<=$1 d1<=$2 d3=>$3 d4<=0 ;
  2052.  
  2053. TCPSendToClient#10,6 =WinSockError TCPChannel ServerConnection string=(message)        : d0=>$0 d1<=$1 d2<=$2 a0<=$3 ;
  2054. TCPSendToServer#10,7 =WinSockError TCPChannel string=(message)                        : d0=>$0 d1<=$1 a0<=$2 ;
  2055.  
  2056. TCPSendToAllClients#10,20 =WinSockError TCPChannel string=(message)    : d0=>$0 d1<=$1 a0<=$2 ;
  2057.  
  2058. TCPReadFromClient#10,8 =WinSockError TCPChannel ServerConnection string=(message) int=(length)    : d0=>$0 d1<=$1 d2<=$2 a0=>$3 d3=>$4 ;
  2059. TCPReadFromServer#10,9 =WinSockError TCPChannel string=(message) int=(length)                    : d0=>$0 d1<=$1        a0=>$2 d3=>$3 ;
  2060.  
  2061. CloseTCPServerConnection#10,10 =WinSockError TCPChannel ServerConnection            : d0=>$0 d1<=$1 d2<=$2 ;
  2062.  
  2063. CloseTCPServer#10,11  =WinSockError TCPChannel : d0=>$0 d1<=$1 ;
  2064. CloseTCPClient#10,19  =WinSockError TCPChannel : d0=>$0 d1<=$1 ;
  2065.  
  2066.  
  2067. CreateDGServer#10,12 =WinSockError DGPort DGChannel                    : d0=>$0 d1<=$1 d3=>$2 ;
  2068. CreateDGClient#10,13 =WinSockError filename=(host) DGPort DGChannel    : d0=>$0 a0<=$1 d1<=$2 d3=>$3 ;
  2069.  
  2070. DGSendToClient#10,14 =WinSockError DGChannel filename=(host) DGPort string=(message)    : d0=>$0 d1<=$1 a0<=$2 d2<=$3 a1<=$4 ;
  2071. DGSendToServer#10,15 =WinSockError DGChannel string=(message)                            : d0=>$0 d1<=$1 a0<=$2 ;
  2072.  
  2073. DGRead#10,16         =WinSockError DGChannel filename=(peer) DGPort string=(message) int=(length) : d0=>$0 d1<=$1 a0=>$2 d2=>$3 a1=>$4 d3=>$5 ;
  2074.  
  2075. CloseDGServer#10,17  =WinSockError DGChannel : d0=>$0 d1<=$1 ;
  2076. CloseDGClient#10,17  =WinSockError DGChannel : d0=>$0 d1<=$1 ;
  2077.  
  2078.  
  2079. GetSocketError#10,18 =string int : a0=>$0 d0<=$1 ;
  2080.  
  2081.  
  2082. CreateTCPServerEx#10,21 =WinSockError
  2083.     TCPPort ServerConnection=(limit) TCPChannel filename=(peer) scriptref=(AcceptHandler) scriptref=(ReceiveHandler)
  2084.     : d4=>$0 d5<=$1 d1<!>$2 d6=>$3 a0!>$4 a4<=$5 a5<=$6 d3<=1 ;
  2085.  
  2086. CreateTCPClientEx#10,22 =WinSockError
  2087.     filename=(host) TCPPort TCPChannel boolean=(connected) scriptref=(ConnectHandler) scriptref=(ReceiveHandler)
  2088.     : d4=>$0 a0<=$1 d5<=$2  d6=>$3 d1!>$4 a4<=$5 a5<=$6 d3<=1 ;
  2089.  
  2090. CreateTCPStreamServerEx#10,21 =WinSockError
  2091.     TCPPort ServerConnection=(limit) TCPChannel filename=(peer) scriptref=(AcceptHandler) scriptref=(ReceiveHandler)
  2092.     : d4=>$0 d5<=$1 d1<!>$2 d6=>$3 a0!>$4 a4<=$5 a5<=$6 d3<=0 ;
  2093.  
  2094. CreateTCPStreamClientEx#10,22 =WinSockError
  2095.     filename=(host) TCPPort TCPChannel boolean=(connected) scriptref=(ConnectHandler) scriptref=(ReceiveHandler)
  2096.     : d4=>$0 a0<=$1 d5<=$2  d6=>$3 d1!>$4 a4<=$5 a5<=$6 d3<=0 ;
  2097.  
  2098. CreateDGServerEx#10,23 =WinSockError DGPort DGChannel    scriptref=(ReceiveHandler)                    : d0=>$0 d1<=$1 d3=>$2 a0<=$3 ;
  2099. CreateDGClientEx#10,24 =WinSockError filename=(host) DGPort DGChannel    scriptref=(ReceiveHandler)    : d0=>$0 a0<=$1 d1<=$2 d3=>$3 a1<=$4 ;
  2100.  
  2101.  
  2102. //event handlers
  2103.  
  2104. command
  2105. //d4 is the internal event number, a4 is the handler
  2106. //d0 is Channel d1 is ServerConnection
  2107. //d2 is WinSockError a0 is peer
  2108.  
  2109. OnTCPAccept#10,25    TCPChannel ServerConnection filename=(peer) scriptref    : d4<=0 d0!>$1 d1!>$2 a0!>$3 a4<=$4 ;
  2110. OnTCPConnect#10,25    TCPChannel boolean=(connected) scriptref                : d4<=1 d0!>$1 d1!>$2 a4<=$3 ;
  2111.  
  2112. OnTCPReceiveFromClient#10,25 TCPChannel ServerConnection scriptref : d4<=2 d0!>$1 d1!>$2 a4<=$3 ;
  2113. OnTCPReceiveFromServer#10,25 TCPChannel scriptref                  : d4<=3 d0!>$1        a4<=$2 ;
  2114.  
  2115. OnDGReceive#10,25        DGChannel scriptref : d4<=4 d0!>$1 a4<=$2 ;
  2116.  
  2117. OnTCPError#10,25        TCPChannel ServerConnection WinSockError scriptref    : d4<=5 d0!>$1 d1!>$2 d2!>$3 a4<=$4 ;
  2118. OnDGError#10,25            DGChannel WinSockError scriptref                    : d4<=6 d0!>$1        d2!>$2 a4<=$3 ;
  2119.  
  2120.  
  2121. OffTCPAccept#10,25                : d4<=0 a4<=0;
  2122. OffTCPConnect#10,25                : d4<=1 a4<=0;
  2123.  
  2124. OffTCPReceiveFromClient#10,25    : d4<=2 a4<=0;
  2125. OffTCPReceiveFromServer#10,25    : d4<=3 a4<=0;
  2126.  
  2127. OffDGReceive#10,25    : d4<=4 a4<=0;
  2128.  
  2129. OffTCPError#10,25    : d4<=5 a4<=0;
  2130. OffDGError#10,25    : d4<=6 a4<=0;
  2131.  
  2132.