STORY.SRC 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802
  1. ************************************************************************
  2. * *
  3. * 044 [RYUUKO NO KEN] *
  4. * STORY FASE PROGRAM *
  5. * by S.OKADA from 92/05/26 Tue 10:25 *
  6. * *
  7. ************************************************************************
  8. XDEF INIT_STORY_GAME,STORY_GAME
  9. XDEF STAGE_ENEMY
  10. XDEF STAGE_TIME_DEC
  11. XDEF LM_PAL_ACT
  12. XDEF GAME_OBJ_MAP,LEVER_SET_GAME
  13. XDEF DEMO_LEVER_SET
  14. XDEF DIST_SET
  15. XREF ?A5
  16. ;by EASY
  17. XREF INIT_MONO_SET
  18. XREF MONO_SET
  19. ;by MAIN
  20. XREF LP_MAIN
  21. ;by GAME_DSP
  22. XREF GAME_START_DISP,GAME_START_CL
  23. XREF GAME_TIME_DISP,TIME_OVER_DISP,TIME_OVER_CL
  24. XREF WINNER_DISP,DEMO_TITLE_SET,DKO_DISP
  25. XREF SCORE_DISP
  26. XREF NUMBER_MESS,BCD_BIN
  27. ;by MOVE
  28. XREF INIT_OVER_DEMO,OVER_DEMO
  29. ;by PHASE
  30. XREF ACTIVE_TRIGER
  31. ;by GAME_SUB
  32. XREF LWORK_DEAD
  33. ;by BACK
  34. XREF BACK2_INIT,BACK2_SCROLL_SET
  35. XREF BEFOR_SCROLL
  36. ;by HIT
  37. XREF HERO1_HIT_JUDGE
  38. XREF HERO2_HIT_JUDGE
  39. ;by DUMMY
  40. XREF BK_OBJECT_SET,BK_CHR_INIT
  41. ;by RANK
  42. XREF INIT_NAMING,NAMING
  43. ;by MESSAGE
  44. XREF MESS_SET
  45. ;by START
  46. XREF INIT_START_DEMO,START_DEMO
  47. SECT GAME,,C
  48. INCLUDE SYS.INC
  49. INCLUDE NEO_GEO.INC
  50. INCLUDE LABEL.INC
  51. INCLUDE HERO_TBL.INC
  52. INCLUDE HK3_TBL.INC
  53. INCLUDE MACRO.INC
  54. INCLUDE EASY_MAC.INC
  55. INCLUDE HFLAG.INC
  56. INCLUDE HERO_STP.INC
  57. INCLUDE CTRL_No.INC
  58. INCLUDE SMACRO.INC
  59. INCLUDE SCODE.INC
  60. IFNE 0
  61. sub step
  62. 0 stage start demo
  63. 1 round start demo
  64. 2 game play
  65. 3 dead slow
  66. 4 to winner
  67. 5 winner demo
  68. 6 to loser
  69. 7 loser demo
  70. ENDC
  71. INIT_STORY_GAME:
  72. AND.B #01111111B,PHASE+1(A5)
  73. JSR LEVER_SET(PC)
  74. LEA.L MLWORK1(A5),A6
  75. MOVE.W SUB_STEP(A5),D0
  76. ADD.W D0,D0
  77. ADD.W D0,D0
  78. MOVE.L ISG_VECTOR(PC,D0.W),A0
  79. JMP (A0)
  80. ISG_VECTOR:
  81. DC.L INIT_STAGE_COLOR 0
  82. DC.L INIT_ROUND_COLOR 1
  83. DC.L INIT_GAME_PLAY 2
  84. DC.L INIT_DEAD_SLOW 3
  85. DC.L INIT_TO_WINNER 4
  86. DC.L INIT_WINNER_DEMO 5
  87. DC.L INIT_TIME_UP 6
  88. DC.L INIT_TIME_UP 7
  89. DC.L INIT_STAGE_START 8
  90. DC.L INIT_ROUND_START 9
  91. DC.L INIT_TO_STOP 10
  92. DC.L INIT_DRAW_GAME 11
  93. DC.L INIT_ROUND_END 12
  94. DC.L INIT_OVER_DEMO 13
  95. DC.L INIT_NAMING 14
  96. DC.L INIT_START_DEMO 15
  97. STORY_GAME:
  98. JSR LEVER_SET(PC)
  99. LEA.L MLWORK1(A5),A6
  100. MOVE.W SUB_STEP(A5),D0
  101. ADD.W D0,D0
  102. ADD.W D0,D0
  103. MOVE.L SG_VECTOR(PC,D0.W),A0
  104. JMP (A0)
  105. SG_VECTOR:
  106. DC.L STAGE_COLOR 0
  107. DC.L ROUND_COLOR 1
  108. DC.L GAME_PLAY 2
  109. DC.L DEAD_SLOW 3
  110. DC.L TO_WINNER 4
  111. DC.L WINNER_DEMO 5
  112. DC.L TIME_UPM 6
  113. DC.L TIME_UPM 7
  114. DC.L STAGE_START 8
  115. DC.L ROUND_START 9
  116. DC.L TO_STOP 10
  117. DC.L DRAW_GAME 11
  118. DC.L ROUND_END 12
  119. DC.L OVER_DEMO 13
  120. DC.L NAMING 14
  121. DC.L START_DEMO 15
  122. LEVER_SET_GAME:
  123. LEVER_SET:
  124. LEA.L INPUT_1(A5),A0
  125. LEA.L PLAYER1(A5),A1
  126. BSR LEVER_SET_SUB
  127. LEA.L INPUT_2(A5),A0
  128. LEA.L PLAYER2(A5),A1
  129. LEVER_SET_SUB:
  130. MOVE.W 2(A0),PLAY_LEVER(A1)
  131. MOVE.B 1(A0),D0
  132. NOT.B D0
  133. MOVE.B 2(A0),D1
  134. NOT.B D1
  135. EOR.B D1,D0
  136. AND.B D1,D0
  137. MOVE.B D0,PLAY_LEVER+2(A1)
  138. RTS
  139. INIT_STAGE_COLOR:
  140. CLR.B ST_BACK_FLAG(A5)
  141. CLR.B IN_BONUS(A5)
  142. CLR.W INSERT_POS(A5)
  143. CLR.B ST_DEMO_IN(A5)
  144. JSR STAGE_STAGE_INIT(PC)
  145. RTS
  146. INIT_ROUND_COLOR:
  147. CLR.B ST_BACK_FLAG(A5)
  148. CLR.B IN_BONUS(A5)
  149. CLR.W INSERT_POS(A5)
  150. CLR.B ST_DEMO_IN(A5)
  151. JSR STAGE_STAGE_INIT(PC)
  152. RTS
  153. STAGE_COLOR:
  154. JSR STAGE_COLOR_SET(PC)
  155. BSET.B #7,PHASE+1(A5)
  156. MOVE.W #8,SUB_STEP(A5)
  157. RTS
  158. ROUND_COLOR:
  159. JSR STAGE_COLOR_SET(PC)
  160. BSET.B #7,PHASE+1(A5)
  161. MOVE.W #9,SUB_STEP(A5)
  162. RTS
  163. INIT_STAGE_START:
  164. CLR.W KING_MUNE(A5)
  165. CLR.W ROUND_No(A5)
  166. BTST.B #4,PHASE+1(A5)
  167. BNE INIT_ROUND_START
  168. TST.B ST_DEMO_ON(A5)
  169. BNE INIT_ROUND_START
  170. JSR STAGE_INIT(PC)
  171. MOVE.W #15,SUB_STEP(A5)
  172. OR.B #80H,PHASE+1(A5)
  173. RTS
  174. STAGE_START:
  175. JMP ROUND_START(PC)
  176. INIT_ROUND_START:
  177. CLR.W KING_MUNE(A5)
  178. JSR STAGE_INIT(PC)
  179. MOVE.W #9,SUB_STEP(A5)
  180. JSR GAME_START_DISP(PC)
  181. MOVE.B #60,BYTE_TIMER(A6)
  182. RTS
  183. ROUND_START:
  184. AND.B #11011111B,START_FLAG2(A5)
  185. TST.B COLOR_STATE(A5)
  186. BNE.S ROUND_START_1
  187. SUBQ.B #1,BYTE_TIMER(A6)
  188. BNE.S ROUND_START_1
  189. MOVE.W #2,SUB_STEP(A5)
  190. JSR GAME_START_CL(PC)
  191. ROUND_START_1:
  192. LEA.L HERO1(A5),A6
  193. JSR LM_HERO
  194. LEA.L HERO2(A5),A6
  195. JSR LM_HERO
  196. JSR BEFOR_SCROLL(PC)
  197. JSR BACK2_SCROLL_SET(PC)
  198. RTS
  199. INIT_TIME_UP:
  200. AND.B #01111111B,PHASE+1(A5)
  201. MOVE.B #60,TIME_UP_TIMER(A5)
  202. JSR TIME_OVER_DISP(PC)
  203. TIME_UPM:
  204. MOVE.B #1,NON_CTRL(A5)
  205. JSR IN_GAME(PC)
  206. SUBQ.B #1,TIME_UP_TIMER(A5)
  207. BNE.S TIME_UPM_1
  208. MOVE.W #10,SUB_STEP(A5)
  209. JSR TIME_OVER_CL(PC)
  210. TIME_UPM_1:
  211. RTS
  212. INIT_TO_STOP:
  213. AND.B #01111111B,PHASE+1(A5)
  214. TO_STOP:
  215. MOVE.B #1,NON_CTRL(A5)
  216. JMP DEAD_SLOW_1(PC)
  217. INIT_DEAD_SLOW:
  218. AND.B #01111111B,PHASE+1(A5)
  219. MOVE.B #11B,SLOW_CUT(A5)
  220. MOVE.B LSPC_MODE_STORE(A5),(A5)
  221. MOVE.W (A5),D0
  222. ADD.W D0,D0
  223. ADD.W D0,D0
  224. MOVE.B LSPC_MODE_STORE+1(A5),D0
  225. MOVE.W D0,LSPC_MODE_STORE(A5)
  226. MOVE.W D0,LSPC_MODE
  227. DEAD_SLOW:
  228. MOVE.B #1,NON_CTRL(A5)
  229. MOVE.B SLOW_CUT(A5),D0
  230. BPL.S DEAD_SLOW_0
  231. BSR NORMAL_AUTO
  232. MOVEQ.L #0,D0
  233. MOVE.B D0,SLOW_CUT(A5)
  234. DEAD_SLOW_0:
  235. AND.B MAIN_COUNT+3(A5),D0
  236. BEQ DEAD_SLOW_1
  237. MOVE.B #1,LP_MAIN_RUN(A5)
  238. RTS
  239. DEAD_SLOW_1:
  240. JSR IN_GAME(PC)
  241. JSR NORMAL_POSE_CHECK(PC)
  242. BEQ.S DEAD_SLOW_2
  243. RTS
  244. DEAD_SLOW_2:
  245. BSR NORMAL_AUTO
  246. JSR WINNER_JUDGE(PC)
  247. JSR ROUND_JUDGE(PC)
  248. OR.B #10000000B,PHASE+1(A5)
  249. TST.B DRAW_FLAG(A5)
  250. BNE.S DEAD_SLOW_3
  251. MOVE.W #4,SUB_STEP(A5)
  252. RTS
  253. DEAD_SLOW_3:
  254. MOVE.W HERO1+HERO_LIFE(A5),D0
  255. OR.W HERO2+HERO_LIFE(A5),D0
  256. BNE.S DS_TIME
  257. JSR DKO_DISP
  258. DS_TIME:
  259. MOVE.W #11,SUB_STEP(A5)
  260. RTS
  261. NORMAL_AUTO:
  262. TST.B SLOW_CUT(A5)
  263. BEQ.S NORMAL_AUTO_1
  264. MOVE.B LSPC_MODE_STORE(A5),(A5)
  265. MOVE.W (A5),D0
  266. LSR.W #2,D0
  267. MOVE.B LSPC_MODE_STORE+1(A5),D0
  268. MOVE.W D0,LSPC_MODE_STORE(A5)
  269. MOVE.W D0,LSPC_MODE
  270. NORMAL_AUTO_1:
  271. RTS
  272. NORMAL_POSE_CHECK:
  273. LEA.L HERO1(A5),A1
  274. JSR NPC_2(PC)
  275. BNE.S NPC_1
  276. LEA.L HERO2(A5),A1
  277. JSR NPC_2(PC)
  278. NPC_1:
  279. RTS
  280. NPC_2:
  281. TST.W HERO_LIFE(A1)
  282. BEQ.S NPC_3
  283. CMP.B #HERO_STOP_STEP,STEP1(A1)
  284. RTS
  285. NPC_3:
  286. MOVEP.W WORK_N0(A1),D0
  287. CLR.B D0
  288. TST.B ACT_FLAG(A5,D0.W)
  289. BMI.S NPC_4
  290. MOVEQ.L #1,D0
  291. RTS
  292. NPC_4:
  293. MOVEQ.L #0,D0
  294. RTS
  295. INIT_GAME_PLAY:
  296. AND.B #01111111B,PHASE+1(A5)
  297. GAME_PLAY:
  298. AND.B #11011111B,START_FLAG2(A5)
  299. CLR.B PAUSE_DI(A5)
  300. CLR.B NON_CTRL(A5)
  301. JSR GAME_CHECK(PC)
  302. IN_GAME:
  303. JSR SCORE_DISP(PC)
  304. BSR NEXT_AREA
  305. BSR DIST_SET
  306. BSR DEMO_LEVER_SET
  307. TST.B NON_CTRL(A5)
  308. BEQ.S IN_GAME_1
  309. CLR.W HERO1+PLAY_LEVER(A5)
  310. CLR.B HERO1+PLAY_LEVER+2(A5)
  311. CLR.W HERO2+PLAY_LEVER(A5)
  312. CLR.B HERO2+PLAY_LEVER+2(A5)
  313. LEA.L HERO1(A5),A6
  314. JSR PWORK_HIT
  315. LEA.L HERO2(A5),A6
  316. JSR PWORK_HIT
  317. BRA IN_GAME_2
  318. IN_GAME_1:
  319. LEA.L HERO1(A5),A6
  320. JSR PWORK_HIT
  321. LEA.L HERO2(A5),A6
  322. JSR PWORK_HIT
  323. LEA.L PLAYER1(A5),A6
  324. JSR HK3_SYSTEM
  325. LEA.L PLAYER2(A5),A6
  326. JSR HK3_SYSTEM
  327. IN_GAME_2:
  328. LEA.L HERO1(A5),A6
  329. JSR LM_HERO
  330. LEA.L HERO2(A5),A6
  331. JSR LM_HERO
  332. JSR BEFOR_SCROLL(PC)
  333. JSR BACK2_SCROLL_SET(PC)
  334. JSR LP_MAIN(PC)
  335. JSR HERO1_HIT_JUDGE
  336. JSR HERO2_HIT_JUDGE
  337. RTS
  338. DEMO_LEVER_SET:
  339. BTST.B #6,PHASE+1(A5)
  340. BNE.S DLS_1
  341. TST.B HOW_TO_FLAG(A5)
  342. BNE.S DLS_1
  343. RTS
  344. DLS_1:
  345. LEA.L HERO1(A5),A1
  346. BSR DLS_2
  347. LEA.L HERO2(A5),A1
  348. DLS_2:
  349. BTST.B #BHS_AUTO,HERO_STATE(A1)
  350. BNE DLS_3
  351. SUBQ.W #1,DEMO_LEV_COUNT(A1)
  352. MOVE.L DEMO_LEVER(A1),A0
  353. MOVEQ.L #DEMO_IN,D0
  354. AND.B DEBUG_DIP1(A5),D0
  355. BNE DLS_IN
  356. MOVE.B (A0)+,D0
  357. MOVE.B D0,D2
  358. MOVE.L A0,DEMO_LEVER(A1)
  359. MOVE.B PLAY_LEVER2(A1),D1
  360. MOVE.B D1,D3
  361. MOVE.B D0,PLAY_LEVER+PLAYER_OFFSET(A1)
  362. MOVE.B D0,PLAY_LEVER2(A1)
  363. EOR.B D0,D1
  364. AND.B D0,D1
  365. MOVE.B D1,PLAY_LEVER+1+PLAYER_OFFSET(A1)
  366. NOT.B D3
  367. NOT.B D2
  368. EOR.B D2,D3
  369. AND.B D2,D3
  370. MOVE.B D3,PLAY_LEVER+2+PLAYER_OFFSET(A1)
  371. DLS_3:
  372. RTS
  373. DLS_IN:
  374. MOVE.B PLAY_LEVER+PLAYER_OFFSET(A1),(A0)+
  375. MOVE.L A0,DEMO_LEVER(A1)
  376. RTS
  377. NEXT_AREA:
  378. BTST.B #7,DEBUG_DIP1(A5)
  379. BEQ.S NEXT_AREA_2
  380. BTST.B #4,PHASE+1(A5)
  381. BNE.S NEXT_AREA_2
  382. BTST.B #BPS_IN_GAME,PLAYER1+PLAYER_STATE(A5)
  383. BEQ.S NEXT_AREA_1
  384. BTST.B #B_P1_START,INPUT_S+1(A5)
  385. BNE NEXT_AREA_3
  386. NEXT_AREA_1:
  387. BTST.B #BPS_IN_GAME,PLAYER2+PLAYER_STATE(A5)
  388. BEQ.S NEXT_AREA_2
  389. BTST.B #B_P2_START,INPUT_S+1(A5)
  390. BNE NEXT_AREA_3
  391. NEXT_AREA_2:
  392. RTS
  393. NEXT_AREA_3:
  394. LEA.L PLAYER1(A5),A0
  395. TST.W STORY_PLAYER(A5)
  396. BEQ.S NEXT_AREA_4
  397. LEA.L PLAYER2(A5),A0
  398. NEXT_AREA_4:
  399. MOVE.L A0,WIN_PLAYER(A5)
  400. OR.B #10000000B,PHASE+1(A5)
  401. MOVE.B #1,STAGE_END_FLAG(A5)
  402. MOVE.W #12,SUB_STEP(A5)
  403. RTS
  404. GAME_CHECK:
  405. TST.W HERO1+HERO_LIFE(A5)
  406. BEQ.S ROUND_OVER
  407. TST.W HERO2+HERO_LIFE(A5)
  408. BEQ.S ROUND_OVER
  409. JSR STAGE_TIME_DEC(PC)
  410. TST.B STAGE_TIME(A5)
  411. BEQ.S TIME_OVER
  412. RTS
  413. TIME_OVER:
  414. OR.B #10000000B,PHASE+1(A5)
  415. MOVE.W #6,SUB_STEP(A5)
  416. RTS
  417. ROUND_OVER:
  418. OR.B #10000000B,PHASE+1(A5)
  419. MOVE.W #3,SUB_STEP(A5)
  420. RTS
  421. STAGE_TIME_DEC:
  422. SUBQ.B #1,STAGE_TIME+1(A5)
  423. BGT.S STD_2
  424. MOVE.B SECOND_VALUE(A5),STAGE_TIME+1(A5)
  425. BTST.B #TIME_STOP,DEBUG_DIP2(A5)
  426. BNE.S STD_1
  427. SUB.B D0,D0
  428. MOVE.B STAGE_TIME(A5),D0
  429. MOVE.B #1,D1
  430. SBCD.B D1,D0
  431. MOVE.B D0,STAGE_TIME(A5)
  432. CMP.B #10,D0
  433. BCC.S STD_1
  434. SOUND #1BH*2
  435. STD_1:
  436. JSR GAME_TIME_DISP(PC)
  437. STD_2:
  438. RTS
  439. WINNER_JUDGE:
  440. ; out)DRAW_FLAG = 1 draw
  441. ; =0 A1 winner
  442. ; A2 loser
  443. ; BSR GET_LIFE_PER
  444. ;
  445. MOVE.B #1,DRAW_FLAG(A5)
  446. LEA.L HERO1(A5),A1
  447. LEA.L HERO2(A5),A2
  448. MOVE.W HERO_LIFE(A1),D0
  449. SUB.W HERO_LIFE(A2),D0
  450. BEQ WINNER_JUDGE_3
  451. BCC WINNER_JUDGE_2
  452. EXG.L A1,A2
  453. WINNER_JUDGE_2:
  454. MOVE.L ANOTHER_PLAYER+PLAYER_OFFSET(A2),WIN_PLAYER(A5)
  455. CLR.B DRAW_FLAG(A5)
  456. ADDQ.W #1,WIN_ROUND+PLAYER_OFFSET(A1)
  457. WINNER_JUDGE_3:
  458. RTS
  459. GET_LIFE_PER:
  460. MOVEQ.L #0,D0
  461. MOVE.B HERO1+LIFE_GAGE(A5),D0
  462. ADD.W D0,D0
  463. ADD.W D0,D0
  464. ADD.W D0,D0
  465. MOVEQ.L #0,D1
  466. MOVE.B HERO1+HERO_LIFE+1(A5),(A5)
  467. MOVE.W (A5),D1
  468. DIVU D0,D1
  469. MOVE.W D1,HERO1+LIFE_PER(A5)
  470. MOVE.B HERO2+LIFE_GAGE(A5),D0
  471. ADD.W D0,D0
  472. ADD.W D0,D0
  473. ADD.W D0,D0
  474. MOVEQ.L #0,D1
  475. MOVE.B HERO2+HERO_LIFE+1(A5),(A5)
  476. MOVE.W (A5),D1
  477. DIVU D0,D1
  478. MOVE.W D1,HERO2+LIFE_PER(A5)
  479. RTS
  480. ROUND_JUDGE:
  481. CLR.B STAGE_END_FLAG(A5)
  482. ADDQ.W #1,ROUND_No(A5)
  483. MOVE.W ROUND_No(A5),D4
  484. MOVE.W WIN_ROUND+PLAYER_OFFSET(A1),D1
  485. MOVE.W WIN_ROUND+PLAYER_OFFSET(A2),D2
  486. CMP.W D2,D1
  487. BEQ ROUND_JUDGE_SAME
  488. BHS.S ROUND_JUDGE_1
  489. EXG.L A1,A2
  490. EXG.L D1,D2
  491. ROUND_JUDGE_1:
  492. MOVE.W MAX_ROUND(A5),D0
  493. CMP.W D0,D4
  494. BHS ROUND_JUDGE_100
  495. CMP.W WINNER_ROUND(A5),D1
  496. BHS ROUND_JUDGE_100
  497. SUB.W D2,D1
  498. SUB.W D4,D0
  499. CMP.W D0,D1
  500. BHI ROUND_JUDGE_100
  501. RTS
  502. ROUND_JUDGE_100:
  503. MOVE.L ANOTHER_PLAYER+PLAYER_OFFSET(A2),WIN_PLAYER(A5)
  504. MOVE.B #1,STAGE_END_FLAG(A5)
  505. CLR.B DRAW_FLAG(A5)
  506. RTS
  507. ROUND_JUDGE_SAME:
  508. CMP.W MAX_ROUND(A5),D4
  509. BHI.S EXTRA_DRAW
  510. ; BEQ.S FINAL_DRAW
  511. RTS
  512. EXTRA_DRAW:
  513. BTST.B #4,PHASE+1(A5)
  514. BNE EXTRA_DRAW_VS
  515. BTST.B #BPS_COM_FLAG,PLAYER_STATE+PLAYER_OFFSET(A1)
  516. BEQ.S EXTRA_DRAW_STORY_1
  517. EXG.L A1,A2
  518. EXTRA_DRAW_STORY_1:
  519. MOVE.L ANOTHER_PLAYER+PLAYER_OFFSET(A2),WIN_PLAYER(A5)
  520. MOVE.B #1,STAGE_END_FLAG(A5)
  521. CLR.B DRAW_FLAG(A5)
  522. RTS
  523. EXTRA_DRAW_VS:
  524. MOVE.W OLD_VS(A5),D0
  525. BMI.S EXTRA_DRAW_VS_2
  526. CLR.B DRAW_FLAG(A5)
  527. CMP.W PLAYER_No(A1),D0
  528. BEQ.S EXTRA_DRAW_VS_1
  529. EXG.L A1,A2
  530. EXTRA_DRAW_VS_1:
  531. MOVE.L ANOTHER_PLAYER+PLAYER_OFFSET(A2),WIN_PLAYER(A5)
  532. EXTRA_DRAW_VS_2:
  533. MOVE.B #1,STAGE_END_FLAG(A5)
  534. RTS
  535. DIST_SET:
  536. MOVE.W HERO1+X_POSITION(A5),D0
  537. SUB.W HERO2+X_POSITION(A5),D0
  538. BPL.S DIST_SET_1
  539. NEG.W D0
  540. DIST_SET_1:
  541. MOVE.W D0,TEMP_DISTANCE(A5)
  542. SUB.W MIN_DISTANCE(A5),D0
  543. BPL.S DIST_SET_2
  544. MOVEQ.L #0,D0
  545. DIST_SET_2:
  546. MOVE.W D0,TEMP_DISTANCE2(A5)
  547. RTS
  548. INIT_TO_WINNER:
  549. AND.B #01111111B,PHASE+1(A5)
  550. MOVE.B #3,BACK2+MASTER_REQUEST(A5)
  551. TO_WINNER:
  552. MOVE.B #1,NON_CTRL(A5)
  553. JSR IN_GAME(PC)
  554. BTST.B #0,BACK2+MASTER_REQUEST(A5)
  555. BNE.S TO_WINNER_1
  556. MOVE.W #5,SUB_STEP(A5)
  557. OR.B #10000000B,PHASE+1(A5)
  558. TO_WINNER_1:
  559. RTS
  560. INIT_DRAW_GAME:
  561. MOVE.W #200H,WORD_TIMER(A6)
  562. AND.B #01111111B,PHASE+1(A5)
  563. RTS
  564. INIT_WINNER_DEMO:
  565. MOVE.L WIN_PLAYER(A5),A6
  566. LEA.L HERO_OFFSET(A6),A6
  567. MOVEP.W WORK_N0(A6),D0
  568. CLR.B D0
  569. LEA.L 0(A5,D0.W),A4
  570. MOVE.W #CTRL_WIN,D4
  571. JSR CTRL_CHANGE
  572. MOVE.W #0,MAIN_STEP(A5)
  573. AND.B #01111111B,PHASE+1(A5)
  574. RTS
  575. WINNER_DEMO:
  576. MOVE.B #1,NON_CTRL(A5)
  577. JSR IN_GAME(PC)
  578. MOVE.W MAIN_STEP(A5),D0
  579. ADD.W D0,D0
  580. ADD.W D0,D0
  581. JMP WIN_VECTOR(PC,D0.W)
  582. WIN_VECTOR:
  583. JMP TO_WIN_END(PC)
  584. JMP TIME_WIN(PC)
  585. JMP PER_WIN(PC)
  586. JMP TOTAL_WIN(PC)
  587. JMP TOTAL_WIN2(PC)
  588. JMP WIN_OVER(PC)
  589. JMP LIFE_WIN(PC)
  590. TO_WIN_END:
  591. MOVE.L WIN_PLAYER(A5),A6
  592. LEA.L HERO_OFFSET(A6),A6
  593. MOVEP.W WORK_N0(A6),D0
  594. CLR.B D0
  595. TST.B ACT_FLAG(A5,D0.W)
  596. BMI.S LIFE_WIN_0
  597. RTS
  598. LIFE_WIN_0:
  599. CLR.L SCORE_TOTAL(A5)
  600. JSR WINNER_DISP(PC)
  601. BTST.B #4,PHASE+1(A5)
  602. BNE TO_WIN_OVER
  603. MOVE.L WIN_PLAYER(A5),A1
  604. BTST.B #BPS_COM_FLAG,PLAYER_STATE(A1)
  605. BEQ TO_WIN_OVER
  606. MOVE.W #6,MAIN_STEP(A5)
  607. MOVE.B #40,MLWORK1+BYTE_TIMER(A5)
  608. RTS
  609. LIFE_WIN:
  610. SUBQ.B #1,MLWORK1+BYTE_TIMER(A5)
  611. BEQ.S LIFE_WIN_1
  612. RTS
  613. LIFE_WIN_1:
  614. BSR LIFE_SCORE_CAL
  615. MOVE.L SCORE_LIFE(A5),D1
  616. ADD.L D1,SCORE_TOTAL(A5)
  617. MOVE.W #8FH,D0
  618. JSR NUMBER_MESS(PC)
  619. MOVE.B #3,MLWORK1+BYTE_TIMER(A5)
  620. MOVE.W #1,MAIN_STEP(A5)
  621. RTS
  622. TIME_WIN:
  623. SUBQ.B #1,MLWORK1+BYTE_TIMER(A5)
  624. BEQ.S TIME_WIN_1
  625. RTS
  626. TIME_WIN_1:
  627. BSR TIME_SCORE_CAL
  628. MOVE.L SCORE_TIME(A5),D1
  629. ADD.L D1,SCORE_TOTAL(A5)
  630. MOVE.W #90H,D0
  631. JSR NUMBER_MESS(PC)
  632. MOVE.B #3,MLWORK1+BYTE_TIMER(A5)
  633. MOVE.W #2,MAIN_STEP(A5)
  634. RTS
  635. PER_WIN:
  636. SUBQ.B #1,MLWORK1+BYTE_TIMER(A5)
  637. BEQ.S PER_WIN_1
  638. RTS
  639. PER_WIN_1:
  640. BSR PER_SCORE_CAL
  641. MOVE.L SCORE_PER(A5),D1
  642. BEQ PER_WIN_2
  643. ADD.L D1,SCORE_TOTAL(A5)
  644. MOVE.W #91H,D0
  645. JSR NUMBER_MESS(PC)
  646. PER_WIN_2:
  647. MOVE.B #3,MLWORK1+BYTE_TIMER(A5)
  648. MOVE.W #3,MAIN_STEP(A5)
  649. RTS
  650. TOTAL_WIN:
  651. SUBQ.B #1,MLWORK1+BYTE_TIMER(A5)
  652. BEQ.S TOTAL_WIN_1
  653. RTS
  654. TOTAL_WIN_1:
  655. MOVE.L SCORE_TOTAL(A5),D1
  656. MOVE.W #92H,D0
  657. JSR.S NUMBER_MESS(PC)
  658. MOVE.B #40,MLWORK1+BYTE_TIMER(A5)
  659. MOVE.W #4,MAIN_STEP(A5)
  660. RTS
  661. TOTAL_WIN2:
  662. JSR ACTIVE_TRIGER
  663. BTST.L #B_A_BUTTON,D2
  664. BNE.S TOTAL_WIN1_1
  665. SUBQ.B #1,MLWORK1+BYTE_TIMER(A5)
  666. BEQ.S TOTAL_WIN1_1
  667. RTS
  668. TOTAL_WIN1_1:
  669. TW1_20:
  670. MOVE.L #10000,D0
  671. MOVE.L #10000H,D3
  672. MOVE.L SCORE_TOTAL(A5),D1
  673. CMP.L D0,D1
  674. BHI TW1_2
  675. MOVE.L #1000,D0
  676. MOVE.L #1000H,D3
  677. CMP.L D0,D1
  678. BHI TW1_2
  679. MOVE.L #100,D0
  680. MOVE.L #100H,D3
  681. CMP.L D0,D1
  682. BHI TW1_2
  683. MOVE.L #10,D0
  684. MOVE.L #10H,D3
  685. CMP.L D0,D1
  686. BHI TW1_2
  687. MOVE.L #1,D0
  688. MOVE.L #1,D3
  689. TW1_2:
  690. MOVE.L D3,REG_D0(A5)
  691. SUB.L D0,D1
  692. MOVE.L D1,SCORE_TOTAL(A5)
  693. MOVE.L WIN_PLAYER(A5),A0
  694. LEA.L HERO_SCORE+HERO_OFFSET+4(A0),A0
  695. LEA.L REG_D0+4(A5),A1
  696. SUB.W D0,D0
  697. ABCD.B -(A1),-(A0)
  698. ABCD.B -(A1),-(A0)
  699. ABCD.B -(A1),-(A0)
  700. ABCD.B -(A1),-(A0)
  701. TST.L D1
  702. BEQ.S TW1_3
  703. BTST.L #B_A_BUTTON,D2
  704. BNE TW1_20
  705. TW1_3:
  706. MOVE.W #92H,D0
  707. JSR.S NUMBER_MESS(PC)
  708. SOUND #S_COUNT
  709. TST.L SCORE_TOTAL(A5)
  710. BEQ TO_WIN_OVER
  711. MOVE.B #6,MLWORK1+BYTE_TIMER(A5)
  712. RTS
  713. PER_SCORE_CAL:
  714. CLR.L SCORE_PER(A5)
  715. TST.B STAGE_TIME(A5)
  716. BEQ PSC_1
  717. MOVE.L WIN_PLAYER(A5),A1
  718. MOVEQ.L #0,D0
  719. MOVE.B STORY_LIFE(A5),D0
  720. MOVE.W D0,D1
  721. ADD.W D0,D0
  722. ADD.W D0,D0
  723. ADD.W D0,D0
  724. CMP.W HERO_LIFE+HERO_OFFSET(A1),D0
  725. BNE PSC_1
  726. SUB.W #12,D1
  727. MULU #5000,D1
  728. ADD.L #20000,D1
  729. MOVE.L D1,SCORE_PER(A5)
  730. PSC_1:
  731. RTS
  732. TIME_SCORE_CAL:
  733. MOVEQ.L #0,D1
  734. MOVE.B STAGE_TIME(A5),D1
  735. JSR BCD_BIN(PC)
  736. MULU #100,D1
  737. MOVE.L D1,SCORE_TIME(A5)
  738. RTS
  739. LIFE_SCORE_CAL:
  740. CLR.L SCORE_LIFE(A5)
  741. MOVE.L WIN_PLAYER(A5),A1
  742. MOVE.W HERO_LIFE+HERO_OFFSET(A1),D1
  743. CMP.W #96,D1
  744. BCS.S LSC_1
  745. SUB.W #96,D1
  746. MULU #400,D1
  747. MOVE.L D1,SCORE_LIFE(A5)
  748. MOVEQ.L #95,D1
  749. LSC_1:
  750. CMP.W #16,D1
  751. BCS.S LSC_2
  752. SUB.W #16,D1
  753. MULU #200,D1
  754. ADD.L D1,SCORE_LIFE(A5)
  755. MOVEQ.L #15,D1
  756. LSC_2:
  757. MULU #100,D1
  758. ADD.L D1,SCORE_LIFE(A5)
  759. RTS
  760. TO_WIN_OVER:
  761. LEA.L MLWORK1(A5),A6
  762. MOVE.W #200H,WORD_TIMER(A6)
  763. MOVE.W #5,MAIN_STEP(A5)
  764. RTS
  765. WIN_OVER:
  766. LEA.L MLWORK1(A5),A6
  767. SEC_TIMER WORD_TIMER
  768. BCS.S WIN_OVER_1
  769. RTS
  770. WIN_OVER_1:
  771. OR.B #10000000B,PHASE+1(A5)
  772. MOVE.W #14,SUB_STEP(A5)
  773. RTS
  774. DRAW_GAME:
  775. LEA.L MLWORK1(A5),A6
  776. SEC_TIMER WORD_TIMER
  777. BCS.S DRAW_GAME_1
  778. MOVE.B #1,NON_CTRL(A5)
  779. JSR IN_GAME(PC)
  780. RTS
  781. DRAW_GAME_1:
  782. OR.B #10000000B,PHASE+1(A5)
  783. MOVE.W #12,SUB_STEP(A5)
  784. RTS
  785. INIT_ROUND_END:
  786. MOVE.W #FADE_OUT+CC_SPEED3,D0
  787. MOVE.W #100H-1,D7
  788. LEA.L COLOR_BUFFER(A5),A0
  789. INIT_ROUND_END_1:
  790. MOVE.W D0,(A0)
  791. LEA.L 20H(A0),A0
  792. DBRA D7,INIT_ROUND_END_1
  793. MOVE.B #1,COLOR_STATE(A5)
  794. TST.B STAGE_END_FLAG(A5)
  795. BEQ.S INIT_ROUND_END_2
  796. MOVE.W #S_FADESPEED_5,D0
  797. JSR.S SET_BGM
  798. INIT_ROUND_END_2:
  799. RTS
  800. ROUND_END:
  801. PAL_WAIT 0FFH
  802. MOVE.W #31H,D0
  803. JSR.S MESS_SET
  804. OR.B #10000000B,PHASE+1(A5)
  805. TST.B STAGE_END_FLAG(A5)
  806. BEQ.S ROUND_END_1
  807. BTST.B #4,PHASE+1(A5)
  808. BNE VS_ROUND_END
  809. MOVE.W #13,SUB_STEP(A5)
  810. RTS
  811. ROUND_END_1:
  812. MOVE.W #1,SUB_STEP(A5)
  813. RTS
  814. VS_ROUND_END:
  815. MOVE.W #0,ROUND_No(A5)
  816. MOVE.W #0,SUB_STEP(A5)
  817. MOVE.B #01110000B,D0
  818. AND.B PHASE+1(A5),D0
  819. OR.B #10000101B,D0
  820. MOVE.B D0,PHASE+1(A5)
  821. RTS
  822. STAGE_INIT:
  823. MOVE.W AREA_No(A5),D0
  824. ADD.W D0,D0
  825. ADD.W D0,D0
  826. JMP STAGE_INIT_VECTOR-4(PC,D0.W)
  827. STAGE_INIT_VECTOR:
  828. JMP INIT_1STG(PC)
  829. JMP INIT_2STG(PC)
  830. JMP INIT_1BNS(PC)
  831. JMP INIT_3STG(PC)
  832. JMP INIT_4STG(PC)
  833. JMP INIT_2BNS(PC)
  834. JMP INIT_5STG(PC)
  835. JMP INIT_6STG(PC)
  836. JMP INIT_3BNS(PC)
  837. JMP INIT_7STG(PC)
  838. JMP INIT_8STG(PC)
  839. JMP INIT_ESTG(PC)
  840. INIT_1STG:
  841. JSR NORMAL_STAGE_INIT(PC)
  842. LEA.L MLWORK1(A5),A6
  843. RTS
  844. INIT_2STG:
  845. JSR NORMAL_STAGE_INIT(PC)
  846. LEA.L MLWORK1(A5),A6
  847. LCHILD WORK_N0,L_PAL_ACT,PAL_ACT2S_1
  848. CLR.W WORD_TIMER(A0)
  849. CLR.B BYTE_TIMER(A0)
  850. CLR.B STEP2(A0)
  851. CLR.B SPEED(A0)
  852. RTS
  853. INIT_3STG:
  854. JSR NORMAL_STAGE_INIT(PC)
  855. LEA.L MLWORK1(A5),A6
  856. LCHILD WORK_N0,L_PAL_ACT,PAL_ACT3S_1
  857. MOVE.W #1,WORD_TIMER(A0)
  858. MOVE.B #1,STEP1(A0)
  859. RTS
  860. INIT_4STG:
  861. JSR NORMAL_STAGE_INIT(PC)
  862. LEA.L MLWORK1(A5),A6
  863. RTS
  864. INIT_5STG:
  865. JSR NORMAL_STAGE_INIT(PC)
  866. LEA.L MLWORK1(A5),A6
  867. RTS
  868. INIT_6STG:
  869. JSR NORMAL_STAGE_INIT(PC)
  870. LEA.L MLWORK1(A5),A6
  871. RTS
  872. INIT_7STG:
  873. JSR NORMAL_STAGE_INIT(PC)
  874. LEA.L MLWORK1(A5),A6
  875. LCHILD WORK_N0,L_PAL_ACT,PAL_ACT7S_1
  876. CLR.W WORD_TIMER(A0)
  877. CLR.B BYTE_TIMER(A0)
  878. CLR.B STEP2(A0)
  879. RTS
  880. INIT_8STG:
  881. JSR NORMAL_STAGE_INIT(PC)
  882. LEA.L MLWORK1(A5),A6
  883. RTS
  884. INIT_ESTG:
  885. CLR.W MIN_DISTANCE(A5)
  886. JSR STAGE_PLAYER_SET(PC)
  887. JSR STAGE_PARM_INIT(PC)
  888. MOVE.W HERO2+X_POSITION(A5),D0
  889. MOVE.W D0,D1
  890. ADD.W HERO1+X_POSITION(A5),D0
  891. LSR.W #1,D0
  892. MOVE.W D0,REG_D0(A5)
  893. MOVE.W BACK2_ST_BIG(A5),REG_D1(A5)
  894. JSR BACK2_INIT(PC)
  895. LEA.L MLWORK1(A5),A6
  896. RTS
  897. INIT_1BNS:
  898. INIT_2BNS:
  899. INIT_3BNS:
  900. RTS
  901. NORMAL_STAGE_INIT:
  902. CLR.W MIN_DISTANCE(A5)
  903. JSR STAGE_PLAYER_SET(PC)
  904. JSR STAGE_PARM_INIT(PC)
  905. MOVE.W HERO2+X_POSITION(A5),D0
  906. MOVE.W D0,D1
  907. ADD.W HERO1+X_POSITION(A5),D0
  908. LSR.W #1,D0
  909. MOVE.W D0,REG_D0(A5)
  910. MOVE.W BACK2_ST_BIG(A5),REG_D1(A5)
  911. JSR BACK2_INIT(PC)
  912. JSR BK_CHR_INIT(PC)
  913. JSR BK_OBJECT_SET(PC)
  914. RTS
  915. STAGE_PARM_INIT:
  916. BSR STAGE_LEVEL_SET
  917. TST.W ROUND_No(A5)
  918. BNE STAGE_PARM_INIT_1
  919. MOVEQ.L #0,D0
  920. MOVE.W D0,PLAYER1+WIN_ROUND(A5)
  921. MOVE.W D0,PLAYER2+WIN_ROUND(A5)
  922. MOVE.B GAME_DIP+SD_ROUND(A5),D0
  923. ADD.W D0,D0
  924. ADD.W D0,D0
  925. MOVE.W STAGE_ROUND_DT(PC,D0.W),MAX_ROUND(A5)
  926. MOVE.W STAGE_ROUND_DT+2(PC,D0.W),WINNER_ROUND(A5)
  927. STAGE_PARM_INIT_1:
  928. BTST.B #6,PHASE+1(A5)
  929. BNE DEMO_TIME
  930. MOVEQ.L #0,D0
  931. MOVE.B D0,DEMO_FLAG(A5)
  932. MOVE.B GAME_DIP+SD_ROUND_TIME(A5),D0
  933. MOVE.B STAGE_BCD(PC,D0.W),STAGE_TIME(A5)
  934. MOVE.B SECOND_VALUE(A5),STAGE_TIME+1(A5)
  935. RTS
  936. DEMO_TIME:
  937. MOVE.B #1,DEMO_FLAG(A5)
  938. MOVE.B #60H,STAGE_TIME(A5)
  939. MOVE.B SECOND_VALUE(A5),STAGE_TIME+1(A5)
  940. RTS
  941. STAGE_ROUND_DT:
  942. DC.W 1,1
  943. DC.W 3,2
  944. DC.W 5,3
  945. STAGE_BCD:
  946. DC.B 10H,10H,10H,10H,10H,10H,10H,10H,10H,10H
  947. DC.B 10H,11H,12H,13H,14H,15H,16H,17H,18H,19H
  948. DC.B 20H,21H,22H,23H,24H,25H,26H,27H,28H,29H
  949. DC.B 30H,31H,32H,33H,34H,35H,36H,37H,38H,39H
  950. DC.B 40H,41H,42H,43H,44H,45H,46H,47H,48H,49H
  951. DC.B 50H,51H,52H,53H,54H,55H,56H,57H,58H,59H
  952. DC.B 60H,61H,62H,63H,64H,65H,66H,67H,68H,69H
  953. DC.B 70H,71H,72H,73H,74H,75H,76H,77H,78H,79H
  954. DC.B 80H,81H,82H,83H,84H,85H,86H,87H,88H,89H
  955. DC.B 90H,91H,92H,93H,94H,95H,96H,97H,98H,99H
  956. REPT 156
  957. DC.B 99H
  958. ENDR
  959. STAGE_LEVEL_SET:
  960. MOVE.W LEVEL_TEMP(A5),D0
  961. BTST.B #6,PHASE+1(A5)
  962. BNE.S SLS_1
  963. MOVEQ.L #0,D0
  964. MOVE.B GAME_DIP+SD_LEVEL(A5),D0
  965. ADD.W D0,D0
  966. MOVE.W ORG_LEVEL_DATA(PC,D0.W),D0
  967. MOVE.W D0,LEVEL_ORG(A5)
  968. ADD.W LEVEL_ADD(A5),D0
  969. MOVE.W D0,LEVEL_TEMP(A5)
  970. SLS_1:
  971. ADD.W D0,D0
  972. MOVE.W ATTACK_MULD(PC,D0.W),ATTACK_MUL(A5)
  973. RTS
  974. ORG_LEVEL_DATA:
  975. DC.W 00,01,02,03,04,05,06,07
  976. ATTACK_MULD:
  977. DC.W (90*256)/100 1
  978. DC.W (95*256)/100 2
  979. DC.W (100*256)/100 3
  980. DC.W (105*256)/100 4
  981. DC.W (110*256)/100 5
  982. DC.W (115*256)/100 6
  983. DC.W (120*256)/100 7
  984. DC.W (125*256)/100 8
  985. ; DC.W (80*256)/100 1
  986. ; DC.W (90*256)/100 2
  987. ; DC.W (100*256)/100 3
  988. ; DC.W (110*256)/100 4
  989. ; DC.W (120*256)/100 5
  990. ; DC.W (130*256)/100 6
  991. ; DC.W (140*256)/100 7
  992. ; DC.W (150*256)/100 8
  993. STAGE_STAGE_INIT:
  994. JSR.S PWORK_INIT
  995. JSR LWORK_DEAD(PC)
  996. LEA.L GAME_OBJ_MAP(PC),A0
  997. JSR.S OBJ_MAP_SET
  998. RTS
  999. GAME_OBJ_MAP: ; sp_no(0~379):sp_cnt(sp_max)
  1000. DC.W 0031H,0050H,0 obj 1 80
  1001. DC.W 0081H,0050H,1 obj 2 80*2
  1002. DC.W 0121H,002CH,0 obj 3 44
  1003. DC.W 014DH,0018H,1 obj 4 24*2
  1004. DC.W 080H,80H+5*4,0C0H,80H+2*4,0E0H,80H+7*4,-1 div
  1005. STAGE_PLAYER_SET:
  1006. BSR POS_X_GET
  1007. MOVE.W D0,-(SP)
  1008. SWAP D0
  1009. LEA.L HERO1(A5),A6
  1010. MOVE.W D0,X_POSITION(A6)
  1011. BSR SPS_SUB
  1012. BSR HERO_1st_CALL
  1013. LEA.L HERO2(A5),A6
  1014. MOVE.W (SP)+,X_POSITION(A6)
  1015. BSR SPS_SUB
  1016. BSR HERO_1st_CALL
  1017. LEA.L HERO2(A5),A1
  1018. MOVE.W HERO_TYPE+HERO1(A5),D0
  1019. CMP.W HERO_TYPE(A1),D0
  1020. BNE.S SPS_1
  1021. MOVEP.W WORK_N0(A1),D0
  1022. CLR.B D0
  1023. ADD.B #3,PALETTE_ADD(A5,D0.W)
  1024. MOVEP.W WORK_N1(A1),D0
  1025. CLR.B D0
  1026. ADD.B #3,PALETTE_ADD(A5,D0.W)
  1027. SPS_1:
  1028. JSR DEMO_TITLE_SET(PC)
  1029. RTS
  1030. POS_X_GET:
  1031. MOVEQ.L #0,D0
  1032. BTST.B #4,PHASE+1(A5)
  1033. BNE.S PXG_1
  1034. TST.B ST_DEMO_ON(A5)
  1035. BNE.S PXG_1
  1036. MOVE.W STORY_STAGE(A5),D0
  1037. PXG_1:
  1038. MOVE.W D0,D1
  1039. ADD.W D0,D0
  1040. ADD.W D1,D0
  1041. ADD.W D0,D0
  1042. MOVE.W PXG_DATA(PC,D0.W),BACK2_ST_BIG(A5)
  1043. MOVE.L PXG_DATA+2(PC,D0.W),D0
  1044. TST.W D1
  1045. BEQ.S PXG_2
  1046. TST.W STORY_PLAYER(A5)
  1047. BEQ.S PXG_2
  1048. NEG.W D0
  1049. ADD.W #300H,D0
  1050. SWAP D0
  1051. NEG.W D0
  1052. ADD.W #300H,D0
  1053. PXG_2:
  1054. RTS
  1055. RUN_DIS EQU 0B4H
  1056. JUMP_DIS EQU 0ACH
  1057. P1_SE EQU 0E8H
  1058. P2_SE EQU 216H
  1059. PXG_DATA:
  1060. DC.W 100H,180H-2CH,180H+2CH
  1061. DC.W 100H,P1_SE+JUMP_DIS,P2_SE 1
  1062. DC.W 100H,P2_SE-58H,P2_SE 2
  1063. DC.W 100H,180H-2CH,180H+2CH
  1064. DC.W 100H,P1_SE+RUN_DIS+JUMP_DIS,P1_SE+RUN_DIS+JUMP_DIS+58H 3
  1065. DC.W 100H,P1_SE+JUMP_DIS,P2_SE 4
  1066. DC.W 100H,180H-2CH,180H+2CH
  1067. DC.W 100H,P1_SE+RUN_DIS,P2_SE 5
  1068. DC.W 100H,180H-2CH,180H+2CH 6
  1069. DC.W 100H,180H-2CH,180H+2CH
  1070. DC.W 100H,P1_SE+JUMP_DIS,P2_SE 7
  1071. DC.W 100H,P1_SE,P2_SE-JUMP_DIS 8
  1072. DC.W 100H,280H-16H,280H+16H END
  1073. HERO_1st_CALL:
  1074. JSR HERO_1st
  1075. CMP.W #9,HERO_TYPE(A6)
  1076. BNE.S H1C_00
  1077. MOVEP.W WORK_N0(A6),D0
  1078. CLR.B D0
  1079. ADD.B #4AH,PALETTE_ADD(A5,D0.W)
  1080. H1C_00:
  1081. LEA.L PLAYER_OFFSET(A6),A6
  1082. JSR INIT_HK3
  1083. H1C_1:
  1084. RTS
  1085. SPS_SUB:
  1086. BTST.B #6,PHASE+1(A5)
  1087. BNE.S SPS_SUB_1
  1088. BTST.B #4,PHASE+1(A5)
  1089. BNE.S SPS_SUB_1
  1090. MOVE.W PLAYER_No+PLAYER_OFFSET(A6),D0
  1091. CMP.W STORY_PLAYER(A5),D0
  1092. BNE STAGE_ENEMY_SET
  1093. SPS_SUB_1:
  1094. BSET.B #BPS_COM_FLAG,PLAYER_STATE+PLAYER_OFFSET(A6)
  1095. RTS
  1096. STAGE_ENEMY_SET:
  1097. BCLR.B #BPS_COM_FLAG,PLAYER_STATE+PLAYER_OFFSET(A6)
  1098. MOVE.W STORY_STAGE(A5),D0
  1099. CLR.B HERO_TYPE(A6)
  1100. MOVE.B STAGE_ENEMY-1(PC,D0.W),HERO_TYPE+1(A6)
  1101. RTS
  1102. STAGE_ENEMY:
  1103. DC.B 2,3,0,4,5,0,6,7,0,8,9,9
  1104. EVEN
  1105. STAGE_COLOR_SET:
  1106. BSR AREA_SET
  1107. MOVE.W AREA_No(A5),D0
  1108. ADD.W D0,D0
  1109. ADD.W D0,D0
  1110. JMP STAGE_COLOR_VECTOR-4(PC,D0.W)
  1111. STAGE_COLOR_VECTOR:
  1112. JMP INIT_1STGC(PC) 1
  1113. JMP INIT_2STGC(PC) 2
  1114. JMP INIT_1BNSC(PC) 3
  1115. JMP INIT_3STGC(PC) 4
  1116. JMP INIT_4STGC(PC) 5
  1117. JMP INIT_2BNSC(PC) 6
  1118. JMP INIT_5STGC(PC) 7
  1119. JMP INIT_6STGC(PC) 8
  1120. JMP INIT_3BNSC(PC) 9
  1121. JMP INIT_7STGC(PC) 10
  1122. JMP INIT_8STGC(PC) 11
  1123. JMP INIT_ESTGC(PC) END
  1124. AREA_SET:
  1125. BTST.B #4,PHASE+1(A5)
  1126. BEQ AREA_SET_1
  1127. MOVE.W HERO1+HERO_TYPE(A5),D0
  1128. MULU #10,D0
  1129. ADD.W HERO2+HERO_TYPE(A5),D0
  1130. MOVEQ.L #0,D1
  1131. MOVE.B VS_STAGE_DATA(PC,D0.W),D1
  1132. MOVE.W D1,AREA_No(A5)
  1133. AREA_SET_1:
  1134. RTS
  1135. VS_STAGE_DATA:
  1136. ; 1 2 1 2 3 4 5 6 7 8
  1137. DC.B 02,07,01,02,04,05,07,08,10,11 1
  1138. DC.B 08,05,01,02,04,05,07,08,10,11 2
  1139. DC.B 01,01,01,02,04,05,07,08,10,11 1
  1140. DC.B 02,02,02,02,04,05,07,08,10,11 2
  1141. DC.B 04,04,04,04,04,05,07,08,10,11 3
  1142. DC.B 05,05,05,05,05,05,07,08,10,11 4
  1143. DC.B 07,07,07,07,07,07,07,08,10,11 5
  1144. DC.B 08,08,08,08,08,08,08,08,10,11 6
  1145. DC.B 10,10,10,10,10,10,10,10,10,11 7
  1146. DC.B 11,11,11,11,11,11,11,11,11,11 8
  1147. INIT_1STGC:
  1148. COLOR_COMMAND
  1149. PALETTE 000H,00H,PG_SET+FADE_IN+CC_SPEED3
  1150. PALETTE 020H,02H,PG_SET+FADE_IN+CC_SPEED3
  1151. PALETTE 030H,03H,PG_SET+FADE_IN+CC_SPEED3
  1152. PALETTE 040H,31H,PG_SET+FADE_IN+CC_SPEED3
  1153. PALETTE 080H,20H,PG_SET+FADE_IN+CC_SPEED3
  1154. PALETTE 090H,21H,PG_SET+FADE_IN+CC_SPEED3
  1155. PALETTE 0A0H,22H,PG_SET+FADE_IN+CC_SPEED3
  1156. PALETTE 0B0H,23H,PG_SET+FADE_IN+CC_SPEED3
  1157. PALETTE 0C0H,24H,PG_SET+FADE_IN+CC_SPEED3
  1158. PALETTE 0D0H,25H,PG_SET+FADE_IN+CC_SPEED3
  1159. PALETTE 0E0H,26H,PG_SET+FADE_IN+CC_SPEED3
  1160. PALETTE 0F0H,27H,PG_SET+FADE_IN+CC_SPEED3
  1161. PALETTE_END
  1162. MOVE.W #10*100H,D0
  1163. JSR AUTO_ACT_SET(PC)
  1164. MOVE.W #S_1STBGM,D0
  1165. BSR SET_BGM_CALL
  1166. RTS
  1167. INIT_2STGC:
  1168. COLOR_COMMAND
  1169. PALETTE 000H,00H,PG_SET+FADE_IN+CC_SPEED3
  1170. PALETTE 020H,04H,PG_SET+FADE_IN+CC_SPEED3
  1171. PALETTE 030H,05H,PG_SET+FADE_IN+CC_SPEED3
  1172. PALETTE 040H,06H,PG_SET+FADE_IN+CC_SPEED3
  1173. PALETTE 080H,20H,PG_SET+FADE_IN+CC_SPEED3
  1174. PALETTE 090H,21H,PG_SET+FADE_IN+CC_SPEED3
  1175. PALETTE 0A0H,22H,PG_SET+FADE_IN+CC_SPEED3
  1176. PALETTE 0B0H,23H,PG_SET+FADE_IN+CC_SPEED3
  1177. PALETTE 0C0H,24H,PG_SET+FADE_IN+CC_SPEED3
  1178. PALETTE 0D0H,25H,PG_SET+FADE_IN+CC_SPEED3
  1179. PALETTE 0E0H,26H,PG_SET+FADE_IN+CC_SPEED3
  1180. PALETTE 0F0H,27H,PG_SET+FADE_IN+CC_SPEED3
  1181. PALETTE_END
  1182. MOVE.W #10*100H,D0
  1183. JSR AUTO_ACT_SET(PC)
  1184. MOVE.W #S_2STBGM,D0
  1185. BSR SET_BGM_CALL
  1186. RTS
  1187. INIT_3STGC:
  1188. COLOR_COMMAND
  1189. PALETTE 000H,00H,PG_SET+FADE_IN+CC_SPEED3
  1190. PALETTE 020H,07H,PG_SET+FADE_IN+CC_SPEED3
  1191. PALETTE 030H,08H,PG_SET+FADE_IN+CC_SPEED3
  1192. PALETTE 040H,09H,PG_SET+FADE_IN+CC_SPEED3
  1193. PALETTE 050H,32H,PG_SET+FADE_IN+CC_SPEED3
  1194. PALETTE 080H,20H,PG_SET+FADE_IN+CC_SPEED3
  1195. PALETTE 090H,21H,PG_SET+FADE_IN+CC_SPEED3
  1196. PALETTE 0A0H,22H,PG_SET+FADE_IN+CC_SPEED3
  1197. PALETTE 0B0H,23H,PG_SET+FADE_IN+CC_SPEED3
  1198. PALETTE 0C0H,24H,PG_SET+FADE_IN+CC_SPEED3
  1199. PALETTE 0D0H,25H,PG_SET+FADE_IN+CC_SPEED3
  1200. PALETTE 0E0H,26H,PG_SET+FADE_IN+CC_SPEED3
  1201. PALETTE 0F0H,27H,PG_SET+FADE_IN+CC_SPEED3
  1202. PALETTE_END
  1203. MOVE.W #10*100H,D0
  1204. JSR AUTO_ACT_SET(PC)
  1205. MOVE.W #S_3STBGM,D0
  1206. BSR SET_BGM_CALL
  1207. RTS
  1208. INIT_4STGC:
  1209. COLOR_COMMAND
  1210. PALETTE 000H,00H,PG_SET+FADE_IN+CC_SPEED3
  1211. PALETTE 020H,0AH,PG_SET+FADE_IN+CC_SPEED3
  1212. PALETTE 030H,0BH,PG_SET+FADE_IN+CC_SPEED3
  1213. PALETTE 040H,0CH,PG_SET+FADE_IN+CC_SPEED3
  1214. PALETTE 080H,20H,PG_SET+FADE_IN+CC_SPEED3
  1215. PALETTE 090H,21H,PG_SET+FADE_IN+CC_SPEED3
  1216. PALETTE 0A0H,22H,PG_SET+FADE_IN+CC_SPEED3
  1217. PALETTE 0B0H,23H,PG_SET+FADE_IN+CC_SPEED3
  1218. PALETTE 0C0H,24H,PG_SET+FADE_IN+CC_SPEED3
  1219. PALETTE 0D0H,25H,PG_SET+FADE_IN+CC_SPEED3
  1220. PALETTE 0E0H,26H,PG_SET+FADE_IN+CC_SPEED3
  1221. PALETTE 0F0H,27H,PG_SET+FADE_IN+CC_SPEED3
  1222. PALETTE_END
  1223. MOVE.W #10*100H,D0
  1224. JSR AUTO_ACT_SET(PC)
  1225. MOVE.W #S_4STBGM,D0
  1226. BSR SET_BGM_CALL
  1227. RTS
  1228. INIT_5STGC:
  1229. COLOR_COMMAND
  1230. PALETTE 000H,00H,PG_SET+FADE_IN+CC_SPEED3
  1231. PALETTE 020H,0DH,PG_SET+FADE_IN+CC_SPEED3
  1232. PALETTE 030H,0EH,PG_SET+FADE_IN+CC_SPEED3
  1233. PALETTE 040H,0FH,PG_SET+FADE_IN+CC_SPEED3
  1234. PALETTE 050H,10H,PG_SET+FADE_IN+CC_SPEED3
  1235. PALETTE 080H,20H,PG_SET+FADE_IN+CC_SPEED3
  1236. PALETTE 090H,21H,PG_SET+FADE_IN+CC_SPEED3
  1237. PALETTE 0A0H,22H,PG_SET+FADE_IN+CC_SPEED3
  1238. PALETTE 0B0H,23H,PG_SET+FADE_IN+CC_SPEED3
  1239. PALETTE 0C0H,24H,PG_SET+FADE_IN+CC_SPEED3
  1240. PALETTE 0D0H,25H,PG_SET+FADE_IN+CC_SPEED3
  1241. PALETTE 0E0H,26H,PG_SET+FADE_IN+CC_SPEED3
  1242. PALETTE 0F0H,27H,PG_SET+FADE_IN+CC_SPEED3
  1243. PALETTE_END
  1244. MOVE.W #7*100H,D0
  1245. JSR AUTO_ACT_SET(PC)
  1246. MOVE.W #S_5STBGM,D0
  1247. BSR SET_BGM_CALL
  1248. RTS
  1249. INIT_6STGC:
  1250. COLOR_COMMAND
  1251. PALETTE 000H,00H,PG_SET+FADE_IN+CC_SPEED3
  1252. PALETTE 020H,11H,PG_SET+FADE_IN+CC_SPEED3
  1253. PALETTE 030H,12H,PG_SET+FADE_IN+CC_SPEED3
  1254. PALETTE 040H,13H,PG_SET+FADE_IN+CC_SPEED3
  1255. PALETTE 080H,20H,PG_SET+FADE_IN+CC_SPEED3
  1256. PALETTE 090H,21H,PG_SET+FADE_IN+CC_SPEED3
  1257. PALETTE 0A0H,22H,PG_SET+FADE_IN+CC_SPEED3
  1258. PALETTE 0B0H,23H,PG_SET+FADE_IN+CC_SPEED3
  1259. PALETTE 0C0H,24H,PG_SET+FADE_IN+CC_SPEED3
  1260. PALETTE 0D0H,25H,PG_SET+FADE_IN+CC_SPEED3
  1261. PALETTE 0E0H,26H,PG_SET+FADE_IN+CC_SPEED3
  1262. PALETTE 0F0H,27H,PG_SET+FADE_IN+CC_SPEED3
  1263. PALETTE_END
  1264. MOVE.W #4*100H,D0
  1265. JSR AUTO_ACT_SET(PC)
  1266. MOVE.W #S_6STBGM,D0
  1267. BSR SET_BGM_CALL
  1268. RTS
  1269. INIT_7STGC:
  1270. COLOR_COMMAND
  1271. PALETTE 000H,00H,PG_SET+FADE_IN+CC_SPEED3
  1272. PALETTE 020H,14H,PG_SET+FADE_IN+CC_SPEED3
  1273. PALETTE 030H,15H,PG_SET+FADE_IN+CC_SPEED3
  1274. PALETTE 040H,16H,PG_SET+FADE_IN+CC_SPEED3
  1275. PALETTE 050H,33H,PG_SET+FADE_IN+CC_SPEED3
  1276. PALETTE 080H,20H,PG_SET+FADE_IN+CC_SPEED3
  1277. PALETTE 090H,21H,PG_SET+FADE_IN+CC_SPEED3
  1278. PALETTE 0A0H,22H,PG_SET+FADE_IN+CC_SPEED3
  1279. PALETTE 0B0H,23H,PG_SET+FADE_IN+CC_SPEED3
  1280. PALETTE 0C0H,24H,PG_SET+FADE_IN+CC_SPEED3
  1281. PALETTE 0D0H,25H,PG_SET+FADE_IN+CC_SPEED3
  1282. PALETTE 0E0H,26H,PG_SET+FADE_IN+CC_SPEED3
  1283. PALETTE 0F0H,27H,PG_SET+FADE_IN+CC_SPEED3
  1284. PALETTE_END
  1285. MOVE.W #10*100H,D0
  1286. JSR AUTO_ACT_SET(PC)
  1287. MOVE.W #S_7STBGM,D0
  1288. BSR SET_BGM_CALL
  1289. RTS
  1290. INIT_8STGC:
  1291. COLOR_COMMAND
  1292. PALETTE 000H,00H,PG_SET+FADE_IN+CC_SPEED3
  1293. PALETTE 020H,17H,PG_SET+FADE_IN+CC_SPEED3
  1294. PALETTE 030H,18H,PG_SET+FADE_IN+CC_SPEED3
  1295. PALETTE 080H,20H,PG_SET+FADE_IN+CC_SPEED3
  1296. PALETTE 090H,21H,PG_SET+FADE_IN+CC_SPEED3
  1297. PALETTE 0A0H,22H,PG_SET+FADE_IN+CC_SPEED3
  1298. PALETTE 0B0H,23H,PG_SET+FADE_IN+CC_SPEED3
  1299. PALETTE 0C0H,24H,PG_SET+FADE_IN+CC_SPEED3
  1300. PALETTE 0D0H,25H,PG_SET+FADE_IN+CC_SPEED3
  1301. PALETTE 0E0H,26H,PG_SET+FADE_IN+CC_SPEED3
  1302. PALETTE 0F0H,27H,PG_SET+FADE_IN+CC_SPEED3
  1303. PALETTE_END
  1304. MOVE.W #10*100H,D0
  1305. JSR AUTO_ACT_SET(PC)
  1306. MOVE.W #S_8STBGM,D0
  1307. BSR SET_BGM_CALL
  1308. RTS
  1309. INIT_ESTGC:
  1310. CLR.B ST_DEMO_ON(A5)
  1311. RTS
  1312. SET_BGM_CALL:
  1313. BTST.B #4,PHASE+1(A5)
  1314. BNE.S SBC_0
  1315. TST.B ST_DEMO_ON(A5)
  1316. BEQ.S SBC_1
  1317. SBC_0:
  1318. JSR.S SET_BGM
  1319. SBC_1:
  1320. RTS
  1321. INIT_1BNSC:
  1322. MOVE.W #0,BONUS_RANK(A5)
  1323. BRA.S INIT_BSG
  1324. INIT_2BNSC:
  1325. MOVE.W #1,BONUS_RANK(A5)
  1326. BRA.S INIT_BSG
  1327. INIT_3BNSC:
  1328. MOVE.W #2,BONUS_RANK(A5)
  1329. INIT_BSG:
  1330. BSR STAGE_LEVEL_SET
  1331. LEA.L PLAYER1(A5),A0
  1332. LEA.L PLAYER2(A5),A1
  1333. TST.W STORY_PLAYER(A5)
  1334. BEQ.S INIT_BSG_1
  1335. EXG.L A0,A1
  1336. INIT_BSG_1:
  1337. BSET.B #BPS_COM_FLAG,PLAYER_STATE(A0)
  1338. BCLR.B #BPS_COM_FLAG,PLAYER_STATE(A1)
  1339. MOVEQ.L #00110000B,D0
  1340. AND.B PHASE+1(A5),D0
  1341. OR.B #89H,D0
  1342. MOVE.B D0,PHASE+1(A5)
  1343. RTS
  1344. AUTO_ACT_SET:
  1345. MOVE.B LSPC_MODE_STORE+1(A5),D0
  1346. BCLR.L #3,D0
  1347. MOVE.W D0,LSPC_MODE_STORE(A5)
  1348. MOVE.W D0,LSPC_MODE
  1349. RTS
  1350. LM_PAL_ACT:
  1351. TST.B COLOR_STATE(A5)
  1352. BEQ.S LM_PAL_ACT_1
  1353. RTS
  1354. LM_PAL_ACT_1:
  1355. EASY_START
  1356. PAL_ACT2S_1:
  1357. ADDQ.W #1,WORD_TIMER(A6)
  1358. CMP.W #4,WORD_TIMER(A6)
  1359. BNE PA2S_1_1
  1360. LEA.L COLOR_BUFFER_0+20H*32H(A5),A0
  1361. LEA.L COLOR_BUFFER_0+20H*33H(A5),A1
  1362. BSR PAL_CHANGE
  1363. LEA.L COLOR_BUFFER_0+20H*34H(A5),A0
  1364. LEA.L COLOR_BUFFER_0+20H*35H(A5),A1
  1365. BSR PAL_CHANGE
  1366. LEA.L COLOR_BUFFER_0+20H*36H(A5),A0
  1367. LEA.L COLOR_BUFFER_0+20H*37H(A5),A1
  1368. BSR PAL_CHANGE
  1369. LEA.L COLOR_BUFFER_0+20H*38H(A5),A0
  1370. LEA.L COLOR_BUFFER_0+20H*39H(A5),A1
  1371. BSR PAL_CHANGE
  1372. MOVE.W #1,COLOR_BUFFER_0+20H*30H(A5)
  1373. CLR.W WORD_TIMER(A6)
  1374. PA2S_1_1:
  1375. TST.B STEP2(A6)
  1376. BNE PA2S_1_10
  1377. ADDQ.B #1,BYTE_TIMER(A6)
  1378. CMP.B #4,BYTE_TIMER(A6)
  1379. BNE PA2S_1_20
  1380. LEA.L COLOR_BUFFER_0+20H*3EH(A5),A0
  1381. LEA.L COLOR_BUFFER_0+20H*3FH(A5),A1
  1382. BSR PAL_CHANGE
  1383. MOVE.W #1,COLOR_BUFFER_0+20H*30H(A5)
  1384. CLR.B BYTE_TIMER(A6)
  1385. ADDQ.B #1,SPEED(A6)
  1386. CMP.B #10,SPEED(A6)
  1387. BNE PA2S_1_20
  1388. MOVE.B #1,STEP2(A6)
  1389. CLR.B SPEED(A6)
  1390. JSR.S RAND8
  1391. AND.B #7FH,D0
  1392. ADD.B #30,D0
  1393. MOVE.B D0,BYTE_TIMER(A6)
  1394. RTS
  1395. PA2S_1_10:
  1396. SUBQ.B #1,BYTE_TIMER(A6)
  1397. BNE PA2S_1_20
  1398. LEA.L COLOR_BUFFER_0+20H*3EH(A5),A0
  1399. LEA.L COLOR_BUFFER_0+20H*3FH(A5),A1
  1400. BSR PAL_CHANGE
  1401. MOVE.W #1,COLOR_BUFFER_0+20H*30H(A5)
  1402. MOVE.B #0,STEP2(A6)
  1403. PA2S_1_20:
  1404. RTS
  1405. PAL_ACT3S_1:
  1406. SUBQ.W #1,WORD_TIMER(A6)
  1407. BEQ.S PA3S_2
  1408. RTS
  1409. PA3S_2:
  1410. LEA.L COLOR_BUFFER_0+20H*54H(A5),A0
  1411. LEA.L COLOR_BUFFER_0+20H*55H(A5),A1
  1412. BSR PAL_CHANGE
  1413. LEA.L COLOR_BUFFER_0+20H*56H(A5),A0
  1414. LEA.L COLOR_BUFFER_0+20H*57H(A5),A1
  1415. BSR PAL_CHANGE
  1416. LEA.L COLOR_BUFFER_0+20H*58H(A5),A0
  1417. LEA.L COLOR_BUFFER_0+20H*59H(A5),A1
  1418. BSR PAL_CHANGE
  1419. LEA.L COLOR_BUFFER_0+20H*5AH(A5),A0
  1420. LEA.L COLOR_BUFFER_0+20H*5BH(A5),A1
  1421. BSR PAL_CHANGE
  1422. LEA.L COLOR_BUFFER_0+20H*5CH(A5),A0
  1423. LEA.L COLOR_BUFFER_0+20H*5DH(A5),A1
  1424. BSR PAL_CHANGE
  1425. LEA.L COLOR_BUFFER_0+20H*5EH(A5),A0
  1426. LEA.L COLOR_BUFFER_0+20H*5FH(A5),A1
  1427. BSR PAL_CHANGE
  1428. MOVE.W #1,COLOR_BUFFER_0+20H*50H(A5)
  1429. MOVEQ.L #0,D0
  1430. MOVE.B STEP2(A6),D0
  1431. ADDQ.B #1,D0
  1432. AND.W #00001111B,D0
  1433. MOVE.B D0,STEP2(A6)
  1434. ADD.W D0,D0
  1435. MOVE.W PA3_TIME(PC,D0.W),WORD_TIMER(A6)
  1436. RTS
  1437. PA3_TIME:
  1438. DC.W 30,10,10,10,30,10,10,10
  1439. DC.W 30,10,30,10,10,10,10,10
  1440. PAL_ACT7S_1:
  1441. ADDQ.W #1,WORD_TIMER(A6)
  1442. CMP.W #10,WORD_TIMER(A6)
  1443. BEQ.S PA7S_2
  1444. RTS
  1445. PA7S_2:
  1446. MOVEQ.L #0,D1
  1447. MOVE.B STEP2(A6),D1
  1448. ADD.W D1,D1
  1449. LEA.L COLOR_BUFFER_0+20H*50H(A5),A0
  1450. LEA.L (A0),A1
  1451. ADD.W PA7_TBL(PC,D1.W),A1
  1452. BSR PAL_CHANGE
  1453. LEA.L COLOR_BUFFER_0+20H*54H(A5),A0
  1454. LEA.L (A0),A1
  1455. ADD.W PA7_TBL(PC,D1.W),A1
  1456. BSR PAL_CHANGE
  1457. LEA.L COLOR_BUFFER_0+20H*58H(A5),A0
  1458. LEA.L (A0),A1
  1459. ADD.W PA7_TBL(PC,D1.W),A1
  1460. BSR PAL_CHANGE
  1461. LEA.L COLOR_BUFFER_0+20H*5CH(A5),A0
  1462. LEA.L (A0),A1
  1463. ADD.W PA7_TBL(PC,D1.W),A1
  1464. BSR PAL_CHANGE
  1465. MOVE.W #1,COLOR_BUFFER_0+20H*50H(A5)
  1466. CLR.W WORD_TIMER(A6)
  1467. ADDQ.B #1,STEP2(A6)
  1468. CMP.B #6,STEP2(A6)
  1469. BNE.S PA7S_3
  1470. CLR.B STEP2(A6)
  1471. PA7S_3:
  1472. RTS
  1473. PA7_TBL:
  1474. DC.W 20H*1
  1475. DC.W 20H*2
  1476. DC.W 20H*3
  1477. DC.W 20H*3
  1478. DC.W 20H*2
  1479. DC.W 20H*1
  1480. PAL_CHANGE:
  1481. MOVEQ.L #8-1,D7
  1482. PAL_CHANGE_1:
  1483. MOVE.L (A0),D0
  1484. MOVE.L (A1),(A0)+
  1485. MOVE.L D0,(A1)+
  1486. DBRA D7,PAL_CHANGE_1
  1487. RTS
  1488. INCLUDE WORK.INC
  1489.