joypad.asm 664 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ldx $4016
  2. sta
  3. rla
  4. ldx $4016
  5. orx
  6. rla
  7. ldx $4016
  8. orx
  9. rla
  10. ldx $4016
  11. orx
  12. rla
  13. ldx $4016
  14. orx
  15. rla
  16. ldx $4016
  17. orx
  18. rla
  19. ldx $4016
  20. orx
  21. rla
  22. ldx $4016
  23. orx
  24. lax
  25. ldy $4017
  26. sta
  27. rla
  28. ldy $4017
  29. ory
  30. rla
  31. ldy $4017
  32. ory
  33. rla
  34. ldy $4017
  35. ory
  36. rla
  37. ldy $4017
  38. ory
  39. rla
  40. ldy $4017
  41. ory
  42. rla
  43. ldy $4017
  44. ory
  45. rla
  46. ldy $4017
  47. ory
  48. lay
  49. ;- below, from patater.com tutorial
  50. ;lda $4016 ; read for A key.
  51. ;and #1 ; check to see if down.
  52. ;bne WasDown ; branch if it was down.
  53. ;lda $4016 ; read for B key.
  54. ;lda $4016 ; read for SELECT
  55. ;lda $4016 ; read START status
  56. ;and #1 ; see if down.
  57. ;bne StartDown ; branch if down.
  58. ;lda $4016 ; UP
  59. ;lda $4016 ; DOWN
  60. ;lda $4016 ; LEFT
  61. ;lda $4016 ; RIGHT