Guest User

Untitled

a guest
Nov 25th, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 KB | None | 0 0
  1. ; Program Name:
  2. ; Author:
  3. ; Version:
  4. ; Date:
  5. ; Written for Doors CSE 8.0 and higher (http://dcs.cemetech.net)
  6.  
  7. .nolist
  8. #include "ti84pcse.inc"
  9. #include "dcse8.inc"
  10.  
  11. .org UserMem
  12. BinaryStart:
  13. .db $DE,$2A,"N",$BB,$B4,$BB,$B4,$BB,$B3,$BB,$C3,")D" ;Disp "Needs D
  14. .db $BB,$BF,$BB,$BF,$BB,$C2,$BB,$C3,")CSE",$2A,$3F ;oors CSE"
  15. .db $EF,$11 ;OpenLib(
  16. .db "D",$BB,$BF,$BB,$BF,$BB,$C2,$BB,$C3,"CSE",$11,$3F ;(tokenized "DoorsCSE")
  17. .db $EF,$12,$3F ;ExecLib
  18. .db $D5,$3F ;Return
  19. .db tExtTok,tAsm84CPrgm,$3F ;Asm84CPrgm
  20. HeaderStart:
  21. .dw ASMStart-HeaderStart ;offset to code
  22. ; Header sections start here
  23.  
  24. .dw 10
  25. .db ASMHEADER_FIELD_TYPE_LIB ;== 3
  26. .db "DoorsCSE",8,0 ;Lib name, min major version, min minor version
  27.  
  28.  
  29. .dw 0 ;End of header field: 0 bytes of data
  30. .db $ff ;End of header field: type 255
  31. .list
  32. ASMStart:
  33. .relocate UserMem
  34. ProgramStart:
  35. ;LabelON
  36. bcall(_runIndicOff)
  37. call clearScreen
  38. ld hl,sInstructions
  39. bcall(_PutS)
  40. ld a,1
  41. bcall(52EAh) ;_EnableSmartViewInputPad
  42. bcall(52F0h) ;_RecycleUSB
  43. res 0,(iy+asm_Flag1)
  44. res 1,(iy+asm_Flag1)
  45. call Delay
  46. smartViewLoop:
  47. ; bcall(530Eh) ;_IsConnectedToPC
  48. ; jr z,smartViewLoopDone
  49. ; bcall(4C9Ch) ;_HandleLinkActivity
  50. bit 4,(iy+9)
  51. res 4,(iy+9)
  52. jr z,notOnPressed
  53. onPressed:
  54. xor a
  55. ld b,a
  56. bcall(52E7h) ;_SendSmartViewKeypress
  57. ld a,3fh
  58. ld b,0
  59. bcall(52E7h) ;_SendSmartViewKeypress
  60. xor a
  61. ld b,a
  62. bcall(52E7h) ;_SendSmartViewKeypress
  63. bit 0,(iy+asm_Flag1)
  64. jr nz,smartViewLoopDone
  65. jr smartViewLoop
  66. notOnPressed:
  67. bit 3,(iy+0)
  68. jr z,smartViewLoop
  69. bcall(_GetCSC)
  70. or a
  71. jr nz,keyCodeFound
  72. bit 1,(iy+asm_Flag1)
  73. jr z,smartViewLoop
  74. res 1,(iy+asm_Flag1)
  75. xor a
  76. ld b,a
  77. bcall(52E7h) ;_SendSmartViewKeypress
  78. jr smartViewLoop
  79. keyCodeFound:
  80. set 1,(iy+asm_Flag1)
  81. cp sk2nd
  82. jr nz,not2ndPressed
  83. bit 0,(iy+asm_Flag1)
  84. jr nz,sk2ndWas
  85. set 0,(iy+asm_Flag1)
  86. jr not2ndPressed
  87. sk2ndWas:
  88. res 0,(iy+asm_Flag1)
  89. not2ndPressed:
  90. ld hl,keyTable
  91. ld b,a
  92. findKeyCodeLoop:
  93. ld a,(hl)
  94. or a
  95. jr z,smartviewLoop
  96. cp b
  97. jr z,sendKeyCode
  98. inc hl
  99. inc hl
  100. inc hl
  101. jr findKeycodeLoop
  102. sendKeyCode:
  103. inc hl
  104. ld b,(hl)
  105. inc hl
  106. ld a,(hl)
  107. bcall(52E7h) ;_SendSmartViewKeypress
  108. jr smartViewLoop
  109. smartViewLoopDone:
  110. xor a
  111. ld b,a
  112. bcall(52E7h) ;_SendSmartViewKeypress
  113. call Delay
  114. xor a
  115. bcall(52EAh) ;_EnableSmartViewInputPad
  116. bcall(52F0h) ;_RecycleUSB
  117. clearScreen:
  118. bcall(_clrTxtShd)
  119. bcall(_clrScrnFull)
  120. bcall(_DrawStatusBar)
  121. bcall(_homeUp)
  122. ret
  123. Delay: ei
  124. ld a,42h
  125. out (36h),a
  126. xor a
  127. out (37h),a
  128. ld a,10
  129. out (38h),a
  130. timerLoop:
  131. in a,(4)
  132. bit 7,a
  133. jr z,timerLoop
  134. ret
  135. sInstructions:
  136. .db " Learn Hacking"
  137. .db " And Programming"
  138. .db " With Calculators! "
  139. .db " "
  140. .db " Demo Input Controller "
  141. .db " "
  142. .db " Input will be shown on "
  143. .db " Demo Display ",0
  144. keyTable:
  145. .db sk2nd,2h,0h
  146. .db skYequ,00h,58
  147. .db skWindow,00h,59
  148. .db skZoom,00h,60
  149. .db skTrace,00h,61
  150. .db skGraph,00h,62
  151. .db skMode,00h,41
  152. .db skDel,00h,76
  153. .db skAlpha,01h,00
  154. .db skGraphvar,00h,35h
  155. .db skStat,00h,77
  156. .db skMath,00h,4
  157. .db skMatrix,00h,5
  158. .db skPrgm,00h,6
  159. .db skVars,00h,73
  160. .db skClear,00h,38h
  161. .db skRecip,00h,7
  162. .db skSin,00h,8
  163. .db skCos,00h,9
  164. .db skTan,00h,10
  165. .db skPower,00h,11
  166. .db skSquare,00h,12
  167. .db skComma,00h,13
  168. .db skLParen,00h,14
  169. .db skRParen,00h,15
  170. .db skDiv,00h,16
  171. .db skLog,00h,17
  172. .db sk7,00h,18
  173. .db sk8,00h,19
  174. .db sk9,00h,20
  175. .db skMul,00h,21
  176. .db skLn,00h,22
  177. .db sk4,00h,23
  178. .db sk5,00h,24
  179. .db sk6,00h,25
  180. .db skSub,00h,26
  181. .db skStore,00h,27
  182. .db sk1,00h,28
  183. .db sk2,00h,29
  184. .db sk3,00h,32
  185. .db skAdd,00h,87
  186. .db sk0,00h,44
  187. .db skDecPnt,00h,55
  188. .db skChs,00h,45
  189. .db skEnter,00h,40
  190. .db skup,00h,82
  191. .db skDown,00h,81
  192. .db skLeft,00h,80
  193. .db skRight,0h,79
  194. .db 0
  195. .endrelocate
  196. .end
  197. .nolist
  198.  
  199.  
  200. ERRORS:
  201. Pass one...
  202. /Continuum.asm:33: error SE113: Unknown opcode '.relocate'
  203. /Continuum.asm:195: error SE113: Unknown opcode '.endrelocate'
  204. Pass two...
  205. /inc/ti84pcse.inc:447: error SE106: Could not find label or macro '_runIndicOff'
  206. /inc/ti84pcse.inc:447: error SE106: Could not find label or macro '_clrTxtShd'
  207. /inc/ti84pcse.inc:447: error SE106: Could not find label or macro '_clrScrnFull'
  208. Assembly time: 3.335 seconds
Advertisement
Add Comment
Please, Sign In to add comment