Advertisement
beckadam

Small Arrow Key Movement Code?

Nov 10th, 2019
719
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Assumes (IX-2) and (IX-1) are 1 byte X and Y coordinates to modify
  2. ;Uses ti.GetCSC scan codes.
  3. ;Assumes that the keycode is 1,2,3, or 4, otherwise unexpected results.
  4. ;Destroys A,HL
  5.     lea hl,ix-1
  6.     sub a,2
  7.     bit 1,a
  8.     jr nz,$+1
  9.     inc hl
  10.     bit 0,a
  11.     jr z,$+3
  12.     inc (hl)
  13.     jr $+1
  14.     dec (hl)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement