HK3_SUB.SRC 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. *************************************************************************
  2. ;* *
  3. ;* *HK3 SUB_ROUNTINE PROGRAMS *
  4. ;* presented by k.morikawa *
  5. ;* 1992/1/28 *
  6. *************************************************************************
  7. XREF ?A5
  8. SECT HK3,,C
  9. ;by STATE_CHK
  10. XREF PLAYER_SCLIM_CHECK
  11. ;by EM_DATA
  12. XREF SETTING_TIMER,STATE_DATA_TBL
  13. XREF STA_CONVERT_TBL
  14. ;by GAME_SYM
  15. XREF RAND8
  16. ;by NEWS
  17. XREF NEWS
  18. INCLUDE LABEL.INC
  19. INCLUDE HFLAG.INC
  20. INCLUDE EM_MAC2.INC
  21. ;************************************************************************
  22. XDEF SET_RD16
  23. XDEF SET_RD32
  24. ;
  25. ;
  26. ; *return_resista:D0(0~fh)
  27. ; 1992/4
  28. SET_RD16:
  29. SET_RD32:
  30. JSR RAND8
  31. ANDI.B #00001111B,D0
  32. ; LEA.L RD16_SEQ,A2
  33. ; MOVE.B (A2,D0),D0
  34. RTS
  35. ;************************************************************************
  36. XDEF TYPE1_SET
  37. ;
  38. ; *receive_resista:A0
  39. ; *use_resista :D3
  40. ; 1992/5/25
  41. TYPE1_SET:
  42. MOVE HERO_TYPE+HERO_OFFSET(A6),D3
  43. D3R_ADD
  44. MOVE.L 0(A0,D3),A0
  45. RTS
  46. ;************************************************************************
  47. XDEF TYPE2_SET
  48. ;
  49. ; *receive_resista:A0
  50. ; *use_resista :D3
  51. ; 1992/5/25
  52. TYPE2_SET:
  53. MOVE HERO_TYPE+HERO_OFFSET(A6),D3
  54. ADD D3,D3
  55. ADDA D3,A0
  56. RTS
  57. ;************************************************************************
  58. XDEF TYPE3_SET
  59. ;
  60. ; *receive_resista:A0
  61. ; *use_resista :D3
  62. ; 1992/5/25
  63. TYPE3_SET:
  64. MOVE HERO_TYPE+HERO_OFFSET(A6),D3
  65. D3R_ADD
  66. ADDA D3,A0
  67. RTS
  68. ;************************************************************************
  69. XDEF ACTION_TIMER_SET
  70. ;
  71. ;
  72. ; 1992/
  73. ACTION_TIMER_SET:
  74. MOVEQ.L #0,D0
  75. MOVE.B GAME_DIP+9(A5),D0
  76. LSL #4,D0
  77. ADD HERO_TYPE+HERO_OFFSET(A6),D0
  78. LEA.L SETTING_TIMER,A2
  79. MOVE.B (A2,D0),SEARCH_WAIT(A6)
  80. RTS
  81. ;************************************************************************
  82. XDEF ACT_TYPE_READ
  83. ;
  84. ; *receive_resista:A1(anothrer_player logical top_address)
  85. ; *return_resista :D4(action_type no)
  86. ; *use_resista :D1,D3,A0
  87. ; 1992/5/26
  88. ACT_TYPE_READ:
  89. MOVEQ.L #0,D1
  90. MOVE ACT_CTRL+HERO_OFFSET(A1),D1
  91. CMP #4FH,D1
  92. BGT ACT_READ_END
  93. LEA.L STATE_DATA_TBL,A0
  94. MOVEQ.L #0,D4
  95. MOVE.B 0(A0,D1),D4 ;action_no_set
  96. ACT_READ_END:
  97. RTS
  98. ;************************************************************************
  99. XDEF MINE_STATE_SET
  100. MINE_STATE_SET:
  101. MOVE.L ANOTHER_PLAYER(A6),A1
  102. JSR ACT_TYPE_READ(PC) ;player action_type (0~0ffh)
  103. MOVE.B NOW_STATE(A6),BEFORE_STATE(A6)
  104. MOVE.B D4,NOW_STATE(A6)
  105. CMP #7,D4
  106. BCC MINE_STA_1
  107. ; MOVE.L ANOTHER_PLAYER(A6),A1
  108. ; JSR PLAYER_SCLIM_CHECK
  109. ; BEQ MS_NEXT_1
  110. ;
  111. ; MOVEQ.L #5,D4
  112. MS_NEXT_1:
  113. MOVE.B NML_CONVERT(PC,D4),NOW_STATE(A6);nomal_mode exchange
  114. MINE_STA_1:
  115. LEA.L (A6),A1
  116. JSR ACT_TYPE_READ(PC)
  117. TST.B D4
  118. BMI MINE_STA_NEXT
  119. CMP #7,D4
  120. BLT MINE_STA_2
  121. MOVEQ.L #0,D4
  122. MINE_STA_2:
  123. LEA.L STA_CONVERT_TBL,A2
  124. MOVE HERO_TYPE+HERO_OFFSET(A6),D3
  125. SUBQ #2,D3
  126. ADD D3,D3
  127. ADDA (A2,D3),A2
  128. MOVE.B (A2,D4),MINE_STATE(A6)
  129. MINE_STA_NEXT:
  130. RTS
  131. NML_CONVERT:
  132. DC.B 0,1,2,3,4,0,0,0
  133. ;************************************************************************
  134. XDEF DISTANCE_SEARCH
  135. ;
  136. ; distance searching program
  137. ; 1991/12/5
  138. ;
  139. ; *receive_resista:D0(object x_position)
  140. ; *return_resista :D2(distance_level)
  141. ; *use_resista :A1,D0,D2
  142. ;
  143. DISTANCE_SEARCH:
  144. MOVE X_DIS_NEG(A6),D0
  145. SRCH_1:
  146. MOVEQ.L #0,D2
  147. CMP DIS_LONG(A6),D0
  148. BLT SRCH_2
  149. ADDQ #1,D2
  150. SRCH_2:
  151. CMP DIS_MID(A6),D0
  152. BLT SRCH_3
  153. ADDQ #1,D2
  154. SRCH_3:
  155. CMP DIS_SHORT(A6),D0
  156. BLT SRCH_4
  157. ADDQ #1,D2
  158. SRCH_4:
  159. MOVE.B D2,DIS_MODE(A6)
  160. RTS
  161. ;************************************************************************
  162. XDEF DISTANCE_CHECK
  163. ;
  164. ; distance_mode command_out checker program
  165. ; 1992/3/23
  166. DISTANCE_CHECK:
  167. ; MOVE X_POSITION+HERO_OFFSET(A6),D0
  168. ; CMP #70H,D0
  169. ; BLT DIS_COM_CUT
  170. ; CMP #02A0H,D0
  171. ; BCC DIS_COM_CUT ;screen_check
  172. MOVEQ.L #0,D1
  173. MOVE.B DIS_MODE(A6),D1
  174. MOVE D1,D2
  175. LSL #4,D1
  176. MOVEQ.L #0,D0
  177. MOVE.B SEARCH_MODE(A6),D0
  178. CMP #3,D0
  179. BGT DIS_COM_CUT
  180. D0R_ADD
  181. ADD D1,D0
  182. MOVE.L DIS_SEARCHER(PC,D0),A2
  183. MOVEQ.L #0CH,D1
  184. AND.B BEFORE_LEVER(A6),D1
  185. BEQ.S DIS_CHECK_1
  186. BTST.B #ACTAT_FLIP,ACT_ATTR(A3)
  187. BEQ.L DIS_CHECK_1
  188. EORI.B #00001100B,D1
  189. DIS_CHECK_1:
  190. MOVEQ.L #0,D0
  191. JSR (A2)
  192. TST.B D0
  193. BEQ DIS_NEXT
  194. ORI.B #COM_REND_BIT,PLAYER_CONTROL(A6)
  195. DIS_NEXT:
  196. RTS
  197. ; ***********************
  198. DIS_SEARCHER:
  199. DC.L DIS0_0 ;01
  200. DC.L DIS0_1 ;02
  201. DC.L DIS0_2 ;03
  202. DC.L DIS0_3 ;04
  203. DC.L DIS1_0 ;05
  204. DC.L DIS1_1 ;06
  205. DC.L DIS1_2 ;07
  206. DC.L DIS1_3 ;08
  207. DC.L DIS2_0 ;09
  208. DC.L DIS2_1 ;10
  209. DC.L DIS2_2 ;11
  210. DC.L DIS2_3 ;12
  211. DC.L DIS3_0 ;13
  212. DC.L DIS3_1 ;14
  213. DC.L DIS3_2 ;15
  214. DC.L DIS3_3 ;16
  215. ; ***********************
  216. ;
  217. ;
  218. ;
  219. DIS0_0:
  220. DIS1_1:
  221. DIS2_2:
  222. DIS3_3:
  223. SRCH_NR_END:
  224. ORI.B #COM_REND_BIT,PLAYER_CONTROL(A6)
  225. MOVEQ.L #0,D0
  226. RTS
  227. ;
  228. ;
  229. DIS1_0:
  230. DIS3_0:
  231. DIS2_0:
  232. JSR D_SRCH_1(PC)
  233. JMP DIS0_CHECK
  234. ;
  235. ;
  236. ;
  237. DIS2_1:
  238. DIS3_1:
  239. JSR D_SRCH_1(PC)
  240. JMP DIS1_CHECK
  241. DIS0_1:
  242. JSR D_SRCH_2(PC)
  243. JMP DIS1_CHECK
  244. ;
  245. ;
  246. ;
  247. DIS3_2:
  248. JSR D_SRCH_1(PC)
  249. JMP DIS2_CHECK
  250. ;
  251. ;
  252. ;
  253. DIS1_2:
  254. DIS0_2:
  255. JSR D_SRCH_2(PC)
  256. JMP DIS2_CHECK
  257. ;
  258. ;
  259. ;
  260. DIS1_3:
  261. DIS2_3:
  262. DIS0_3:
  263. JSR D_SRCH_2(PC)
  264. JMP DIS3_CHECK
  265. ;************************************************************************
  266. ;
  267. ;
  268. ;
  269. DIS0_CHECK:
  270. TST D2 ;now_dis
  271. SEQ D0
  272. CMP #2,D2
  273. BGT.L DIS_COM_CUT
  274. RTS
  275. DIS1_CHECK:
  276. CMP #1,D2
  277. SEQ D0
  278. CMP #2,D2
  279. BGT.L DIS_COM_CUT
  280. RTS
  281. DIS2_CHECK:
  282. CMP #2,D2
  283. SEQ D0
  284. SUBQ #1,D2
  285. BMI.L DIS_COM_CUT
  286. RTS
  287. DIS3_CHECK:
  288. CMP #3,D2
  289. SEQ D0
  290. CMP #1,D2
  291. BLE DIS_COM_CUT
  292. RTS
  293. ;************************************************************************
  294. D_SRCH_1:
  295. ; CMP.B #8,D1
  296. ; BEQ.L DIS_COM_CUT
  297. RTS
  298. D_SRCH_2:
  299. ; CMP.B #4,D1
  300. ; BEQ.L DIS_COM_CUT
  301. RTS
  302. DIS_COM_CUT:
  303. MOVE.B #4,BEFORE_LEVER(A6)
  304. ORI.B #00000011B,PLAYER_CONTROL(A6)
  305. MOVEQ.L #0,D0
  306. RTS
  307. ;************************************************************************
  308. XDEF END_LEVER,LEVER_SET
  309. ; ******** 4/27
  310. ;
  311. ; *lever & pad data setting
  312. ;
  313. ; *receive_resista:D0(lever & pad data)
  314. ; :A3(physical work address)
  315. ;
  316. END_LEVER:
  317. MOVE #0,ACT_COM(A6)
  318. ANDI.B #11001100B,PLAYER_CONTROL(A6)
  319. LEVER_SET:
  320. CMP.B #80H,D0
  321. BHI.L DIRECT_MODE
  322. MOVE #0F0H,D1
  323. AND.B D0,D1
  324. BEQ LS_3
  325. JSR ATTACK_CODE_CHK
  326. BEQ LS_3
  327. ANDI.B #00001100B,D0
  328. LS_3:
  329. MOVEQ.L #0CH,D1
  330. AND.B D0,D1
  331. BEQ LS_1
  332. BTST.B #ACTAT_FLIP,ACT_ATTR(A3)
  333. BEQ LS_1
  334. EORI.B #00001100B,D0
  335. LS_1:
  336. ; MOVE.L ANOTHER_PLAYER+HERO_OFFSET(A6),A1
  337. ; BTST.B #BHS_DAMAGE,HERO_STATE(A1)
  338. ; BEQ LS_2
  339. ; ANDI.B #00001111B,D0
  340. LS_2:
  341. MOVE.B D0,PLAY_LEVER+HERO_OFFSET(A6)
  342. MOVEQ.L #0,D1
  343. MOVE.B BEFORE_LEVER(A6),D1
  344. MOVE.B D0,BEFORE_LEVER(A6)
  345. MOVE.B D0,PLAY_LEVER+HERO_OFFSET+1(A6)
  346. EOR.B D0,D1
  347. BNE AT_MODE_CHK
  348. ANDI.B #00001111B,D0
  349. MOVE.B D0,PLAY_LEVER+HERO_OFFSET+1(A6)
  350. AT_MODE_CHK:
  351. MOVE.L A0,ACTION_ADRS(A6)
  352. ANDI.B #1,D0
  353. BEQ LEVER_SET_END
  354. MOVE #EINT4,EM_INT(A6)
  355. LEVER_SET_END:
  356. RTS
  357. DIRECT_MODE:
  358. JSR ATTACK_CODE_CHK
  359. BNE DIRECT_MODE_1
  360. BTST.B #BHS_JUMP,HERO_STATE+HERO_OFFSET(A6)
  361. BEQ DIRECT_SET
  362. DIRECT_MODE_1:
  363. MOVEQ.L #0,D0
  364. DIRECT_SET:
  365. MOVE.B #1,CTRL_FLAG+HERO_OFFSET(A6)
  366. MOVE D0,DIRECT_CTRL+HERO_OFFSET(A6)
  367. MOVE.L A0,ACTION_ADRS(A6)
  368. RTS
  369. ;
  370. ;
  371. ;
  372. ATTACK_CODE_CHK:
  373. CMP.W D0,D0
  374. RTS
  375. BTST.B #BHS_JUMP,HERO_STATE+HERO_OFFSET(A6)
  376. BNE AT_CHK_CLEAR
  377. TST.B D0
  378. BPL ATC_1
  379. MOVE D0,D3
  380. ANDI.B #7FH,D3
  381. ADD D3,D3
  382. ADD #14*2,D3
  383. MOVE D3,D2
  384. ATC_1:
  385. MOVE.B NOW_STATE(A6),D2
  386. ADD D2,D2
  387. MOVE AT_DIS_DATA(PC,D2),D2
  388. CMP X_DIS_NEG(A6),D2
  389. BLT ATC_2
  390. MOVEQ.L #0,D1
  391. RTS
  392. ATC_2:
  393. TST.B TARGET_Y+1(A6)
  394. BPL ATC_3
  395. CLR.B TARGET_Y+1(A6)
  396. ATC_3:
  397. MOVE HERO_TYPE+HERO_OFFSET(A6),D1
  398. SUBQ.W #2,D1
  399. MOVEQ.L #0,D2
  400. LEA.L RES_TIME_DATA(PC),A1
  401. MOVE.B (A1,D1),D2
  402. MOVEQ.L #0,D1
  403. CMP.B TARGET_Y+1(A6),D2
  404. SHI D1 ;
  405. ADDQ.B #1,D1
  406. RTS
  407. AT_CHK_CLEAR:
  408. MOVEQ.L #0,D1
  409. RTS
  410. RES_TIME_DATA:
  411. DC.B 8 ;1
  412. DC.B 8 ;2
  413. DC.B 8 ;3
  414. DC.B 8 ;4
  415. DC.B 8 ;5
  416. DC.B 8 ;6
  417. DC.B 8 ;7
  418. DC.B 8 ;8
  419. ;
  420. ; now_state
  421. ;
  422. AT_DIS_DATA:
  423. DC.W 100 ;jub
  424. DC.W 100 ;strong_punch
  425. DC.W 130 ;nml_punch
  426. DC.W 110 ;body_blow
  427. DC.W 100 ;kick
  428. DC.W 100 ;strong_kick
  429. DC.W 130 ;nml_kick
  430. DC.W 110 ;low_kick
  431. DC.W 165 ;crounch_punch
  432. DC.W 165 ;crounch_kick
  433. DC.W 170 ;jump_punch
  434. DC.W 170 ;jump_kick
  435. DC.W 300 ;hado_ken
  436. DC.W 300 ;super_action
  437. DC.W 300 ;100_retsu
  438. DC.W 300 ;super_hado_ken
  439. ;************************************************************************
  440. INCLUDE WORK.INC
  441. ;************************************************************************
  442.