Advertisement
Guest User

Untitled

a guest
Mar 11th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1.  
  2. ;#################################
  3. ;my v put map
  4. ;input: a = characeter
  5. ; (textStart) = os small font buf
  6. ; (textPage) = os small font page
  7. ; textInverse, (iy + textFlags)
  8. ; (penColz)
  9. ;output: (penColz) increased, so it can be a subroutine
  10. ;destroys: none
  11.  
  12. myyVPutC:
  13. di
  14. push af
  15. push bc
  16. push de
  17. push hl
  18. push ix
  19.  
  20. or a
  21. jp z, myyVPutMapDone
  22.  
  23. bit appTextSave, (iy + appFlags)
  24. jr z, dontSaveText
  25.  
  26. ld hl, (textSavePtr)
  27. ld (hl), a
  28. inc hl
  29. ld (textSavePtr), hl
  30. dontSaveText:
  31.  
  32. call getLetterLength
  33.  
  34. inc hl
  35. drawCursorEntry:
  36. inc hl
  37. push hl
  38. ld h, a
  39. ld de, (penColz)
  40. ld a, d
  41. and 7
  42. add a, h
  43. sub 8
  44. ld c, a
  45. push de
  46. ld l, 0
  47. add hl, de
  48. ld (penColz), hl
  49.  
  50. pop de
  51.  
  52. inc e
  53. call getPixel2
  54. pop ix
  55.  
  56.  
  57.  
  58. ld b, 6
  59. ld de, 11
  60. putMapLoop:
  61. push bc
  62. ld a, (textPage)
  63. out (07), a
  64. ld a, c
  65. ld c, 0
  66. or a
  67. jr z, charAligned
  68. jp m, negAligned
  69. posAligned:
  70. ld b, a
  71. ld a, (ix)
  72. posAlignedLp:
  73. rra
  74. rr c
  75. djnz posAlignedLp
  76. jr alignDone
  77. negAligned:
  78. neg
  79. ld b, a
  80. ld a, (ix)
  81. negAlignedLp:
  82. rlca
  83. djnz negAlignedLp
  84. jr alignDone
  85. charAligned:
  86. ld a, (ix)
  87. alignDone:
  88. push af
  89. #if _84
  90. ld a, $81
  91. #else
  92. ld a, $41
  93. #endif
  94. out (07), a
  95. pop af
  96.  
  97. bit textInverse, (iy + textFlags)
  98. jr nz, inverseText
  99.  
  100. or (hl)
  101. ld (hl), a
  102. inc hl
  103. ld a, c
  104. or (hl)
  105. ld (hl), a
  106. jr putDone
  107. inverseText:
  108. cpl
  109. and (hl)
  110. ld (hl), a
  111. inc hl
  112. ld a, c
  113. cpl
  114. and (hl)
  115. ld (hl), a
  116. putDone:
  117.  
  118. add hl, de
  119. inc ix
  120. pop bc
  121. djnz putMapLoop
  122.  
  123.  
  124. myyVPutMapDone:
  125. pop ix
  126. pop hl
  127. pop de
  128. pop bc
  129. pop af
  130. ; ei
  131. ret
  132.  
  133.  
  134.  
  135. ;########################################
  136. ;get pixel
  137. ;input: de = xy
  138. ;output: hl = plotSScreen loc
  139. ;destroys: none
  140.  
  141. getPixel2:
  142. push de
  143. push af
  144. ld a, d
  145. ld d, 0
  146. ld h, d
  147. ld l, e
  148. add hl, de
  149. add hl, de
  150. add hl, hl
  151. add hl, hl
  152.  
  153. and %11111000
  154. rrca
  155. rrca
  156. rrca
  157. or $40
  158. ld d, plotSScreen / 256
  159. ld e, a
  160. add hl, de
  161. pop af
  162. pop de
  163. ret
  164.  
  165.  
  166.  
  167. ;########################################
  168. getLetterLength:
  169. ld l, a
  170. ld h, 0
  171. add hl, hl
  172. add hl, hl
  173. add hl, hl
  174. push de
  175. push af
  176. ld de, (textStart)
  177. add hl, de
  178.  
  179.  
  180. ld a, (textPage)
  181. out (07), a
  182.  
  183. ld d, (hl)
  184.  
  185. #if _84
  186. ld a, $81
  187. #else
  188. ld a, $41
  189. #endif
  190. out (07), a
  191.  
  192. pop af
  193. cp ' '
  194. jr nz, notSpacedd
  195. inc d
  196. notSpacedd:
  197. ld a, d
  198. pop de
  199. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement