HK3.SRC 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. ************************************************************************
  2. * *
  3. * 044 [ART OF FIGHT] *
  4. * ENEMY MAIN PROGRAM *
  5. * by K.MORIKAWA *
  6. * from 91/11/29 Fri 10:37 *
  7. * *
  8. ************************************************************************
  9. XDEF INIT_HK3,HK3_SYSTEM
  10. XDEF ACTION_SYSTEM
  11. XREF ?A5
  12. SECT HK3,,C
  13. ;by HK3_SET
  14. XREF FORCE_DATA_SET,ACT_DATA_SET
  15. XREF INIT_DIS_SET,SPECIAL_ADRS_SET
  16. XREF MINE_STATE_SET
  17. XREF ATTACK_CHECK,SPECIAL_CHECK,SCLIM_CHECK
  18. XREF AT_BF_CHECK
  19. XREF DIS_SRCH_CHK
  20. ;by HK3_INT
  21. XREF SPECIAL_CHECKER
  22. XREF COM_INT1,COM_INT2,COM_INT3,COM_INT4
  23. ;by HK3_SUB
  24. XREF ACTION_TIMER_SET,DISTANCE_CHECK,DISTANCE_SEARCH
  25. XREF HK3_DMG,HK3_JUMP_DMG
  26. ;by COM_OPE
  27. XREF COMMAND_OPERATION,COMMAND_WAIT
  28. XREF OPERATION_STOP
  29. XREF DEFENCE_WAIT,SANKAKU_PROG
  30. XREF UP_DEFENCE,DOWN_DEFENCE
  31. XREF DEFENCE_NEXT
  32. ;by EM_DATA
  33. XREF FORCE_TBL
  34. ;by STATE_CHK
  35. XREF SPECIAL_STATE_CHK,ATTACK_STATE_CHK
  36. XREF SCREEN_LIM_CHECK
  37. ;by GAME_SYM
  38. XREF RAND8
  39. ;by NEWS
  40. XREF INIT_NEWS,NEWS
  41. INCLUDE MACRO.INC @@@
  42. INCLUDE NEO_GEO.INC @@@
  43. INCLUDE LABEL.INC
  44. INCLUDE HFLAG.INC
  45. INCLUDE EM_MAC2.INC
  46. INCLUDE CML.INC
  47. ;
  48. ; *** initialize ***
  49. ;
  50. INIT_HK3:
  51. ; BCLR.B #BPS_HK3_INIT,PLAYER_STATE(A6)
  52. ; RTS
  53. ;
  54. BCLR.B #BPS_HK3_INIT,PLAYER_STATE(A6)
  55. BEQ.S INIT_HK3_1
  56. RTS
  57. INIT_HK3_1:
  58. OR.B #PS_HK3_INIT,PLAYER_STATE(A6)
  59. MOVE.W HERO_TYPE+HERO_OFFSET(A6),D0
  60. ADD.W D0,D0
  61. ADD.W D0,D0
  62. MOVE.L INIT_HK3_VECTOR(PC,D0.W),A0
  63. JMP (A0)
  64. INIT_HK3_VECTOR:
  65. DC.L INIT_PL1
  66. DC.L INIT_PL2
  67. DC.L INIT_M1
  68. DC.L INIT_M2
  69. DC.L INIT_M3
  70. DC.L INIT_M4
  71. DC.L INIT_M5
  72. DC.L INIT_M6
  73. DC.L INIT_M7
  74. DC.L INIT_M8
  75. ;
  76. ; *** system main ***
  77. ;
  78. ; receive_resista :A6(player_logical_work)
  79. HK3_SYSTEM:
  80. ; MOVE.W PLAY_LEVER(A6),PLAY_LEVER+HERO_OFFSET(A6)
  81. ; MOVE.B PLAY_LEVER+2(A6),PLAY_LEVER+2+HERO_OFFSET(A6)
  82. ; RTS
  83. ;
  84. BTST.B #BPS_COM_FLAG,PLAYER_STATE(A6)
  85. BNE.S HK3_1
  86. MOVEQ.L #3,D0
  87. AND.B DEBUG_DIP1(A5),D0
  88. BNE.S HK3_1
  89. HK3_2:
  90. BTST.B #BPS_HK3_INIT,PLAYER_STATE(A6)
  91. BNE.S HK3_3
  92. JSR INIT_HK3_1(PC)
  93. HK3_3:
  94. CLR.W PLAY_LEVER+HERO_OFFSET(A6)
  95. CLR.B PLAY_LEVER+2+HERO_OFFSET(A6)
  96. MOVE.W HERO_TYPE+HERO_OFFSET(A6),D0
  97. ADD.W D0,D0
  98. ADD.W D0,D0
  99. MOVE.L HK3_VECTOR(PC,D0.W),A0
  100. JMP (A0)
  101. HK3_1:
  102. MOVE.W PLAY_LEVER(A6),PLAY_LEVER+HERO_OFFSET(A6)
  103. MOVE.B PLAY_LEVER+2(A6),PLAY_LEVER+2+HERO_OFFSET(A6)
  104. RTS
  105. HK3_VECTOR:
  106. DC.L HK3_PL1
  107. DC.L HK3_PL2
  108. DC.L HK3_M1
  109. DC.L HK3_M2
  110. DC.L HK3_M3
  111. DC.L HK3_M4
  112. DC.L HK3_M5
  113. DC.L HK3_M6
  114. DC.L HK3_M7
  115. DC.L HK3_M8
  116. INIT_PL1:
  117. INIT_PL2:
  118. MOVE.W #118H,DIS_LONG(A6)
  119. MOVE.W #0B0H,DIS_MID(A6)
  120. MOVE.W #231H-1C6H,DIS_SHORT(A6)
  121. JSR INIT_SET(PC)
  122. RTS
  123. INIT_M1:
  124. MOVE.W #78H,DIS_SHORT(A6)
  125. MOVE.W #0F8H,DIS_MID(A6)
  126. MOVE.W #150H,DIS_LONG(A6)
  127. JSR INIT_SET(PC)
  128. RTS
  129. INIT_M2:
  130. MOVE.W #0A0H,DIS_SHORT(A6)
  131. MOVE.W #10CH,DIS_MID(A6)
  132. MOVE.W #150H,DIS_LONG(A6)
  133. JSR INIT_SET(PC)
  134. RTS
  135. INIT_M3:
  136. MOVE.W #07DH,DIS_SHORT(A6)
  137. MOVE.W #0F3H,DIS_MID(A6)
  138. MOVE.W #150H,DIS_LONG(A6)
  139. JSR INIT_SET(PC)
  140. RTS
  141. INIT_M4:
  142. MOVE.W #70H,DIS_SHORT(A6)
  143. MOVE.W #0F0H,DIS_MID(A6)
  144. MOVE.W #150H,DIS_LONG(A6)
  145. JSR INIT_SET(PC)
  146. RTS
  147. INIT_M5:
  148. MOVE.W #80H,DIS_SHORT(A6)
  149. MOVE.W #0F8H,DIS_MID(A6)
  150. MOVE.W #150H,DIS_LONG(A6)
  151. JSR INIT_SET(PC)
  152. RTS
  153. INIT_M6:
  154. MOVE.W #78H,DIS_SHORT(A6)
  155. MOVE.W #0D0H,DIS_MID(A6)
  156. MOVE.W #150H,DIS_LONG(A6)
  157. JSR INIT_SET(PC)
  158. RTS
  159. INIT_M7:
  160. MOVE.W #0A8H,DIS_SHORT(A6)
  161. MOVE.W #0F0H,DIS_MID(A6)
  162. MOVE.W #150H,DIS_LONG(A6)
  163. JSR INIT_SET(PC)
  164. RTS
  165. INIT_M8:
  166. MOVE.W #82H,DIS_SHORT(A6)
  167. MOVE.W #120H,DIS_MID(A6)
  168. MOVE.W #150h,DIS_LONG(A6)
  169. JSR INIT_SET(PC)
  170. RTS
  171. HK3_PL1:
  172. HK3_PL2:
  173. HK3_M1
  174. HK3_M2
  175. HK3_M3
  176. HK3_M4
  177. HK3_M5
  178. HK3_M6
  179. HK3_M7
  180. HK3_M8
  181. JSR ACTION_SYSTEM(PC)
  182. MOVE.B EM_STEP+1(A6),TEST_R+1(A5)
  183. JSR HK3_DIP1(PC)
  184. RTS
  185. ;************************************************************************
  186. INIT_SET:
  187. JSR INIT_NEWS
  188. MOVE.B MAIN_COUNT+3(A5),RANDOM_SEED(A5)
  189. MOVEQ.L #0,D0
  190. MOVE D0,DG_TBLNO(A6)
  191. MOVE D0,WIN_ROUND+2(A6)
  192. MOVE.B D0,PLAYER_CONTROL(A6)
  193. MOVE.B D0,DEF_IN_COUNT(A6)
  194. MOVE.L D0,EM_STEP(A6)
  195. MOVE.L D0,X_DIS(A6)
  196. MOVE.L D0,ACTION_ADRS(A6)
  197. MOVE.L D0,ACT_WAIT(A6)
  198. MOVE.L D0,TIME_MODE(A6)
  199. MOVE.L D0,STATE_CNT(A6)
  200. MOVE.L D0,SRCH_TIMER(A6)
  201. MOVE.L D0,SP_SEQ_LV(A6)
  202. MOVE.B D0,SPEED_RANK(A6)
  203. MOVE.B D0,ATTACK_ON(A6)
  204. MOVE.B D0,ACT_ON(A6)
  205. MOVE #17,EM_STEP(A6)
  206. ; JSR ACTION_TIMER_SET(PC)
  207. RTS
  208. ;************************************************************************
  209. HK3_DIP1:
  210. LEA.L EM_OUT,A1
  211. MOVEQ.L #DISP_HK3,D0
  212. AND.B DEBUG_DIP1(A5),D0
  213. BNE.S HKD_1
  214. ; LEA.L EM_CLEAR,A1
  215. RTS
  216. HKD_1:
  217. MOVE.B PLAYER1+DIS_MODE(A5),TEST_COLOR+1(A5)
  218. MOVE.B PLAYER1+DG_TBLNO(A5),TEST_PG+1(A5)
  219. MOVE.B PLAYER2+DIS_MODE(A5),TEST_G+1(A5)
  220. MOVE.B PLAYER2+DG_TBLNO(A5),TEST_B+1(A5)
  221. MESS_ON
  222. MOVE.L A1,(A0)+
  223. MESS_OFF
  224. RTS
  225. ;************************************************************************
  226. ;
  227. ; *enemy_action_control system
  228. ;
  229. ; presented by k.morikawa
  230. ; version 1.00 1992/4/27~
  231. ;
  232. ; *use_resista:A0(action_data_top or operation_command address)
  233. ; A3(player logical_data top_address)
  234. ; A4(job_operation top_address)
  235. ; A6(player physical_data top_address)
  236. ;
  237. ACTION_SYSTEM:
  238. MOVE.B WORK_N0+HERO_OFFSET(A6),(A5) ;logical_work_setting
  239. MOVE.W (A5),D0 ;
  240. LEA.L 0(A5,D0),A3
  241. JSR RAND8
  242. JSR NEWS
  243. MOVE.L ANOTHER_PLAYER(A6),A2
  244. MOVE X_POSITION+HERO_OFFSET(A2),D0
  245. SUB X_POSITION+HERO_OFFSET(A6),D0
  246. MOVE D0,X_DIS(A6)
  247. TST D0
  248. BPL ACT_SYS_1
  249. NEG D0
  250. ACT_SYS_1:
  251. MOVE X_DIS_NEG(A6),OLD_X_DIS(A6)
  252. MOVE D0,X_DIS_NEG(A6)
  253. JSR DISTANCE_SEARCH
  254. JSR FORCE_DATA_SET ;player_level_setting
  255. JSR MINE_STATE_SET
  256. MOVE EM_STEP(A6),D0
  257. D0R_ADD
  258. MOVE.L ACTION_PROG(PC,D0),A0
  259. JSR (A0)
  260. JSR TRI_MOVE(PC)
  261. JSR NEAR_ATTACK(PC)
  262. RTS
  263. XDEF ACTION_PROG
  264. ACTION_PROG:
  265. DC.L PROG_DUMMY ;0
  266. DC.L INIT_DIS_SET ;1
  267. DC.L COM_INT1 ;2 command_interrupt type 1 operation
  268. DC.L COM_INT2 ;3 command_interrupt type 2 operation
  269. DC.L COM_INT3 ;4 command_interrupt type 3 operation
  270. DC.L COM_INT4 ;5 command_interrupt type 4 operation
  271. DC.L DEFENCE_WAIT ;6
  272. DC.L DEFENCE_NEXT ;7
  273. DC.L SANKAKU_PROG ;8
  274. DC.L UP_DEFENCE ;9
  275. DC.L DOWN_DEFENCE ;10
  276. DC.L SPECIAL_CHECK ;11
  277. DC.L ATTACK_CHECK ;12
  278. DC.L SCLIM_CHECK ;13
  279. DC.L AT_BF_CHECK ;14
  280. DC.L HK3_DMG ;15
  281. DC.L HK3_JUMP_DMG ;16
  282. DC.L DIS_SRCH_CHK ;17
  283. PROG_DUMMY:
  284. RTS
  285. NEAR_ATTACK:
  286. MOVE.W HERO_TYPE+HERO_OFFSET(A6),D1
  287. MOVE.L ANOTHER_PLAYER+HERO_OFFSET(A6),A0
  288. BTST.B #BHS_DAMAGE,HERO_STATE(A0)
  289. BNE.S NA_NON
  290. BTST.B #BHS_DOWN,HERO_STATE(A0)
  291. BEQ.S NA_1
  292. BTST.B #BHS_JUMP,HERO_STATE+HERO_OFFSET(A6)
  293. BNE.S NA_1
  294. BTST.B #BHS_DOWN,HERO_STATE+HERO_OFFSET(A6)
  295. BNE.S NA_1
  296. RTS
  297. NA_1:
  298. ADD.W D1,D1
  299. ADD.W D1,D1
  300. ADD.W D1,D1
  301. ADD.W LEVEL_TEMP(A5),D1
  302. ADD.W D1,D1
  303. MOVE.W NA_DIST(PC,D1.W),D0
  304. CMP.W X_DIS_NEG(A6),D0
  305. BCS.S NA_NON
  306. JSR.S RAND8
  307. AND.B #00110000B,D0
  308. OR.B D0,PLAY_LEVER+HERO_OFFSET+1(A6)
  309. NA_NON:
  310. RTS
  311. NA_DIST:
  312. DC.W 48,48,48,48,48,48,48,48 H1
  313. DC.W 48,48,48,48,48,48,48,48 H2
  314. DC.W 02,04,08,16,24,32,40,48 E1
  315. DC.W 02,04,08,16,24,32,40,48 E2
  316. DC.W 08,12,16,24,32,40,48,56 E3
  317. DC.W 16,32,48,48,50,52,54,54 E4
  318. DC.W 16,32,48,48,50,52,54,54 E5
  319. DC.W 02,04,08,16,24,32,40,48 E6
  320. DC.W 16,32,48,48,48,56,56,56 E7
  321. DC.W 32,48,56,56,56,56,56,56 E8
  322. TRI_MOVE:
  323. MOVE.W HERO_TYPE+HERO_OFFSET(A6),D1
  324. BTST.B #BHS_JUMP,HERO_STATE+HERO_OFFSET(A6)
  325. BEQ.S TRI_NON
  326. CMP.W #20H,ACT_CTRL+HERO_OFFSET(A6)
  327. BCC.S TRI_NON
  328. ADD.W D1,D1
  329. ADD.W D1,D1
  330. ADD.W D1,D1
  331. ADD.W LEVEL_TEMP(A5),D1
  332. ADD.W D1,D1
  333. MOVE.W TRI_DIST(PC,D1.W),D0
  334. BEQ.S TRI_NON
  335. TST.B 0(A6,D0.W)
  336. ; TST.B AREA_POSITION+HERO_OFFSET(A6)
  337. ; TST.B LIMIT_STOP(A6)
  338. BEQ.S TRI_NON
  339. MOVE.L VZ+HERO_OFFSET(A6),D0
  340. BPL.S TRI_MOVE_1
  341. NEG.L D0
  342. TRI_MOVE_1:
  343. CMP.L #30000H,D0
  344. BCC.S TRI_NON
  345. OR.B #01000000B,PLAY_LEVER+1+HERO_OFFSET(A6)
  346. OR.B #01000010B,PLAY_LEVER+HERO_OFFSET(A6)
  347. TRI_NON:
  348. RTS
  349. TRI_EI:
  350. DC.B 1,1
  351. ; 1 2 3 4 5 6 7 8
  352. DC.B 1,0,1,1,0,1,0,1
  353. LS EQU LIMIT_STOP
  354. AP EQU AREA_POSITION+HERO_OFFSET
  355. TRI_DIST:
  356. DC.W 00,00,00,00,00,00,00,00 H1
  357. DC.W 00,00,00,00,00,00,00,00 H2
  358. DC.W 00,00,LS,LS,AP,AP,AP,AP E1
  359. DC.W 00,00,00,00,00,00,00,00 E2
  360. DC.W 00,00,LS,LS,AP,AP,AP,AP E3
  361. DC.W 00,LS,LS,LS,AP,AP,AP,AP E4
  362. DC.W 00,00,00,00,00,00,00,00 E5
  363. DC.W 00,LS,LS,AP,AP,AP,AP,AP E6
  364. DC.W 00,00,00,00,00,00,00,00 E7
  365. DC.W 00,LS,AP,AP,AP,AP,AP,AP E8
  366. ;************************************************************************
  367. ;
  368. ; parameter fix output
  369. ; 1991/12/17
  370. EM_OUT:
  371. FIX_FORMAT.B CODE,00FFH
  372. FIX_AUTO 20H
  373. FIX_ADRS 2,25
  374. FIX_PRINTF
  375. DC.B '1P-STA='
  376. PARM 2,TEST_PALETTE
  377. DC.B 0FFH
  378. FIX_ADRS 2,26
  379. FIX_PRINTF
  380. DC.B '1P-DIS='
  381. PARM 2,TEST_COLOR
  382. DC.B 0FFH
  383. FIX_ADRS 2,27
  384. FIX_PRINTF
  385. DC.B '1P-TBL='
  386. PARM 2,TEST_PG
  387. DC.B 0FFH
  388. FIX_AUTO 20H
  389. FIX_ADRS 29,25
  390. FIX_PRINTF
  391. DC.B '2P-STA='
  392. PARM 2,TEST_R
  393. DC.B 0FFH
  394. FIX_ADRS 29,26
  395. FIX_PRINTF
  396. DC.B '2P-DIS='
  397. PARM 2,TEST_G
  398. DC.B 0FFH
  399. FIX_ADRS 29,27
  400. FIX_PRINTF
  401. DC.B '2P-TBL='
  402. PARM 2,TEST_B
  403. DC.B 0FFH
  404. FIX_END
  405. EM_CLEAR:
  406. FIX_FORMAT.B CODE,03FFH
  407. FIX_AUTO 20H
  408. FIX_ADRS 2,25
  409. FIX_DIRECT_DATA
  410. DC.B ' '
  411. DC.B 0FFH
  412. FIX_ADRS 2,26
  413. FIX_DIRECT_DATA
  414. DC.B ' '
  415. DC.B 0FFH
  416. FIX_ADRS 2,27
  417. FIX_DIRECT_DATA
  418. DC.B ' '
  419. DC.B 0FFH
  420. FIX_ADRS 29,25
  421. FIX_DIRECT_DATA
  422. DC.B ' '
  423. DC.B 0FFH
  424. FIX_ADRS 29,26
  425. FIX_DIRECT_DATA
  426. DC.B ' '
  427. DC.B 0FFH
  428. FIX_ADRS 29,27
  429. FIX_DIRECT_DATA
  430. DC.B ' '
  431. DC.B 0FFH
  432. FIX_END
  433. ;************************************************************************
  434. INCLUDE WORK.INC
  435. ;************************************************************************
  436.