home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / customise / texturgdn / !TexturGdn / Docs / Extensions < prev    next >
Encoding:
Text File  |  1996-10-12  |  23.3 KB  |  635 lines

  1.  
  2.                         Language Extensions
  3.                         ===================
  4.  
  5. 1.0 Introduction
  6. 2.0 The RMStore directory
  7. 3.0 Structure
  8. 4.0 Resources
  9. 5.0 Coding
  10. 6.0 Calling internal commands
  11.  
  12. 1.0 Introduction
  13. ~~~~~~~~~~~~~~~~
  14. This document describes how to write language-extensions to the texture
  15. generation language used in the Texture Garden program, reasons why you might
  16. be interested in doing this and information about installing other people's
  17. extension modules.
  18.  
  19. Commands may be included, but functions (refer to the "Language" file for the
  20. differences between these) may not currently be implemented by third parties.
  21.  
  22. Example source code using the BASIC assembler is available.  Although this
  23. code is distributed as freeware (i.e. copyright is retained) the author
  24. expresses every intention of approving use of my code where it is
  25. incorporated into modules intended for my program, so please do not hesitate
  26. to steal and butcher it; if this was objected to no source code would have
  27. been distributed.
  28.  
  29. 2.0 The RMStore directory
  30. ~~~~~~~~~~~~~~~~~~~~~~~~~
  31. This is a directory immediately inside the "!TexturGdn" directory.  The
  32. location is usually "<TextureGdn$Dir>.RMStore".  The precise location is held
  33. in the system variable <TextureGdnRMStore$Dir> which is usually set up in the
  34. !Run file.
  35.  
  36. This directory should always contain a text file called "Index".  This file
  37. has a simple format:
  38.  
  39. Any line starting with a "|" is considered to be a comment. The end of the
  40. file is marked by the "End" token. Any other lines are considered as paths
  41. from <TextureGdnRMStore$Dir> to files containing language extensions.
  42.  
  43. The file "Kernel" should always be present in the directory.  It contains all
  44. the commands implemented as the core of the language.  There may also be
  45. other files.
  46.  
  47. The files may be of any type.  Conventionally, they are "Modules"
  48. (Type &FFA).  Though they are not loaded as such by the program this enables
  49. them to conveniently contain a version number and help text.
  50.  
  51. When adding extension modules to the program the relevant file should be
  52. added to the "RMStore" directory and the twig of its path inserted into the
  53. "Index" file.
  54.  
  55. 3.0 Structure
  56. ~~~~~~~~~~~~~
  57. Language extensions should all conform to the following structure:
  58.  
  59. Bytes:        Description...
  60. &0000-&002B   Header (Undefined bytes)
  61. &002C-&XXXX   Command Table index
  62. &XXXX-&YYYY   Command Table
  63. &YYYY-&ZZZZ   Command code
  64.  
  65. The Command Table index has the following format:
  66.  
  67. Offset bytes: Description...
  68. &0000           Command index entry 0
  69. &000C          Command index entry 1
  70. &0018          Command index entry 2
  71. -             -
  72. n x &C        Command index entry n
  73. -             -
  74. &UUUU         End of table marker.
  75.  
  76. The End of table marker is represented by the three consecutive words 
  77. -1,-1 and -1.
  78.  
  79. Command index entry n consists of three words
  80.  
  81. Word 0: Offset from start of file to the text of command n.
  82. Word 1: Offset from start of file to the entry point of the code to perform
  83.         the command.
  84. Word 2: Various flags
  85.  
  86. The Various flags are considered as &ABCDEFGH where &A is the number of
  87. parameters the command accepts (0-15), &B is a code advising how the command
  88. should be treated by the mutator (the "Mutation Options"), and &CDEFGH
  89. contain other miscellaneous bit-flags to mark specific command types.
  90.  
  91. These bit-flags have the following meanings:
  92.  
  93. &000003 :                                           (Reserved)
  94. &00000C : See immediately below:
  95.      &4 : Command ends an indentation
  96.      &8 : Command starts an indentation
  97. &0000F0 :                                           (Reserved)
  98. &00FF00 : As follows:
  99.   &0C00 : Command is an "endif"                     (Reserved)
  100.   &0200 : Command starts mutation                   (Reserved)
  101.   &0300 : Command stops  mutation                   (Reserved)
  102.   &0400 : Command is a  "Define"                    (Reserved)
  103.   &0500 : Command is a  "Goto"                      (Reserved)
  104.   &0600 : Command is a  "Call"                      (Reserved)
  105.   &0700 : Command is a  "Return"                    (Reserved)
  106.   &0800 : Command is an "End"                         (Reserved)
  107.   &0900 : Command is an "If"                         (Reserved)
  108.   &0A00 : Command is an "Then"                      (Reserved)
  109.   &0B00 : Command is an "Else"                      (Reserved)
  110.   &0100 : Command is a  "comment" ("|")             (Reserved)
  111.   &0D00 : Command ends the colour definition        (Reserved)
  112.   &0E00 : Command starts the colour definition      (Reserved)
  113.   &0F00 : Command is a  "CreateOneDiensionalFilter" (Reserved)
  114.   &1000 : Command is a  "CreateTwoDiensionalFilter" (Reserved)
  115.   &1100 : Command is an "Until"                     (Reserved)
  116.   &1200 : Command is a  "Resize"                    (Reserved)
  117.   &1300 : Command is a  "ResizeSprite"              (Reserved)
  118.   &1400 : Command is a  "MakeSprite"                (Reserved)
  119.   &1500 : Command is an "AddToSprite"               (Reserved)
  120.   &1600 : Command is a  "MakeVirtualSprite"         (Reserved)
  121.   &1700 - &FF00 For expansion                       (Reserved)
  122. &FF0000 : Bits all for expansion and must be zero   (Reserved)
  123.  
  124. "Reserved" means that most users should not need to mess with it.
  125.  
  126. The "Command Table" contains the entries pointed to by word 0 of the Command
  127. index entry.  These are mixed case strings terminated by a single ASCII 13
  128. character.  They need not be word aligned.
  129.  
  130. The "Command code" contains the code pointed to by word 1 of the Command
  131. index entry.  These are ARM code subroutines called at the appropriate moment
  132. in the generation of the textures.  Any workspace may also be stored here,
  133. rather than claimed from the system, if it is small enough.  The location of
  134. the "Command code" relative to the "Command table" is arbitrary.
  135.  
  136. Mutation Options
  137. ~~~~~~~~~~~~~~~~
  138. This specifies how any following parameters are treated by the mutator.
  139. 0 - Completely ignore.
  140. 1 - Treat as unsigned 16-bit logarithmic number (reserved for functions)
  141. 2 - Very occasionally add or subtract one (used for "Shear")
  142. 3 - Occasionally completely randomize (used for "Seed")
  143. 4 - Treat as unsigned 16-bit logarithmic number
  144. 5 - Reserved...
  145.  
  146. 4.0 Resources
  147. ~~~~~~~~~~~~~
  148. When a code fragment is called in the generation of a texture it may interact
  149. with the main program and share its data in a number of ways.
  150.  
  151. On entry to the routine the following register conventions are used:
  152.  
  153. R14 - return address
  154. R13 - system stack
  155. R12 - pointer to Texture Garden main data structure
  156. R11 - pointer to current point in texture program execution
  157.  
  158. On exit R0 - R10, R12 and R14 may be corrupted.  R11 should normally be
  159. incremented to the start of the next expected command.  R13 should normally
  160. be preserved in the normal manner.
  161.  
  162. R11 contains a pointer to the next item in the texture program's execution.
  163. This will always be the next item after the code representing the currently
  164. called command.  Note that the program is not held internally as a textfile,
  165. but in an internal format.
  166.  
  167. Each command, parameter or function is coded for by one word.  Parameters are
  168. coded for by their values.  Commands and functions are coded bu an internal
  169. number, the complete details of which are not specified, but which always has
  170. bit 31 set.  The end of the file is coded as -1.  This need not normally be
  171. checked for.
  172.  
  173. R12 contains a pointer to a data structure which has the following structure:
  174.  
  175. Brief list:
  176.  
  177. Routines
  178. ~~~~~~~~
  179. &0000 : TG_getrnd - routine returning 32bit random number in R3
  180. &0004 : TG_getrnd2 - routine returning 32bit random number in R3
  181. &0008 : TG_getparameter - routine returning the value of the next parameter
  182. &000C : TG_cstable - location of sin and cosine table.
  183. &0010 : TG_astable - location of arcsin table.
  184. &0014 : TG_forstac - location of stack of for addresses
  185. &0018 : TG_forcoun - location of stack of for addresses
  186. &001C : TG_itisthecodebank - location of 16 words of ARM code for "Combine"
  187. &0020 : TG_onedimensionalfixsta - routine to start one-dimensional routines
  188. &0024 : TG_onedimensionalfixend - routine to end one-dimensional routines
  189. &0028 : TG_colourconversion - routine to perform conversion from 24-bit
  190. &002C : TG_mcheap_get - allocate memory from heap
  191. &0030 : TG_mcheap_release - deallocate memory in heap
  192. &0034 : TG_reporterror - routine to report texture errors to the user
  193. &0038 : TG_executesinglecommand - Single command execution routine
  194. &003C : TG_convertcommandname - Converts pointer to command name
  195. &0040 : TG_miscop - perform a variety of operations.
  196. &0044 : Reserved
  197.  
  198. Data
  199. ~~~~
  200. &0048 : TG_mainworkspaceaddress - the two-dimensional buffer
  201. &004C : TG_totalsize - the size of the two-dimensional buffer
  202. &0050 : TG_totalsizeminusone - the size of the two-dimensional buffer - 1
  203. &0054 : TG_powertwo - Log to the base two of the size of the main buffer
  204. &0058 : TG_powertwo_1D - Log to the base two of the 1D buffer size (10).
  205. &005C : TG_dat - temp storage
  206. &0060 : TG_stack_temp - temp storage
  207. &0064 : TG_cnd - temp storage
  208. &0068 : TG_scrapaddress - address of a temp storage bank
  209. &006C : TG_actualphase - Current phase to be used in FFTs
  210. &0070 : TG_actualnoise - Amplitude of noise to be filtered
  211. &0074 : TG_cosamag - Cosine artefacts magnitude
  212. &0078 : TG_sinamag - Sine artefacts magnitude
  213. &007C : TG_precultflags - flags for FFT
  214. &0080 : TG_tempb - temp storage
  215. &0084 : TG_tempb2 - temp storage
  216. &0088 : TG_onedeebuffertwo - the secondary two-dimensional buffer
  217. &008C : TG_onedeebufferone - the primary two-dimensional buffer
  218. &0090 : TG_onedeebuffer - the two-dimensional buffer
  219. &0094 : TG_forcntr - the depth of the current for nesting
  220. &0098 : TG_dithering - Dithering
  221. &009C : TG_ditheringOne - DitheringOne
  222. &00A0 : TG_ditheringTwo - DitheringTwo
  223. &00A4 : TG_resultoftestpar - internal communications
  224. &00A8 : TG_resultoftestparP4 - internal communications
  225. &00AC : TG_seed - Seed (Low word)
  226. &00B0 : TG_seedP4 - Seed (High word)
  227. &00B4 : TG_seedTwo - Seed Two (Low word)
  228. &00B8 : TG_seedTwoP4 - Seed Two (High word)
  229. &00BC : TG_aframesmem% - Number of current animation frame
  230. &00C0 : TG_aframetype% - Address of table of 1024 nibbles animation type
  231. &00C4 : TG_areweanimating - Flag
  232. &00C8 : TG_blockmem% - address of a temp storage bank
  233. &00CC : TG_block2mem% - address of a temp storage bank
  234. &00D0 : TG_spriteaddress - address of the current sprite
  235. &00D4 : TG_spritearea - address of the main sprite area
  236. &00D8 : TG_spritepaladdress - address of the current palette sprite
  237. &00DC : TG_spriteXoriginal - used in resizing sprite
  238. &00E0 : TG_spriteYoriginal - used in resizing sprite
  239. &00E4 : TG_spriteXactual - used in resizing sprite
  240. &00E8 : TG_spriteYactual - used in resizing sprite
  241. &00EC : TG_modenumber - Number of current mode
  242. &00F0 : TG_log2BPP - Log to the base two of the number of bits per pixel
  243. &00F4 : TG_XEigenFactor - The X Eigen Factor of the mode
  244. &00F8 : TG_YEigenFactor - The Y Eigen Factor of the mode
  245. &00FC : TG_cmd_ifmem - Number to detect "If"s with
  246. &0100 : TG_cmd_elsemem - Number to detect "Else"s with
  247. &0104 : TG_cmd_endifmem - Number to detect "Endif"s with
  248. &0108 : TG_cmd_define - Number to detect "Define"s with
  249. &010C : TG_cmd_ifyetq - Flag to detect if there has been an if on the line
  250. &0110 : TG_colourmapcorrupt - Set if TG_colourconversion has been called
  251. &0114 : TG_AddressOfSolidBlock - Address of last DefineSolidBlock command
  252. &0118 : TG_memorystoreone - Address of claimed memory to be released
  253. &011C : TG_memorystoretwo - Address of claimed memory to be released
  254. &0120 : TG_FirstDefinition - zero of address of first "Define" command
  255. &0124 : TG_CallStackMem - Not used
  256. &0128 : TG_customresize - Set if resizing is not done with "ResizeSprite"
  257.  
  258. Those "Routines" in the above list which may be called can be reached by
  259. using the following code:
  260.  
  261. MOV    R14,PC
  262. LDR    PC,[R12,#TG_routineoffset]
  263.  
  264. In the examples this is a macro called "calltg".
  265.  
  266. Descriptive list:
  267.  
  268. Routines
  269. ~~~~~~~~
  270. TG_getrnd (&0000)
  271.   Entry : none
  272.   Exit  : corrupts R4 returns 32bit random number in R3.
  273.  
  274. TG_getrnd2 (&0004)
  275.   Entry : none
  276.   Exit  : corrupts R0 returns 32bit random number in R3.
  277.   Notes : This command uses a different seed to the one above.
  278.  
  279. TG_getparameter (&0008)
  280.   Entry : R11 points to current mark in program.
  281.   Exit  : R10 returns the value of the next parameter.
  282.           R11 updated to point to next point in program.
  283.  
  284. TG_cstable (&000C)
  285. Location of sin and cosine table.  2048 words, format as follows:
  286.   Word0    : Cosine(2*PI/1024 x 0) x 2^15
  287.   Word1    :   Sine(2*PI/1024 x 0) x 2^15
  288.   Word2    : Cosine(2*PI/1024 x 1) x 2^15
  289.   Word3    :   Sine(2*PI/1024 x 1) x 2^15
  290.   Word4    : Cosine(2*PI/1024 x 2) x 2^15
  291.   Word5    :   Sine(2*PI/1024 x 2) x 2^15
  292.   ...      : ...
  293.   Word2046 : Cosine(2*PI/1024 x 1023) x 2^15
  294.   Word2047 :   Sine(2*PI/1024 x 1023) x 2^15
  295.  
  296. TG_astable (&0010)
  297.   Arcsin table.  256 bytes.
  298.  
  299. TG_forstac (&0014)
  300.   Location of stack of for addresses.
  301.  
  302. TG_forcoun (&0018)
  303.   Location of stack of for addresses.
  304.  
  305. TG_itisthecodebank (&001C)
  306.   Location of 16 words of ARM code for "Combine"
  307.   The words are as follows:
  308.  
  309.     &0 : CMP   A,#&10000
  310.     &1 : MOVS  A,A,LSR #16
  311.     &2 : MOVS  A,A,LSL #16
  312.     &3 : EorS  A,A,#&8000
  313.     &4 : ADDS  A,A,9
  314.     &5 : CMP   A,9
  315.     &6 : SUBS  A,A,9
  316.     &7 : MOVCS A,#&10000
  317.     &8 : RSBCS A,A,#&20000
  318.     &9 : RSBMI A,A,#&0
  319.     &A : MOVMI A,#&0
  320.     &B : MOVCC A,9
  321.     &C : MOVCS A,9
  322.     &D : SUBCS A,A,#1
  323.     &E : MOVS  A,A,LSR #1
  324.     &F : MULS  A,9,A
  325.  
  326. TG_onedimensionalfixsta (&0020)
  327.   Routine to start one-dimensional routines.
  328.  
  329. TG_onedimensionalfixend (&0024)
  330.   Routine to end one-dimensional routines.
  331.  
  332. TG_colourconversion (&0028)
  333.   Routine to perform conversion of the palette from 24-bit colour in the
  334.   format &RRGGBBXX to a series of bytes representing the colour number of
  335.   the colour for the mode.
  336.  
  337. TG_mcheap_get (&002C)
  338.   This allocates memory from Texture Garden's heap
  339.   Entry : R0 contains number of bytes requested.
  340.   Exit  : R0 : 0 (an error has occurred (V is also set), or...
  341.           R0 : contains a pointer to the memory.
  342.           R1 - R7 corrupted.
  343.  
  344.   Note: this routine returns an error by setting the V flag and setting R0
  345.         to 0.
  346.  
  347. TG_mcheap_release (&0030) 
  348.   This deallocates memory which has been previously allocated from Texture
  349.   Garden's heap.
  350.   Entry : R0 contains a pointer to the memory.
  351.   Exit  : R0 : 0 : an error has occurred (V is also set), or...
  352.           R0 : 1 : sucessful.
  353.           R1 - R7 corrupted.
  354.  
  355.   Note: this routine returns an error by setting the V flag and setting R0
  356.         to 0.
  357.  
  358. TG_reporterror (&0034)
  359.   Entry : R0 points to the error string
  360.   Exit  : *** This routine does not return ***
  361.  
  362. TG_executesinglecommand (&0038) - Single command execution routine.
  363.   Entry : R11 points to the command to be executed.
  364.   Exit  : R0 - R10 and R12 are corrupted.  R11 points to immediately after
  365.           the command.
  366.  
  367. TG_convertcommandname (&003C) - Converts pointer to command name.
  368.   Entry : R0 points to the command to be converted.
  369.   Exit  : R0 contains the corresponding internal command code.
  370.  
  371. TG_miscop (&0040) - Performs a variety of miscellaneous operations.
  372.   Entry : R0 contains the reason code, see the following list:
  373.   
  374.   Entry : R0 = 0;
  375.     Allocate memory for another two dimensional buffer, if required and
  376.     return a pointer to it in R10.
  377.   Exit : R0 to R9 are corrupted.
  378.   
  379.   Entry : R0 = 1;
  380.     Allocate memory for a virtual sprite if required and return a pointer to
  381.     it in R10.
  382.   Exit : R0 to R9 are corrupted.
  383.   
  384.   All other reason codes are reserved.
  385.  
  386. 5.0 Coding
  387. ~~~~~~~~~~
  388. Example source (in the BASIC assembler) should be available in the
  389. "Library.Source.Extra" file and the "Library.Source.Kernel" file.  The latter
  390. may not be present in the distribution you have received, but should be in
  391. all registered versions.
  392.  
  393. If a command takes longer than about 0.2 seconds, then it should check the
  394. escape key at regular intervals (using an INKEY(minus) equivalent) and
  395. terminate if it is pressed.
  396.  
  397. On entry to its routine, a command usually starts by getting its relevant
  398. parameters.  These should always be checked to see if they are functions, and
  399. evaluated if this is the case.  It is recommended that the following code be
  400. used to get each one:
  401.  
  402. LDR    R10,[R11],#4
  403. TST    R10,#&80000000
  404. MOVNE  R14,PC
  405. LDRNE  PC,[R12,#TG_getparameter]
  406.  
  407. This is used so frequently that it really cries out to be a macro. 
  408. "getrecursiveparam" is its name in the examples.
  409.  
  410. The "Routine" TG_getparameter will normally preserve R0-R7, R12 and R13.  R8
  411. and R9 may be corrupted.  R10 contains the returned result of the function. 
  412. R11 is updated to point to the next word of interest.
  413.  
  414. Another command which will be used frequently relates to the implementation
  415. of the "combination type" commands.  Programmers may implement these in
  416. whatever manner they choose.  The author finds them to be best implemented
  417. using the following self-modifying code for speed, though this may cause a
  418. speed penalty for those with StrongARM chips.
  419.  
  420. In my routines, the following functions are used.
  421.  
  422. DEFFNgetaddparam(alse%)   ... corrupts R0-R3
  423. [OPT Pass%
  424.         LDR    0,[C,#TG_itisthecodebank]
  425.         ADR    1,alse%
  426.         And    2,R10,#&F
  427.         LDR    3,[0,2,ASL #2]
  428.         STR    3,[1]
  429.         MOV    R10,R10,LSR #4
  430.         And    2,R10,#&F
  431.         LDR    3,[0,2,ASL #2]
  432.         STR    3,[1,#4]
  433.         MOV    R10,R10,LSR #4
  434.         And    2,R10,#&F
  435.         LDR    3,[0,2,ASL #2]
  436.         STR    3,[1,#8]
  437.         MOV    R10,R10,LSR #4
  438.         And    2,R10,#&F
  439.         LDR    3,[0,2,ASL #2]
  440.         STR    3,[1,#12]
  441.         
  442.         MOV    0,#1
  443.         ADD    2,1,#12
  444.         SWI    &2006E ; REM XOS_SynchroniseCodeAreas
  445. ]
  446. = Pass%
  447.  
  448. DEFFNfourwords
  449. [OPT Pass%
  450.         MOV    R10,R10
  451.         MOV    R10,R10
  452.         MOV    R10,R10
  453.         MOV    R10,R10
  454. ]
  455. = Pass%
  456.  
  457. These are called as follows...
  458.  
  459. .command_entry
  460. ...
  461. OPT    FNgetrecursiveparam           ...see above
  462. OPT    FNgetaddparam(code_insertion)
  463. ...
  464. .code_insertion
  465. OPT    FNfourwords
  466. ...
  467.  
  468. The two values to be combined should be held in R9 (old) and R10 (new value)
  469. when "code_insertion" is reached.  The data table at TG_itisthecodebank
  470. contains the following pieces of code:
  471.  
  472. CMP    A,#&10000   ; 0
  473. MOVS   A,A,LSR #16 ; 1
  474. MOVS   A,A,LSL #16 ; 2
  475. EorS   A,A,#&8000  ; 3
  476. ADDS   A,A,9       ; 4
  477. CMP    A,9         ; 5
  478. SUBS   A,A,9       ; 6
  479. MOVCS  A,#&10000   ; 7
  480. RSBCS  A,A,#&20000 ; 8
  481. RSBMI  A,A,#&0     ; 9
  482. MOVMI  A,#&0       ; A
  483. MOVCC  A,9         ; B
  484. MOVCS  A,9         ; C
  485. SUBCS  A,A,#1      ; D
  486. MOVS   A,A,LSR #1  ; E
  487. MULS   A,9,A       ; F
  488.  
  489. Examination of FNgetaddparam should reveal that four values from the above
  490. table are taken according to the value of the four nibbles of the given
  491. parameter and stored at "code_insertion", least-significant nibble first.
  492.  
  493. 6.0 Calling internal commands
  494. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  495. "TG_executesinglecommand" and "TG_convertcommandname" may be used by commands
  496. to call other commands directly.  This is done in a crude manner,
  497. constructing the command in memory, and then setting the command pointer to
  498. point to it and then calling Texture Garden.
  499.  
  500. "TG_convertcommandname" should be used to convert the command name to a
  501. command code.  Commands should be stored in memory locally and followed by
  502. any parameters.  Commands may be of any case, and may be abbreviated by using
  503. the "." character (however, using this feature is very bad practise).  The
  504. current value of the command pointer (usually in R11) should then be saved,
  505. the location of the command to be executed should be loaded into R11 and
  506. "TG_executesinglecommand" should be called.  Then the command pointer should
  507. be recovered from wherever it was saved.
  508.  
  509. Note: "TG_executesinglecommand" executes one command only.  The command
  510. should not be a comment or one of "If", "Then" or "Else"; the functionality
  511. of these may be mimicked manually.
  512.  
  513. Expression evaluation may be performed using a similar method, ie. set up the
  514. expression in coded form in memory, store R11, set R11 to point to the
  515. expression, and then use FNgetrecursiveparam (or its equivalent macro - see
  516. above) to evaluate it, restoring R11 afterwards.
  517.  
  518. The only functions in Texture Garden that currently use this functionality
  519. are the "SlowRotate" commands.  These use the "TwoDimensionalPoint" function
  520. to help them with their anti-aliasing.
  521.  
  522. In principle, any commonly used subroutine may be more efficiently
  523. implemented as a hard-wired command using this technique.
  524.  
  525. Because "TG_convertcommandname" performs a slow lookup, a number of common
  526. expression evaluation functions are assigned particular code numbers.
  527.  
  528. The following command names are guaranteed to be given numbers as follows:
  529.  
  530. &80000000 - "UnknownCommand" ; please do not use.
  531. &80000001 - "Combine"
  532. &80000002 - "ScaledSignedMultiply"
  533. &80000003 - "SignedMultiply"
  534. &80000004 - "PartlyScaledSignedMultiply"
  535. &80000005 - "PartlyScaledMultiply"
  536. &80000006 - "Divide"
  537. &80000007 - "Eor"
  538. &80000008 - "And"
  539. &80000009 - "Or"
  540. &8000000A - "LogicalShiftLeft"
  541. &8000000B - "LogicalShiftRight"
  542. &8000000C - "ArithmeticShiftLeft"
  543. &8000000D - "ArithmeticShiftRight"
  544. &8000000E - "Absolute"
  545. &8000000F - "Variable"
  546. &80000010 - "Random"
  547. &80000011 - "SimpleAddition"
  548. &80000012 - "UnboundedAddition"
  549. &80000013 - "CeilingAddition"
  550. &80000014 - "HalvingAddition"
  551. &80000015 - "SimpleSubtraction"
  552. &80000016 - "UnboundedSubtraction"
  553. &80000017 - "FloorSubtraction"
  554. &80000018 - "HalvingSubtraction"
  555. &80000019 - "Maximise"
  556. &8000001A - "Minimise"
  557. &8000001B - "Overwrite"
  558. &8000001C - "PositiveOverwrite"
  559. &8000001D - "Preserve"
  560. &8000001E - "Multiplication"
  561. &8000001F - "ScaledMultiplication"
  562. &80000020 - "Zeroise"
  563. &80000021 - "True"
  564. &80000022 - "False"
  565. &80000023 - "Zero"
  566. &80000024 - "Ninety"
  567. &80000025 - "OneHundredAndEighty"
  568. &80000026 - "TwoHundredandSeventy"
  569. &80000027 - "FloydSteinberg"
  570. &80000028 - "IsLessThan"
  571. &80000029 - "IsGreaterThan"
  572. &8000002A - "IsLessThanOrEqualTo"
  573. &8000002B - "IsGreaterThanOrEqualTo"
  574. &8000002C - "SignedIsLessThan"
  575. &8000002D - "SignedIsGreaterThan"
  576. &8000002E - "SignedIsLessThanOrEqualTo"
  577. &8000002F - "SignedIsGreaterThanOrEqualTo"
  578. &80000030 - "IsEqualTo"
  579. &80000031 - "IsNotEqualTo"
  580. &80000032 - "Sin"
  581. &80000033 - "Cos"
  582. &80000034 - "SignedSin"
  583. &80000035 - "SignedCos"
  584. &80000036 - "SquareRoot"
  585. &80000037 - "Noise"
  586. &80000038 - "PinkNoise"
  587. &80000039 - "QuickNoise"
  588. &8000003A - "BandpassNoise"
  589. &8000003B - "BandpassQuickNoise"
  590. &8000003C - "FractalNoise"
  591. &8000003D - "ShiftedSymmetricNoise"
  592. &8000003E - "ShiftedSymmetricPinkNoise"
  593. &8000003F - "ShiftedNoise"
  594. &80000040 - "ShiftedPinkNoise"
  595. &80000041 - "ShiftedSymmetricQuickNoise"
  596. &80000042 - "ShiftedQuickNoise"
  597. &80000043 - "ShiftedSymmetricFractalNoise"
  598. &80000044 - "ShiftedFractalNoise"
  599. &80000045 - "TwoDimensionalPoint"
  600. &80000046 - "QuickTwoDimensionalPoint"
  601. &80000047 - "OneDimensionalPoint"
  602. &80000048 - "QuickOneDimensionalPoint"
  603. &80000049 - "OneDimensionalPointOne"
  604. &8000004A - "QuickOneDimensionalPointOne"
  605. &8000004B - "OneDimensionalPointTwo"
  606. &8000004C - "QuickOneDimensionalPointTwo"
  607. &8000004D - "X"
  608. &8000004E - "Y"
  609. &8000004F - "Z"
  610. &80000050 - "Size"
  611. &80000051 - "LogSize"
  612. &80000052 - "LogBitsPerPixel"
  613. &80000053 - "AnimationType"
  614. &80000054 - "AnimationFrameNumber"
  615.  
  616. These functions all preserve R0-R7 and return their value in R10, updating
  617. R11 according to the number of parameters they take.  They operate by
  618. evaluating their parameters recursively.
  619.  
  620. X-, Y- and Z-based functions are expecting to find their values in R2, R3 and
  621. R4 respectively, and they depend upon this for their operation.  This
  622. includes the functions from "Noise" to "ShiftedFractalNoise".  It is probably
  623. best to avoid these at the moment.
  624.  
  625. In general, different copies of Texture Garden will use different coding
  626. schemes for the numbers they assign to their commands.  It is recommended
  627. that you do not rely on the numbers given to commands other than those above
  628. as being constant.
  629.  
  630. More information relating to writing extension modes is contained in the rest
  631. of the documentation, notably the "Distribute", "Language" and "Technical"
  632. files.
  633.  
  634.  
  635.