Geekboy

Untitled

Feb 13th, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;#######################################################################;
  2. ;       ___      ___   ___  __    ______   .___  ___.     ______.       ;
  3. ;      /   \     \  \ /  / |  |  /  __  \  |   \/   |    /      |       ;
  4. ;     /  ^  \     \  '  /  |  | |  |  |  | |  \  /  |   |   (---`       ;
  5. ;    /  /_\  \     >   <   |  | |  |  |  | |  |\/|  |    \   \          ;
  6. ;   /  _____  \   /  .  \  |  | |  `--'  | |  |  |  | .---)   |         ;
  7. ;  /__/     \__\ /__/ \__\ |__|  \______/  |__|  |__| |______/          ;
  8. ;                                                                       ;
  9. ;                The Assembly SDK for Axe programmers                   ;
  10. ;                         By Kevin Horowitz                             ;
  11. ;                       Last revision:  1.1.2                           ;
  12. ;                                                                       ;
  13. ;  This template will make it easy to implement real assembly commands  ;
  14. ;into Axe Parser so that they can be used just like the native commands ;
  15. ;that come with the App.                                                ;
  16. ;                                                                       ;
  17. ;#######################################################################;
  18.  
  19. ;###################
  20. ;#  Library header #
  21. ;###################
  22.  
  23. ;You should include "Axe.inc" in your axiom because it contains a lot of useful
  24. ;definitions to aid in Axiom development.  If you're using token replacements,
  25. ;you should also include "TokenHook.inc".
  26. #include "ti83plus.inc"
  27. #include "Axe.inc"
  28. #include "TokenHook.inc"
  29.  
  30. #define  Cn2_Setup          $4209
  31. #define  Cn2_Clear_SendBuf  $420C
  32. #define  Cn2_Clear_RecBuf   $420F
  33. #define Cn2_Setdown         $4212
  34. #define Cn2_GetK            $4221
  35. #define SWord               $87FF
  36. #define Rword               $86F3
  37. #define Sdat                $8801
  38. #define Rdat                $86FA
  39.  
  40. ;All Axioms must start with $DE,$C0:
  41. .dw $C0DE
  42.  
  43. ;1 CnOn is init calcnet and returns the pointer to your calc id
  44.  
  45. .dw initend          ;lable to thinger that states its the end
  46. .db %00001000
  47. .db t2ByteTok, tNormalPDF  ;tok
  48. .db %00000000
  49. .db 0       ;arguments
  50.  
  51.  
  52. .org $0000
  53.  call Cn2_Setup
  54.  ld hl,$86EE
  55. initend:
  56. ;2
  57.  
  58. ;1 CnOff takes it down
  59. .dw teardown          ;lable to thinger that states its the end
  60. .db %00001000
  61. .db t2ByteTok, tDNormal  ;tok
  62. .db %00000000        
  63. .db 0       ;arguments
  64. .org $0000
  65.  call cn2_setdown
  66. teardown:
  67. ;2
  68.  
  69. ;1 CnONr sets it up and moves stuff around in memory
  70. .dw moveitlikeaboss          ;lable to thinger that states its the end
  71. .db %00001000
  72. .db t2ByteTok, tNormalPDF  ;tok
  73. .db %00000010         ; uses r
  74. .db 0       ;arguments
  75. .org $0000
  76.  ld hl,$86EE
  77. moveitlikeaboss:
  78. ;2
  79.  
  80. ;========== General purpose commands
  81. ;1 GetS returns the send buffer flag
  82. .dw sflag         ;lable to thinger that states its the end
  83. .db %00001000
  84. .db t2ByteTok, tInvNorm ; invnorm
  85. .db %00000000        
  86. .db 0       ;arguments
  87. .org $0000
  88.  ld a,(SWord)  ;put msb in l
  89.  rlca            ; rotate to bit one
  90.  ld l,a          ; load into l
  91.  ld h,0           ; clear h
  92. sflag:
  93. ;2
  94. ;======= for future use when kerm makes cn2.3+ ======
  95. ;== ld a,(sizeword) \ cp $80 \ sbc hl,hl \ inc hl  ==
  96. ;=============== does the same as ^v ================
  97. ;1 GetR
  98. .dw rflag         ;lable to thinger that states its the end
  99. .db %00001000
  100. .db t2ByteTok, tTPDF  ; tpdf
  101. .db %00000000        
  102. .db 0
  103. .org 0
  104.  ld a,(RWord)  ;put msb in l
  105.  rlca            ; rotate to bit one
  106.  ld l,a          ; load into l
  107.  ld h,0           ; clear h
  108. rflag:
  109. ;2
  110.  
  111. ;1 SetS Sets the ok to send flag  
  112. .dw ssflag          ;lable to thinger that states its the end
  113. .db %00001000
  114. .db t2ByteTok, $12  ; tCDF
  115. .db %00000000        
  116. .db 0       ;arguments
  117. .org $0000
  118.  ld hl,(SWord)
  119.  set 7,(hl)
  120. ssflag:
  121. ;2
  122.  
  123. ;1 ResS Resets the ok to send flag  note i see no applicable use other than to change data if the data in the buffer was not sent in a reasonable time
  124. .dw rsflag         ;lable to thinger that states its the end
  125. .db %00001000
  126. .db t2ByteTok, $1d ;x2pdf
  127. .db %00000000        
  128. .db 0
  129. .org 0
  130. ld hl,(SWord)
  131. res 7,(hl)
  132. rsflag:
  133. ;2
  134.  
  135. ;1 SetR Sets the "you got data" flag, only applicable use is to block incoming messages
  136. .dw srflag          ;lable to thinger that states its the end
  137. .db %00001000
  138. .db t2ByteTok, $13  ; x2cdf
  139. .db %00000000        
  140. .db 0       ;arguments
  141. .org $0000
  142.  ld hl,(RWord)
  143.  set 7,(hl)
  144. srflag:
  145. ;2
  146.  
  147. ;1 ResR Resets the "You got data flag" Allows more data to come in
  148. .dw rrflag         ;lable to thinger that states its the end
  149. .db %00001000
  150. .db t2ByteTok, $1E ;fpdf
  151. .db %00000000        
  152. .db 0
  153. .org 0
  154. ld hl,(RWord)
  155. res 7,(hl)
  156. rrflag:
  157. ;2
  158.  
  159.  
  160.  
  161.  
  162. ;=============== Key Routine need this cause well axe uses getcsc which is a nono with calcnet ==========
  163. ;============================ already debounces will add smooth input later =============================
  164.  
  165. ;1
  166. .dw keyquit         ;lable to thinger that states its the end
  167. .db %00001001
  168. .db $BB, tChI  ;tok
  169. .db %00000000  
  170. .db 0
  171. .org 0
  172. p_GetKey:
  173.     CALL cn2_GetK
  174.     ld  h,0
  175.     ld  l,a
  176. keyquit:
  177. ;2
  178. .dw $0000
  179.  
  180. ;1 TokenHooks
  181. .dw hNormalPDF
  182. .db 4
  183. .db "CnOn"
  184.  
  185. .dw hDNormal
  186. .db 5
  187. .db "CnOff"
  188.  
  189. .dw hInvNorm
  190. .db 5
  191. .db "GetR"
  192.  
  193.  
  194. .dw hInvT
  195. .db 7
  196. .db "TheGame"
  197.  
  198.  
  199. .dw hTPDF
  200. .db 4
  201. .db "GetS"
  202.  
  203. .dw hDT       ;tcdf
  204. .db 4
  205. .db "SetS"
  206.  
  207. .dw hChiPDF
  208. .db 4
  209. .db "ResS"
  210.  
  211. .dw hChI
  212. .db 4
  213. .db "SetR"
  214.  
  215. .dw hFPDF
  216. .db 5
  217. .db "ResR"
  218.  
  219. .dw HDF
  220. .db 5
  221. .db "CnKey"
  222. ;2
Advertisement
Add Comment
Please, Sign In to add comment