COM_OPE.SRC 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  1. *************************************************************************
  2. ;* *
  3. ;* ACTION COMMAND OPERATION PROGRAM *
  4. ;* 1992/2/29~1992/5/30 *
  5. ;* version 0.08 *
  6. ;* 1992/6/1~1992/6/26 *
  7. ;* version 0.09 *
  8. ;************************************************************************
  9. XREF ?A5
  10. SECT HK3,,C
  11. INCLUDE NEO_GEO.INC @@@
  12. INCLUDE LABEL.INC
  13. INCLUDE HFLAG.INC
  14. INCLUDE EM_MAC2.INC
  15. ;by HK3_SET
  16. XREF ACT_DATA_SET
  17. ;by HK3_SUB
  18. XREF END_LEVER,LEVER_SET
  19. XREF ACTION_TIMER_SET,TYPE1_SET
  20. XREF DISTANCE_CHECK
  21. XREF PLAYER_SCLIM_CHECK
  22. ;by EM_DATA
  23. XREF AF_WAIT_TBL
  24. ;by HK3_INT
  25. XREF INT4_TBL
  26. ;************************************************************************
  27. XDEF OPERATION_STOP
  28. ;
  29. ;
  30. ;
  31. OPERATION_STOP:
  32. BTST.B #DIS_SRCH_MODE,PLAYER_CONTROL(A6)
  33. BEQ STOP_SEARCH
  34. MOVE.L ANOTHER_PLAYER(A6),A0
  35. CMP #0EH,ACT_CTRL+HERO_OFFSET(A0)
  36. BEQ.S STOP_SEARCH ;player is damage_action
  37. BRA SEQ_COM_SET ;to normal_seq_set
  38. STOP_SEARCH:
  39. BRA ACT_COM_READ
  40. ;************************************************************************
  41. XDEF COMMAND_WAIT
  42. ;
  43. ;
  44. ;
  45. COMMAND_WAIT:
  46. TST.B SEARCH_WAIT(A6)
  47. BMI.S COM_OPE_SET
  48. BEQ.S COM_OPE_SET
  49. MOVEQ.L #0,D0
  50. MOVE.B DIS_MODE(A6),D0
  51. EOR.B #3,D0
  52. SUB.B D0,SEARCH_WAIT(A6)
  53. MOVE #0,PLAY_LEVER+HERO_OFFSET(A6)
  54. RTS
  55. ;************************************************************************
  56. XDEF COMMAND_OPERATION,ACT_COM_READ
  57. ;
  58. ; action_commmand opreation program
  59. ; 1992/3/
  60. ;
  61. COM_OPE_SET:
  62. COMMAND_OPERATION:
  63. BTST.B #COMMAND_STOP,PLAYER_CONTROL(A6) ;<**
  64. BNE COM_OPE_1
  65. MOVE.L ANOTHER_PLAYER(A6),A0
  66. CMP #0EH,ACT_CTRL+HERO_OFFSET(A0)
  67. BNE COM_OPE_2
  68. MOVE #EM_INIT,EM_STEP(A6)
  69. RTS
  70. COM_OPE_2:
  71. CMP.B #5,STEP2+HERO_OFFSET(A6)
  72. BEQ.S DM_NON
  73. BTST.B #BHS_DAMAGE,HERO_STATE+HERO_OFFSET(A6)
  74. BNE DAMAGE_CUT
  75. DM_NON:
  76. CMP #20H,ACT_CTRL+HERO_OFFSET(A6)
  77. BCC COM_OPE_1
  78. ACT_COM_READ:
  79. MOVE.L ACTION_ADRS(A6),A0
  80. MOVE ACT_COM(A6),D0
  81. D0R_ADD
  82. JMP ACT_COM_PROG(PC,D0)
  83. COM_OPE_1:
  84. MOVEQ.L #0,D0
  85. MOVE.B BEFORE_LEVER(A6),D0 ;if no_action or action_skip then
  86. MOVEA.L ACTION_ADRS(A6),A0 ;set berofre lever
  87. BRA LEVER_SET
  88. ; ************************
  89. ACT_COM_PROG:; ;act_no
  90. BRA COM_INITIAL ; 00
  91. BRA DIRECT_LEVER ; 01
  92. BRA SRCH_STA_DIS ; 02
  93. BRA SRCH_ONLY_DIS ; 03
  94. BRA CHECK_AT_DIS1 ; 04
  95. BRA CHECK_AT_DIS2 ; 05
  96. BRA DLS_REPEAT_LEVER ; 06
  97. BRA DLS_TIMER_LEVER ; 07
  98. BRA DLS_SRCH_STA_DIS ; 08
  99. BRA DLS_SRCH_ONLY_DIS ; 09
  100. BRA DLS_CHECK_AT_DIS1 ; 10
  101. BRA DLS_CHECK_AT_DIS2 ; 11
  102. BRA KIRYOKU_POWER_ON ; 12
  103. BRA SANKAKU_PROG ;13
  104. ; ************************
  105. ;************************************************************************
  106. ;
  107. ;
  108. ;
  109. COM_INITIAL:
  110. CLR.B BEFORE_LEVER(A6)
  111. MOVEQ.L #0,D0
  112. MOVE.B (A0)+,D0
  113. CMP.B #0FFH,D0
  114. BEQ COM_OPE_END
  115. SUBQ #1,D0 ;1
  116. BEQ.L DIRECT_INIT
  117. SUBQ #1,D0 ;2
  118. BEQ.L SRCH_SD_INIT
  119. SUBQ #1,D0 ;3
  120. BEQ.L ONLY_DIS_INIT
  121. SUBQ #1,D0 ;4
  122. BEQ.L CHK_AT1_INIT
  123. SUBQ #1,D0 ;5
  124. BEQ.L CHK_AT2_INIT
  125. SUBQ #1,D0 ;6
  126. BEQ.L INIT_DEFENCE
  127. SUBQ #1,D0 ;7
  128. BEQ.L INIT_SANKAKU
  129. MOVEQ.L #0,D0
  130. BRA END_LEVER
  131. ;************************************************************************
  132. XDEF COM_OPE_END
  133. XDEF DAMAGE_CUT
  134. ;
  135. ;
  136. ;
  137. DAMAGE_CUT:
  138. BSET.B #DAMAGE_END,PLAYER_CONTROL(A6)
  139. MOVE.W #15,EM_STEP(A6)
  140. COM_OPE_END:
  141. JSR COM_END(PC)
  142. CLR.B PLAYER_CONTROL(A6)
  143. MOVEQ.L #0,D0
  144. MOVE.B D0,TEST_R+1(A5)
  145. MOVE.B D0,DG_TBLNO(A6)
  146. MOVE.B D0,STATE_MODE(A6)
  147. MOVEA.L ACTION_ADRS(A6),A0
  148. JSR END_LEVER
  149. BSET.B #COM_RESULT_END,PLAYER_CONTROL(A6)
  150. RTS
  151. ;************************************************************************
  152. ;
  153. ; *action commnad no.1
  154. ;
  155. DIRECT_INIT:
  156. MOVE #1,ACT_COM(A6)
  157. DIRECT_LEVER:
  158. MOVEQ.L #0,D0
  159. CMP.B #0FFH,(A0)
  160. BEQ ACTC_ESTEP
  161. MOVE.B (A0)+,D0
  162. CMP.B #0F0H,D0
  163. BEQ ACTC1_1
  164. JMP LEVER_SET
  165. ACTC1_1:
  166. MOVE.B (A0)+,D0
  167. D0R_ADD
  168. JMP SUB_OPE_TBL(PC,D0.W)
  169. ACTC_ESTEP:
  170. JSR COM_END
  171. MOVE.B #0,DG_TBLNO(A6)
  172. MOVEQ.L #00001110B,D0
  173. AND.B BEFORE_LEVER(A6),D0
  174. JMP END_LEVER
  175. ; ***************************
  176. SUB_OPE_TBL:
  177. BRA DLS_REPT_INIT ;0
  178. BRA DLS_TIMER_INIT ;1
  179. BRA DLS_SD_INIT ;2
  180. BRA DLS_DIS_INIT ;3
  181. BRA DLS_AT1_INIT ;4
  182. BRA DLS_AT2_INIT ;5
  183. BRA INIT_DEFENCE ;6
  184. BRA INIT_SANKAKU ;7
  185. BRA INIT_KIRYOKU ;8
  186. ; ***************************
  187. ;
  188. ;************************************************************************
  189. XDEF SRCH_SD_INIT
  190. ;
  191. ; *action commnad no.2
  192. ;
  193. SRCH_SD_INIT:
  194. MOVE #2,ACT_COM(A6)
  195. MOVE.B (A0)+,SEARCH_MODE(A6)
  196. MOVE.B (A0)+,SEARCH_STATE(A6)
  197. MOVE.B (A0)+,SUCCESS_LEVER(A6)
  198. MOVE.B (A0)+,FAIL_LEVER(A6)
  199. MOVE.B (A0)+,SRCH_TIMER(A6)
  200. MOVE.L A0,ACTION_ADRS(A6)
  201. RTS
  202. SRCH_STA_DIS:
  203. JSR DISTANCE_CHECK
  204. MOVEQ.L #0,D0
  205. TST.B SRCH_TIMER(A6)
  206. BEQ SRSD_2
  207. MOVEQ.L #0,D1
  208. MOVE.B SEARCH_STATE(A6),D1
  209. MOVE.L ANOTHER_PLAYER(A6),A1
  210. CMP ACT_CTRL+HERO_OFFSET(A1),D1
  211. BEQ SRSD_4
  212. SUB.B #1,SRCH_TIMER(A6)
  213. MOVEQ.L #3,D1
  214. AND.B PLAYER_CONTROL(A6),D1
  215. BNE SRSD_1
  216. MOVE.B (A0),D0
  217. JMP LEVER_SET
  218. SRSD_1:
  219. SUBQ #3,D1
  220. BEQ SRSD_2
  221. SRSD_4:
  222. MOVE.B SUCCESS_LEVER(A6),D0
  223. BRA SRSD_3
  224. SRSD_2:
  225. MOVE.B FAIL_LEVER(A6),D0
  226. SRSD_3:
  227. JSR END_LEVER
  228. ADD.L #1,ACTION_ADRS(A6)
  229. RTS
  230. MOVE.L ACTION_ADRS(A6),A0
  231. JMP COM_INITIAL(PC)
  232. ;************************************************************************
  233. ;
  234. ;
  235. ;
  236. ONLY_DIS_INIT:
  237. MOVE #3,ACT_COM(A6)
  238. MOVE.B (A0)+,SEARCH_MODE(A6)
  239. MOVE.B (A0)+,SRCH_TIMER(A6)
  240. MOVE.L A0,ACTION_ADRS(A6)
  241. RTS
  242. SRCH_ONLY_DIS:
  243. JSR DISTANCE_CHECK
  244. MOVEQ.L #0,D0
  245. TST.B SRCH_TIMER(A6)
  246. BEQ SROD_1
  247. SUB.B #1,SRCH_TIMER(A6)
  248. MOVE.B (A0),D0
  249. MOVEQ.L #3,D1
  250. AND.B PLAYER_CONTROL(A6),D1
  251. BNE SROD_1
  252. BRA LEVER_SET
  253. SROD_1:
  254. MOVE.B BEFORE_LEVER(A6),D0
  255. JSR END_LEVER
  256. ADD.L #1,ACTION_ADRS(A6)
  257. RTS
  258. ;************************************************************************
  259. XDEF ACT_COM_4
  260. ;
  261. ;
  262. ;
  263. ACT_COM_4:
  264. CHK_AT1_INIT:
  265. MOVE #4,ACT_COM(A6)
  266. MOVE.B (A0)+,SRCH_TIMER(A6)
  267. MOVE.B (A0)+,SUCCESS_LEVER(A6)
  268. MOVE.L A0,ACTION_ADRS(A6)
  269. RTS
  270. CHECK_AT_DIS1:
  271. MOVEQ.L #0,D0
  272. TST.B SRCH_TIMER(A6)
  273. BEQ CHKAD1_3
  274. SUB.B #1,SRCH_TIMER(A6)
  275. BTST.B #COM_RESULT_END,PLAYER_CONTROL(A6)
  276. BNE DLSAD1_3
  277. MOVE X_DIS_NEG(A6),D1
  278. CHKAD1_1:
  279. MOVEQ.L #0,D2
  280. MOVE.B (A0),D2
  281. CMP.B #255,D2
  282. BEQ.S CHKAD1_101
  283. CMP D2,D1
  284. BGT CHKAD1_2
  285. CHKAD1_101:
  286. MOVE.B SUCCESS_LEVER(A6),D0
  287. CHKAD1_3:
  288. JSR END_LEVER
  289. ADD.L #1,ACTION_ADRS(A6)
  290. RTS
  291. CHKAD1_2:
  292. BRA LEVER_SET
  293. ;************************************************************************
  294. ;
  295. ;
  296. ;
  297. CHK_AT2_INIT:
  298. MOVE #5,ACT_COM(A6)
  299. MOVE.B (A0)+,SRCH_TIMER(A6)
  300. MOVE.B (A0)+,SUCCESS_LEVER(A6)
  301. MOVE.L A0,ACTION_ADRS(A6)
  302. RTS
  303. CHECK_AT_DIS2:
  304. MOVEQ.L #0,D0
  305. TST.B SRCH_TIMER(A6)
  306. BEQ CHKAD2_3
  307. SUB.B #1,SRCH_TIMER(A6)
  308. MOVE X_DIS_NEG(A6),D1
  309. CHKAD2_1:
  310. MOVEQ.L #0,D2
  311. MOVE.B 1(A0),D2
  312. CMP.B #255,D2
  313. BEQ.S CHKAD2_101
  314. CMP D2,D1
  315. BGT CHKAD1_4
  316. CHKAD2_101:
  317. MOVE.B 1(A0),D2
  318. CMP D2,D1
  319. BLE CHKAD1_4
  320. MOVE.B SUCCESS_LEVER(A6),D0
  321. CHKAD2_3:
  322. JSR END_LEVER
  323. ADD.L #1,ACTION_ADRS(A6)
  324. MOVE.L ACTION_ADRS(A6),A0
  325. JMP COM_INITIAL(PC)
  326. CHKAD1_4:
  327. BRA LEVER_SET
  328. ;************************************************************************
  329. ;
  330. ; *action sub_command no.1
  331. ; <*** 1992/8/25
  332. XDEF SP_SRCH
  333. SP_SRCH:
  334. DLS_REPT_INIT:
  335. MOVE #6,ACT_COM(A6)
  336. MOVE.B (A0)+,SRCH_TIMER(A6)
  337. MOVE.B (A0)+,SUCCESS_LEVER(A6)
  338. MOVE.L A0,ACTION_ADRS(A6)
  339. DLS_REPEAT_LEVER
  340. ; LEA.L (A6),A1
  341. ; JSR PLAYER_SCLIM_CHECK
  342. ; BNE DLSREP_F_END
  343. MOVEQ.L #0,D0
  344. TST.B SRCH_TIMER(A6)
  345. BEQ DLSREP_F_END
  346. SUBQ.B #1,SRCH_TIMER(A6)
  347. MOVE.L #80004H,D0
  348. MOVEQ.L #0,D3
  349. MOVE.B (A0),D3
  350. MOVE.W X_DIS_NEG(A6),D4
  351. CMP.W OLD_X_DIS(A6),D3
  352. BHI.S DLS_REP_1
  353. SWAP D0
  354. EXG.L D3,D4
  355. DLS_REP_1:
  356. CMP.W D4,D3
  357. BLS DLSREP_END
  358. MOVE.L D0,D1
  359. BTST.B #ACTAT_FLIP,ACT_ATTR(A3)
  360. BEQ DLS_REP_2
  361. SWAP D1
  362. DLS_REP_2:
  363. CMP.B LIMIT_STOP(A6),D1
  364. BNE LEVER_SET
  365. DLSREP_END:
  366. MOVE.B SUCCESS_LEVER(A6),D0
  367. DLSREP_F_END:
  368. JSR END_LEVER
  369. MOVE #1,ACT_COM(A6)
  370. ADD.L #1,ACTION_ADRS(A6)
  371. RTS
  372. ;************************************************************************
  373. ;
  374. ; *action sub_command no.2
  375. ;
  376. DLS_TIMER_INIT:
  377. MOVE #7,ACT_COM(A6)
  378. MOVE.B (A0)+,ACT_WAIT(A6)
  379. MOVE.B (A0)+,SUCCESS_LEVER(A6)
  380. MOVE.L A0,ACTION_ADRS(A6)
  381. RTS
  382. DLS_TIMER_LEVER:
  383. MOVEQ.L #0,D0
  384. TST.B ACT_WAIT(A6)
  385. BEQ DLSTM_END
  386. SUB.B #1,ACT_WAIT(A6)
  387. JMP LEVER_SET
  388. DLSTM_END:
  389. MOVE.B SUCCESS_LEVER(A6),D0
  390. JSR END_LEVER
  391. MOVE #1,ACT_COM(A6)
  392. ; ADD.L #1,ACTION_ADRS(A6)
  393. RTS
  394. ;************************************************************************
  395. ;
  396. ; *action sub_command no.3
  397. ;
  398. DLS_SD_INIT:
  399. MOVE #8,ACT_COM(A6)
  400. MOVE.B (A0)+,SEARCH_MODE(A6)
  401. MOVE.B (A0)+,SEARCH_STATE(A6)
  402. MOVE.B (A0)+,SUCCESS_LEVER(A6)
  403. MOVE.B (A0)+,FAIL_LEVER(A6)
  404. MOVE.B (A0)+,SRCH_TIMER(A6)
  405. MOVE.L A0,ACTION_ADRS(A6)
  406. RTS
  407. DLS_SRCH_STA_DIS:
  408. JSR DISTANCE_CHECK
  409. MOVEQ.L #0,D0
  410. TST.B SRCH_TIMER(A6)
  411. BEQ DLSSD_2
  412. MOVEQ.L #0,D1
  413. MOVE.B SEARCH_STATE(A6),D1
  414. MOVE.L ANOTHER_PLAYER(A6),A1
  415. CMP ACT_CTRL+HERO_OFFSET(A1),D1
  416. BEQ DLSSD_4
  417. SUB.B #1,SRCH_TIMER(A6)
  418. MOVEQ.L #3,D1
  419. AND.B PLAYER_CONTROL(A6),D1
  420. BNE DLSSD_1
  421. MOVE.B (A0),D0
  422. JMP LEVER_SET
  423. DLSSD_1:
  424. SUBQ #3,D1
  425. BEQ DLSSD_2
  426. DLSSD_4:
  427. MOVE.B SUCCESS_LEVER(A6),D0
  428. JMP DLSSD_3
  429. DLSSD_2:
  430. MOVE.B FAIL_LEVER(A6),D0
  431. DLSSD_3:
  432. JSR END_LEVER
  433. MOVE #1,ACT_COM(A6)
  434. ADD.L #1,ACTION_ADRS(A6)
  435. RTS
  436. ;************************************************************************
  437. ;
  438. ; *action sub_command no.4
  439. ;
  440. DLS_DIS_INIT:
  441. MOVE #9,ACT_COM(A6)
  442. MOVE.B (A0)+,SEARCH_MODE(A6)
  443. MOVE.B (A0)+,SRCH_TIMER(A6)
  444. MOVE.L A0,ACTION_ADRS(A6)
  445. RTS
  446. DLS_SRCH_ONLY_DIS:
  447. JSR DISTANCE_CHECK
  448. MOVEQ.L #0,D0
  449. TST.B SRCH_TIMER(A6)
  450. BEQ DLSOD_1
  451. SUB.B #1,SRCH_TIMER(A6)
  452. MOVEQ.L #3,D1
  453. AND.B PLAYER_CONTROL(A6),D1
  454. BNE DLSOD_1
  455. MOVE.B (A0),D0
  456. JMP LEVER_SET
  457. DLSOD_1:
  458. ; MOVE.B BEFORE_LEVER(A6),D0
  459. JSR END_LEVER
  460. MOVE.W #1,ACT_COM(A6)
  461. ADD.L #1,ACTION_ADRS(A6)
  462. RTS
  463. ;************************************************************************
  464. ;
  465. ; *action sub_command no.5
  466. ;
  467. DLS_AT1_INIT:
  468. MOVE #10,ACT_COM(A6)
  469. MOVE.B (A0)+,SRCH_TIMER(A6)
  470. MOVE.B (A0)+,SUCCESS_LEVER(A6)
  471. MOVE.L A0,ACTION_ADRS(A6)
  472. RTS
  473. DLS_CHECK_AT_DIS1:
  474. MOVEQ.L #0,D0
  475. TST.B SRCH_TIMER(A6)
  476. BEQ DLSAD1_3
  477. SUB.B #1,SRCH_TIMER(A6)
  478. BTST.B #COM_RESULT_END,PLAYER_CONTROL(A6)
  479. BNE DLSAD1_3
  480. MOVE X_DIS_NEG(A6),D1
  481. DLSAD1_1:
  482. MOVEQ.L #0,D2
  483. MOVE.B (A0),D2
  484. CMP D2,D1
  485. BLE DLSAD1_2
  486. JMP LEVER_SET
  487. DLSAD1_2:
  488. MOVE.B SUCCESS_LEVER(A6),D0
  489. DLSAD1_3:
  490. JSR END_LEVER
  491. MOVE #1,ACT_COM(A6)
  492. ADD.L #1,ACTION_ADRS(A6)
  493. RTS
  494. ;************************************************************************
  495. ;
  496. ;
  497. ;
  498. ;
  499. DLS_AT2_INIT:
  500. MOVE #11,ACT_COM(A6)
  501. MOVE.B (A0)+,SRCH_TIMER(A6)
  502. MOVE.B (A0)+,SUCCESS_LEVER(A6)
  503. MOVE.L A0,ACTION_ADRS(A6)
  504. RTS
  505. DLS_CHECK_AT_DIS2:
  506. MOVEQ.L #0,D0
  507. TST.B SRCH_TIMER(A6)
  508. BEQ DLSAD2_3
  509. SUB.B #1,SRCH_TIMER(A6)
  510. MOVE X_DIS_NEG(A6),D1
  511. DLSAD2_1:
  512. MOVEQ.L #0,D2
  513. MOVE.B 1(A0),D2
  514. CMP.B #255,D2
  515. BEQ.S DLSAD2_101
  516. CMP D2,D1
  517. BGT DLSAD1_4
  518. DLSAD2_101:
  519. MOVE.B 1(A0),D2
  520. CMP D2,D1
  521. BGT DLSAD1_2
  522. DLSAD1_4:
  523. JMP LEVER_SET
  524. DLSAD2_2:
  525. MOVE.B SUCCESS_LEVER(A6),D0
  526. DLSAD2_3:
  527. JSR END_LEVER
  528. MOVE #1,ACT_COM(A6)
  529. ADD.L #1,ACTION_ADRS(A6)
  530. RTS
  531. ;************************************************************************
  532. ;
  533. ;
  534. ;
  535. INIT_DEFENCE:
  536. ADDQ.L #2,A0
  537. BRA END_LEVER
  538. ;************************************************************************
  539. XDEF SANKAKU_PROG
  540. SANKAKU_LEVER EQU 3Ah+80h
  541. ;
  542. ;
  543. ;
  544. INIT_SANKAKU:
  545. MOVE #13,ACT_COM(A6)
  546. MOVE.L A0,ACTION_ADRS(A6)
  547. MOVE.B #00000101B,D0
  548. BRA LEVER_SET
  549. SANKAKU_PROG:
  550. MOVEQ.L #0,D0
  551. BTST.B #BHS_JUMP,HERO_STATE+HERO_OFFSET(A6)
  552. BEQ SANKAKU_END
  553. CMP.W #3AH,ACT_CTRL+HERO_OFFSET(A6)
  554. BEQ SANKAKU_NEXT
  555. MOVE.B AREA_POSITION+HERO_OFFSET(A6),D0
  556. BEQ.S SANKAKU_NEXT
  557. MOVE.L VZ+HERO_OFFSET(A6),D0
  558. BPL S_PROG_1
  559. NEG.L D0
  560. S_PROG_1:
  561. CMP.L #30000H,D0
  562. BCS SANKAKU_SET
  563. SANKAKU_NEXT:
  564. RTS
  565. SANKAKU_END:
  566. JSR END_LEVER
  567. MOVE #0,ACT_COM(A6)
  568. ADD.L #1,ACTION_ADRS(A6)
  569. RTS
  570. ;************************************************************************
  571. SANKAKU_SET:
  572. MOVEQ.L #0,D0
  573. MOVE.B #SANKAKU_LEVER,D0
  574. MOVE.L ACTION_ADRS(A6),A0
  575. JSR LEVER_SET
  576. RTS
  577. DEFENCE_END:
  578. SANKAKU_CHECK_END:
  579. CLR.B STATE_MODE(A6)
  580. MOVE #EM_ATTACK,EM_STEP(A6)
  581. MOVE.B NOW_STATE(A6),STATE_MODE(A6)
  582. JSR ACT_DATA_SET
  583. DEF_NEXT_2:
  584. RTS
  585. ;************************************************************************
  586. KIRYOKU EQU 19H+80H
  587. XDEF INIT_KIRYOKU
  588. INIT_KIRYOKU:
  589. MOVE.B (A0)+,SEARCH_MODE(A6)
  590. MOVE.B (A0)+,SRCH_TIMER(A6)
  591. MOVE.W #12,ACT_COM(A6)
  592. MOVE.L A0,ACTION_ADRS(A6)
  593. MOVEQ.L #0,D0
  594. MOVE.B RIKI_MAX+HERO_OFFSET(A6),D1
  595. SUB.B HERO_SPIRIT+HERO_OFFSET(A6),D1
  596. CMP.B #16,D1
  597. BCS KIRYOKU_2
  598. MOVEQ.L #0,D0
  599. MOVE.B #KIRYOKU,D0
  600. BRA LEVER_SET
  601. KIRYOKU_POWER_ON:
  602. MOVEQ.L #0,D0
  603. MOVE.B HERO_SPIRIT+HERO_OFFSET(A6),D1
  604. CMP.B RIKI_MAX+HERO_OFFSET(A6),D1
  605. BEQ KIRYOKU_2
  606. TST.B SRCH_TIMER(A6)
  607. BEQ KIRYOKU_2
  608. SUB.B #1,SRCH_TIMER(A6)
  609. JSR DISTANCE_CHECK
  610. MOVEQ.L #3,D1
  611. AND.B PLAYER_CONTROL(A6),D1
  612. BNE KIRYOKU_2
  613. MOVE.B #10H,D0
  614. BRA LEVER_SET
  615. KIRYOKU_2:
  616. MOVEQ.L #0,D0
  617. JSR END_LEVER
  618. MOVE #1,ACT_COM(A6)
  619. RTS
  620. ;
  621. ; BNE => RESULT_END
  622. ; BEQ => CONTINUE
  623. ;
  624. F_MAX_CHK:
  625. MOVEQ.L #0,D1
  626. MOVE.B RIKI_MAX+HERO_OFFSET(A6),D1
  627. SUB.B HERO_SPIRIT+HERO_OFFSET(A6),D1
  628. MOVEQ.L #0,D0
  629. CMP.B #16,D1
  630. SHS.B D0
  631. ADDQ.B #1,D0
  632. RTS
  633. ;************************************************************************
  634. COM_END:
  635. CLR.B SPEED_RANK(A6)
  636. CLR.B ATTACK_ON(A6)
  637. CLR.B ACT_ON(A6)
  638. BTST.B #DIS_SRCH_MODE,PLAYER_CONTROL(A6)
  639. BNE SEQ_COM_SET
  640. ; MOVE #EINT1,EM_INT(A6)
  641. RTS
  642. SEQ_COM_SET:
  643. ; JSR ACTION_TIMER_SET
  644. BCLR.B #DIS_SRCH_MODE,PLAYER_CONTROL(A6)
  645. RTS
  646. ;************************************************************************
  647. INCLUDE WORK.INC
  648. ;************************************************************************
  649.