home *** CD-ROM | disk | FTP | other *** search
/ Dream 44 / Amiga_Dream_44.iso / RiscPc / programmation / scm4e2.arc / !ArcExtsns < prev    next >
Text File  |  1994-06-20  |  5KB  |  146 lines

  1. Documentation for Acorn Archimedes extension routines
  2. -----------------------------------------------------
  3.  
  4. Preamble
  5. --------
  6. As it stands, GNU Scheme is a useful LISP type language - providing a number
  7. of useful functions for symbolic computation and functional programming.
  8. However it does not really provide many good ways of interacting with the
  9. underlying operating-system on the archimedes; thus a small set of routines
  10. were added on to provide some more fun functions - as well as allowing
  11. the user to write Scheme to perform the likes of L-systems plotting and
  12. turtle graphics moderately painlessly.
  13.  
  14.  
  15. List of functions provided
  16. --------------------------
  17. (mode <n>)                  Changes the video mode to 'n'
  18.  
  19. (vdu25 <type> <x> <y>)          Performs generalised plot command
  20.  
  21. (vdu29 <x> <y>)                  Changes the graphics origin
  22.  
  23. (graphics-origin! <x> <y>)    Ditto but a more obvious name
  24.  
  25. (text-cursor! <x> <y>)          Moves the text cursor to position x,y
  26.  
  27. (remove-cursor!)              Removes the cursors
  28.  
  29. (restore-cursor!)             Restores the cursors
  30.  
  31. (plot <type> <x> <y>)          Does as per vdu25 but via only one call to
  32.                         OS_Plot SWI
  33.  
  34. (move <x> <y>)                  Does a graphics cursor move to x,y
  35.  
  36. (point <x> <y>)                  Puts a point at x y
  37.  
  38. (circle <x> <y> <rad>)          Draws a circle of radius rad at x,y
  39.  
  40. (wait)                        Waits for the next vsync event
  41.  
  42. (gcol <a> <c>)                  Performs plotting action 'a' with colour 'c'
  43.  
  44. (cls)                        Clear text screen
  45.  
  46. (clg)                        Clear graphics screen
  47.  
  48. (text-colour! <n>)            Sets the text colour to 'n'
  49.  
  50. (fill <x> <y>)                  Flood fill from x,y - same as plot 133
  51.  
  52. (draw <x> <y>)                  Draws to x y from where you are currently
  53.  
  54. (vdu <n>)                   Does vdu n ;-)
  55.  
  56. (get)                        Waits for a keypress (handy for pausing after
  57.                         drawing has been plotted)
  58.  
  59.  
  60. All of the above are written in C and linked into the interpreter at compile
  61. time. However - due to these being fairly useful to write other routines,
  62. I've written a few other routines in scheme that provide nearly all the other
  63. graphics primitives that you might like to play with - these are present in
  64. <scm$dir>.arc_ext and are as follows :
  65.  
  66.  
  67. (paged-on)                  Switches on paged output - try using (terms)
  68.  
  69. (paged-off)                  Switches it off again
  70.  
  71. (text-window x1 y1 x2 y2)     Defines a text window
  72.  
  73. (graphics-window x1 y1 x2 y2) Defines a graphics window
  74.  
  75. (home-text-cursor)            Obvious
  76.  
  77. (default-windows)             Ditto
  78.  
  79. (default-colours)             Ditto
  80.  
  81. (move-by x y)                  Relative version of 'move'
  82.  
  83. (point-by x y)                  Relative version of 'point'
  84.  
  85. (draw-by x y)                  Relative version of 'draw'
  86.  
  87. (line x1 y2 x2 y2)            Draws a line from x1,y1 to x2,y2
  88.  
  89. (circle-fill x y rad)          Plots a filled circle at x,y of radius rad
  90.  
  91. (rectangle-fill x y w h)      Plots a filled rectangle
  92.  
  93. (rectangle x y w h)           Plots an outline rectangle
  94.  
  95.  
  96. Using the functions
  97. -------------------
  98. Ahem. Well I've included a couple of drawing demos in !Scm.scm.arc_demos;
  99. but due to my lack of graphical talent thats about it - surely someone else
  100. can knock up a few odds and ends?
  101.  
  102. If you have problems figuring out what to feed the functions as arguments 
  103. then I'd suggest picking up the Basic manual which has exactly the same
  104. primitives generally, failing that peer at the prms.
  105.  
  106.  
  107. Known problems
  108. --------------
  109. Actually. None. 
  110. (Surely some mistake? ;-)
  111. If anyone runs up against any I'd love to know (I don't think I mean that
  112. either really but never mind)...
  113. The ones I'm looking for are messages back from SCM along the line of
  114.  
  115.           #@(Bus error
  116.           
  117. results being returned from execution of function - if you can reproduce it
  118. along with a name of the function it happened in then I would be grateful of
  119. hearing of it. (I know why it does this..)
  120. There isn't a generic os_swi call that would allow you to (say) specify
  121. an integer and a list of ten numbers to pass to it.
  122. I'm considering this one - seeing as there so many possible types passable
  123. via the registers in a swi call I can see this becoming subject to the law
  124. of diminishing returns very quickly...
  125. However!
  126. If anyone wants a feature / function added then feel free to suggest away
  127. and I'll happily add it in (provided it isn't ludicrous.. - WIMP
  128. routines would be wonderful but hugely unpleasant in practice)
  129. The error checking is virtually non existant. Should do something about this
  130. really.
  131.  
  132.  
  133. Known features
  134. --------------
  135. (Not problems but never mind)
  136.  
  137. You can totally screw up your display beyond aesthetic pleasance....
  138.  
  139. (This isn't my fault - I'm only providing stuff with which to build neat
  140. graphics hacks)
  141.  
  142.  
  143. ams
  144. 13/6/94
  145.  
  146. (I'm contactable via any of the means present in the release notes)