HERO.SRC 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583
  1. ************************************************************************
  2. * *
  3. * 044 [ART OF FIGHT] *
  4. * HERO MAIN PROGRAM *
  5. * by S.OKADA from 91/09/19 Thu 16:52 *
  6. * *
  7. ************************************************************************
  8. XDEF HERO_1st,LM_HERO,DIR_CHANGE
  9. XDEF Z_MINIMUM
  10. XDEF ADC_SET
  11. XREF ?A5
  12. ;by MOVE_CHG
  13. XREF MOVE_CHANGE,CTRL_CHANGE
  14. XREF SPECIAL_CHECK
  15. XREF ATTACK_OFF,ATTACK_OFF_LM
  16. XREF TO_JUMP
  17. ;by HERO_CML
  18. XREF HERO_STATE_DISP
  19. ;by HERO_PM
  20. XREF STAR_MAKE
  21. ;by DMG_SET
  22. XREF ALL_DEAD_SOUND,RIKI_SOUND_CUT
  23. ;by BACK
  24. XREF GL
  25. ;by GAME_SUB
  26. XREF GET_OBJ_BACK_ADRS
  27. ;by SUB
  28. XREF PWORK_SET,SEC_TIME
  29. SECT HERO,,C
  30. INCLUDE GAME_SYM.INC
  31. INCLUDE MACRO.INC
  32. INCLUDE NEO_GEO.INC
  33. INCLUDE LABEL.INC
  34. INCLUDE HFLAG.INC
  35. INCLUDE HERO_STP.INC
  36. INCLUDE ACT_GRP.INC
  37. INCLUDE CTRL_No.INC
  38. INCLUDE ACT_No.INC
  39. ;
  40. ; *** hero's work configration ***
  41. ;
  42. ;HERO1,2 N0(0) p_main N0(1) weak point T2 N0(5) attack
  43. ; & gard T3 N1(2) head T1
  44. ; N2(3) body1 T0
  45. ; N3(4) shadow & body2 T0
  46. HERO_1st:
  47. MOVE.W #GL,Y_POSITION(A6)
  48. MOVEQ.L #0,D0
  49. MOVE.L D0,Z_POSITION(A6)
  50. MOVE.W D0,X_POSITION+2(A6)
  51. MOVE.W D0,Y_POSITION+2(A6)
  52. MOVE.L D0,VX(A6)
  53. MOVE.L D0,VY(A6)
  54. MOVE.L D0,VZ(A6)
  55. MOVE.B D0,STEP1(A6)
  56. MOVE.B D0,STEP2(A6)
  57. MOVE.B D0,HIT_OFF(A6)
  58. MOVE.B D0,ATTACK_LEVEL(A6)
  59. MOVE.B D0,SPECIAL_LEVER(A6)
  60. MOVE.B D0,ATTACK_TIMER(A6)
  61. MOVE.B D0,STATE(A6)
  62. MOVE.B D0,RUNNING_CT(A6)
  63. MOVE.B D0,ADC_COMMAND(A6)
  64. MOVE.W D0,HERO_SPIRIT_D(A6)
  65. MOVE.B D0,FLAG(A6)
  66. MOVE.W D0,DIRECT_CTRL(A6)
  67. MOVE.B D0,CTRL_FLAG(A6)
  68. MOVE.B D0,BEFOR_ATTACK(A6)
  69. MOVE.B D0,AREA_POSITION(A6)
  70. MOVE.B D0,RIKI_TIMER(A6)
  71. MOVE.B D0,REV_TRIG_OFF(A6)
  72. MOVE.B D0,SPECIAL_USE(A6)
  73. MOVE.B D0,WEAK_HIT(A6)
  74. MOVE.B D0,DOWN_DMG(A6)
  75. MOVE.B D0,TAMA_No(A6)
  76. MOVE.B D0,HERO_STATE_ON(A6)
  77. MOVE.B D0,PLAY_LEVER2(A6)
  78. MOVE.B D0,NON_ADC(A6)
  79. MOVE.W D0,RENDA_COUNT(A6)
  80. MOVE.B #11B,FURA_COUNT(A6)
  81. MOVE.L #1,HERO_SCORE_D(A6)
  82. MOVE.B #-1,SPECIAL_No(A6)
  83. MOVE.B #HS_AUTO,HERO_STATE(A6)
  84. MOVE.W #200H,WORD_TIMER(A6)
  85. BSR GAGE_SET
  86. MOVE.B LIFE_GAGE(A6),D0
  87. ADD.W D0,D0
  88. ADD.W D0,D0
  89. ADD.W D0,D0
  90. MOVE.W D0,HERO_LIFE(A6)
  91. SUBQ.W #1,D0
  92. MOVE.W D0,HERO_LIFE_D(A6)
  93. MOVE.B SPIRIT_GAGE(A6),D0
  94. ADD.W D0,D0
  95. ADD.W D0,D0
  96. ADD.W D0,D0
  97. MOVE.B D0,HERO_SPIRIT(A6)
  98. MOVE.B D0,(A5)
  99. MOVE.W (A5),RIKI_MAX(A6)
  100. CLR.B HERO_SPIRIT+1(A6)
  101. BSR HERO_MAIN_SET
  102. BSR HERO_WEAK_SET
  103. BSR HERO_HEAD_SET
  104. BSR HERO_BODY1_SET
  105. BSR HERO_BODY2_SET
  106. BSR HERO_ATTACK_SET
  107. BSR HERO_AREA_SET
  108. TST.B HOW_TO_FLAG(A5)
  109. BNE.S HERO_1st_001
  110. BSR HERO_FACE_SET
  111. BSR HERO_BALL_SET
  112. HERO_1st_001:
  113. MOVE.W #CTRL_STOP,D4
  114. JSR CTRL_CHANGE(PC)
  115. MOVE.B #00001111B,D0
  116. AND.B PHASE+1(A5),D0
  117. BEQ HERO_1st_1
  118. MOVE.B #HERO_STOP_STEP,D0
  119. BCLR.B #BHS_AUTO,HERO_STATE(A6)
  120. HERO_1st_1:
  121. MOVE.B D0,STEP1(A6)
  122. MOVE.W HERO_TYPE(A6),D0
  123. ADD.W D0,D0
  124. MOVE.W HERO_MIN_DIST(PC,D0.W),D0
  125. ADD.W D0,MIN_DISTANCE(A5)
  126. RTS
  127. HERO_MIN_DIST:
  128. DC.W 32,32
  129. DC.W 32,32,32,32
  130. DC.W 32,32,32,32
  131. GAGE_SET:
  132. BTST.B #6,PHASE+1(A5)
  133. BNE.S GAGE_COM
  134. BTST.B #4,PHASE+1(A5)
  135. BNE.S GAGE_VS
  136. BTST.B #BPS_COM_FLAG,PLAYER_STATE+PLAYER_OFFSET(A6)
  137. BEQ.S GAGE_COM
  138. MOVE.B STORY_LIFE(A5),LIFE_GAGE(A6)
  139. MOVE.B STORY_SPIRIT(A5),SPIRIT_GAGE(A6)
  140. RTS
  141. GAGE_VS:
  142. MOVE.B #16,LIFE_GAGE(A6)
  143. MOVE.B #16,SPIRIT_GAGE(A6)
  144. RTS
  145. GAGE_COM:
  146. MOVE.W HERO_TYPE(A6),D0
  147. ADD.W D0,D0
  148. MOVE.B GAGE_COMD(PC,D0.W),LIFE_GAGE(A6)
  149. MOVE.B GAGE_COMD+1(PC,D0.W),SPIRIT_GAGE(A6)
  150. RTS
  151. GAGE_COMD:
  152. DC.B 12,12 H1
  153. DC.B 12,12 H2
  154. DC.B 12,13 E1
  155. DC.B 14,12 E2
  156. DC.B 13,16 E3
  157. DC.B 13,14 E4
  158. DC.B 14,13 E5
  159. DC.B 14,13 E6
  160. DC.B 16,13 E7
  161. DC.B 16,16 E8
  162. HERO_MAIN_SET:
  163. MOVEP.W HERO_OBJ_START(A6),D0
  164. CLR.B D0
  165. LEA.L 0(A5,D0.W),A0
  166. MOVE.L #P_HERO*10000H,D2
  167. MOVE.B #90H,D5 PRIORITY
  168. JSR.S PWORK_SET
  169. LEA.L (A0),A4
  170. MOVE.B WORK_No(A6),MASTER_No(A4)
  171. MOVE.B WORK_No(A4),WORK_N0(A6)
  172. MOVE.L X_POSITION(A6),X_POSITION(A4)
  173. MOVE.L Y_POSITION(A6),Y_POSITION(A4)
  174. MOVE.L Z_POSITION(A6),Z_POSITION(A4)
  175. CLR.L VX(A4)
  176. CLR.L VY(A4)
  177. CLR.L VZ(A4)
  178. MOVE.B #0010B,HIT_ACTIVE(A4)
  179. MOVE.B #0001B,HIT_PASSIVE(A4)
  180. MOVE.W PLAYER_No+PLAYER_OFFSET(A6),D0
  181. OR.B D0,ACT_ATTR(A4)
  182. MOVE.B #3,HIT_TYPE_No(A4)
  183. RTS
  184. HERO_WEAK_SET:
  185. LEA.L 100H(A0),A0
  186. LEA.L (A0),A1
  187. MOVE.B WORK_No(A4),MASTER_No(A0)
  188. MOVE.B WORK_No(A0),WORK_N0(A4)
  189. MOVE.W #P_HERO_WEAK,TYPE(A0)
  190. MOVE.B #0010B,HIT_ACTIVE(A0)
  191. MOVE.B #0001B,HIT_PASSIVE(A0)
  192. MOVE.B #2,HIT_TYPE_No(A0)
  193. MOVEQ.L #0,D0
  194. MOVE.B D0,HIT_FLAG(A0)
  195. MOVE.L D0,HIT_OFS_X(A0)
  196. MOVE.L D0,HIT_LEFT(A0)
  197. MOVE.L D0,HIT_UPPER(A0)
  198. RTS
  199. HERO_HEAD_SET:
  200. LEA.L 100H(A0),A0
  201. MOVE.B WORK_No(A4),MASTER_No(A0)
  202. MOVE.B WORK_No(A0),WORK_N1(A4)
  203. MOVE.W #P_HERO_HEAD,TYPE(A0)
  204. MOVE.B #0010B,HIT_ACTIVE(A0)
  205. MOVE.B #0001B,HIT_PASSIVE(A0)
  206. MOVE.B #1,HIT_TYPE_No(A0)
  207. MOVEQ.L #0,D0
  208. MOVE.W D0,ACT_No(A0)
  209. MOVE.B D0,HIT_FLAG(A0)
  210. MOVE.L D0,HIT_OFS_X(A0)
  211. MOVE.L D0,HIT_LEFT(A0)
  212. MOVE.L D0,HIT_UPPER(A0)
  213. RTS
  214. HERO_BODY1_SET:
  215. LEA.L 100H(A0),A0
  216. MOVE.B WORK_No(A4),MASTER_No(A0)
  217. MOVE.B WORK_No(A0),WORK_N2(A4)
  218. MOVE.W #P_HERO_BODY,TYPE(A0)
  219. MOVE.B #0010B,HIT_ACTIVE(A0)
  220. MOVE.B #0001B,HIT_PASSIVE(A0)
  221. MOVE.B #0,HIT_TYPE_No(A0)
  222. MOVEQ.L #0,D0
  223. MOVE.B D0,ACT_TYPE(A0)
  224. MOVE.B D0,HIT_FLAG(A0)
  225. MOVE.L D0,HIT_OFS_X(A0)
  226. MOVE.L D0,HIT_LEFT(A0)
  227. MOVE.L D0,HIT_UPPER(A0)
  228. RTS
  229. HERO_BODY2_SET:
  230. LEA.L 100H(A0),A0
  231. MOVE.L #P_HERO_SHADOW*10000H+63H,D2 C_KAGE
  232. MOVE.B #8FH,D5 PRIORITY
  233. JSR.S PWORK_SET
  234. MOVE.B WORK_No(A4),MASTER_No(A0)
  235. MOVE.B WORK_No(A0),WORK_N3(A4)
  236. MOVE.B #0010B,HIT_ACTIVE(A0)
  237. MOVE.B #0001B,HIT_PASSIVE(A0)
  238. MOVE.B #0,HIT_TYPE_No(A0)
  239. MOVE.B PLAYER_No+PLAYER_OFFSET+1(A6),ACT_TYPE(A0)
  240. MOVEQ.L #0,D0
  241. MOVE.B D0,HIT_FLAG(A0)
  242. MOVE.L D0,HIT_OFS_X(A0)
  243. MOVE.L D0,HIT_LEFT(A0)
  244. MOVE.L D0,HIT_UPPER(A0)
  245. RTS
  246. HERO_ATTACK_SET:
  247. LEA.L 100H(A0),A0
  248. MOVE.B WORK_No(A4),MASTER_No(A0)
  249. MOVE.B WORK_No(A0),WORK_N0(A1)
  250. MOVE.W #P_HERO_ATTACK,TYPE(A0)
  251. MOVE.B #0001B,HIT_ACTIVE(A0)
  252. MOVE.B #0010B,HIT_PASSIVE(A0)
  253. MOVE.B #0,HIT_TYPE_No(A0)
  254. MOVEQ.L #0,D0
  255. MOVE.L D0,VX(A0)
  256. MOVE.L D0,VY(A0)
  257. MOVE.B D0,HIT_FLAG(A0)
  258. MOVE.L D0,HIT_OFS_X(A0)
  259. MOVE.L D0,HIT_LEFT(A0)
  260. MOVE.L D0,HIT_UPPER(A0)
  261. MOVE.B D0,LEVEL(A0)
  262. RTS
  263. HERO_AREA_SET:
  264. LEA.L 100H(A0),A0
  265. MOVE.B WORK_No(A4),MASTER_No(A0)
  266. MOVE.B WORK_No(A0),WORK_N1(A1)
  267. MOVE.W #P_HERO_AREA,TYPE(A0)
  268. MOVEQ.L #0,D0
  269. MOVE.B D0,HIT_FLAG(A0)
  270. MOVE.L D0,HIT_OFS_X(A0)
  271. MOVE.L D0,HIT_LEFT(A0)
  272. MOVE.L D0,HIT_UPPER(A0)
  273. RTS
  274. HERO_FACE_SET:
  275. LEA.L 100H(A0),A0
  276. MOVE.B WORK_No(A0),WORK_N1(A6)
  277. MOVE.L #P_HERO_DISP*10000H+C_PLAY_FACE,D2
  278. MOVE.B #0E0H,D5
  279. JSR.S PWORK_SET
  280. MOVE.W #0C7H,REL_Y(A0)
  281. MOVE.W #28H,REL_X(A0)
  282. TST.W PLAYER_No+PLAYER_OFFSET(A6)
  283. BEQ.S HERO_FACE_SET_1
  284. MOVE.W #320-28H,REL_X(A0)
  285. BSET.B #ACTAT_FLIP,ACT_ATTR(A0)
  286. HERO_FACE_SET_1:
  287. MOVE.W HERO_TYPE(A6),D0
  288. SUBQ.B #1,D0
  289. MOVE.B D0,ACT_COUNT(A0)
  290. RTS
  291. HERO_BALL_SET:
  292. LEA.L 100H(A0),A0
  293. MOVE.B WORK_No(A0),WORK_N2(A6)
  294. MOVE.L #P_HERO_DISP*10000H+C_WIN_BALL,D2
  295. MOVE.B #0E0H,D5
  296. JSR.S PWORK_SET
  297. MOVE.W #0BFH,REL_Y(A0)
  298. RTS
  299. LM_HERO:
  300. ; hero move
  301. ; A4 sub PWORK :WORK_N0
  302. ; auto send to A4 X,Y,Z_POSITION
  303. ; VX
  304. ; move caluculation in PM_HERO and position back
  305. ; VY,VZ send by command own.(if need. default 0)
  306. JSR HERO_STATE_DISP(PC)
  307. MOVE.B WORK_N0(A6),(A5)
  308. MOVE.W (A5),D0
  309. LEA.L 0(A5,D0.W),A4
  310. CLR.L VY(A4)
  311. CLR.L VZ(A4)
  312. BSR RENDA_DEC
  313. BSR ACT_DEAD_CUT
  314. BSR LOWER_SET
  315. BSR REV_TRIG_CHECK
  316. BSR BEFOR_STEP
  317. BSR ATTACK_DEC
  318. BSR FALL_CHECK
  319. BSR DAMAGE_CHECK
  320. BSR LOCK_CHECK
  321. JSR SPECIAL_CHECK(PC)
  322. BCLR.B #BHS_DEFENCE,HERO_STATE(A6)
  323. MOVEQ.L #0,D0
  324. MOVE.B STEP1(A6),D0
  325. ADD.B D0,D0
  326. ADD.B D0,D0
  327. MOVE.L LM_HERO_VECTOR(PC,D0.W),A0
  328. JSR (A0)
  329. MOVE.L X_POSITION(A6),X_POSITION(A4)
  330. MOVE.L Y_POSITION(A6),Y_POSITION(A4)
  331. MOVE.L Z_POSITION(A6),Z_POSITION(A4)
  332. MOVE.L VX(A6),VX(A4)
  333. JSR ACT_DATA_MOVE(PC)
  334. ; JSR BACK_OBJ_JUDGE(PC)
  335. ; JSR OBJECT_HIT(PC)
  336. RTS
  337. LM_HERO_VECTOR:
  338. DC.L HERO_START start ready wait
  339. DC.L HERO_WALK front walk
  340. DC.L HERO_BACK back walk
  341. DC.L HERO_ATTACK normal attack
  342. DC.L HERO_JUMP jump
  343. DC.L HERO_SIT down
  344. DC.L HERO_DAMAGE1 move bururu
  345. DC.L HERO_DAMAGE2 non bururu
  346. DC.L HERO_FALL after jump
  347. DC.L HERO_CHECK action check
  348. DC.L HERO_TO_SIT to sit down
  349. DC.L HERO_UP to up from down
  350. DC.L HERO_LOCK_OFF lock
  351. DC.L HERO_LOCK_DEF lock
  352. DC.L HERO_STOP stop
  353. DC.L HERO_DAMAGE3 stop bururu
  354. DC.L HERO_RUN running
  355. DC.L HERO_RUNB running
  356. DC.L HERO_NAGERARE nagerare
  357. DC.L HERO_STARTC start jump
  358. DC.L HERO_WIN win or los
  359. DC.L HERO_WIN
  360. DC.L HERO_RIKI
  361. DC.L HERO_COM
  362. DC.L HERO_FURA
  363. DC.L HERO_RET100
  364. DC.L HERO_STARTD
  365. BEFOR_STEP:
  366. MOVEQ.L #0,D0
  367. MOVE.B STEP2(A6),D0
  368. ADD.B D0,D0
  369. ADD.B D0,D0
  370. MOVE.L LM2_HERO_VECTOR(PC,D0.W),A0
  371. JMP (A0)
  372. LM2_HERO_VECTOR:
  373. DC.L LM2_HERO0 no
  374. DC.L LM2_HERO1 no move
  375. DC.L LM2_HERO2 stop
  376. DC.L LM2_HERO3 no damage
  377. DC.L LM2_HERO4 bururu
  378. DC.L LM2_HERO5 no damage
  379. ACT_DEAD_CUT:
  380. MOVE.L ANOTHER_PLAYER(A6),A0
  381. TST.W HERO_LIFE(A0)
  382. BNE.S ACT_DEAD_CUT_1
  383. CLR.B DOWN_DMG(A6)
  384. TST.B ACT_No(A4)
  385. BPL.S ACT_DEAD_CUT_1
  386. BCLR.B #6,ACT_No(A4)
  387. BEQ.S ACT_DEAD_CUT_1
  388. MOVE.L CML_STACK(A4),ADRS1(A4)
  389. ACT_DEAD_CUT_1:
  390. RTS
  391. REV_TRIG_CHECK:
  392. BTST.B #B_C_BUTTON,PLAY_LEVER+1(A6)
  393. BEQ.S RTC_1
  394. CLR.B REV_TRIG_OFF(A6)
  395. RTC_1:
  396. RTS
  397. ATTACK_DEC:
  398. ; TST.B ATTACK_TIMER(A6)
  399. ; BEQ.S ATTACK_DEC_1
  400. ;
  401. ; SUBQ.B #1,ATTACK_TIMER(A6)
  402. ;ATTACK_DEC_1:
  403. RTS
  404. HERO_RET100:
  405. CLR.L VX(A6)
  406. CLR.L VZ(A6)
  407. MOVE.L ANOTHER_PLAYER(A6),A0
  408. CMP.B #ATTACK_STEP,STEP1(A0)
  409. BNE RET100_OFF
  410. CMP.B #1,ACT_TIMER(A4)
  411. BNE HERO_RET100_END
  412. MOVE.L ADRS1(A4),A1
  413. MOVE.W RET100_No(A0),D0
  414. ADD.W D0,D0
  415. ADD.W D0,D0
  416. MOVE.W 0(A1,D0.W),D1
  417. BTST.B #ACTAT_FLIP,ACT_ATTR(A4)
  418. BNE.S HERO_RET100_1
  419. NEG.W D1
  420. HERO_RET100_1:
  421. MOVE.W X_POSITION(A6),D2
  422. SUB.W X_POSITION(A0),D2
  423. SUB.W D2,D1
  424. ASR.W #3,D1
  425. ADD.W D1,X_POSITION(A6)
  426. MOVE.W 2(A1,D0.W),D1
  427. MOVE.W Z_POSITION(A6),D2
  428. SUB.W Z_POSITION(A0),D2
  429. SUB.W D2,D1
  430. ASR.W #3,D1
  431. ADD.W D1,Z_POSITION(A6)
  432. HERO_RET100_END:
  433. RTS
  434. RET100_OFF:
  435. MOVE.W #6FH*2,D0 100RETU_STOP
  436. JSR.S SET_SOUND
  437. MOVE.B #0,DEF_DAMAGE_ACT_TYPE(A6)
  438. MOVE.B #0,DAMAGE_LEVEL(A6)
  439. MOVE.B #1,DEF_HIT_TYPE_No(A6)
  440. MOVE.W #CTRL_DAMAGE,D4
  441. JMP CTRL_CHANGE(PC)
  442. HERO_WIN:
  443. CLR.L VX(A6)
  444. CLR.L VZ(A6)
  445. CLR.L VX(A4)
  446. CLR.L VZ(A4)
  447. RTS
  448. HERO_STARTD:
  449. HERO_COM:
  450. CLR.L VX(A6)
  451. TST.B ACT_FLAG(A4)
  452. BPL.S HERO_COM_3
  453. MOVE.W #CTRL_STOP,D4
  454. JSR CTRL_CHANGE(PC)
  455. HERO_COM_3:
  456. RTS
  457. HERO_RIKI:
  458. CLR.L VX(A6)
  459. MOVE.B PLAY_LEVER(A6),D0
  460. AND.B #A_BUTTON+B_BUTTON,D0
  461. BNE.S HERO_RIKI_1
  462. HERO_RIKI_0:
  463. JSR RIKI_SOUND_CUT(PC)
  464. MOVE.W #CTRL_STOP,D4
  465. JMP CTRL_CHANGE(PC)
  466. HERO_RIKI_1:
  467. ; SUBQ.B #1,RIKI_TIMER(A6)
  468. ; BCS HERO_RIKI_END
  469. LEA.L RIKI_RIKI_TIME(PC),A0
  470. BSR RIKI_UP
  471. MOVE.W RIKI_MAX(A6),D0
  472. CMP.W HERO_SPIRIT(A6),D0
  473. BEQ.S HERO_RIKI_0
  474. RTS
  475. RIKI_DEC:
  476. LEA.L AUTO_RIKI_TIME(PC),A0
  477. MOVE.W HERO_TYPE(A6),D0
  478. ADD.W D0,D0
  479. BTST.B #BPS_COM_FLAG,PLAYER_STATE+PLAYER_OFFSET(A6)
  480. BNE.S RIKI_DEC_11
  481. ADDQ.W #1,D0
  482. RIKI_DEC_11:
  483. ADD.W D0,D0
  484. MOVE.W 0(A0,D0.W),D0
  485. ADD.W D0,D0
  486. ADD.W D0,D0
  487. SUB.W D0,HERO_SPIRIT(A6)
  488. CMP.B #129,HERO_SPIRIT(A6)
  489. BCS.S RIKI_DEC_2
  490. MOVE.W #1,HERO_SPIRIT(A6)
  491. RIKI_DEC_2:
  492. RTS
  493. AUTO_RIKI_UP:
  494. LEA.L AUTO_RIKI_TIME(PC),A0
  495. RIKI_UP:
  496. MOVE.W HERO_TYPE(A6),D0
  497. ADD.W D0,D0
  498. BTST.B #BPS_COM_FLAG,PLAYER_STATE+PLAYER_OFFSET(A6)
  499. BNE.S HERO_RIKI_11
  500. ADDQ.W #1,D0
  501. HERO_RIKI_11:
  502. ADD.W D0,D0
  503. MOVE.W 0(A0,D0.W),D0
  504. ADD.W HERO_SPIRIT(A6),D0
  505. CMP.W RIKI_MAX(A6),D0
  506. BCS.S HERO_RIKI_2
  507. MOVE.W RIKI_MAX(A6),D0
  508. HERO_RIKI_2:
  509. MOVE.W D0,HERO_SPIRIT(A6)
  510. RTS
  511. HERO_RIKI_END:
  512. MOVE.W #CTRL_STOP,D4
  513. JMP CTRL_CHANGE(PC)
  514. RIKI_RIKI_TIME:
  515. DC.W 80H,80H H1
  516. DC.W 80H,80H H2
  517. DC.W 80H,70H E1
  518. DC.W 80H,70H E2
  519. DC.W 80H,80H E3
  520. DC.W 60H,90H E4
  521. DC.W 80H,90H E5
  522. DC.W 60H,0A0H E6
  523. DC.W 80H,0C0H E7
  524. DC.W 80H,100H E8
  525. AUTO_RIKI_TIME:
  526. DC.W 4,4 H1
  527. DC.W 4,4 H2
  528. DC.W 4,4 E1
  529. DC.W 4,4 E2
  530. DC.W 4,4 E3
  531. DC.W 4,4 E4
  532. DC.W 4,4 E5
  533. DC.W 4,5 E6
  534. DC.W 4,8 E7
  535. DC.W 4,16 E8
  536. HERO_START:
  537. ; start ready wait
  538. JSR DIR_CHANGE(PC)
  539. LEA.L WORD_TIMER(A6),A0
  540. JSR.S SEC_TIME
  541. BCC HERO_START_1
  542. MOVE.W #CTRL_STARTC,D4
  543. JSR CTRL_CHANGE(PC)
  544. HERO_START_1:
  545. RTS
  546. HERO_STARTC:
  547. CLR.L VX(A6)
  548. TST.B ACT_FLAG(A4)
  549. BMI HERO_STARTC_END
  550. BTST.B #BHS_JUMP,HERO_STATE(A6)
  551. BEQ.S HERO_STARTC_10
  552. JSR JUMP_MOVE(PC)
  553. TST.L D0
  554. BNE.S HERO_STARTC_1
  555. BTST.B #5,ACT_FLAG(A4) down stop ?
  556. BNE.S HERO_STARTC_1
  557. MOVE.B #1,ACT_DEC(A4)
  558. HERO_STARTC_1:
  559. BTST.B #BHS_JUMP,HERO_STATE(A6)
  560. BNE.S HERO_STARTC_2
  561. HERO_STARTC_10:
  562. MOVE.B #1,ACT_DEC(A4)
  563. HERO_STARTC_2:
  564. RTS
  565. HERO_STARTC_END:
  566. MOVE.W #CTRL_STOP,D4
  567. JSR CTRL_CHANGE(PC)
  568. RTS
  569. HERO_STOP:
  570. ; stop
  571. JSR AUTO_RIKI_UP(PC)
  572. MOVE.W RIKI_MAX(A6),D0
  573. CMP.W HERO_SPIRIT(A6),D0
  574. BEQ.S HERO_STOP_2
  575. MOVE.B PLAY_LEVER(A6),D0
  576. AND.B #A_BUTTON+B_BUTTON,D0
  577. BEQ.S HERO_STOP_2
  578. AND.B #0F0H,PLAY_LEVER(A6)
  579. AND.B #0F0H,PLAY_LEVER+1(A6)
  580. AND.B #0F0H,PLAY_LEVER+2(A6)
  581. ADDQ.B #1,RIKI_TIMER(A6)
  582. CMP.B #30,RIKI_TIMER(A6)
  583. BCS.S HERO_STOP_2
  584. CLR.B RIKI_TIMER(A6)
  585. MOVE.W RIKI_MAX(A6),D0
  586. CMP.W HERO_SPIRIT(A6),D0
  587. BEQ.S HERO_STOP_2
  588. MOVE.W #CTRL_RIKI,D4
  589. JMP CTRL_CHANGE(PC)
  590. HERO_STOP_2:
  591. JSR DIR_CHANGE(PC)
  592. HERO_STOP_3:
  593. JSR RUNNING_CHECK(PC)
  594. BNE TO_RUNNING
  595. JSR MOVE_CHANGE(PC)
  596. BNE HERO_STOP_1
  597. TST.B BEFOR_PUSH(A6)
  598. BEQ.S HERO_STOP_301
  599. SUBQ.B #1,BEFOR_PUSH(A6)
  600. BRA.S HERO_STOP_1
  601. HERO_STOP_301:
  602. JSR WALK_JUDGE(PC)
  603. CMP.B #HERO_STOP_STEP,STEP1(A6)
  604. BNE HERO_STOP_MOVE move
  605. CMP.B #CG_STOP,ACT_GROUP(A6)
  606. BEQ.S HERO_STOP_1
  607. BTST.B #6,ACT_FLAG(A4)
  608. BNE.S HERO_STOP_1
  609. MOVE.W #CTRL_STOP,D4
  610. JSR CTRL_CHANGE(PC)
  611. HERO_STOP_1:
  612. RTS
  613. HERO_STOP_MOVE:
  614. CMP.B #BACK_STEP,STEP1(A6)
  615. BEQ HERO_BACK_00
  616. RTS
  617. HERO_WALK:
  618. ; front walk
  619. JSR AUTO_RIKI_UP(PC)
  620. JSR DIR_CHANGE(PC)
  621. JSR RUNNING_CHECK(PC)
  622. BNE TO_RUNNING
  623. JSR MOVE_CHANGE(PC)
  624. BNE HERO_WALK_1
  625. JSR WALK_JUDGE(PC)
  626. HERO_WALK_1:
  627. RTS
  628. HERO_BACK:
  629. ; back walk or standing gard
  630. JSR AUTO_RIKI_UP(PC)
  631. JSR DIR_CHANGE(PC)
  632. JSR RUNNING_CHECK(PC)
  633. BNE TO_RUNNING
  634. JSR MOVE_CHANGE(PC)
  635. BNE HERO_BACK_4
  636. JSR WALK_JUDGE(PC)
  637. HERO_BACK_00:
  638. CMP.B #BACK_STEP,STEP1(A6)
  639. BNE HERO_BACK_4
  640. BSET.B #BHS_DEFENCE,HERO_STATE(A6)
  641. JSR GARD_JUDGE(PC)
  642. BEQ HERO_BACK_2
  643. CLR.L VX(A6)
  644. CMP.B #CG_WALKG,ACT_GROUP(A6)
  645. BEQ HERO_BACK_1
  646. MOVE.W #CTRL_GARD,D4
  647. JSR CTRL_CHANGE(PC)
  648. HERO_BACK_1:
  649. RTS
  650. HERO_BACK_2:
  651. CMP.B #CG_WALKB,ACT_GROUP(A6)
  652. BEQ HERO_BACK_4
  653. CMP.B #CG_WALKG,ACT_GROUP(A6)
  654. BNE HERO_BACK_3
  655. MOVE.B #1,ACT_DEC(A4)
  656. TST.B ACT_FLAG(A4)
  657. BMI HERO_BACK_3
  658. CLR.L VX(A6)
  659. RTS
  660. HERO_BACK_3:
  661. MOVE.W #CTRL_WALK_BACK,D4
  662. JSR CTRL_CHANGE(PC)
  663. HERO_BACK_4:
  664. RTS
  665. GARD_JUDGE:
  666. MOVE.L ANOTHER_PLAYER(A6),A0
  667. TST.B SPECIAL_USE(A0)
  668. BNE GARD_JUDGE_1
  669. CMP.B #2,BACK2+STEP1(A5)
  670. BEQ GARD_JUDGE_1
  671. MOVEP.W WORK_N0(A0),D0
  672. CLR.B D0
  673. BTST.B #4,ACT_FLAG(A5,D0.W)
  674. GARD_JUDGE_1:
  675. RTS
  676. WALK_JUDGE:
  677. MOVEQ.L #LEFT+RIGHT,D0
  678. AND.B PLAY_LEVER(A6),D0
  679. BEQ WALK_JUDGE_2 walk
  680. BSR WALK_SPEED
  681. MOVE.L D1,VX(A6)
  682. CMP.B D3,D0
  683. BNE WALK_JUDGE_3
  684. CMP.B #WALK_STEP,STEP1(A6)
  685. BEQ.S WALK_JUDGE_1
  686. MOVE.W #CTRL_WALK,D4
  687. JSR CTRL_CHANGE(PC)
  688. WALK_JUDGE_1:
  689. RTS
  690. WALK_JUDGE_2:
  691. CLR.L VX(A6)
  692. MOVE.B #HERO_STOP_STEP,STEP1(A6)
  693. RTS
  694. WALK_JUDGE_3:
  695. CMP.B #BACK_STEP,STEP1(A6)
  696. BEQ.S WALK_JUDGE_4
  697. MOVE.B #BACK_STEP,STEP1(A6)
  698. WALK_JUDGE_4:
  699. RTS
  700. WALK_SPEED:
  701. MOVE.W HERO_TYPE(A6),D1
  702. ADD.W D1,D1
  703. ADD.W D1,D1
  704. ADD.W D1,D1
  705. BSR FOWARD_JUDGE
  706. BEQ.S WALK_SPEED_1
  707. ADDQ.W #4,D1
  708. WALK_SPEED_1:
  709. MOVE.L WALK_SPEED_DATA(PC,D1.W),D1
  710. TST.B D2
  711. BEQ.S WALK_SPEED_2
  712. NEG.L D1
  713. WALK_SPEED_2:
  714. RTS
  715. FOWARD_JUDGE:
  716. MOVEQ.L #1,D2
  717. AND.B ACT_ATTR(A4),D2
  718. MOVE.B FOWARD_LEVER(PC,D2.W),D3
  719. CMP.B D3,D0
  720. RTS
  721. FOWARD_LEVER:
  722. DC.B RIGHT,LEFT
  723. WALK MACRO SPEED1,SPEED2
  724. SH SET SPEED1/100
  725. SL SET SPEED1-SH*100
  726. DC.W SH,(SL*10000H)/100
  727. SH SET SPEED2/100
  728. SL SET SPEED2-SH*100
  729. DC.W SH,(SL*10000H)/100
  730. ENDM
  731. WALK_SPEED_DATA:
  732. WALK 300,-300 0
  733. WALK 300,-300 1
  734. WALK 300,-300 2
  735. WALK 200,-250 3
  736. WALK 450,-450 4
  737. WALK 300,-300 5
  738. WALK 300,-300 6
  739. WALK 300,-300 7
  740. WALK 300,-300 8
  741. WALK 300,-300 9
  742. WALK 300,-300 10
  743. TO_RUNNING:
  744. MOVE.W #30,RUNNING_TIMER(A6)
  745. MOVEQ.L #LEFT+RIGHT,D0
  746. AND.B PLAY_LEVER(A6),D0
  747. BSR FOWARD_JUDGE
  748. BNE TO_BACK_RUN
  749. MOVE.W #CTRL_RUN,D4
  750. JSR CTRL_CHANGE(PC)
  751. RTS
  752. TO_BACK_RUN:
  753. MOVE.W #CTRL_RUN_BACK,D4
  754. JSR CTRL_CHANGE(PC)
  755. RTS
  756. HERO_RUN:
  757. ; foward running
  758. JSR AUTO_RIKI_UP(PC)
  759. JSR RUN_ATTACK(PC)
  760. MOVE.B ACT_FLAG(A4),D0
  761. BMI RUNNING_STOP
  762. BTST.L #6,D0
  763. BNE.S HERO_RUN_0
  764. JSR MOVE_CHANGE(PC)
  765. BNE HERO_RUN_1
  766. MOVE.B PLAY_LEVER(A6),D0
  767. AND.B #00001111B,D0
  768. BEQ.S HERO_RUN_0
  769. CMP.B RUNNING_LEVER(A6),D0
  770. BNE RUNNING_STOP
  771. HERO_RUN_0:
  772. BSR RUN_SPEED
  773. HERO_RUN_1:
  774. RTS
  775. RUN_ATTACK:
  776. MOVEQ.L #CTRL_RUN_PUNCH,D4
  777. BTST.B #B_A_BUTTON,PLAY_LEVER+1(A6)
  778. BNE.S RA_ATTACK
  779. MOVEQ.L #CTRL_RUN_KICK,D4
  780. BTST.B #B_B_BUTTON,PLAY_LEVER+1(A6)
  781. BNE.S RA_ATTACK
  782. RAA_1:
  783. RTS
  784. RA_ATTACK:
  785. JSR CTRL_CHANGE(PC)
  786. BEQ.S RAA_1
  787. ADDQ.L #4,SP
  788. RTS
  789. HERO_RUNB:
  790. ; back running
  791. JSR AUTO_RIKI_UP(PC)
  792. MOVE.B ACT_FLAG(A4),D0
  793. BMI RUNNING_STOP
  794. BTST.L #6,D0
  795. BNE.S HERO_RUNB_0
  796. JSR MOVE_CHANGE(PC)
  797. BNE HERO_RUNB_1
  798. MOVE.B PLAY_LEVER(A6),D0
  799. AND.B #00001111B,D0
  800. BEQ.S HERO_RUNB_0
  801. CMP.B RUNNING_LEVER(A6),D0
  802. BNE RUNNING_STOP
  803. HERO_RUNB_0:
  804. BSR RUN_SPEED
  805. HERO_RUNB_1:
  806. RTS
  807. RUNNING_STOP:
  808. MOVE.W #CTRL_STOP,D4
  809. JSR CTRL_CHANGE(PC)
  810. RTS
  811. RUN_SPEED:
  812. MOVEQ.L #LEFT+RIGHT,D0
  813. AND.B RUNNING_LEVER(A6),D0
  814. MOVE.W HERO_TYPE(A6),D1
  815. ADD.W D1,D1
  816. ADD.W D1,D1
  817. ADD.W D1,D1
  818. BSR FOWARD_JUDGE
  819. BEQ.S RUN_SPEED_1
  820. ADDQ.W #4,D1
  821. RUN_SPEED_1:
  822. MOVE.L RUN_SPEED_DATA(PC,D1.W),D1
  823. TST.B D2
  824. BEQ.S RUN_SPEED_2
  825. NEG.L D1
  826. RUN_SPEED_2:
  827. MOVE.L D1,VX(A6)
  828. RTS
  829. RUN_SPEED_DATA:
  830. WALK 561,-561 0
  831. WALK 561,-561 1
  832. WALK 395,-395 1
  833. WALK 400,-600 2
  834. WALK 190,-190 3
  835. WALK 425,-425 4
  836. WALK 425,-566 5
  837. WALK 425,-425 6
  838. WALK 840,-840 7
  839. WALK 561,-561 8
  840. HERO_ATTACK:
  841. ; normal attack
  842. CLR.L VX(A6)
  843. JSR RENDA_CHECK(PC)
  844. BTST.B #BHS_JUMP,HERO_STATE(A6)
  845. BEQ.S HERO_ATTACK_101
  846. JSR JUMP_MOVE(PC)
  847. BTST.B #BHS_JUMP,HERO_STATE(A6)
  848. BNE.S HERO_ATTACK_1
  849. BTST.B #3,ACT_FLAG(A4)
  850. BEQ.S HERO_ATTACK_6
  851. HERO_ATTACK_101:
  852. MOVE.B #1,ACT_DEC(A4)
  853. HERO_ATTACK_1:
  854. TST.B ACT_FLAG(A4)
  855. BPL.S HERO_ATTACK_5
  856. BTST.B #BHS_JUMP,HERO_STATE(A6)
  857. BNE.S HERO_ATTACK_3
  858. BTST.B #BHS_DOWN,HERO_STATE(A6)
  859. BNE.S HERO_ATTACK_4
  860. HERO_ATTACK_2:
  861. JSR ATTACK_OFF_LM(PC)
  862. MOVE.B #ATTACK_TIME1,ATTACK_TIMER(A6)
  863. MOVE.W #CTRL_STOP,D4
  864. JSR CTRL_CHANGE(PC)
  865. MOVE.B #12,BEFOR_PUSH(A6)
  866. RTS
  867. HERO_ATTACK_3:
  868. JSR ATTACK_OFF_LM(PC)
  869. MOVE.B #ATTACK_TIME1,ATTACK_TIMER(A6)
  870. MOVE.W #CTRL_FALL,D4
  871. JSR CTRL_CHANGE(PC)
  872. RTS
  873. HERO_ATTACK_4:
  874. JSR ATTACK_OFF_LM(PC)
  875. MOVE.B #ATTACK_TIME1,ATTACK_TIMER(A6)
  876. MOVE.W #CTRL_SIT,D4
  877. JSR CTRL_CHANGE(PC)
  878. HERO_ATTACK_5:
  879. RTS
  880. HERO_ATTACK_6:
  881. JSR ATTACK_OFF_LM(PC)
  882. MOVE.B #ATTACK_TIME1,ATTACK_TIMER(A6)
  883. MOVE.W #CTRL_LANDING,D4
  884. JSR CTRL_CHANGE(PC)
  885. RTS
  886. RENDA_CHECK:
  887. BTST.B #RENDA_ON,DEBUG_DIP2(A5)
  888. BEQ RENDA_CHECK_1
  889. MOVE.B HERO_STATE(A6),D0
  890. AND.B #HS_DOWN+HS_JUMP,D0
  891. BNE RENDA_OFF
  892. MOVE.W HERO_TYPE(A6),D1
  893. MOVE.B RENDA_BUTTON(PC,D1.W),D0
  894. AND.B PLAY_LEVER+1(A6),D0
  895. BEQ.S RENDA_CHECK_1
  896. ADD.W D1,D1
  897. MOVE.W RENDA_ATTACK(PC,D1.W),D4
  898. CMP.W ACT_CTRL(A6),D4
  899. BEQ.S RENDA_OFF
  900. ADD.W #25,RENDA_COUNT(A6)
  901. CMP.W #60,RENDA_COUNT(A6)
  902. BCS.S RENDA_CHECK_1
  903. JSR CTRL_CHANGE(PC)
  904. ADDQ.L #4,SP
  905. RENDA_OFF:
  906. CLR.W RENDA_COUNT(A6)
  907. RENDA_CHECK_1:
  908. RTS
  909. RENDA_DEC:
  910. BTST.B #RENDA_ON,DEBUG_DIP2(A5)
  911. BEQ RENDA_DEC_1
  912. TST.W RENDA_COUNT(A6)
  913. BEQ.S RENDA_DEC_1
  914. SUBQ.W #1,RENDA_COUNT(A6)
  915. RENDA_DEC_1:
  916. RTS
  917. RENDA_BUTTON:
  918. DC.B A_BUTTON,B_BUTTON
  919. DC.B 0,0
  920. DC.B A_BUTTON,0
  921. DC.B 0,0,0,A_BUTTON
  922. RENDA_ATTACK:
  923. DC.W 42H,42H,42H,42H,43H,42H
  924. DC.W 42H,42H,42H,42H
  925. HERO_JUMP:
  926. ; jump
  927. JSR JUMP_MOVE(PC)
  928. TST.B ACT_FLAG(A4)
  929. BPL.S HERO_JUMP_2
  930. MOVE.L D0,-(SP)
  931. MOVE.W #CTRL_FALL,D4
  932. JSR CTRL_CHANGE(PC)
  933. MOVE.L (SP)+,D0
  934. HERO_JUMP_2:
  935. TST.L D0
  936. BNE.S HERO_JUMP_3
  937. BCLR.B #7,ACT_DEC(A4)
  938. HERO_JUMP_3:
  939. BTST.B #BHS_JUMP,HERO_STATE(A6)
  940. BNE HERO_JUMP_1
  941. MOVE.W #CTRL_STOP,D4
  942. JSR CTRL_CHANGE(PC)
  943. AND.B #00001111B,PLAY_LEVER(A6)
  944. AND.B #00001111B,PLAY_LEVER+1(A6)
  945. JSR MOVE_CHANGE(PC)
  946. RTS
  947. HERO_JUMP_1:
  948. MOVE.W PLAY_LEVER(A6),-(SP)
  949. AND.B #11111100B,PLAY_LEVER(A6)
  950. AND.B #11111100B,PLAY_LEVER+1(A6)
  951. JSR MOVE_CHANGE(PC)
  952. MOVE.W (SP)+,PLAY_LEVER(A6)
  953. RTS
  954. HERO_FALL:
  955. ; after jump
  956. BTST.B #BHS_JUMP,HERO_STATE(A6)
  957. BEQ HERO_FALL_4
  958. JSR JUMP_MOVE(PC)
  959. BTST.B #BHS_JUMP,HERO_STATE(A6)
  960. BNE HERO_FALL_1
  961. CLR.B BEFORE_LEVER+PLAYER_OFFSET(A6)
  962. BCLR.B #7,ACT_DEC(A4)
  963. HERO_FALL_1:
  964. MOVE.W PLAY_LEVER(A6),-(SP)
  965. AND.B #11111100B,PLAY_LEVER(A6)
  966. AND.B #11111100B,PLAY_LEVER+1(A6)
  967. JSR MOVE_CHANGE(PC)
  968. MOVE.W (SP)+,PLAY_LEVER(A6)
  969. RTS
  970. HERO_FALL_4:
  971. TST.B ACT_FLAG(A4)
  972. BPL.S HERO_FALL_5
  973. BCLR.B #BHS_AUTO,HERO_STATE(A6)
  974. MOVE.W #CTRL_STOP,D4
  975. BTST.B #B_DOWN,PLAY_LEVER(A6)
  976. BEQ.S HERO_FALL_41
  977. MOVE.W #CTRL_SIT,D4
  978. HERO_FALL_41:
  979. JSR CTRL_CHANGE(PC)
  980. AND.B #00001101B,PLAY_LEVER(A6)
  981. AND.B #00001101B,PLAY_LEVER+1(A6)
  982. JSR MOVE_CHANGE(PC)
  983. RTS
  984. HERO_FALL_5:
  985. BCLR.B #7,ACT_DEC(A4)
  986. RTS
  987. HERO_TO_SIT:
  988. ; to sit down
  989. JSR AUTO_RIKI_UP(PC)
  990. CLR.L VX(A6)
  991. TST.B ACT_FLAG(A4)
  992. BPL.S HERO_TO_SIT_1
  993. MOVE.W #CTRL_SIT,D4
  994. JSR CTRL_CHANGE(PC)
  995. HERO_TO_SIT_1:
  996. AND.B #11111100B,PLAY_LEVER(A6)
  997. AND.B #11111100B,PLAY_LEVER+1(A6)
  998. JSR MOVE_CHANGE(PC)
  999. RTS
  1000. HERO_UP:
  1001. ; to up from down
  1002. JSR AUTO_RIKI_UP(PC)
  1003. CLR.L VX(A6)
  1004. TST.B ACT_FLAG(A4)
  1005. BPL.S HERO_UP_1
  1006. BCLR.B #BHS_DOWN,HERO_STATE(A6)
  1007. MOVE.W PLAYER_No+PLAYER_OFFSET(A6),D0
  1008. BCLR.B D0,BACK2+MOVE_DIR(A5)
  1009. MOVE.W #CTRL_STOP,D4
  1010. JSR CTRL_CHANGE(PC)
  1011. RTS
  1012. HERO_UP_1:
  1013. AND.B #11111100B,PLAY_LEVER(A6)
  1014. AND.B #11111100B,PLAY_LEVER+1(A6)
  1015. JSR MOVE_CHANGE(PC)
  1016. RTS
  1017. HERO_SIT:
  1018. ; sit down
  1019. JSR AUTO_RIKI_UP(PC)
  1020. JSR DIR_CHANGE(PC)
  1021. MOVE.W #CTRL_SIT,ACT_CTRL(A6)
  1022. CLR.L VX(A6)
  1023. BTST.B #B_DOWN,PLAY_LEVER(A6)
  1024. BNE.S HERO_SIT_1
  1025. MOVE.W #CTRL_TO_UP,D4
  1026. JSR CTRL_CHANGE(PC)
  1027. RTS
  1028. HERO_SIT_1:
  1029. AND.B #11111100B,PLAY_LEVER(A6)
  1030. AND.B #11111100B,PLAY_LEVER+1(A6)
  1031. JSR MOVE_CHANGE(PC)
  1032. BNE HERO_SIT_5 action changed
  1033. MOVEQ.L #1,D0
  1034. AND.B ACT_ATTR(A4),D0
  1035. MOVE.B DOWN_DEF_LEV(PC,D0.W),D0
  1036. AND.B PLAY_LEVER(A6),D0
  1037. BNE.S HERO_SIT_4
  1038. HERO_SIT_2:
  1039. CMP.B #CG_SIT,ACT_GROUP(A6)
  1040. BEQ HERO_SIT_3
  1041. MOVE.B #1,ACT_DEC(A4)
  1042. TST.B ACT_FLAG(A4)
  1043. BPL.S HERO_SIT_3
  1044. MOVE.W #CTRL_SIT,D4
  1045. JSR CTRL_CHANGE(PC)
  1046. HERO_SIT_3:
  1047. RTS
  1048. HERO_SIT_4:
  1049. MOVE.W #CTRL_SIT_GARD,ACT_CTRL(A6)
  1050. BSET.B #BHS_DEFENCE,HERO_STATE(A6)
  1051. JSR GARD_JUDGE(PC)
  1052. BEQ HERO_SIT_6
  1053. CMP.B #CG_SITG,ACT_GROUP(A6)
  1054. BEQ.S HERO_SIT_5
  1055. MOVE.W #CTRL_SIT_GARD,D4
  1056. JSR CTRL_CHANGE(PC)
  1057. HERO_SIT_5:
  1058. RTS
  1059. HERO_SIT_6:
  1060. ; JSR RIKI_DEC(PC)
  1061. JMP HERO_SIT_2(PC)
  1062. DOWN_DEF_LEV:
  1063. DC.B LEFT,RIGHT
  1064. HERO_LOCK_DEF:
  1065. ; lock
  1066. CLR.L VX(A6)
  1067. SUBQ.B #1,LOCK_TIMER(A6)
  1068. BNE HERO_LOCK_DEF_1
  1069. BCLR.B #BHSS_LOCK_DEF,STATE(A6)
  1070. MOVE.B #HERO_STOP_STEP,STEP1(A6)
  1071. HERO_LOCK_DEF_1:
  1072. RTS
  1073. HERO_LOCK_OFF:
  1074. ; lock
  1075. CLR.L VX(A6)
  1076. SUBQ.B #1,LOCK_TIMER(A6)
  1077. BNE HERO_LOCK_OFF_1
  1078. BCLR.B #BHSS_LOCK_OFF,STATE(A6)
  1079. MOVE.B #HERO_STOP_STEP,STEP1(A6)
  1080. HERO_LOCK_OFF_1:
  1081. RTS
  1082. HERO_NAGERARE:
  1083. BCLR.B #BHS_DAMAGE,HERO_STATE(A6)
  1084. BTST.B #BHS_JUMP,HERO_STATE(A6)
  1085. BEQ.S HERO_NAGERARE_1
  1086. BCLR.B #BHSS_NAGERARE,STATE(A6)
  1087. MOVE.B #DAMAGE2_STEP,STEP1(A6)
  1088. HERO_NAGERARE_1:
  1089. RTS
  1090. HERO_DAMAGE3:
  1091. CLR.L VX(A6)
  1092. TST.B ADC_COMMAND(A6)
  1093. BEQ HERO_DAM_END_1
  1094. MOVE.B ADC_VZ(A6),D0
  1095. CMP.B ACT_TIMER(A4),D0
  1096. BNE.S HERO_DAMAGE3_1
  1097. MOVE.B #11000000B,ADC_COMMAND(A6)
  1098. CLR.W ADC_VZ(A6)
  1099. HERO_DAMAGE3_1:
  1100. RTS
  1101. HERO_DAMAGE1:
  1102. ; move bururu
  1103. TST.B ACT_FLAG(A4)
  1104. BMI HERO_DAM_END
  1105. EOR.W #2,DISP_X(A4)
  1106. MOVEQ.L #0,D0
  1107. BTST.B #6,ACT_FLAG(A4)
  1108. BNE.S HERO_DAM1_1
  1109. MOVEQ.L #1,D0
  1110. BTST.B #ACTAT_FLIP,ACT_ATTR(A4)
  1111. BNE.S HERO_DAM1_1
  1112. MOVEQ.L #-1,D0
  1113. HERO_DAM1_1:
  1114. MOVE.W D0,VX(A6)
  1115. RTS
  1116. HERO_DAMAGE2:
  1117. ; non bururu
  1118. CLR.L VX(A6)
  1119. TST.B ACT_FLAG(A4)
  1120. BMI HERO_DAM_END
  1121. BTST.B #BHS_JUMP,HERO_STATE(A6)
  1122. BEQ.S HERO_DAM2_10
  1123. JSR JUMP_MOVE(PC)
  1124. TST.L D0
  1125. BNE.S HERO_DAM2_1
  1126. BSET.B #BHS_DAMAGE,HERO_STATE(A6)
  1127. OR.B #81H,HIT_OFF(A6)
  1128. BTST.B #5,ACT_FLAG(A4) down stop ?
  1129. BNE.S HERO_DAM2_1
  1130. MOVE.B #1,ACT_DEC(A4)
  1131. HERO_DAM2_1:
  1132. BTST.B #BHS_JUMP,HERO_STATE(A6)
  1133. BNE.S HERO_DAM2_2
  1134. TST.B SLOW_CUT(A5)
  1135. BEQ.S HERO_DAM2_10
  1136. MOVE.B #10000011B,SLOW_CUT(A5)
  1137. HERO_DAM2_10:
  1138. MOVE.B #1,ACT_DEC(A4)
  1139. HERO_DAM2_2:
  1140. RTS
  1141. HERO_DAM_END:
  1142. CLR.W DISP_X(A4)
  1143. TST.W HERO_LIFE(A6)
  1144. BNE.S HERO_DAM_END_1
  1145. ; MOVE.L ANOTHER_PLAYER+PLAYER_OFFSET(A6),A0
  1146. ; MOVE.L A0,WIN_PLAYER(A5)
  1147. RTS
  1148. HERO_DAM_END_1:
  1149. CLR.B NON_ADC(A6)
  1150. TST.B DOWN_DMG(A6)
  1151. BMI.S HERO_DAM_END_101
  1152. BEQ HERO_DAM_END_9
  1153. JSR TO_FURA(PC)
  1154. HERO_DAM_END_101:
  1155. CLR.B DOWN_DMG(A6)
  1156. MOVE.B #NO_DAMAGE_STEP3,STEP2(A6)
  1157. MOVE.B #6,BYTE_TIMER(A6)
  1158. BRA HERO_DAM_END_8
  1159. HERO_DAM_END_9:
  1160. AND.B #7EH,HIT_OFF(A6)
  1161. HERO_DAM_END_8:
  1162. BCLR.B #BHS_DAMAGE,HERO_STATE(A6)
  1163. BTST.B #BHS_DOWN,HERO_STATE(A6)
  1164. BNE.S HERO_DAM_END_2
  1165. BTST.B #B_DOWN,PLAY_LEVER(A6)
  1166. BNE.S HERO_DAM_END_2
  1167. HERO_FURA_END:
  1168. MOVE.W #CTRL_STOP,D4
  1169. JSR CTRL_CHANGE(PC)
  1170. JMP HERO_STOP(PC)
  1171. HERO_DAM_END_2:
  1172. MOVE.W #CTRL_SIT,D4
  1173. JSR CTRL_CHANGE(PC)
  1174. JMP HERO_SIT(PC)
  1175. TO_FURA:
  1176. MOVEQ.L #0,D1
  1177. CMP.W #16,HERO_LIFE(A6)
  1178. BCS.S TO_FURA_2
  1179. CMP.W #64,HERO_LIFE(A6)
  1180. BCS.S TO_FURA_1
  1181. MOVEQ.L #1,D1
  1182. TO_FURA_1:
  1183. BTST.B D1,FURA_COUNT(A6)
  1184. BEQ.S TO_FURA_2
  1185. JSR.S RAND8
  1186. BTST.B #6,PHASE+1(A5)
  1187. BNE.S TO_FURA_2
  1188. CMP.B #40H,D0
  1189. BCS.S TO_FURA_3
  1190. TO_FURA_2:
  1191. RTS
  1192. TO_FURA_3:
  1193. ADDQ.L #4,SP
  1194. CLR.B DOWN_DMG(A6)
  1195. BCLR.B D1,FURA_COUNT(A6)
  1196. AND.B #7EH,HIT_OFF(A6)
  1197. BCLR.B #BHS_DAMAGE,HERO_STATE(A6)
  1198. MOVE.W #CTRL_FURA,D4
  1199. JMP CTRL_CHANGE(PC)
  1200. HERO_FURA:
  1201. CLR.L VX(A6)
  1202. TST.B STAGE_TIME(A5)
  1203. BEQ HERO_FURA_END
  1204. SUBQ.W #1,FURA_TIMER(A6)
  1205. BEQ HERO_FURA_END
  1206. BTST.B #BPS_COM_FLAG,PLAYER_STATE+PLAYER_OFFSET(A6)
  1207. BEQ.S HERO_FURA_1
  1208. MOVE.B PLAY_LEVER+1(A6),D0
  1209. ; AND.B #00001111B,D0
  1210. BEQ.S HERO_FURA_1
  1211. SUBQ.B #1,FURA_LEVER(A6)
  1212. BEQ HERO_FURA_END
  1213. HERO_FURA_1:
  1214. RTS
  1215. HERO_CHECK:
  1216. ; action check mode
  1217. RTS
  1218. LM2_HERO0:
  1219. RTS
  1220. LM2_HERO1:
  1221. ; no move
  1222. BSET.B #BHF_NON_ACT,FLAG(A6)
  1223. CLR.L VX(A6)
  1224. CLR.L VX(A4)
  1225. ADDQ.W #4,SP
  1226. RTS
  1227. LM2_HERO2:
  1228. ; stop
  1229. CLR.L VX(A4)
  1230. CLR.L VX(A6)
  1231. BTST.B #BHS_DAMAGE,HERO_STATE(A6)
  1232. BNE LM_HERO2_2
  1233. BTST.B #BHF_DAMAGE,FLAG(A6)
  1234. BEQ LM_HERO2_2
  1235. MOVE.B #0,STEP2(A6)
  1236. BCLR.B #BHF_NON_ACT,FLAG(A6)
  1237. CLR.B BYTE_TIMER(A6)
  1238. BSR DAMAGE_CHECK
  1239. RTS
  1240. LM_HERO2_2:
  1241. BSET.B #BHF_NON_ACT,FLAG(A6)
  1242. ADDQ.W #4,SP
  1243. SUBQ.B #1,BYTE_TIMER(A6)
  1244. BNE.S LM2_HERO2_1
  1245. SUBQ.W #4,SP
  1246. MOVE.B #0,STEP2(A6)
  1247. BCLR.B #BHF_NON_ACT,FLAG(A6)
  1248. LM2_HERO2_1:
  1249. RTS
  1250. LM2_HERO3:
  1251. ; no damage
  1252. SUBQ.B #1,BYTE_TIMER(A6)
  1253. BNE.S LM2_HERO3_1
  1254. ; CMP.B #NO_DAMAGE_STEP2,STEP2(A6)
  1255. ; BNE.S LM2_HERO3_1
  1256. MOVE.B #0,STEP2(A6)
  1257. DAMAGE_STEP_OFF:
  1258. AND.B #7EH,HIT_OFF(A6)
  1259. LM2_HERO3_1:
  1260. RTS
  1261. LM2_HERO4:
  1262. ; bururu
  1263. CLR.L VX(A4)
  1264. CLR.L VX(A6)
  1265. BSET.B #BHF_NON_ACT,FLAG(A6)
  1266. ADDQ.W #4,SP
  1267. EOR.W #2,DISP_X(A4)
  1268. SUBQ.B #1,BYTE_TIMER(A6)
  1269. BNE.S LM2_HERO4_1
  1270. BCLR.B #BHF_NON_ACT,FLAG(A6)
  1271. MOVE.W #0,DISP_X(A4)
  1272. MOVE.B #0,STEP2(A6)
  1273. SUBQ.W #4,SP
  1274. MOVE.L ANOTHER_PLAYER(A6),A0
  1275. CMP.B #NO_MOVE_STEP2,STEP2(A0)
  1276. BNE.S LM2_HERO4_1
  1277. MOVE.B #0,STEP2(A0)
  1278. LM2_HERO4_1:
  1279. RTS
  1280. LM2_HERO5:
  1281. SUBQ.B #1,BYTE_TIMER(A6)
  1282. BNE.S LM2_HERO5_1
  1283. AND.B #7EH,HIT_OFF(A6)
  1284. MOVE.B #0,STEP2(A6)
  1285. LM2_HERO5_1:
  1286. RTS
  1287. JUMP_MOVE:
  1288. Z_MINIMUM EQU 30000H
  1289. CLR.L VX(A6)
  1290. MOVEQ.L #1,D0
  1291. TST.W Z_POSITION(A6)
  1292. ; TST.W HERO_LOWER(A6)
  1293. BGE.S JUMP_MOVE_1
  1294. CLR.L Z_POSITION(A6)
  1295. CLR.L VX(A6)
  1296. CLR.L VZ(A6)
  1297. CLR.L VZ(A4)
  1298. CLR.W JUMP_VX(A6)
  1299. CLR.W JUMP_AX(A6)
  1300. BCLR.B #BHS_JUMP,HERO_STATE(A6)
  1301. BCLR.B #BHF_NO_DIR_CHG,FLAG(A6)
  1302. RTS
  1303. JUMP_MOVE_1:
  1304. BTST.B #6,ACT_FLAG(A4)
  1305. BNE.S JUMP_MOVE_4
  1306. BCLR.B #BHF_NO_BJUDGE,FLAG(A6)
  1307. MOVE.W JUMP_VX(A6),D0
  1308. MOVE.W D0,D1
  1309. SUB.W JUMP_AX(A6),D0
  1310. EOR.W D0,D1
  1311. BPL.S JUMP_MOVE_11
  1312. MOVE.W JUMP_VX(A6),D0
  1313. JUMP_MOVE_11:
  1314. MOVE.W D0,JUMP_VX(A6)
  1315. EXT.L D0
  1316. LSL.L #8,D0
  1317. MOVE.L D0,VX(A6)
  1318. MOVE.W AZ(A6),D0
  1319. EXT.L D0
  1320. LSL.L #8,D0
  1321. ADD.L VZ(A6),D0
  1322. MOVE.L D0,VZ(A6)
  1323. MOVE.L D0,D1
  1324. BPL.S JUMP_MOVE_2
  1325. NEG.L D1
  1326. JUMP_MOVE_2:
  1327. CMP.L #Z_MINIMUM,D1
  1328. BCC.S JUMP_MOVE_3
  1329. MOVEQ.L #0,D0
  1330. JUMP_MOVE_3:
  1331. MOVE.L D0,VZ(A4)
  1332. RTS
  1333. JUMP_MOVE_4:
  1334. BSET.B #BHF_NO_BJUDGE,FLAG(A6)
  1335. RTS
  1336. ADC_SET:
  1337. MOVEP.W MASTER_No(A6),D0
  1338. CLR.B D0
  1339. LEA.L -LOG(A5,D0.W),A4
  1340. MOVE.W ACT_No(A6),ADC_ACT_No(A4)
  1341. MOVE.B ACT_COUNT(A6),ADC_ACT_COUNT(A4)
  1342. MOVE.W (A0)+,D0
  1343. MOVE.B D0,ADC_COMMAND(A4)
  1344. MOVE.L (A0)+,ADC_VX(A4)
  1345. RTS
  1346. ACT_DATA_MOVE:
  1347. ; action data command move
  1348. ; ADC_COMMAND d7 bururu
  1349. ; d6 x move
  1350. ; d5 z move
  1351. ; d4 x move (last time only)
  1352. ; d3 z move (last time only)
  1353. ; d2 x move from another hero (last time only)
  1354. ; d1 z move from another hero (last time only)
  1355. ; d0 action inner loop
  1356. TST.B NON_ADC(A6)
  1357. BEQ.S ADM_00
  1358. AND.B #10011111B,ADC_COMMAND(A6)
  1359. ADM_00:
  1360. MOVE.B ADC_COMMAND(A6),D4
  1361. BEQ.S ADC_OFF_1
  1362. MOVE.W ACT_No(A4),D0
  1363. CMP.W ADC_ACT_No(A6),D0
  1364. BNE.S ADC_OFF
  1365. MOVE.B ACT_COUNT(A4),D0
  1366. CMP.B ADC_ACT_COUNT(A6),D0
  1367. BEQ.S ADM_1
  1368. ADC_OFF:
  1369. CLR.B ADC_COMMAND(A6)
  1370. CLR.W DISP_X(A4)
  1371. ADC_OFF_1:
  1372. RTS
  1373. ADM_1:
  1374. ADD.B D4,D4
  1375. BCC.S ADM_2
  1376. BSR ADC_BURURU
  1377. ADM_2:
  1378. ADD.B D4,D4
  1379. BCC.S ADM_3
  1380. BSR ADC_X_MOVE_1
  1381. ADM_3:
  1382. ADD.B D4,D4
  1383. BCC.S ADM_4
  1384. BSR ADC_Z_MOVE_1
  1385. ADM_4:
  1386. ADD.B D4,D4
  1387. BCC.S ADM_5
  1388. BSR ADC_X_MOVE
  1389. ADM_5:
  1390. ADD.B D4,D4
  1391. BCC.S ADM_6
  1392. BSR ADC_Z_MOVE
  1393. ADM_6:
  1394. ADD.B D4,D4
  1395. BCC.S ADM_7
  1396. BSR ADC_X_OFS
  1397. ADM_7:
  1398. ADD.B D4,D4
  1399. BCC.S ADM_8
  1400. BSR ADC_Z_OFS
  1401. ADM_8:
  1402. ADD.B D4,D4
  1403. BCC.S ADM_9
  1404. BSR ADC_LOOP
  1405. ADM_9:
  1406. RTS
  1407. ADC_BURURU:
  1408. CLR.L VX(A4)
  1409. CLR.L VZ(A4)
  1410. EOR.W #2,DISP_X(A4)
  1411. RTS
  1412. ADC_X_MOVE:
  1413. MOVE.B ACT_DEC(A4),D0
  1414. BLE.S ADC_X_MOVE_3
  1415. MOVE.B ACT_TIMER(A4),D1
  1416. SUB.B D0,D1
  1417. BGT.S ADC_X_MOVE_3
  1418. ADC_X_MOVE_1:
  1419. BTST.B #BHF_NON_ACT,FLAG(A6)
  1420. BNE.S ADC_X_MOVE_3
  1421. MOVE.W ADC_VX(A6),D0
  1422. BTST.B #0,ACT_ATTR(A4)
  1423. BEQ.S ADC_X_MOVE_2
  1424. NEG.W D0
  1425. ADC_X_MOVE_2:
  1426. EXT.L D0
  1427. LSL.L #8,D0
  1428. ADD.L D0,VX(A4)
  1429. ADC_X_MOVE_3:
  1430. RTS
  1431. ADC_Z_MOVE:
  1432. MOVE.B ACT_DEC(A4),D0
  1433. BLE.S ADC_Z_MOVE_3
  1434. MOVE.B ACT_TIMER(A4),D1
  1435. SUB.B D0,D1
  1436. BGT.S ADC_Z_MOVE_3
  1437. ADC_Z_MOVE_1:
  1438. BTST.B #BHF_NON_ACT,FLAG(A6)
  1439. BNE.S ADC_Z_MOVE_3
  1440. MOVE.W ADC_VZ(A6),D0
  1441. EXT.L D0
  1442. LSL.L #8,D0
  1443. ADD.L D0,VZ(A4)
  1444. ADC_Z_MOVE_3:
  1445. RTS
  1446. ADC_X_OFS:
  1447. MOVE.B ACT_DEC(A4),D0
  1448. BLE.S ADC_X_OFS_3
  1449. MOVE.B ACT_TIMER(A4),D1
  1450. SUB.B D0,D1
  1451. BGT.S ADC_X_OFS_3
  1452. ADC_X_OFS_1:
  1453. BTST.B #BHF_NON_ACT,FLAG(A6)
  1454. BNE.S ADC_X_OFS_3
  1455. MOVEQ.L #0,D0
  1456. MOVE.W ADC_VX(A6),D0
  1457. BTST.B #0,ACT_ATTR(A4)
  1458. BEQ.S ADC_X_OFS_2
  1459. NEG.W D0
  1460. ADC_X_OFS_2:
  1461. MOVE.L ANOTHER_PLAYER(A6),A0
  1462. ADD.W X_POSITION(A0),D0
  1463. SUB.W X_POSITION(A6),D0
  1464. SWAP D0
  1465. MOVE.L D0,VX(A4)
  1466. ADC_X_OFS_3:
  1467. RTS
  1468. ADC_Z_OFS:
  1469. MOVE.B ACT_DEC(A4),D0
  1470. BLE.S ADC_Z_OFS_3
  1471. MOVE.B ACT_TIMER(A4),D1
  1472. SUB.B D0,D1
  1473. BGT.S ADC_Z_OFS_3
  1474. ADC_Z_OFS_1:
  1475. BTST.B #BHF_NON_ACT,FLAG(A6)
  1476. BNE.S ADC_Z_OFS_3
  1477. MOVEQ.L #0,D0
  1478. MOVE.W ADC_VZ(A6),D0
  1479. MOVE.L ANOTHER_PLAYER(A6),A0
  1480. ADD.W Z_POSITION(A0),D0
  1481. SUB.W Z_POSITION(A6),D0
  1482. SWAP D0
  1483. MOVE.L D0,VZ(A4)
  1484. ADC_Z_OFS_3:
  1485. RTS
  1486. ADC_LOOP:
  1487. MOVE.B ACT_DEC(A4),D0
  1488. BLE.S ADC_LOOP_3
  1489. MOVE.B ACT_TIMER(A4),D1
  1490. SUB.B D0,D1
  1491. BGT.S ADC_LOOP_3
  1492. BTST.B #BHF_NON_ACT,FLAG(A6)
  1493. BNE.S ADC_LOOP_3
  1494. MOVE.W ADC_VX(A6),D0
  1495. SUBQ.W #2,D0
  1496. MOVE.B D0,ACT_COUNT(A4)
  1497. ADC_LOOP_3:
  1498. RTS
  1499. RUNNING_CHECK:
  1500. MOVEQ.L #0,D0
  1501. MOVE.B RUNNING_CT(A6),D0
  1502. ADD.W D0,D0
  1503. ADD.W D0,D0
  1504. JMP RUNNING_VECTOR(PC,D0.W)
  1505. RUNNING_VECTOR:
  1506. JMP RUN_CT0(PC)
  1507. JMP RUN_CT1(PC)
  1508. JMP RUN_CT2(PC)
  1509. JMP RUN_CT3(PC)
  1510. RUN_CT0:
  1511. TST.B PLAY_LEVER(A6)
  1512. BNE.S RUN_CT0_1
  1513. MOVE.B #1,RUNNING_CT(A6)
  1514. RUN_CT0_1:
  1515. MOVEQ.L #0,D0
  1516. RTS
  1517. RUN_CT1:
  1518. MOVE.B PLAY_LEVER(A6),D0
  1519. BEQ RUN_CT1_1
  1520. CMP.B #LEFT,D0
  1521. BEQ.S RUN_CT1_0
  1522. CMP.B #RIGHT,D0
  1523. BEQ.S RUN_CT1_0
  1524. MOVE.B #0,RUNNING_CT(A6)
  1525. MOVEQ.L #0,D0
  1526. RTS
  1527. RUN_CT1_0:
  1528. MOVE.B #2,RUNNING_CT(A6)
  1529. MOVE.B D0,RUNNING_LEVER(A6)
  1530. MOVE.W #16,RUNNING_TIMER(A6)
  1531. RUN_CT1_1:
  1532. MOVEQ.L #0,D0
  1533. RTS
  1534. RUN_CT2:
  1535. MOVE.B PLAY_LEVER(A6),D0
  1536. BEQ.S RUN_CT2_3
  1537. CMP.B RUNNING_LEVER(A6),D0
  1538. BNE.S RUN_CT2_1
  1539. SUBQ.W #1,RUNNING_TIMER(A6)
  1540. BPL.S RUN_CT2_4
  1541. RUN_CT2_1:
  1542. MOVE.B #0,RUNNING_CT(A6)
  1543. MOVEQ.L #0,D0
  1544. RTS
  1545. RUN_CT2_3:
  1546. MOVE.B #3,RUNNING_CT(A6)
  1547. MOVE.W #16,RUNNING_TIMER(A6)
  1548. RUN_CT2_4:
  1549. MOVEQ.L #0,D0
  1550. RTS
  1551. RUN_CT3:
  1552. MOVE.B PLAY_LEVER(A6),D0
  1553. BEQ.S RUN_CT3_0
  1554. CMP.B RUNNING_LEVER(A6),D0
  1555. BNE.S RUN_CT3_1
  1556. MOVE.B #0,RUNNING_CT(A6)
  1557. MOVEQ.L #1,D0
  1558. RTS
  1559. RUN_CT3_0:
  1560. SUBQ.W #1,RUNNING_TIMER(A6)
  1561. BPL.S RUN_CT3_4
  1562. RUN_CT3_1:
  1563. MOVE.B #0,RUNNING_CT(A6)
  1564. RUN_CT3_4:
  1565. MOVEQ.L #0,D0
  1566. RTS
  1567. DIR_CHANGE:
  1568. MOVE.L ANOTHER_PLAYER(A6),A0
  1569. MOVE.L X_POSITION(A6),D0
  1570. CMP.L X_POSITION(A0),D0
  1571. BCS.S DIR_CHANGE_1
  1572. BSET.B #ACTAT_FLIP,ACT_ATTR(A4)
  1573. RTS
  1574. DIR_CHANGE_1:
  1575. BCLR.B #ACTAT_FLIP,ACT_ATTR(A4)
  1576. RTS
  1577. DAMAGE_CHECK:
  1578. BCLR.B #BHF_DAMAGE,FLAG(A6)
  1579. BEQ DAMAGE_CHECK_2
  1580. CMP.W #2EH,ACT_CTRL(A6)
  1581. BEQ DAMAGE_CHECK_2
  1582. BTST.B #BHS_DAMAGE,HERO_STATE(A6)
  1583. BNE DAMAGE_CHECK_2
  1584. BSR DAMAGE_NEXT
  1585. AND.W #3FFFH,ACT_No(A4)
  1586. TST.B STAGE_TIME(A5)
  1587. BNE.S DMC_0000
  1588. CLR.B DAMAGE_LEVEL(A6)
  1589. DMC_0000:
  1590. MOVEQ.L #0,D0
  1591. MOVE.B DAMAGE_LEVEL(A6),D0
  1592. SUB.W D0,HERO_LIFE(A6)
  1593. BGT DAMAGE_CHECK_1
  1594. MOVEQ.L #0,D0
  1595. MOVE.B DEMO_FLAG(A5),D0
  1596. MOVE.W D0,HERO_LIFE(A6)
  1597. BNE.S DAMAGE_CHECK_1
  1598. BTST.B #5,DEBUG_DIP1(A5)
  1599. BEQ.S DAMAGE_DEAD_00
  1600. MOVE.W #1,HERO_LIFE(A6)
  1601. BRA.S DAMAGE_CHECK_1
  1602. DAMAGE_DEAD_00:
  1603. BTST.B #BHSS_NAGERARE,STATE(A6)
  1604. BNE ALL_DEAD_SOUND NAGE_DEAD
  1605. JSR DIR_CHANGE(PC)
  1606. MOVE.W #CTRL_DEAD,D4
  1607. JMP CTRL_CHANGE(PC)
  1608. DAMAGE_CHECK_1:
  1609. BTST.B #BHSS_NAGERARE,STATE(A6)
  1610. BNE DAMAGE_CHECK_2
  1611. JSR DIR_CHANGE(PC)
  1612. MOVE.W #CTRL_DAMAGE,D4
  1613. JMP CTRL_CHANGE(PC)
  1614. DAMAGE_CHECK_2:
  1615. RTS
  1616. DAMAGE_NEXT:
  1617. MOVE.L ANOTHER_PLAYER(A6),A0
  1618. TST.B DAMAGE_LOCK(A0)
  1619. BMI DAMAGE_100RET
  1620. BNE DAMAGE_CHECK_LOCK
  1621. MOVE.B DEF_HIT_STOP(A6),BYTE_TIMER(A0)
  1622. BEQ.S DAMAGE_CHECK_0
  1623. ADDQ.B #4,BYTE_TIMER(A0)
  1624. MOVE.B #STOP_STEP2,STEP2(A0)
  1625. DAMAGE_CHECK_0:
  1626. BSR GET_DAMAGE_LEVEL
  1627. BSR SCORE_UP
  1628. JSR STAR_MAKE(PC)
  1629. JSR ATTACK_OFF_LM(PC)
  1630. MOVE.L ANOTHER_PLAYER(A6),A0
  1631. CLR.B ACT_FLAG(A4)
  1632. CLR.L VX(A6)
  1633. BSET.B #BHS_DAMAGE,HERO_STATE(A6)
  1634. OR.B #81H,HIT_OFF(A6)
  1635. RTS
  1636. DAMAGE_CHECK_LOCK:
  1637. BSR GET_DAMAGE_LEVEL
  1638. BSR SCORE_UP
  1639. JSR STAR_MAKE(PC)
  1640. JSR ATTACK_OFF_LM(PC)
  1641. MOVE.L ANOTHER_PLAYER(A6),A0
  1642. CLR.B ACT_FLAG(A4)
  1643. CLR.L VX(A6)
  1644. ; BSET.B #BHS_DAMAGE,HERO_STATE(A6)
  1645. ; OR.B #81H,HIT_OFF(A6)
  1646. RTS
  1647. DAMAGE_100RET:
  1648. BSR GET_DAMAGE_LEVEL
  1649. JSR STAR_MAKE(PC)
  1650. JSR ATTACK_OFF_LM(PC)
  1651. MOVE.L ANOTHER_PLAYER(A6),A0
  1652. CLR.B ACT_FLAG(A4)
  1653. CLR.L VX(A6)
  1654. ; BSET.B #BHS_DAMAGE,HERO_STATE(A6)
  1655. ; OR.B #81H,HIT_OFF(A6)
  1656. CLR.B DAMAGE_LEVEL(A6)
  1657. RTS
  1658. XDEF GET_DAMAGE_LEVEL
  1659. GET_DAMAGE_LEVEL:
  1660. MOVE.L ANOTHER_PLAYER(A6),A0
  1661. MOVE.B DAMAGE_LEVEL(A6),D0
  1662. MOVEQ.L #0FH,D1
  1663. AND.B DEF_HIT_TYPE_No(A6),D1
  1664. CMP.B #3,D1 gard ?
  1665. BNE.S GDL_1
  1666. BSR GDL_1
  1667. MOVE.B D0,DAMAGE_LEVEL2(A6)
  1668. MOVE.B DEF_GARD_LEVEL(A6),D0
  1669. GDL_1:
  1670. TST.B D0
  1671. BEQ GDL_4
  1672. MOVE.W HERO_TYPE(A6),D1
  1673. ADD.W D1,D1
  1674. ADD.W D1,D1
  1675. ADD.W HERO_TYPE(A6),D1 *5
  1676. BTST.B #4,PHASE+1(A5)
  1677. BNE.S GDL_3
  1678. MOVE.W LEVEL_TEMP(A5),D2
  1679. LSR.W #1,D2
  1680. ADD.W D2,D1
  1681. ADDQ.W #1,D1
  1682. GDL_3:
  1683. ADD.W D1,D1
  1684. ADD.W D1,D1
  1685. MOVE.W HERO_LIFE(A6),D2
  1686. TST.B D2
  1687. BPL.S GDL_301
  1688. MOVEQ.L #127,D2
  1689. GDL_301:
  1690. LSR.W #5,D2
  1691. ADD.W D2,D1
  1692. MOVEQ.L #0,D2
  1693. MOVE.B DEFENCE_POINT(PC,D1.W),D2
  1694. BEQ.S GDL_4
  1695. AND.W #0FFH,D0
  1696. MULU D2,D0
  1697. LSR.W #8,D0
  1698. GDL_4:
  1699. BCLR.B #0,WEAK_HIT(A6)
  1700. BEQ.S GDL_2
  1701. ADD.B COUNTER_LEVEL(A6),D0
  1702. GDL_2:
  1703. MOVE.B D0,DAMAGE_LEVEL(A6)
  1704. RTS
  1705. DP MACRO L1,L2,L3,L4
  1706. DC.B (L4*256)/100
  1707. DC.B (L3*256)/100
  1708. DC.B (L2*256)/100
  1709. DC.B (L1*256)/100
  1710. ENDM
  1711. DEFENCE_POINT:
  1712. ;H1
  1713. DP 80,75,65,50 vs
  1714. DP 80,75,65,50
  1715. DP 80,75,65,50
  1716. DP 80,75,65,50
  1717. DP 80,75,65,50
  1718. ;H2
  1719. DP 80,75,65,50 vs
  1720. DP 80,75,65,50
  1721. DP 80,75,65,50
  1722. DP 80,75,65,50
  1723. DP 80,75,65,50
  1724. ;E1
  1725. DP 80,75,65,50 vs
  1726. DP 90,85,75,60
  1727. DP 80,75,65,50
  1728. DP 75,70,60,45
  1729. DP 70,65,55,40
  1730. ;E2
  1731. DP 70,65,55,40
  1732. DP 80,75,65,50
  1733. DP 70,65,55,40
  1734. DP 65,60,50,35
  1735. DP 60,55,45,30
  1736. ;E3
  1737. DP 90,85,75,60 vs
  1738. DP 00,95,85,70
  1739. DP 90,85,75,60
  1740. DP 85,80,70,55
  1741. DP 80,75,65,50
  1742. ;E4
  1743. DP 80,75,65,50
  1744. DP 90,85,75,60
  1745. DP 80,75,65,50
  1746. DP 75,70,60,45
  1747. DP 70,65,55,40
  1748. ; DP 90,85,75,60 vs
  1749. ; DP 00,95,85,70
  1750. ; DP 90,85,75,60
  1751. ; DP 80,75,65,50
  1752. ; DP 70,65,55,40
  1753. ;E5
  1754. DP 70,65,55,40 vs
  1755. DP 80,75,65,50
  1756. DP 70,65,55,40
  1757. DP 65,60,50,35
  1758. DP 60,55,45,30
  1759. ;E6
  1760. DP 75,70,60,45 vs
  1761. DP 85,80,70,55
  1762. DP 75,70,60,45
  1763. DP 70,65,55,40
  1764. DP 65,60,50,35
  1765. ;E7
  1766. DP 70,65,55,40 vs
  1767. DP 80,75,65,50
  1768. DP 70,65,55,40
  1769. DP 75,60,50,35
  1770. DP 60,55,45,30
  1771. ;E8
  1772. DP 85,75,60,45 vs
  1773. DP 85,75,60,45
  1774. DP 75,65,50,35
  1775. DP 70,60,45,30
  1776. DP 65,55,40,25
  1777. SCORE_UP:
  1778. BTST.B #4,PHASE+1(A5)
  1779. BNE SCORE_UP_END
  1780. TST.B HOW_TO_FLAG(A5)
  1781. BNE SCORE_UP_END
  1782. MOVEM.L A0-A1,-(SP)
  1783. CLR.L REG_D0(A5)
  1784. MOVEQ.L #7CH,D1
  1785. AND.B DAMAGE_LEVEL(A6),D1
  1786. LSR.B #1,D1
  1787. MOVE.W DAMAGE_POINT(PC,D1.W),REG_D0+2(A5)
  1788. LEA.L HERO_SCORE+4(A0),A0
  1789. LEA.L REG_D0+4(A5),A1
  1790. SUB.W D1,D1
  1791. ABCD.B -(A1),-(A0)
  1792. ABCD.B -(A1),-(A0)
  1793. ABCD.B -(A1),-(A0)
  1794. ABCD.B -(A1),-(A0)
  1795. ADDQ.L #4,A0
  1796. LEA.L DEF_HIT_SCORE+4(A6),A1
  1797. SUB.W D1,D1
  1798. ABCD.B -(A1),-(A0)
  1799. ABCD.B -(A1),-(A0)
  1800. ABCD.B -(A1),-(A0)
  1801. ABCD.B -(A1),-(A0)
  1802. MOVEM.L (SP)+,A0-A1
  1803. SCORE_UP_END:
  1804. RTS
  1805. DAMAGE_POINT:
  1806. DC.W 0000H,0010H,0020H,0030H 00
  1807. DC.W 0040H,0050H,0060H,0070H 10
  1808. DC.W 0080H,0090H,0100H,0110H 20
  1809. DC.W 0120H,0130H,0140H,0150H 30
  1810. DC.W 0160H,0170H,0180H,0190H 40
  1811. DC.W 0200H,0210H,0220H,0230H 50
  1812. DC.W 0240H,0250H,0260H,0270H 60
  1813. DC.W 0280H,0290H,0300H,0310H 70
  1814. DC.W 0320H,0330H,0340H,0350H 80
  1815. DC.W 0360H,0370H,0380H,0390H 90
  1816. DC.W 0400H,0410H,0420H,0430H A0
  1817. DC.W 0440H,0450H,0460H,0470H B0
  1818. DC.W 0480H,0490H,0500H,0510H C0
  1819. DC.W 0520H,0530H,0540H,0550H D0
  1820. DC.W 0560H,0570H,0580H,0590H E0
  1821. DC.W 0600H,0610H,0620H,0630H F0
  1822. LOCK_CHECK:
  1823. BTST.B #BHSS_NAGERARE,STATE(A6)
  1824. BEQ.S NAGE_CK_1
  1825. CMP.B #NAGERARE_STEP,STEP1(A6)
  1826. BEQ.S NAGE_CK_1
  1827. CLR.L VX(A6)
  1828. CLR.L VX(A4)
  1829. MOVE.W PLAYER_No+PLAYER_OFFSET(A6),D0
  1830. BCLR.B D0,BACK2+MOVE_DIR(A5)
  1831. BCLR.B #BHS_DOWN,HERO_STATE(A6)
  1832. MOVE.W #CTRL_NAGERARE,D4
  1833. JSR CTRL_CHANGE(PC)
  1834. NAGE_CK_1:
  1835. RTS
  1836. BTST.B #BHSS_LOCK_DEF,STATE(A6)
  1837. BEQ.S LOCK_CHECK_1
  1838. CMP.B #LOCK_DEF_STEP,STEP1(A6)
  1839. BEQ.S LOCK_CHECK_1
  1840. MOVE.B #LOCK_DEF_STEP,STEP1(A6)
  1841. MOVE.B #60,LOCK_TIMER(A6)
  1842. LOCK_CHECK_1:
  1843. RTS
  1844. LOWER_SET:
  1845. MOVEP.W WORK_N2(A4),D0
  1846. CLR.B D0
  1847. MOVE.W HIT_LOWER(A5,D0.W),HERO_LOWER(A6)
  1848. ; MOVE.W Z_POSITION(A4),HERO_LOWER(A6)
  1849. RTS
  1850. FALL_CHECK:
  1851. CMP.B #FALL_STEP,STEP1(A6)
  1852. BEQ.S FALL_CHECK_1
  1853. BTST.B #BHS_JUMP,HERO_STATE(A6)
  1854. BNE.S FALL_CHECK_1
  1855. BTST.B #5,ACT_FLAG(A4) offset jump
  1856. BNE.S FALL_CHECK_1
  1857. ; BTST.B #BHF_OBJ_STOP,FLAG(A6)
  1858. ; BNE.S FALL_CHECK_2
  1859. ; TST.W HIT_LOWER(A4)
  1860. TST.W Z_POSITION(A6)
  1861. BLE.S FALL_CHECK_1
  1862. CLR.L VZ(A6)
  1863. CLR.W JUMP_VX(A6)
  1864. MOVE.W #-0D00H/20,AZ(A6)
  1865. BSET.B #BHS_JUMP,HERO_STATE(A6)
  1866. JSR ATTACK_OFF_LM(PC)
  1867. BTST.B #BHS_DAMAGE,HERO_STATE(A6)
  1868. BNE.S FALL_CHECK_1
  1869. MOVE.W #CTRL_FALL,D4
  1870. JSR CTRL_CHANGE(PC)
  1871. FALL_CHECK_1:
  1872. RTS
  1873. FALL_CHECK_2:
  1874. TST.L HERO_LOWER(A6)
  1875. BGT.S FALL_CHECK_3
  1876. BCLR.B #BHF_OBJ_STOP,FLAG(A6)
  1877. CLR.L Z_POSITION(A6)
  1878. CLR.L VZ(A6)
  1879. FALL_CHECK_3:
  1880. RTS
  1881. BACK_OBJ_JUDGE:
  1882. BCLR.B #BHF_NO_BJUDGE,FLAG(A6)
  1883. BNE BOJ_3
  1884. MOVE.L HIT_LEFT(A4),-(SP)
  1885. MOVE.W VX(A4),D0
  1886. ADD.W X_POSITION(A4),D0
  1887. SUB.W #12,D0
  1888. MOVE.W D0,HIT_LEFT(A4)
  1889. ADD.W #24,D0
  1890. MOVE.W D0,HIT_RIGHT(A4)
  1891. MOVE.W VZ(A4),D0
  1892. ADD.W D0,HIT_UPPER(A4)
  1893. ADD.W D0,HIT_LOWER(A4)
  1894. LEA.L (A4),A0
  1895. JSR.S GET_OBJ_BACK_ADRS
  1896. BOJ_1:
  1897. LEA.L (A1),A0
  1898. MOVE.W D6,D7
  1899. BOJ_2:
  1900. TST.B (A0)+
  1901. BNE.S BOJ_4 hit
  1902. DBRA D7,BOJ_2
  1903. LEA.L 20H(A1),A1
  1904. DBRA D5,BOJ_1
  1905. MOVE.L (SP)+,HIT_LEFT(A4)
  1906. AND.B #"(HF_OBJ_STOP+HF_ON_OBJ),FLAG(A6)
  1907. BOJ_3:
  1908. RTS
  1909. BOJ_4:
  1910. MOVE.B -1(A0),(A5)
  1911. MOVE.W (A5),D0
  1912. LEA.L 0(A5,D0.W),A2
  1913. MOVE.W HIT_LEFT(A4),D0
  1914. MOVE.W HIT_RIGHT(A4),D5
  1915. MOVE.L (SP)+,HIT_LEFT(A4)
  1916. SUB.W HIT_LEFT(A2),D5
  1917. BMI BOJ_NON
  1918. MOVE.W HIT_RIGHT(A2),D6
  1919. SUB.W D0,D6 HIT_LEFT(A4),D6
  1920. BMI BOJ_NON
  1921. MOVE.W HIT_UPPER(A4),D3
  1922. SUB.W HIT_LOWER(A2),D3
  1923. BMI BOJ_NON
  1924. MOVE.W HIT_UPPER(A2),D4
  1925. SUB.W HIT_LOWER(A4),D4
  1926. BPL BOJ_5
  1927. BCLR.B #BHF_OBJ_STOP,FLAG(A6)
  1928. BSET.B #BHF_ON_OBJ,FLAG(A6)
  1929. RTS
  1930. BOJ_5:
  1931. MOVEQ.L #0,D1
  1932. CMP.W D4,D3
  1933. BCS.S BOJ_6
  1934. MOVEQ.L #1,D1
  1935. EXG.L D3,D4
  1936. BOJ_6:
  1937. CMP.W D6,D5
  1938. BCS.S BOJ_7
  1939. ADDQ.W #2,D1
  1940. EXG.L D5,D6
  1941. BOJ_7:
  1942. ; CMP.W D3,D5
  1943. ; BCS BOJ_X_IN
  1944. BTST.L #0,D1
  1945. BEQ BOJ_LOW
  1946. MOVE.B FLAG(A6),D0
  1947. AND.B #HF_OBJ_STOP+HF_ON_OBJ,D0
  1948. BEQ BOJ_NON
  1949. ; SWAP D3
  1950. ; CLR.W D3
  1951. ; ADD.L VZ(A2),D3
  1952. ; MOVE.L D3,VZ(A4)
  1953. MOVEQ.L #0,D0
  1954. MOVE.W HIT_UPPER(A2),D0
  1955. SWAP D0
  1956. SUB.L Z_POSITION(A6),D0
  1957. ADD.L VZ(A2),D0
  1958. MOVE.L D0,VZ(A4)
  1959. MOVE.L VX(A2),D0
  1960. ADD.L D0,VX(A4)
  1961. BSET.B #BHF_OBJ_STOP,FLAG(A6)
  1962. BCLR.B #BHS_JUMP,HERO_STATE(A6)
  1963. BEQ.S BOJ_8
  1964. BTST.B #BHS_DAMAGE,HERO_STATE(A6)
  1965. BNE.S BOJ_8
  1966. JSR ATTACK_OFF_LM(PC)
  1967. MOVE.W #CTRL_STOP,D4
  1968. JSR CTRL_CHANGE(PC)
  1969. BOJ_8:
  1970. RTS
  1971. BOJ_LOW:
  1972. BOJ_X_IN:
  1973. BOJ_NON:
  1974. AND.B #"(HF_OBJ_STOP+HF_ON_OBJ),FLAG(A6)
  1975. RTS
  1976. ;************************************************************************
  1977. ;
  1978. ; * objcet vs object judge program
  1979. ;
  1980. ; version 1.0*10^-9 date 1991/11/11
  1981. ;
  1982. ; this program is special hit_judge_prog
  1983. ; 1.back_object_no check(looking buffer)
  1984. ; 2.now_object fall_direction is down_check
  1985. ; 3.moving character is taller than object chararcter_check
  1986. ;
  1987. ; *receive_resista:A1(object_buffer address)
  1988. ; A4(physical_work address)
  1989. ; A6(logical_work address)
  1990. ; D5(x_size counter)
  1991. ;
  1992. ; *return_code :FLAG(bit_6 => fall_flag)
  1993. ; (bit_7 => hit_flag)
  1994. ;
  1995. OBJECT_HIT:
  1996. MOVE.L HIT_LEFT(A4),-(SP)
  1997. MOVE.W VX(A4),D0
  1998. ADD.W X_POSITION(A4),D0
  1999. SUB.W #16,D0
  2000. MOVE.W D0,HIT_LEFT(A4)
  2001. ADD.W #8,D0
  2002. MOVE.W D0,HIT_RIGHT(A4)
  2003. MOVE.W VZ(A4),D0
  2004. ADD.W D0,HIT_UPPER(A4)
  2005. ADD.W D0,HIT_LOWER(A4)
  2006. ; MOVE.W VX(A4),D0
  2007. ; ADD.W D0,HIT_LEFT(A4)
  2008. ; ADD.W D0,HIT_RIGHT(A4)
  2009. ; MOVE.W VZ(A4),D0
  2010. ; ADD.W D0,HIT_UPPER(A4)
  2011. ; ADD.W D0,HIT_LOWER(A4) :01
  2012. LEA.L (A4),A0
  2013. JSR.S GET_OBJ_BACK_ADRS
  2014. OH_LOOP1:
  2015. TST.B (A1)+ ;check 1
  2016. BNE.S OH_CHK_1 ;
  2017. DBRA D5,OH_LOOP1
  2018. MOVE.L (SP)+,HIT_LEFT(A4)
  2019. BSET.B #BHF_ON_OBJ,FLAG(A6)
  2020. BCLR.B #BHF_OBJ_STOP,FLAG(A6)
  2021. RTS
  2022. OH_CHK_1:
  2023. MOVE.B -1(A1),(A5)
  2024. MOVE.W (A5),D0
  2025. LEA.L 0(A5,D0.W),A2
  2026. MOVE.L (SP)+,HIT_LEFT(A4)
  2027. BSET.B #BHF_OBJ_STOP,FLAG(A6)
  2028. MOVE.L VX(A2),D0
  2029. ADD.L D0,VX(A4)
  2030. MOVE.L VZ(A2),D0
  2031. ADD.L D0,VZ(A4)
  2032. MOVE.W VZ(A4),D0 ;check 2
  2033. BPL.L OH_CHK_END ;
  2034. MOVE.W HIT_UPPER(A2),D0;check 3
  2035. SUB.W HIT_LOWER(A4),D0;
  2036. BPL.L OH_CHK_END ;
  2037. MOVE.W HIT_UPPER(A2),Z_POSITION(A4)
  2038. MOVE.W HIT_UPPER(A2),Z_POSITION(A6)
  2039. MOVE.L #0,VZ(A4)
  2040. MOVE.L #0,AZ(A6)
  2041. JSR ATTACK_OFF_LM(PC)
  2042. BSET.B #BHF_OBJ_STOP,FLAG(A6)
  2043. BCLR.B #BHS_JUMP,HERO_STATE(A6)
  2044. MOVE.W #CTRL_STOP,D4
  2045. JSR CTRL_CHANGE(PC)
  2046. OH_CHK_END:
  2047. RTS
  2048. ;************************************************************************
  2049. INCLUDE WORK.INC
  2050.