Advertisement
Zeda

move v2

Jan 17th, 2022
2,833
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "keys.inc"
  2. #include "ti83plus.inc"
  3. #define bcall(x)  rst 28h \ .dw x
  4. .db     $BB,$6D
  5. .org    progstart
  6.     ld  b, 0
  7.     ld  c, 0
  8.     bcall(_RunIndicOff)
  9.     jp  disp
  10. start:
  11.     bcall(_GetCSC)
  12.     cp  skLeft
  13.     jp  z, move_left
  14.     cp  skRight
  15.     jp  z, move_right
  16.     cp  skUp
  17.     jp  z, move_up
  18.     cp  skDown
  19.     jp  z, move_down
  20.     cp  skClear
  21.     jr  nz, start
  22.     ret
  23. move_down:
  24.     ld  a, c
  25.     cp  7
  26.     jp  z, start
  27.     inc c
  28.     jp  disp
  29.  
  30. move_up:
  31.     ld  a, c
  32.     cp  0
  33.     jp  z, start
  34.     dec c
  35.     jp  disp
  36.  
  37. move_left:
  38.     ld  a, b
  39.     cp  0
  40.     jp  z, start
  41.     dec b
  42.     jp  disp
  43.  
  44. move_right:
  45.     ld  a, b
  46.     cp  15
  47.     jp  z, start
  48.     inc b
  49. disp:
  50.     push    bc
  51.     bcall(_ClrLCDFull)
  52.     pop bc
  53.     ld  (curRow), bc
  54.     ld  a, 'A'
  55.     bcall(_PutC)
  56.     jp  start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement