home *** CD-ROM | disk | FTP | other *** search
/ Really Useful CD 1 / ReallyUsefulCD1.iso / extras / languages / smalltalk / _smalltalk / sources / c / armgraph < prev    next >
Encoding:
Text File  |  1989-11-18  |  1.5 KB  |  132 lines

  1. /* > c.ARMGraph */
  2.  
  3. #include <stdio.h>
  4. #include "<OSLib$Dir>.h.os"
  5. #include "<OSLib$Dir>.h.bbc"
  6.  
  7. /* useful interface routines */
  8.  
  9. void vdu(int c)
  10. {
  11.   bbc_vdu(c);
  12. }
  13.  
  14. void vduboth(int c)
  15. {
  16.   bbc_vdu(c); bbc_vdu(c >> 8);
  17. }
  18.  
  19. void mode(int m)
  20. {
  21.   vdu(22); vdu(m);
  22. }
  23.  
  24. void plot(int m, int x, int y)
  25. {
  26.   vdu(25); vdu(m); vduboth(x); vduboth(y);
  27. }
  28.  
  29. void move(int x, int y)
  30. {
  31.   plot(4, x, y);
  32. }
  33.  
  34. void moveby(int x, int y)
  35. {
  36.   plot(0, x, y);
  37. }
  38.  
  39. void draw(int x, int y)
  40. {
  41.   plot(5, x, y);
  42. }
  43.  
  44. void drawby(int x, int y)
  45. {
  46.   plot(1, x, y);
  47. }
  48.  
  49. void rectanglefill(int a, int b, int c, int d)
  50. {
  51.   move(a, b);
  52.   plot(0x61, c, d);
  53. }
  54.  
  55. void rectangle(int a, int b, int c, int d)
  56. {
  57.   move(a, b);
  58.   drawby(c, 0);
  59.   drawby(0, d);
  60.   drawby(-c, 0);
  61.   drawby(0, -d);
  62. }
  63.  
  64. void gcol(int a, int b)
  65. {
  66.   vdu(18); vdu(a); vdu(b);
  67. }
  68.  
  69. void colour(int a)
  70. {
  71.   vdu(17); vdu(a);
  72. }
  73.  
  74. void defchar(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
  75. {
  76.   vdu(23);  vdu(c); vdu(a1); vdu(a2); vdu(a3);
  77.   vdu(a4); vdu(a5); vdu(a6); vdu(a7); vdu(a8);
  78. }
  79.  
  80. void erase()
  81. {  vdu(16);
  82. }
  83.  
  84. void cont(int a, int b)
  85. { draw(a,b);
  86. }
  87.  
  88. void point(int a,int b)
  89. { plot(69,a,b);
  90. }
  91.  
  92. void circle(int a, int b, int r)
  93. { move(a,b);
  94.   plot(149,r,0);
  95. }
  96.  
  97. void arc(int a,b,c,d,e,f)
  98. {
  99. }
  100.  
  101. void space(int a,b,c,d)
  102. {
  103.   vdu(24);
  104.   vduboth(a);
  105.   vduboth(b);
  106.   vduboth(c);
  107.   vduboth(d);
  108. }
  109.  
  110. void line(int a,b,c,d)
  111. { move(a,b);
  112.   draw(c,d);
  113. }
  114.  
  115. void label(char * l)
  116. { vdu(5);
  117.   printf("%s",l);
  118.   vdu(4);
  119. }
  120.  
  121. void linemod(char *l)
  122. {
  123. }
  124.  
  125. void openpl()
  126. {
  127. }
  128.  
  129. void closepl()
  130. {
  131. }
  132.