home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff274.lzh / HP11 / amiga / chars.c < prev    next >
C/C++ Source or Header  |  1989-11-16  |  5KB  |  190 lines

  1. /* this defines the character shapes */
  2. #include "exec/types.h"
  3. #include "intuition/intuition.h"
  4.  
  5. /* First the shape of the seven segments + point & comma.
  6.   They are defined in a 14x13 box and are drawn by a series of lines.
  7.   The offsets are relative to the top left corner of this box */
  8. static WORD top[] = {
  9.    4,0,
  10.    10,0,
  11.    9,1,
  12.    5,1
  13. };
  14. static WORD ctr[] = {
  15.    4,6,
  16.    10,6,
  17.    10,7,
  18.    4,7,
  19. };
  20. static WORD bottom[] = {
  21.    5,12,
  22.    9,12,
  23.    10,13,
  24.    4,13
  25. };
  26. static WORD tl[] = {
  27.    3,1,
  28.    3,6,
  29.    4,5,
  30.    4,1
  31. };
  32. static WORD tr[] = {
  33.    11,1,
  34.    11,6,
  35.    10,5,
  36.    10,1
  37. };
  38. static WORD bl[] = {
  39.    3,7,
  40.    3,12,
  41.    4,12,
  42.    4,8
  43. };
  44. static WORD br[] = {
  45.    11,7,
  46.    11,12,
  47.    10,12,
  48.    10,8
  49. };
  50. static WORD pt[] = {
  51.    -1,12,
  52.    0,12,
  53.    0,13,
  54.    -1,13
  55. };
  56. static WORD com[] = {
  57.    0,14,
  58.    -1,14,
  59.    -1,15,
  60.    -2,15
  61. };
  62.  
  63. /* Character definitions, they are composed of the seven segments */
  64. static struct Border zero[] = {
  65. { 0, 0, 1, 2, JAM1, 4, top, &zero[1] },
  66. { 0, 0, 1, 2, JAM1, 4, tl, &zero[2] },
  67. { 0, 0, 1, 2, JAM1, 4, tr, &zero[3] },
  68. { 0, 0, 1, 2, JAM1, 4, bl, &zero[4] },
  69. { 0, 0, 1, 2, JAM1, 4, br, &zero[5] },
  70. { 0, 0, 1, 2, JAM1, 4, bottom, NULL }
  71. };
  72. static struct Border one[] = {
  73. { 0, 0, 1, 2, JAM1, 4, tr, &one[1] },
  74. { 0, 0, 1, 2, JAM1, 4, br, NULL }
  75. };
  76. static struct Border two[] = {
  77. { 0, 0, 1, 2, JAM1, 4, top, &two[1] },
  78. { 0, 0, 1, 2, JAM1, 4, tr, &two[2] },
  79. { 0, 0, 1, 2, JAM1, 4, ctr, &two[3] },
  80. { 0, 0, 1, 2, JAM1, 4, bl, &two[4] },
  81. { 0, 0, 1, 2, JAM1, 4, bottom, NULL }
  82. };
  83. static struct Border three[] = {
  84. { 0, 0, 1, 2, JAM1, 4, top, &three[1] },
  85. { 0, 0, 1, 2, JAM1, 4, ctr, &three[2] },
  86. { 0, 0, 1, 2, JAM1, 4, bottom, &three[3] },
  87. { 0, 0, 1, 2, JAM1, 4, tr, &three[4] },
  88. { 0, 0, 1, 2, JAM1, 4, br, NULL }
  89. };
  90. static struct Border four[] = {
  91. { 0, 0, 1, 2, JAM1, 4, tr, &four[1] },
  92. { 0, 0, 1, 2, JAM1, 4, tl, &four[2] },
  93. { 0, 0, 1, 2, JAM1, 4, br, &four[3] },
  94. { 0, 0, 1, 2, JAM1, 4, ctr, NULL }
  95. };
  96. static struct Border five[] = {
  97. { 0, 0, 1, 2, JAM1, 4, top, &five[1] },
  98. { 0, 0, 1, 2, JAM1, 4, ctr, &five[2] },
  99. { 0, 0, 1, 2, JAM1, 4, bottom, &five[3] },
  100. { 0, 0, 1, 2, JAM1, 4, tl, &five[4] },
  101. { 0, 0, 1, 2, JAM1, 4, br, NULL }
  102. };
  103. static struct Border six[] = {
  104. { 0, 0, 1, 2, JAM1, 4, top, &six[1] },
  105. { 0, 0, 1, 2, JAM1, 4, ctr, &six[2] },
  106. { 0, 0, 1, 2, JAM1, 4, bottom, &six[3] },
  107. { 0, 0, 1, 2, JAM1, 4, tl, &six[4] },
  108. { 0, 0, 1, 2, JAM1, 4, bl, &six[5] },
  109. { 0, 0, 1, 2, JAM1, 4, br, NULL }
  110. };
  111. static struct Border seven[] = {
  112. { 0, 0, 1, 2, JAM1, 4, top, &seven[1] },
  113. { 0, 0, 1, 2, JAM1, 4, tr, &seven[2] },
  114. { 0, 0, 1, 2, JAM1, 4, br, NULL }
  115. };
  116. static struct Border eight[] = {
  117. { 0, 0, 1, 2, JAM1, 4, top, &eight[1] },
  118. { 0, 0, 1, 2, JAM1, 4, ctr, &eight[2] },
  119. { 0, 0, 1, 2, JAM1, 4, bottom, &eight[3] },
  120. { 0, 0, 1, 2, JAM1, 4, tl, &eight[4] },
  121. { 0, 0, 1, 2, JAM1, 4, tr, &eight[5] },
  122. { 0, 0, 1, 2, JAM1, 4, bl, &eight[6] },
  123. { 0, 0, 1, 2, JAM1, 4, br, NULL }
  124. };
  125. static struct Border nine[] = {
  126. { 0, 0, 1, 2, JAM1, 4, top, &nine[1] },
  127. { 0, 0, 1, 2, JAM1, 4, ctr, &nine[2] },
  128. { 0, 0, 1, 2, JAM1, 4, bottom, &nine[3] },
  129. { 0, 0, 1, 2, JAM1, 4, tl, &nine[4] },
  130. { 0, 0, 1, 2, JAM1, 4, tr, &nine[5] },
  131. { 0, 0, 1, 2, JAM1, 4, br, NULL }
  132. };
  133. static struct Border minus[] = {
  134. { 0, 0, 1, 2, JAM1, 4, ctr, NULL }
  135. };
  136. static struct Border E[] = {
  137. { 0, 0, 1, 2, JAM1, 4, top, &E[1] },
  138. { 0, 0, 1, 2, JAM1, 4, ctr, &E[2] },
  139. { 0, 0, 1, 2, JAM1, 4, bottom, &E[3] },
  140. { 0, 0, 1, 2, JAM1, 4, tl, &E[4] },
  141. { 0, 0, 1, 2, JAM1, 4, bl, NULL }
  142. };
  143. static struct Border r[] = {
  144. { 0, 0, 1, 2, JAM1, 4, ctr, &r[1] },
  145. { 0, 0, 1, 2, JAM1, 4, bl, NULL }
  146. };
  147. static struct Border o[] = {
  148. { 0, 0, 1, 2, JAM1, 4, ctr, &o[1] },
  149. { 0, 0, 1, 2, JAM1, 4, bottom, &o[2] },
  150. { 0, 0, 1, 2, JAM1, 4, bl, &o[3] },
  151. { 0, 0, 1, 2, JAM1, 4, br, NULL }
  152. };
  153. static struct Border R[] = {
  154. { 0, 0, 1, 2, JAM1, 4, top, &R[1] },
  155. { 0, 0, 1, 2, JAM1, 4, tl, NULL }
  156. };
  157. static struct Border u[] = {
  158. { 0, 0, 1, 2, JAM1, 4, tl, &u[1] },
  159. { 0, 0, 1, 2, JAM1, 4, tr, &u[2] },
  160. { 0, 0, 1, 2, JAM1, 4, ctr, NULL }
  161. };
  162. static struct Border n[] = {
  163. { 0, 0, 1, 2, JAM1, 4, top, &n[1] },
  164. { 0, 0, 1, 2, JAM1, 4, tl, &n[2] },
  165. { 0, 0, 1, 2, JAM1, 4, tr, NULL },
  166. };
  167. static struct Border i[] = {
  168. { 0, 0, 1, 2, JAM1, 4, tr, NULL },
  169. };
  170. static struct Border point[] = {
  171. { 0, 0, 1, 2, JAM1, 4, pt, NULL },
  172. };
  173. static struct Border comma[] = {
  174. { 0, 0, 1, 2, JAM1, 4, pt, &comma[1] },
  175. { 0, 0, 1, 2, JAM1, 4, com, NULL }
  176. };
  177. static struct Border P[] = {
  178. { 0, 0, 1, 2, JAM1, 4, top, &P[1] },
  179. { 0, 0, 1, 2, JAM1, 4, ctr, &P[2] },
  180. { 0, 0, 1, 2, JAM1, 4, tr, &P[3] },
  181. { 0, 0, 1, 2, JAM1, 4, tl, &P[4] },
  182. { 0, 0, 1, 2, JAM1, 4, bl, NULL }
  183. };
  184.  
  185. /* The character array, visible to the exterior */
  186. struct Border *hp11char[] = {
  187.   zero, one, two, three, four, five, six, seven, eight, nine,
  188.   minus, E, r, o, R, u, n, i, nine /* g */, point, comma, P };
  189.  
  190.