STATE_CH.SRC 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. ;************************************************************************
  2. ;* *
  3. ;* *HK3 STATE_CONDITION SEARCHING PROGRAM *
  4. ;* presented by k.morikawa *
  5. ;* 1992/5/1~ *
  6. ;************************************************************************
  7. XREF ?A5
  8. SECT HK3,,C
  9. ;by HK3_SET
  10. XREF SPECIAL_ADRS_SET,ACT_DATA_SET
  11. ;by HK3_SUB
  12. XREF SET_RD16,ACT_TYPE_READ
  13. XREF TYPE1_SET,TYPE2_SET
  14. ;by EM_DATA
  15. XREF DEFENCE_TBL
  16. ;by HK3_SET
  17. XREF TBL_ADRS_SET
  18. INCLUDE LABEL.INC
  19. INCLUDE HFLAG.INC
  20. INCLUDE EM_MAC2.INC
  21. ;************************************************************************
  22. XDEF SPECIAL_STATE_CHK
  23. ;
  24. ; special_attack checker
  25. ;
  26. SPECIAL_STATE_CHK:
  27. MOVE.W #11011111B,D0
  28. AND.B HERO_STATE+HERO_OFFSET(A6),D0
  29. BNE SP_STA_SKIP
  30. MOVE.B NOW_STATE(A6),D0
  31. BEQ NEXT_AT_CHECK
  32. BPL NEXT_AT_CHECK
  33. ANDI.W #7FH,D0
  34. MOVE.B SP_PRIO(PC,D0.W),D2
  35. CMP.B SPEED_RANK(A6),D2
  36. BLS NEXT_AT_CHECK
  37. MOVE.B D2,SPEED_RANK(A6)
  38. MOVE.B D0,TEST_R+1(A5)
  39. MOVE.B D0,STATE_MODE(A6)
  40. JSR SPECIAL_ADRS_SET
  41. CLR.B STATE_CNT(A6)
  42. MOVEQ.L #1,D0
  43. RTS
  44. SP_STA_SKIP:
  45. NEXT_AT_CHECK:
  46. MOVEQ.L #0,D0
  47. RTS
  48. SP_PRIO:
  49. ; 80 81 82 83 84 85 86 87 88 89 8A
  50. DC.B 00,08,09,10,11,06,01,06,05,04,02,03
  51. DS.W 0
  52. SPECIAL_TEST:; 0:1:2:3:4:5:6:7
  53. DC.B 0,0,0,0,0,0,0,0
  54. DC.B 0,0,1,1,0,0,0,0
  55. ;************************************************************************
  56. XDEF ATTACK_STATE_CHK
  57. ;
  58. ; *attack_state checker
  59. ;
  60. ATTACK_STATE_CHK:
  61. ; BTST.B #SPECIAL_MODE,PLAYER_CONTROL(A6)
  62. ; BNE NEXT_SPSTA_CHK
  63. ;
  64. TST NOW_STATE(A6)
  65. BEQ NEXT_SPSTA_CHK
  66. BMI NEXT_SPSTA_CHK
  67. JSR AT_BIT_CHK(PC)
  68. BEQ NEXT_SPSTA_CHK
  69. MOVE.L ANOTHER_PLAYER(A6),A0
  70. MOVE HERO_TYPE+HERO_OFFSET(A0),D0
  71. D0R_ADD
  72. LEA DEFENCE_TBL,A0
  73. MOVE.L (A0,D0),A0
  74. MOVE HERO_TYPE+HERO_OFFSET(A6),D0
  75. SUB.B #2,D0
  76. LSL #5,D0 ;defence_tbl top_address
  77. MOVEQ.L #0,D1
  78. MOVE.B NOW_STATE(A6),D1
  79. MOVE.B D1,STATE_MODE(A6)
  80. MOVE.B D1,TEST_R+1(A5)
  81. SUB #7,D1
  82. ADD D1,D1
  83. ADD D1,D0
  84. ADDA (A0,D0),A0
  85. ADDA D0,A0
  86. MOVE.L A0,ACTION_ADRS(A6)
  87. JSR TBL_ADRS_SET
  88. MOVE.W #0,ACT_COM(A6)
  89. ANDI.B #11000111B,PLAYER_CONTROL(A6)
  90. MOVEQ.L #1,D0
  91. RTS
  92. NEXT_SPSTA_CHK:
  93. MOVEQ.L #0,D0
  94. RTS
  95. ;************************************************************************
  96. XDEF PLAYER_SCLIM_CHECK
  97. ;
  98. ; * screen limit checker program
  99. ; 1992/5/1
  100. PLAYER_SCLIM_CHECK:
  101. MOVE X_POSITION+HERO_OFFSET(A1),D3
  102. CMP #70H,D3
  103. BLT PL_SCLIM_SET
  104. CMP #02A0H,D3
  105. BCC PL_SCLIM_SET ;screen_check
  106. PLAYER_STA_NEXT:
  107. MOVEQ.L #0,D3
  108. RTS
  109. PL_SCLIM_SET:
  110. MOVEQ.L #1,D3
  111. RTS
  112. ;************************************************************************
  113. XDEF SCREEN_LIM_CHECK
  114. ;
  115. ; * screen limit checker program
  116. ; 1992/5/1
  117. SCREEN_LIM_CHECK:
  118. MOVEQ.L #0,D0
  119. RTS
  120. CMP.B #6,STATE_MODE(A6)
  121. BEQ STA_NML_NEXT
  122. BTST.B #SPECIAL_MODE,PLAYER_CONTROL(A6)
  123. BNE STA_NML_NEXT
  124. MOVE X_POSITION+HERO_OFFSET(A6),D0
  125. CMP #70H,D0
  126. BLT LIMIT_SEARCH
  127. CMP #02A0H,D0
  128. BCC LIMIT_SEARCH ;screen_check
  129. STA_NML_NEXT:
  130. MOVEQ.L #0,D0
  131. RTS
  132. LIMIT_SEARCH:
  133. MOVE.B #6,STATE_MODE(A6)
  134. JSR SPECIAL_ADRS_SET
  135. MOVEQ.L #1,D0
  136. RTS
  137. ;************************************************************************
  138. XDEF PLAYER_SCLIM_CHK
  139. ;
  140. ; * screen limit checker program
  141. ; 1992/5/1
  142. PLAYER_SCLIM_CHK:
  143. MOVE X_POSITION+HERO_OFFSET(A1),D0
  144. CMP #70H,D0
  145. BLT PL_STA_NEXT
  146. CMP #02A0H,D0
  147. BCC PL_STA_NEXT ;screen_check
  148. SP_NEXT:
  149. MOVEQ.L #0,D0
  150. RTS
  151. PL_STA_NEXT:
  152. MOVEQ.L #1,D0
  153. RTS
  154. ;************************************************************************
  155. XDEF AT_BIT_CHK
  156. ;
  157. ; *return_resista :D3(equal => skip : not_equal => set defence)
  158. ;
  159. AT_BIT_CHK:
  160. MOVEQ.L #0,D3
  161. TST.B NOW_STATE(A6)
  162. BMI AT_BIT_2
  163. BEQ AT_BIT_2
  164. MOVE.L ANOTHER_PLAYER(A6),A2
  165. CLR.W (A5)
  166. MOVE.B WORK_N0+HERO_OFFSET(A2),(A5)
  167. MOVE.W (A5),D0
  168. CLR.W (A5)
  169. BTST.B #4,ACT_FLAG(A5,D0)
  170. SEQ D3
  171. AT_BIT_1:
  172. ADDQ.B #1,D3
  173. AT_BIT_2:
  174. RTS
  175. ;************************************************************************
  176. INCLUDE WORK.INC
  177. ;************************************************************************
  178.