home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / h / hp11 / Amiga_Code / c / ami_chars < prev    next >
Encoding:
Text File  |  1992-05-07  |  3.6 KB  |  201 lines

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