Advertisement
Guest User

Untitled

a guest
Jan 15th, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. .nolist
  2. #include "ti84pcse.inc"
  3. .list
  4. .db tExtTok, tAsm84CCmp
  5. .org UserMem
  6. ASMStart:
  7. .org UserMem
  8. ProgramStart:
  9. ;LabelON
  10. ld hl,sInstructions
  11. bcall(_PutS)
  12. ld a,1
  13. bcall(52EAh) ;_EnableSmartViewInputPad
  14. bcall(52F0h) ;_RecycleUSB
  15. res 0,(iy+asm_Flag1)
  16. res 1,(iy+asm_Flag1)
  17. call Delay
  18. smartViewLoop:
  19. ; bcall(530Eh) ;_IsConnectedToPC
  20. ; jr z,smartViewLoopDone
  21. ; bcall(4C9Ch) ;_HandleLinkActivity
  22. bit 4,(iy+9)
  23. res 4,(iy+9)
  24. jr z,notOnPressed
  25. onPressed:
  26. xor a
  27. ld b,a
  28. bcall(52E7h) ;_SendSmartViewKeypress
  29. ld a,3fh
  30. ld b,0
  31. bcall(52E7h) ;_SendSmartViewKeypress
  32. xor a
  33. ld b,a
  34. bcall(52E7h) ;_SendSmartViewKeypress
  35. bit 0,(iy+asm_Flag1)
  36. jr nz,smartViewLoopDone
  37. jr smartViewLoop
  38. notOnPressed:
  39. bit 3,(iy+0)
  40. jr z,smartViewLoop
  41. bcall(_GetCSC)
  42. or a
  43. jr nz,keyCodeFound
  44. bit 1,(iy+asm_Flag1)
  45. jr z,smartViewLoop
  46. res 1,(iy+asm_Flag1)
  47. xor a
  48. ld b,a
  49. bcall(52E7h) ;_SendSmartViewKeypress
  50. jr smartViewLoop
  51. keyCodeFound:
  52. set 1,(iy+asm_Flag1)
  53. cp sk2nd
  54. jr nz,not2ndPressed
  55. bit 0,(iy+asm_Flag1)
  56. jr nz,sk2ndWas
  57. set 0,(iy+asm_Flag1)
  58. jr not2ndPressed
  59. sk2ndWas:
  60. res 0,(iy+asm_Flag1)
  61. not2ndPressed:
  62. ld hl,keyTable
  63. ld b,a
  64. findKeyCodeLoop:
  65. ld a,(hl)
  66. or a
  67. jr z,smartviewLoop
  68. cp b
  69. jr z,sendKeyCode
  70. inc hl
  71. inc hl
  72. inc hl
  73. jr findKeycodeLoop
  74. sendKeyCode:
  75. inc hl
  76. ld b,(hl)
  77. inc hl
  78. ld a,(hl)
  79. bcall(52E7h) ;_SendSmartViewKeypress
  80. jr smartViewLoop
  81. smartViewLoopDone:
  82. xor a
  83. ld b,a
  84. bcall(52E7h) ;_SendSmartViewKeypress
  85. call Delay
  86. xor a
  87. bcall(52EAh) ;_EnableSmartViewInputPad
  88. bcall(52F0h) ;_RecycleUSB
  89. clearScreen:
  90. ret
  91. Delay: ei
  92. ld a,42h
  93. out (36h),a
  94. xor a
  95. out (37h),a
  96. ld a,10
  97. out (38h),a
  98. timerLoop:
  99. in a,(4)
  100. bit 7,a
  101. jr z,timerLoop
  102. ret
  103. sInstructions:
  104. .db 0
  105. keyTable:
  106. .db sk2nd,2h,0h
  107. .db skYequ,00h,58
  108. .db skWindow,00h,59
  109. .db skZoom,00h,60
  110. .db skTrace,00h,61
  111. .db skGraph,00h,62
  112. .db skMode,00h,41
  113. .db skDel,00h,76
  114. .db skAlpha,01h,00
  115. .db skGraphvar,00h,35h
  116. .db skStat,00h,77
  117. .db skMath,00h,4
  118. .db skMatrix,00h,5
  119. .db skPrgm,00h,6
  120. .db skVars,00h,73
  121. .db skClear,00h,38h
  122. .db skRecip,00h,7
  123. .db skSin,00h,8
  124. .db skCos,00h,9
  125. .db skTan,00h,10
  126. .db skPower,00h,11
  127. .db skSquare,00h,12
  128. .db skComma,00h,13
  129. .db skLParen,00h,14
  130. .db skRParen,00h,15
  131. .db skDiv,00h,16
  132. .db skLog,00h,17
  133. .db sk7,00h,18
  134. .db sk8,00h,19
  135. .db sk9,00h,20
  136. .db skMul,00h,21
  137. .db skLn,00h,22
  138. .db sk4,00h,23
  139. .db sk5,00h,24
  140. .db sk6,00h,25
  141. .db skSub,00h,26
  142. .db skStore,00h,27
  143. .db sk1,00h,28
  144. .db sk2,00h,29
  145. .db sk3,00h,32
  146. .db skAdd,00h,87
  147. .db sk0,00h,44
  148. .db skDecPnt,00h,55
  149. .db skChs,00h,45
  150. .db skEnter,00h,40
  151. .db skup,00h,82
  152. .db skDown,00h,81
  153. .db skLeft,00h,80
  154. .db skRight,0h,79
  155. .db 0
  156. .end
  157. .nolist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement