joy_routines.s 751 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ****************************************
  2. ****** GET STICK READINGS *****
  3. ****************************************
  4. get_stick_readings
  5. btst #7,$bfe001
  6. bne.s set_fire_up
  7. move.w #1,fire
  8. bra.s no_fire_pressed
  9. set_fire_up
  10. move.w #0,fire
  11. no_fire_pressed
  12. move.w $dff00c,d0 ;joy1dat
  13. update_joy_values
  14. btst #9,d0
  15. beq.s tryleft
  16. move.w #-1,xdirec
  17. bra upanddown
  18. tryleft
  19. btst #1,d0
  20. beq.s movezero
  21. move.w #1,xdirec
  22. bra.s upanddown
  23. movezero
  24. move.w #0,xdirec
  25. upanddown
  26. move.w d0,d1
  27. rol.w #1,d0
  28. eor.w d0,d1
  29. btst #1,d1
  30. beq.s tryup
  31. move.w #-1,ydirec
  32. bra.s quitjoyread
  33. tryup
  34. btst #9,d1
  35. beq.s stop_y
  36. move.w #1,ydirec
  37. bra.s quitjoyread
  38. stop_y
  39. move.w #0,ydirec
  40. quitjoyread
  41. rts
  42. fire dc.w 0
  43. xdirec dc.w 0
  44. ydirec dc.w 0