Advertisement
luckytyphlosion

ts_jump_random

Nov 8th, 2019
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1.  
  2. .macro ts_jump_random untrap:req, ratio1:req, target1:req, ratio2, target2, ratio3, target3, ratio4, target4, ratio5, target5, ratio6, target6, ratio7, target7, ratio8, target8
  3. .byte 0xF0
  4. .byte (1 << 6) | (\untrap << 7)
  5. .ifnb \ratio2
  6. .ifnb \ratio3
  7. .ifnb \ratio4
  8. .ifnb \ratio5
  9. .ifnb \ratio6
  10. .ifnb \ratio7
  11. .ifnb \ratio8
  12. .byte 8
  13. .else
  14. .byte 7
  15. .endif
  16. .else
  17. .byte 6
  18. .endif
  19. .else
  20. .byte 5
  21. .endif
  22. .else
  23. .byte 4
  24. .endif
  25. .else
  26. .byte 3
  27. .endif
  28. .else
  29. .byte 2
  30. .endif
  31. .else
  32. .byte 1
  33. .endif
  34.  
  35. .byte \ratio1, \target1
  36.  
  37. .ifb \ratio2
  38. .exitm
  39. .endif
  40. .ifb \target2
  41. .error "ts_jump_random: ratio2 specified but not target2!"
  42. .exitm
  43. .endif
  44. .byte \ratio2, \target2
  45.  
  46. .ifb \ratio3
  47. .exitm
  48. .endif
  49. .ifb \target3
  50. .error "ts_jump_random: ratio3 specified but not target3!"
  51. .exitm
  52. .endif
  53. .byte \ratio3, \target3
  54.  
  55. .ifb \ratio4
  56. .exitm
  57. .endif
  58. .ifb \target4
  59. .error "ts_jump_random: ratio4 specified but not target4!"
  60. .exitm
  61. .endif
  62. .byte \ratio4, \target4
  63.  
  64. .ifb \ratio5
  65. .exitm
  66. .endif
  67. .ifb \target5
  68. .error "ts_jump_random: ratio5 specified but not target5!"
  69. .exitm
  70. .endif
  71. .byte \ratio5, \target5
  72.  
  73. .ifb \ratio6
  74. .exitm
  75. .endif
  76. .ifb \target6
  77. .error "ts_jump_random: ratio6 specified but not target6!"
  78. .exitm
  79. .endif
  80. .byte \ratio6, \target6
  81.  
  82. .ifb \ratio7
  83. .exitm
  84. .endif
  85. .ifb \target7
  86. .error "ts_jump_random: ratio7 specified but not target7!"
  87. .exitm
  88. .endif
  89. .byte \ratio7, \target7
  90.  
  91. .ifb \ratio8
  92. .exitm
  93. .endif
  94. .ifb \target8
  95. .error "ts_jump_random: ratio8 specified but not target8!"
  96. .exitm
  97. .endif
  98. .byte \ratio8, \target8
  99. .endm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement