GDAC2.S 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251
  1. ; GDAC2.S
  2. ;THIS SUBROUTINE DETECTS A COLLISION BETWEEN A HERO MISSLE AND AN ENEMY SHIP
  3. ;
  4. ;
  5. COLDET1 LDX #56 ;INIT PTR TO BEGINNING OF HERO MISSLES
  6. NEWMIS LDA TYPE,X ;SEE IF MISSLE EXISTS
  7. BEQ NXMIS
  8. LDY #0
  9. NXEN LDA TYPE,Y ;SEE IF ENEMY EXISTS
  10. BEQ NXENMY
  11. LDA YCORD,X ;TEST FOR COLLISION
  12. CLC ;IF: (YSHIP < YMIS+7) AND
  13. ADC #4 ; (YSHIP+10 > YMIS) AND
  14. CMP YCORD,Y ; (XSHIP < XMIS+4 < XSHIP+7)
  15. BCC NXENMY
  16. LDA YCORD,Y
  17. CLC
  18. ADC #6
  19. CMP YCORD,X
  20. BCC NXENMY
  21. LDA TYPE+62 ;SEE IF SECOND SHIP ACTIVE
  22. BEQ MONODTCT
  23. LDA XCORD,Y
  24. CLC
  25. ADC #3
  26. CMP XCORD,X
  27. BCC NXENMY
  28. LDA XCORD,X
  29. CLC
  30. ADC #3 ;SEE IF SHIP IS BETWEEN MISSILES
  31. CMP XCORD,Y
  32. BEQ NXENMY
  33. ADC #6
  34. CMP XCORD,Y
  35. BCC NXENMY
  36. JSR COLLIS1
  37. RTS
  38. ; JMP NXMIS
  39. MONODTCT LDA XCORD,X
  40. CLC
  41. ADC #3
  42. CMP XCORD,Y
  43. BCC NXENMY
  44. LDA XCORD,Y
  45. CLC
  46. ADC #2
  47. CMP XCORD,X
  48. BCC NXENMY
  49. JSR COLLIS1 ;FOUND A COLLISION
  50. RTS
  51. ; JMP NXMIS
  52. NXENMY INY ;INC ELISTPTR TO NEXT ENEMY
  53. CPY #40 ;SEE IF CAPTD HERO
  54. BNE CHKPHERO
  55. LDA MODE+40
  56. CMP #6
  57. BCC CHKPHERO
  58. CMP #10 ;MODES 6 - 9 ARE SAFE FROM EXPLOSION
  59. BCS CHKPHERO
  60. SKIPHERO INY ;IF SO, DON'T CHECK FOR COLLISION
  61. CHKPHERO CPY #45 ;AND SEE IF AT END OF ENMYLIST
  62. BNE NXEN
  63. NXMIS CPX #57 ;INC MISPTR TO NEXT MISSLE AND SEE
  64. BNE NDONCOL ;IF AT END OF HMISLST
  65. RTS ;YES, SO RETURN FROM SUBROUTINE
  66. NDONCOL LDX #57 ;NO, SO CHECK NEW MISSLE AGAINST ALL
  67. JMP NEWMIS ;OF ENMYLIST
  68. ;
  69. ;
  70. ;THIS SUBROUTINE IS CALLED BY COLDET1 WHEN A COLLISION IS FOUND BETWEEN A HERO
  71. ;MISSLE (POINTED TO BY X REG) AND AN ENEMY SHIP (POINTED TO BY Y REG).
  72. ;
  73. COLLIS1 LDA TYPE,Y ;SEE IF IS BOSS SHIP AND FIRST SHOT
  74. AND #$7F ;TO HIT IT
  75. CMP #3
  76. BEQ COLLIXY
  77. CMP #4 ;SEE IF BLUE BOSS
  78. BNE COLLIXZ
  79. LDA MODE,Y ;SEE IF IN BOSS WAIT MODE
  80. AND #$8F ;LOOK AT MSB AND LOW 4 BITS
  81. CMP #3
  82. BNE COLLIXZ
  83. LDA #0
  84. STA WAITCNT ;CLEAR WAITCNT
  85. JSR SCRAPALL ;KILL TRACTOR BEAM
  86. JMP COLLIXX ;NOW HANDLE EXPLOSION
  87. COLLIXY LDA TYPE,Y ;CHANGE TO BLUE BOSS
  88. CLC
  89. ADC #1
  90. STA TYPE,Y
  91. LDA #14 ;BOSS HIT SOUND
  92. JSR TUNIN
  93. LDA #0 ;ZERO OUT MISSLE
  94. STA TYPE,X
  95. RTS
  96. COLLIXZ
  97. CMP #16 ;GREEN BOSS W/ CAPTURED HERO
  98. BNE DAK1
  99. LDA TYPE,Y
  100. CLC
  101. ADC #1
  102. STA TYPE,Y ;CHANGE TYPE TO BLUE BOSS W/ HERO
  103. LDA #14
  104. JSR TUNIN
  105. LDA #0
  106. STA TYPE,X ;ZERO OUT MISSILE
  107. RTS
  108. DAK1 CMP #17 ;BLUE BOSS W/ CAPTURED HERO
  109. BNE COLLIXX
  110. LDA WAITCNT ;SEE IF FIRST PICKED UP
  111. BEQ NOTRACTR
  112. LDA #0
  113. STA WAITCNT ;BOOT TRACTOR BEAM IF FIRST PICKED UP
  114. JSR SCRAPALL ;BOOT TRACTOR BEAM TUNE
  115. LDA #11 ;PUT IN 'PUT HERO BACK DOWN' MODE
  116. STA MODE+40
  117. BNE BIRDBUG1
  118. NOTRACTR
  119. LDA MODE,Y ;GET MODE OF BOSS
  120. BEQ HREAPR
  121. CMP #1
  122. BNE NOTHRP
  123. HREAPR LDA #5
  124. STA HEROREAP ;SET HERO REAPPEAR MODE
  125. ;MAY NEED TO STORE A 5 TO THE MODE HERE
  126. STX BOZO0
  127. LDX #40
  128. JSR COTBOATK
  129. LDX BOZO0 ;NEED TO SAVE THE X VALUE
  130. JMP BIRDBUG1 ;CONTINUE TO KILL BOSS
  131. NOTHRP LDA #8 ;HERO SPIN MODE
  132. STA MODE+40
  133. LDA #5
  134. JSR TUNIN ;TUNE 5 IS RELEASED HERO TUNE
  135. LDA #6
  136. JSR TUNIN ;TUNE 6 IS OTHER CHANNEL OF TUNE
  137. BIRDBUG1 LDA #4
  138. STA TYPE,Y ;HANDLE LIKE REGULAR BLUE BOSS
  139. COLLIXX CPY #40 ;SEE IF CAPTURED HERO SHIP
  140. BEQ NOATC
  141. ; DEC NUMFLY
  142. LDA MODE,Y ;SEE IF IN SHIFT OR EXPAND MODE
  143. BEQ NOATC
  144. CMP #1 ;DEC AIRBORNE IF WAS FLYING
  145. BEQ NOATC
  146. ;NOW, DEC IF SHOT WHILE IN ORIENT MODE
  147. DEC AIRBORNE
  148. NOATC CPY #40 ;SEE WHAT TYPE ENEMY SHIP WAS KILLED
  149. BNE NOTHER ;SEE IF HERO SHIP
  150. LDA #27 ;HERO DEATH SOUND
  151. JSR TUNIN
  152. LDA #28 ;HERO DEATH SOUND
  153. JSR TUNIN
  154. LDA #$00 ;HERO DEATH SCORE
  155. STA HEROREAP
  156. STA MODE+40 ;RESET MODE OF DEAD HERO
  157. JSR CLEARBOS ;CLEAR BOSS WHICH CARRIED HERO
  158. LDA #$01
  159. STA TEMP4
  160. LDA #11 ;ONE THOUSAND TYPE
  161. STA SCRTEMP
  162. JMP NOATCX
  163. NOTHER LDA CHALSTG ;SEE IF CHALLENGING STAGE
  164. BEQ NOTHER0
  165. SED
  166. LDA CHALSCR
  167. CLC
  168. ADC #1 ;INCREMENT SCORE FOR CHLNGING STAGE
  169. STA CHALSCR
  170. CLD
  171. INC WAVESCR ;INCREMENT SCORE FOR THIS WAVE
  172. NOTHER0 LDA TYPE,Y
  173. AND #$7F
  174. CMP #1 ;SEE IF BLUE SHIP
  175. BEQ META10
  176. CMP #13
  177. BNE NOTBLU
  178. LDA CHALSTG
  179. BNE META10 DONT GIVE 1000 BONUS IF CHAL STAGE
  180. INC SCORPCNT
  181. LDA SCORPCNT
  182. CMP #3 ;SEE IF HAVE 2 ALREADY
  183. BNE META10
  184. LDA #11
  185. STA SCRTEMP ;GIVE THOUSAND BONUS
  186. LDA #$01
  187. STA TEMP4
  188. BNE NOATCX
  189. META10 LDA #12 ;BLUE DEATH SOUND
  190. JSR TUNIN
  191. LDA MODE,Y ;GET MODE OF DEAD SHIP
  192. BEQ LOWBLUE ;SEE IF IN SHIFTING MODE
  193. CMP #1 ;SEE IF IN EXPANSION MODE
  194. BEQ LOWBLUE ;IF SO, SCORE = 50
  195. LDA #$10 ;BLUE DEATH SCORE
  196. STA TEMP5
  197. BNE NOATCX
  198. LOWBLUE LDA #$05
  199. STA TEMP5 ;GIVE SCORE OF 50
  200. BNE NOATCX
  201. NOTBLU CMP #2 ;SEE IF RED SHIP
  202. BEQ ISREDX
  203. CMP #50
  204. BNE NOTREDX
  205. ISREDX LDA #11 ;RED DEATH SOUND
  206. JSR TUNIN
  207. LDA MODE,Y ;GET MODE OF DEAD SHIP
  208. BEQ LOWRED
  209. CMP #1
  210. BEQ LOWRED ;SEE IF IN SHIFT OR EXPAND MODE
  211. LDA #$16 ;RED DEATH SCORE
  212. STA TEMP5
  213. BNE NOATCX
  214. LOWRED LDA #$08
  215. STA TEMP5 ;GIVE SCORE OF 80
  216. BNE NOATCX
  217. NOTREDX
  218. LDA #10 ;BOSS DEATH SOUND (MUST BE BOSS)
  219. JSR TUNIN
  220. JSR ABOSSHIT
  221. ; ENTRY POINT FROM OTHER CODE SEGMENTS (I'M SORRY TO SAY)
  222. NOATCX
  223. LDA WAVESCR ;CHECK SCORE OF WAVE
  224. CMP #8 ;SEE IF PERFECT
  225. BNE NOTHOBON ;NO THOUSAND BONUS
  226. LDA #0
  227. STA WAVESCR
  228. LDA #$80
  229. STA BORNCNT PUT DELAY BEFORE NEXT WAVE
  230. LDA #$01
  231. STA TEMP4
  232. LDA CHALNUM ;SEE WHAT STAGE THIS IS
  233. CMP #4
  234. BMI THOBON
  235. LDA #$60
  236. STA TEMP5
  237. LDA #12
  238. BNE SIXTNBON
  239. THOBON LDA #11
  240. SIXTNBON STA SCRTEMP ;STORE 1000 SCORE BONUS
  241. NOTHOBON LDA #0 ;ZERO OUT MISSLE
  242. STA TYPE,X
  243. STA TYPE,Y ;ZERO OUT ENEMY SHIP
  244. JSR ENMYBOOM
  245. RTS
  246. ;
  247. ;THIS SUBROUTINE DETECTS A COLLISION BETWEEN THE HERO SHIP AND ANY ENEMY
  248. ;SHIP
  249. ;
  250. COLDET2 LDA TYPE+63 ;SEE IF HERO SHIP EXISTS
  251. BNE CONTC2
  252. NONIE RTS
  253. CONTC2 LDA FARREN
  254. BMI NONIE
  255. LDA CHALSTG DONT DETECT IF CHALLENGING STAGE
  256. BNE NONIE
  257. LDY #0 ;INIT PTR TO BEGINNING OF ENEMY SHIPS
  258. NXSHP LDA TYPE,Y ;SEE IF ENEMY SHIP EXISTS
  259. BEQ NXESHIP
  260. LDA YCORD,Y ;TEST FOR COLLISION
  261. CMP #162 ;IF: 161 < YSHIP < 181 AND
  262. BCC NXESHIP ; (HEROX + 7) > XSHIP AND
  263. CMP #181 ; (XSHIP + 7) > HEROX
  264. BCS NXESHIP
  265. LDA XCORD+63 ;(HEROX)
  266. CLC
  267. ADC #6
  268. CMP XCORD,Y
  269. BCC HERO2TST
  270. LDA XCORD,Y
  271. CLC
  272. ADC #6
  273. CMP XCORD+63 ;(HEROX)
  274. BCC NXESHIP
  275. JSR COLLIS2
  276. RTS NEW CODE
  277. HERO2TST LDA TYPE+62
  278. BEQ NXESHIP
  279. LDA XCORD+62
  280. CLC
  281. ADC #6
  282. CMP XCORD,Y ;MAKE SURE Y ISN'T TRASHED
  283. BCC NXESHIP
  284. LDA XCORD,Y
  285. CLC
  286. ADC #6
  287. CMP XCORD+62 ;(HEROX)
  288. BCC NXESHIP
  289. JSR COLLIS2A
  290. RTS
  291. NXESHIP INY ;INC ELISTPTR TO NEXT ENEMY
  292. CPY #45 ;AND SEE IF AT END OF ENMYLIST
  293. BMI NXSHP
  294. ;THIS CHECKS FOR COLLISION BETWEEN AN ENEMY MISSILE AND THE HERO SHIP
  295. LDY #46
  296. NXEMIS1 LDA TYPE,Y ;SEE IF ENEMY MISSLE EXISTS
  297. BEQ NXEMIS
  298. LDA YCORD,Y ;TEST FOR COLLISION
  299. CLC ;IF: (171 < YMIS+7) AND
  300. ADC #6 (181 > YMIS) AND
  301. CMP #171 ; (XHERO < XMIS+4 < XHERO+7)
  302. BCC NXEMIS
  303. LDA #180
  304. CMP YCORD,Y
  305. BCC NXEMIS
  306. LDA XCORD,Y
  307. CLC
  308. ADC #4
  309. CMP XCORD+63
  310. BCC NXEMIS ;MISSILE TOO FAR TO LEFT OF SHIP
  311. LDA XCORD+63
  312. CLC
  313. ADC #4
  314. CMP XCORD,Y
  315. BCC HERO2CHK ;MISSILE TOO FAR TO RIGHT OF SHIP
  316. JSR COLLIS3
  317. RTS
  318. HERO2CHK LDA TYPE+62 ;SEE IF 2ND HERO ACTIVE
  319. BEQ NXEMIS
  320. LDA XCORD+62 ;CHECK FOR HIT ON 2ND HERO
  321. SEC
  322. SBC #4
  323. CMP XCORD,Y
  324. BCS NXEMIS
  325. CLC
  326. ADC #7
  327. CMP XCORD,Y
  328. BCC NXEMIS
  329. JSR COLLIS3A
  330. RTS
  331. NXEMIS INY ;INC ELISTPTR TO NEXT ENEMY
  332. CPY #56 ;AND SEE IF AT END OF ENMYLIST
  333. BNE NXEMIS1
  334. RTS
  335. H2BOOM LDA #0 ;ZERO OUT SECOND SHIP
  336. STA TYPE+62
  337. STA MODE+63 ;RESET DUAL MODE
  338. LDA #52 ;STORE HERO EXPLOSION TYPE
  339. STA TYPE+65
  340. LDA XCORD+62
  341. SEC
  342. SBC #4
  343. STA XCORD+65 ;STORE XCORD FOR EXPLOSION
  344. LDA #7
  345. STA ANGLE+65
  346. LDA #168
  347. STA YCORD+65
  348. LDA #5
  349. STA ML+65
  350. LDA #0
  351. STA MODE+65
  352. RTS
  353. H1BOOM LDA #0 ;ZERO OUT HERO SHIP
  354. STA TYPE+63
  355. LDA #52 ;STORE HERO EXPLOSION TYPE
  356. STA TYPE+66
  357. LDA XCORD+63
  358. SEC
  359. SBC #4
  360. STA XCORD+66 ;STORE XCORD FOR EXPLOSION
  361. LDA #7
  362. STA ANGLE+66
  363. LDA #168
  364. STA YCORD+66
  365. LDA #5
  366. STA ML+66
  367. LDA #0
  368. STA MODE+66
  369. RTS
  370. ;
  371. ;THIS SUBROUTINE IS CALLED WHEN AN ENEMY SHIP RUNS INTO THE HERO SHIP
  372. ;
  373. COLLIS2A JSR H2BOOM
  374. JMP COLLIS2B
  375. COLLIS2 CPY #40
  376. BNE COLLIS2M
  377. LDA MODE+40 ;GET MODE OF SHIP
  378. CMP #9 ;SEE IF IN REUNITE MODE
  379. BNE COLLIS2M
  380. RTS ;DON'T DO ANYTHING
  381. COLLIS2M JSR H1BOOM
  382. LDA TYPE+62 ;SEE IF 2ND HERO ACTIVE
  383. BEQ COLLIS2B ;NO, GO ON
  384. LDA #5 ;RESET HERO SHIP
  385. STA TYPE+63
  386. LDA XCORD+62
  387. ; STA XCORD+63 ;SWITCH XCORDS
  388. STA HEROX
  389. LDA #0
  390. STA TYPE+62 ;KILL 2ND SHIP
  391. STA MODE+63 ;RESET DUAL MODE
  392. COLLIS2B LDA TYPE,Y ;SEE IF IS BOSS SHIP AND FIRST TIME
  393. AND #$7F ;HIT
  394. CMP #3
  395. BEQ COLL21
  396. CMP #16 ;SEE IF GREEN BOSS W/ HERO
  397. BNE COLLIS2G
  398. LDA #17
  399. STA TYPE,Y ;CHANGE TO BLUE BOSS W/ HERO
  400. JMP COLL22
  401. COLL21 LDA #4
  402. STA TYPE,Y ;CHANGE TO BLUE BOSS
  403. COLL22 LDA #9 ;HERO DEATH SOUND
  404. JSR TUNIN
  405. LDA #14 ;CHANGE TO BLUE BOSS SOUND
  406. JSR TUNIN
  407. LDX #58
  408. JMP TRYNXSP1
  409. COLLIS2G CMP #17 ;SEE IF IS BLUE BOSS W/ HERO
  410. BNE COLLIS2H
  411. LDA #8
  412. STA MODE+40 ;SET TO HERO SPIN MODE
  413. LDA #4 ;SET TO REG BLUE BOSS
  414. STA TYPE,Y
  415. LDA #5
  416. JSR TUNIN
  417. LDA #6
  418. JSR TUNIN ;HERO RELEASE SOUND
  419. COLLIS2H CPY #40 ;SEE IF IS CAPTURED HERO SHIP
  420. BNE NOTCAPH
  421. JSR CLEARBOS ;CLEAR BOSS THAT CARRIED HERO
  422. LDA #$01
  423. STA TEMP4
  424. LDA #11 ;ONE THOUSAND TYPE
  425. STA SCRTEMP
  426. LDA #0
  427. STA HEROREAP
  428. JMP ZAPHERO
  429. NOTCAPH
  430. ; DEC NUMFLY ;DEC NUMBER SHPS FLYING
  431. DEC AIRBORNE
  432. LDA TYPE,Y ;SEE WHAT TYPE OF ENEMY SHIP IT WAS
  433. AND #$7F
  434. CMP #1 ;SEE IF BLUE SHIP
  435. BEQ META11
  436. CMP #13
  437. BNE NOTBLUG
  438. META11 LDA #$10 ;BLUE DEATH SCORE
  439. STA TEMP5
  440. LDA FARREN
  441. CMP #4
  442. BNE DSBLFAR
  443. LDA SWCHA
  444. ASL A
  445. ASL A
  446. ASL A
  447. BCS DSBLFAR
  448. LDA #$FF
  449. STA FARREN
  450. JMP ZAPHERO
  451. DSBLFAR LDA #0
  452. STA FARREN
  453. JMP ZAPHERO
  454. NOTBLUG
  455. CMP #2 ;SEE IF RED SHIP
  456. BNE NOTREDXG
  457. LDA #$16 ;RED DEATH SCORE
  458. STA TEMP5
  459. JMP ZAPHERO
  460. NOTREDXG
  461. JSR ABOSSHIT ; HOW YOU PRONOUNCE IT IS YOUR OWN
  462. ; BUSINESS
  463. ; THIS IS AN ENTRY POINT FOR BIZARRE CODE SEGMENTS ABOVE
  464. ZAPHERO LDA #0 ; FORMERLY COLLIS2X
  465. STA TYPE,Y ;ZERO OUT ENEMY SHIP
  466. LDA #9 ;HERO DEATH SOUND
  467. JSR TUNIN
  468. TRYNXSP1
  469. JSR ENMYBOOM
  470. RTS ;
  471. ; COMBINED NOTREDXG AND NOTREDX
  472. ABOSSHIT
  473. LDA MODE,Y ;MUST BE BOSS
  474. BPL FOURHX ;SEE IF WAS ATTACKING WITH ESCORTS
  475. AND #$0F
  476. CMP #5
  477. BMI FOURHX
  478. CMP #9
  479. BPL FOURHX
  480. LDA COUNTXY,Y ;SEE HOW MANY ESCORTS IT HAD
  481. CMP #$0F
  482. BEQ FOURHX ;GO TO NO ESCORT
  483. CMP #$1F
  484. BNE SIXTENHX
  485. LDA #$80 ;ONE ESCORT
  486. STA TEMP5
  487. LDA #10 ;EIGHT HUNDRED TYPE
  488. STA SCRTEMP
  489. RTS
  490. SIXTENHX LDA #$60 ;TWO ESCORTS
  491. STA TEMP5
  492. LDA #$01
  493. STA TEMP4
  494. LDA #12 ;SIXTEEN HUNDRED TYPE
  495. STA SCRTEMP
  496. RTS
  497. FOURHX LDA YCORD,Y ;GET YCORD OF BOSS
  498. CMP #13 ;SEE IF AT RESTING YCORD
  499. BEQ FOURH1 ;SCORE IS 150 IF SO
  500. LDA #$40 ;NO ESCORTS
  501. STA TEMP5 ;SCORE
  502. LDA #9 ;FOUR HUNDRED TYPE
  503. STA SCRTEMP
  504. RTS
  505. FOURH1 LDA #$15
  506. STA TEMP5 ;GIVE SCORE OF 150
  507. RTS
  508. ; ENEMY BOOM !
  509. ENMYBOOM LDX #58
  510. BOOMLOOP LDA TYPE,X ; IT IS NOW TIME FOR THE GALAGA ON
  511. BEQ GOTSP1 ; YOUR TELEVISION TO EXPLODE
  512. INX
  513. CPX #62
  514. BNE BOOMLOOP
  515. LDX #58 ;ALL SPACES TAKEN, JUST USE FIRST SPACE
  516. BOMLOP LDA TYPE,X ;FIND A USABLE SPOT
  517. CMP #9
  518. BPL GOTSP1 USE A 'NUMBER' SPOT
  519. INX
  520. CPX #62
  521. BNE BOMLOP
  522. LDX #58
  523. GOTSP1 LDA #8 ;CHANGE ENEMY SHIP INTO EXPLOSION
  524. STA TYPE,X
  525. LDA XCORD,Y
  526. SEC
  527. SBC #3 ;CENTER THE EXPLOSION
  528. STA XCORD,X
  529. LDA YCORD,Y
  530. STA YCORD,X
  531. LDA #5
  532. STA ML,X
  533. LDA #7
  534. STA ANGLE,X
  535. LDA SCRTEMP
  536. STA MODE,X
  537. LDA #0
  538. STA SCRTEMP
  539. RTS
  540. ;
  541. ;THIS SUBROUTINE IS CALLED WHEN AN ENEMY MISSLE RUNS INTO THE HERO SHIP
  542. ;
  543. COLLIS3A JSR H2BOOM ;ZERO OUT 2ND HERO
  544. JMP COLLIS3B
  545. COLLIS3 JSR H1BOOM ;ZERO OUT HERO SHIP
  546. LDA TYPE+62 ;SEE IF 2ND SHIP ACTIVE
  547. BEQ COLLIS3B ;NO, GO ON
  548. LDA #0
  549. STA MODE+63 ;PUT BACK IN SINGLE MODE
  550. STA TYPE+62 ;KILL 2ND SHIP
  551. LDA #5
  552. STA TYPE+63 ;SWITCH TO HERO SHIP
  553. LDA XCORD+62
  554. ; STA XCORD+63 ;SET NEW XCORD
  555. STA HEROX
  556. COLLIS3B LDA #0
  557. STA TYPE,Y ;ZERO OUT MISSLE
  558. LDA #9 ;HERO DEATH SOUND
  559. JSR TUNIN
  560. LDA FARREN
  561. BEQ NON1
  562. LDA SWCHA
  563. ASL A
  564. ASL A
  565. ASL A
  566. ASL A
  567. BCS DISFAR
  568. INC FARREN
  569. BNE NON1
  570. DISFAR LDA #0
  571. STA FARREN
  572. NON1 RTS
  573. ;THIS SUBROUTINE CLEARS THE BOSS GALAGA WHICH WAS CARRYING A HERO SHIP
  574. ; IT IS CALLED WHEN THE CAPTURED HERO IS KILLED
  575. CLEARBOS STY KEEPY
  576. LDY CAPBOS1
  577. LDA TYPE,Y ;GET TYPE OF CAPTURING HERO
  578. AND #$7F ;BOOT HIGH BIT
  579. CMP #16 ;SEE IF HAS HERO
  580. BMI ENDCLRBS
  581. LDA TYPE,Y
  582. SEC
  583. SBC #13
  584. STA TYPE,Y
  585. ENDCLRBS LDY KEEPY
  586. RTS
  587. ;
  588. ;THIS SUBROUTINE HANDLES EXPLOSIONS. THE EXPLOSION IS POINTED TO BY THE
  589. ;Y REG
  590. ;THE Y REG IS SAVED
  591. ;
  592. EXPLO TYA ;TRANSFER Y REG TO X REG
  593. TAX
  594. LDA TYPE,X ;CHECK TYPE
  595. CMP #8 ;SEE IF EXPLOSION
  596. BEQ BUGEXPLO
  597. CMP #52
  598. BNE SHOWNUM
  599. BUGEXPLO DEC ML,X
  600. BPL ENDNUM
  601. CPY #60 ;SEE IF IS HERO EXPLOSION
  602. BMI BUGEX1
  603. LDA #7
  604. BNE BUGEX2
  605. BUGEX1 LDA #3
  606. BUGEX2 STA ML,X
  607. DEC ANGLE,X
  608. BNE ENDNUM
  609. LDA MODE,X
  610. STA TYPE,X
  611. LDA #100
  612. STA ML,X
  613. LDA #1
  614. STA ANGLE,X ;PREVENT FLAPPING
  615. BNE ENDNUM
  616. SHOWNUM CMP #9
  617. BMI ENDNUM ;NOT A SCORE
  618. CMP #13
  619. BPL ENDNUM ;NOT A SCORE
  620. DEC ML,X
  621. BNE ENDNUM
  622. LDA #0
  623. STA TYPE,X
  624. STA MODE,X
  625. ENDNUM RTS
  626. *******************************************************************************
  627. *
  628. * SOUND.S by Kevin G. Osborn
  629. * Contains subroutines
  630. * TUNER
  631. * SCRAPALL
  632. * SCRAPONE
  633. * TUNIN
  634. *******************************************************************************
  635. ********************************************************************************
  636. * SIMPSONG VERSION 0.03
  637. *
  638. * THIS SIMPLE SOUND DRIVER HAS, IN SOME WAYS, FEWER FEATURES BUT USES LESS RAM
  639. * AND ROM AND DOES NOT BACK UP SOUNDS FOR LATER (SOMETIMES MUCH LATER)
  640. * CONTINUATION. IT FEATURES 256 NOTE TUNES, SINGLE DURATION PER TUNE, ENDLESS
  641. * TUNES. IF A VALUE IN THE CONTROL OR VOLUME TABLES HAS THE HIGH BIT SET, THAT
  642. * VOLUME OR CONTROL WILL REMAIN IN EFFECT TILL THE END OF THE TUNE.
  643. * AN FF IN THE FREQUENCY TABLE WILL TERMINATE THE TUNE, AN FE WILL CAUSE IT TO
  644. * RESTART. AN FD WILL CALL THE TUNE NUMBER FOLLOWING (IN THE FREQ TABLE).
  645. *
  646. * SUBROUTINES:
  647. * SCRAPALL -- KILL ALL TUNES. SHOULD BE CALLED AT POWERUP, CHANGING PLAYERS,
  648. * AND GAME OVER
  649. *
  650. * SCRAPONE -- KILL A PARTICULAR TUNE. PUT THE NUMBER OF THE TUNE YA WANNA
  651. * AXE IN THE ACCUMULATOR.
  652. *
  653. * TUNIN -- START THAT TUNE YOU PUT IN ACC.
  654. *
  655. * THE ABOVE ROUTINES PRESERVE THE X AND Y REGS
  656. *
  657. * TABLES NEEDED ARE:
  658. * RAM:
  659. *DCH0 DS 1 ONE BYTE--DURATION CNTR CHAN. 0
  660. *DCH1 DS 1 ONE BYTE--DURATION CNTR CHAN. 1
  661. *TUNNUM DS 1 ONE BYTE--TUNE NUM FOR CHAN. 0
  662. *TUNNUM1 DS 1 ONE BYTE--TUNE NUM FOR CHAN. 1
  663. *TINDEX0 DS 1 ONE BYTE--NOTE POINTER 0
  664. *TINDEX1 DS 1 ONE BYTE--NOTE POINTER 1
  665. *CINDEX0 DS 1 CONTROL INDEX
  666. *CINDEX1 DS 1
  667. *VINDEX0 DS 1 VOLUME INDEX
  668. *VINDEX1 DS 1
  669. *MPTRL EQU KTEMP0 ZERO PAGE TEMP(NOT GAMEPLAY)
  670. *MPTRH EQU KTEMP1 ZERO PAGE TEMP(NOT GAMEPLAY)
  671. *TUNTEMP EQU TEMP0 ANY GAMEPLAY TEMP
  672. * ROM:
  673. * DURTABL ONE DURATION IN FRAMES PER TUNE
  674. * TBASE LOW ADDRESS OF THE START OF FREQ DATA BY TUNE NUMBER
  675. * TBASEH DITTO FOR HIGH ADDRESS
  676. * VBASE LOW ADDRESS OF THE START OF VOL DATA BY TUNE NUMBER
  677. * VBASEH DITTO FOR HIGH ADDRESS
  678. * CBASE LOW ADDRESS OF THE START OF CTRL DATA BY TUNE NUMBER
  679. * CBASEH DITTO FOR HIGH ADDRESS
  680. * PRYOR PRIORITY BY TUNE NUMBERS -- ZERO THE LOWEST
  681. * VOLTABL VOLUMES
  682. * FREQTABL FREQUENCIES
  683. * CTLTABL CONTROLS
  684. ********************************************************************************
  685. * SCRAPALL
  686. * KILL ALL TUNES. SHOULD BE CALLED AT POWERUP, CHANGING PLAYERS,
  687. * AND GAME OVER
  688. * ALSO BEFORE INITIATING A TUNE WITH TWO VOICES
  689. SCRAPALL TYA
  690. PHA
  691. TXA
  692. PHA
  693. LDY #0
  694. STY AUDV0
  695. STY AUDV1
  696. DEY
  697. STY TUNNUM
  698. STY TUNNUM1
  699. PLA
  700. TAX
  701. PLA
  702. TAY
  703. RTS
  704. ; IF YOU WANT, LOOP THIS UP
  705. ********************************************************************************
  706. * SCRAPONE
  707. * KILL A PARTICULAR TUNE. PUT THE NUMBER OF THE TUNE YA WANNA
  708. * AXE IN THE ACCUMULATOR.
  709. SCRAPONE CMP TUNNUM
  710. BNE CKCH1
  711. LDA #0
  712. STA AUDV0
  713. LDA #$FF
  714. STA TUNNUM
  715. RTS
  716. CKCH1 SEC
  717. SBC TUNNUM1
  718. BNE REETS
  719. STA AUDV1
  720. LDA #$FF
  721. STA TUNNUM1
  722. REETS RTS
  723. ********************************************************************************
  724. * TUNIN
  725. * START THAT TUNE YOU PUT IN ACC.
  726. TUNIN STA TUNTEMP
  727. TYA
  728. PHA
  729. TXA
  730. PHA
  731. LDY #1
  732. LDX TUNTEMP
  733. TROIK1 LDA TUNNUM,Y
  734. CMP TUNTEMP ;SEE IF TUNE IS ALREADY IN
  735. BEQ DO ;GO AHEAD AND LOAD
  736. DEY
  737. BPL TROIK1
  738. LDY #1
  739. TROIKA LDA TUNNUM,Y ;FIRST CHECK FOR AN EMPTY CHANNEL
  740. CMP #$FF
  741. BEQ DO
  742. TRKNX DEY
  743. BPL TROIKA
  744. LDA TUNNUM1 ;THIS IS DONE TO PREVENT GLITCHINESS
  745. AND #$7F
  746. TAY
  747. LDA PRYOR,X
  748. CMP PRYOR,Y ;CHECK FOR LOWEST PRIORITY
  749. LDY #1
  750. BCS DO
  751. LDA TUNNUM ;THIS IS DONE TO PREVENT GLITCHINESS
  752. AND #$7F
  753. TAY
  754. LDA PRYOR,X
  755. CMP PRYOR,Y ;CHECK FOR LOWEST PRIORITY
  756. BCC ROOTS
  757. LDY #0
  758. DO TXA
  759. ORA #$80
  760. STA TUNNUM,Y
  761. ROOTS PLA
  762. TAX
  763. PLA
  764. TAY
  765. RTS
  766. ********************************************************************************
  767. *TUNER SHOULD BE CALLED ONCE PER FRAME, NO INPUTS, AND IT OPERATES WITH
  768. *A TOTAL DISREGARD FOR REGISTER SANCTITY. EACH TUNE CAN BE 256 NOTES LONG
  769. *IF YOUR TUNES ARE VERY SMALL, YOU COULD DO AWAY WITH ALL THE INDIRECT STUFF
  770. TUNER
  771. ; TEST FOR ATTRACT
  772. LDA AUTOPLAY
  773. BNE REETS
  774. ; TEST FOR PAUSE
  775. LDA PAUSE
  776. BMI REETS ;MINUS IF IN PAUSE
  777. LDX #1
  778. TUNLOP LDY TUNNUM,X
  779. INY
  780. BNE NETN ;TUNNUM=FF DO NEXT CHANNEL
  781. JNXTCH JMP NXTCH
  782. NETN DEY
  783. BPL BOOGIE
  784. TYA ;NEW TUNE--INTITIATE
  785. AND #$7F
  786. STA TUNNUM,X
  787. TAY
  788. LDA CTRLTABL,Y
  789. STA AUDC0,X ; IN EFFECT UNTIL CHANGED
  790. LDA #$FF
  791. STA DCH0,X ;START
  792. STA TINDEX0,X
  793. * STA CINDEX0,X
  794. STA VINDEX0,X
  795. BOOGIE LDA TBASE,Y
  796. STA MPTRL
  797. LDA TBASEH,Y
  798. STA MPTRH
  799. DEC DCH0,X
  800. BPL JNXTCH
  801. LDA DURTABL,Y
  802. STA DCH0,X
  803. LDY TINDEX0,X
  804. * INC CINDEX0,X
  805. INC VINDEX0,X
  806. INY
  807. LDA (MPTRL),Y ;FREQ
  808. CMP #$FF
  809. BNE CKENL
  810. STA TUNNUM,X ;END THIS FUNKY TUNE
  811. LDA #0
  812. STA AUDV0,X
  813. BEQ JNXTCH
  814. CKENL CMP #$FE ; TEST FOR REPEATS
  815. BEQ FOOBEQ
  816. CKNXTT CMP #$FD ; CONTINUE WITH THE NEXT TUNE
  817. BNE STFREQ
  818. INY ; NEXT BYTE IS TUNE INDEX
  819. LDA (MPTRL),Y
  820. TAY
  821. ORA #$80 ; SO THAT NEW CTRL AND VOLUME GET READ
  822. STA TUNNUM,X
  823. LDA TBASE,Y ; GET ADDRESS OF NEW TUNE
  824. STA MPTRL
  825. LDA TBASEH,Y
  826. STA MPTRH
  827. FOOBEQ LDY #0 ; JUMP HERE FOR REPEAT
  828. TYA ; Y MUST BE 0, IT'S THE FREQ. INDEX
  829. * STA CINDEX0,X
  830. STA VINDEX0,X
  831. FRQLOOP LDA (MPTRL),Y
  832. STFREQ ; BPL SKIP0 ; IF BIT 7 SET, GET NEW DURATION
  833. ; INY
  834. ; LDA (MPTRL),Y ;DURATION CHANGES ARE DISABLED
  835. ; STA DCH0,X
  836. ; DEY
  837. ; LDA (MPTRL),Y
  838. ; INY
  839. ; JMP STIT0
  840. SKIP0 ASL A
  841. BPL SKIP1 ; IF BIT 6 SET, THIS IS A REST
  842. LSR A
  843. AND #$BF
  844. STA DCH0,X
  845. TYA
  846. STA TINDEX0,X
  847. DEC VINDEX0,X
  848. * DEC CINDEX0,X
  849. LDA #0
  850. STA AUDV0,X
  851. BEQ NXTCH
  852. SKIP1 ASL A
  853. BPL STIT ; IF BIT 5 IS SET, THIS IS A NEW CTRL
  854. LSR A
  855. LSR A
  856. AND #$1F
  857. STA AUDC0,X
  858. INY
  859. JMP FRQLOOP ; DO NEXT BYTE BEFORE RETURNING
  860. STIT LSR A
  861. LSR A
  862. STIT0 STA AUDF0,X
  863. TYA
  864. STA TINDEX0,X
  865. LDY TUNNUM,X
  866. LDA VBASE,Y
  867. STA MPTRL
  868. LDA VBASEH,Y
  869. STA MPTRH
  870. LDY VINDEX0,X
  871. LDA (MPTRL),Y
  872. BPL STVL
  873. DEY
  874. STVL STA AUDV0,X
  875. TYA
  876. STA VINDEX0,X
  877. NXTCH DEX
  878. BMI ROTS
  879. JMP TUNLOP
  880. ROTS RTS
  881. ********************************************************************************
  882. ********************************************************************************
  883. * POINTER TABLES.
  884. TBASE DB L(TTITLE0),L(TTITLE1),L(TSTACHA),L(TFREE1),L(TFREE2)
  885. DB L(TRELEAS1),L(TRELEAS2),L(THERSHOT),L(TBIRDSWO)
  886. DB L(THERDEA),L(TBOSDEA),L(TREDDEA),L(TBLUDEA)
  887. DB L(TTRANSFM),L(TBOSCHNG),L(TCHALNG1),L(TCHALNG2)
  888. DB L(TPERFEC1),L(TPERFEC2),L(TSTATS1),L(TSTATS2)
  889. DB L(TTRACTOR),L(TCAPTURE),L(TKIDNAP1),L(TKIDNAP2)
  890. DB L(TBACMUS),L(TTRAC2),L(TSUIC),L(TSUIC2)
  891. TBASEH DB H(TTITLE0),H(TTITLE1),H(TSTACHA),H(TFREE1),H(TFREE2)
  892. DB H(TRELEAS1),H(TRELEAS2),H(THERSHOT),H(TBIRDSWO)
  893. DB H(THERDEA),H(TBOSDEA),H(TREDDEA),H(TBLUDEA)
  894. DB H(TTRANSFM),H(TBOSCHNG),H(TCHALNG1),H(TCHALNG2)
  895. DB H(TPERFEC1),H(TPERFEC2),H(TSTATS1),H(TSTATS2)
  896. DB H(TTRACTOR),H(TCAPTURE),H(TKIDNAP1),H(TKIDNAP2)
  897. DB H(TBACMUS),H(TTRAC2),H(TSUIC),H(TSUIC2)
  898. VBASE DB L(TTITLE0V),L(TTITLE1V),L(TSTACHAV),L(TFREE1V),L(TFREE2V)
  899. DB L(TRELES1V),L(TRELES2V),L(THERSHOV),L(TBIRDSWV)
  900. DB L(THERDEAV),L(TBOSDEAV),L(TREDDEAV),L(TBLUDEAV)
  901. DB L(TTRNSFMV),L(TBOSCHGV),L(TCHLNG1V),L(TCHLNG2V)
  902. DB L(TPERFC1V),L(TPERFC2V),L(TSTATS1V),L(TSTATS2V)
  903. DB L(TTRACTRV),L(TCAPTURV),L(TKIDNP1V),L(TKIDNP2V)
  904. DB L(TBACMUSV),L(TTRAC2V),L(TSUICV),L(TSUIC2V)
  905. VBASEH DB H(TTITLE0V),H(TTITLE1V),H(TSTACHAV),H(TFREE1V),H(TFREE2V)
  906. DB H(TRELES1V),H(TRELES2V),H(THERSHOV),H(TBIRDSWV)
  907. DB H(THERDEAV),H(TBOSDEAV),H(TREDDEAV),H(TBLUDEAV)
  908. DB H(TTRNSFMV),H(TBOSCHGV),H(TCHLNG1V),H(TCHLNG2V)
  909. DB H(TPERFC1V),H(TPERFC2V),H(TSTATS1V),H(TSTATS2V)
  910. DB H(TTRACTRV),H(TCAPTURV),H(TKIDNP1V),H(TKIDNP2V)
  911. DB H(TBACMUSV),H(TTRAC2V),H(TSUICV),H(TSUIC2V)
  912. ********************************************************************************
  913. CTRLTABL DB $0D,$0D,4,4,4
  914. DB 4,$D,4,4
  915. DB 8,4,1,1
  916. DB 4,4,4,4
  917. DB 4,$D,$D,$D
  918. DB 4,4,4,$D
  919. DB $D,4,4,$D ;29 TUNES
  920. DURTABL DB $08,$08,$00,$03,$03
  921. DB $02,$02,$00,$03
  922. DB $09,$02,$01,$01
  923. DB $03,$00,$05,$05
  924. DB $02,$02,$08,$08
  925. DB $01,$02,$02,$02
  926. DB $03,$01,$00,$00
  927. PRYOR DB 6,5,7,8,7
  928. DB 13,12,3,4
  929. DB 7,5,5,5
  930. DB 9,5,8,7
  931. DB 15,14,15,14
  932. DB 9,9,11,10
  933. DB 1,8,8,1
  934. ********************************************************************************
  935. * FREQTABL
  936. ;TUNE 0: TITLE SONG
  937. TTITLE0 DB $0D,$0D,$24,$1F,$1B,$1B,$17,$18,$18,$1F,$1B,$1B,$12,$14,$14
  938. DB $1F,$1B,$1B,$17,$18,$18,$1F,$1B,$1B,$10,$0F,$0F,$11,$13,$13
  939. DB $14,$17,$17,$1A,$1B,$1B,$2D,$0B,$24,$11,$11,$0F,$11,$11,$14
  940. DB $12,$17,$1B,$14,$14,$14,$FF
  941. TREDDEAV
  942. TBLUDEAV
  943. TTITLE0V
  944. TBIRDSWV
  945. TBOSDEAV
  946. TBOSCHGV
  947. TCHLNG1V
  948. TCHLNG2V
  949. TPERFC1V
  950. TSTATS1V
  951. TTRACTRV
  952. TSUICV DB $89
  953. ;TUNE1: TITLE SONG
  954. TTITLE1 DB $10,$51,$0F,$51,$0D,$51,$0F,$51,$10,$51
  955. DB $0F,$51,$0D,$51,$0F,$48,$0F,$11,$11,$12,$14,$14
  956. DB $17,$1A,$1A,$1B,$1F,$1F,$1B,$12,$12,$11,$12,$12,$16,$18,$18
  957. DB $18,$1B,$1B,$1B,$FF
  958. TTITLE1V
  959. TTRAC2V
  960. TSUIC2V DB $84
  961. ;TUNE2: STAGE CHANGE
  962. TSTACHA DB $0F,$40,$13,$40,$11,$43
  963. DB $0F,$40,$13,$40,$11,$FF
  964. TSTACHAV
  965. TKIDNP1V
  966. TFREE2V DB $87
  967. ;TUNE3: EXTRA SHIP FANFARE
  968. TFREE1 DB $13,$17,$13,$0E,$0B,$09,$FF
  969. TFREE1V DB $8A
  970. TBACMUSV DB $83 ;LOWERED THIS VOLUME
  971. ;TUNE4: EXTRA SHIP FANFARE
  972. TFREE2 DB $17,$1D,$17,$13,$0F,$11,$FF
  973. ;TUNE5: CAPTURED SHIP RELEASED, PLAYS UNTIL UNITED
  974. TRELEAS1 DB $D,$42,$10,$42,$F,$42,$12,$42
  975. DB $10,$42,$14,$42,$12,$42,$15,$42
  976. DB $14,$42,$19,$42,$1C,$42,$1F,$42
  977. DB $2D,$A,$42,$C,$42,$D,$42,$E,$42
  978. DB $D,$42,$A,$42,$C,$42,$24,$1F,$42
  979. DB $2D,$A,$42,$24,$1C,$42,$1F,$42,$19,$42
  980. DB $1C,$42,$14,$42,$15,$42,$14,$42
  981. DB $12,$42,$1C,$42,$19,$42,$16,$42,$FE
  982. TRELES1V
  983. TTRNSFMV DB $88
  984. ;TUNE6: SAME AS 4
  985. TRELEAS2 DB $1C,$1C,$1C,$1C,$12,$12,$12,$12
  986. DB $D,$D,$D,$D,$D,$D,$10,$10
  987. DB $12,$12,$14,$14,$15,$15,$18,$18
  988. DB $1C,$1C,$1D,$1D,$1C,$1C,$18,$18
  989. DB $15,$15,$45,$14,$14,$45
  990. DB $12,$12,$45,$10,$10,$45
  991. DB $12,$12,$12,$41,$14,$14,$15,$15
  992. DB $18,$18,$1C,$1C,$1D,$1D,$18,$18,$FE
  993. TPERFC2V
  994. TRELES2V
  995. TSTATS2V
  996. TKIDNP2V DB $85
  997. ;TUNE7: HERO SHOT
  998. THERSHOT DB 6,7,8,9,$A,$B,$C,$D ;FREQ
  999. DB $F,$11,$13,$15,$17,$19,$1C,$1F
  1000. DB $FF
  1001. THERSHOV DB 3,4,5,5,5,5,5,5,5,5,4,4,3,3,4,4,$FF
  1002. ;TUNE8: BIRDSWOOPING SOUND
  1003. TBIRDSWO DB $0A,$0B,$0C,$0D,$0E ;FREQ
  1004. DB $0F,$10,$11,$12,$13
  1005. DB $14,$15,$17,$18,$1A
  1006. DB $1B,$1D,$1F,$2D,$0B,$0C
  1007. DB $0D,$0E,$0F,$10,$11
  1008. DB $12,$13,$14,$15,$FF
  1009. ;TUNE9: HERO DEATH SOUND
  1010. THERDEA DB $1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F,$FF
  1011. THERDEAV DB $B,$D,$C,$B,$A,9,7,5,3,2,1,$FF
  1012. ;TUNE10: BOSS DEATH SOUND
  1013. TBOSDEA DB $1F,$1C,$1A,$1C,$1A
  1014. DB $19,$1A,$19,$18,$FF
  1015. ;TUNE11: RED DEATH SOUND
  1016. TREDDEA DB $09,$08,$07,$05,$41 ;FREQ
  1017. DB $06,$07,$08,$0B,$FF
  1018. ;TUNE12: BLUE DEATH SOUND
  1019. TBLUDEA DB $0D,$0B,$0A,$09,$41 ;FREQ
  1020. DB $0A,$0B,$0D,$0F,$FF
  1021. ;TUNE13: ONE BIRD INTO THREE BIRDS
  1022. TTRANSFM DB $1D,$1A,$1D,$1A,$16,$13,$16,3,$FF
  1023. ;TUNE14: BOSS GOING TO BLUE
  1024. TBOSCHNG DB $1F,$1E,$40,$1C,$1B
  1025. DB $40,$19,$18,$FF
  1026. ;TUNE15: CHALLENGING STAGE CHANNEL 1
  1027. TCHALNG1 DB $13,$4B,$13,$12
  1028. DB $10,$0E,$0E,$0E,$FF
  1029. ;TUNE16: CHALLENGING STAGE CHANNEL 2
  1030. TCHALNG2 DB $1F,$4B,$1F,$1D
  1031. DB $1A,$17,$17,$17,$FF
  1032. ;TUNE17: PERFECT SCORE FANFARE
  1033. TPERFEC1 DB $12,$12,$12,$12,$12,$00,$12,$00
  1034. DB $12,$12,$12,$12,$14,$14,$14,$14
  1035. DB $14,$14,$14,$00,$14,$14,$14,$14
  1036. DB $14,$14,$14,$00,$14,$14,$14,$14
  1037. DB $11,$11,$11,$11,$11,$00,$11,$00
  1038. DB $11,$11,$11,$11,$12,$12,$12,$12
  1039. DB $12,$12,$12,$00,$12,$12,$12,$12
  1040. DB $12,$12,$12,$00,$12,$12,$12,$00
  1041. DB $11,$00,$11,$11,$11,$00,$11,$00
  1042. DB $11,$11,$11,$11,$0F,$00,$0F,$0F
  1043. DB $0F,$00,$0F,$00,$0F,$0F,$0F,$00
  1044. DB $0F,$0F,$0F,$00,$0F,$0F,$0F,$00
  1045. DB $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D
  1046. DB $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D
  1047. DB $FD,8 ;CALL BIRD SWOOP SOUND
  1048. ;TUNE18: PERFECT SCORE FANFARE
  1049. TPERFEC2 DB $1F,$1F,$18,$18,$14,$14,$0F,$0F
  1050. DB $1F,$1F,$18,$18,$14,$14,$0F,$0F
  1051. DB $1F,$1F,$18,$18,$14,$14,$0F,$0F
  1052. DB $1F,$1F,$18,$18,$14,$14,$0F,$0F
  1053. DB $1F,$1F,$18,$18,$14,$14,$0F,$0F
  1054. DB $1F,$1F,$18,$18,$14,$14,$0F,$0F
  1055. DB $1F,$1F,$18,$18,$14,$14,$0F,$0F
  1056. DB $1F,$1F,$18,$18,$14,$14,$0F,$0F
  1057. DB $1D,$42,$1D,$1D,$1D,$42,$1D,$42
  1058. DB $1D,$1D,$1D,$1D,$1A,$42,$1A,$1A
  1059. DB $1A,$42,$1A,$42,$1A,$1A,$1A,$42
  1060. DB $1A,$1A,$1A,$42,$1A,$1A,$1A,$42
  1061. DB $17,$17,$14,$14,$12,$12,$0F,$0F
  1062. DB $12,$12,$12,$12,$17,$17,$17,$17,$FF
  1063. ;TUNE19: STATISTICS DISPLAY SOUND
  1064. TSTATS1 DB $D,$D,$24,$1F,$1B,$1B,$17,$18,$18
  1065. DB $1F,$1B,$1B,$12,$14,$14,$1F,$1B
  1066. DB $1B,$17,$18,$18,$1F,$1B,$1B,$10
  1067. DB $F,$F,$11,$13,$13,$14,$17,$17
  1068. DB $1A,$1B,$1B,$2D,$B,$24,$11,$11,$F,$11
  1069. DB $11,$14,$12,$17,$1B,$14,$14,$14
  1070. ABCD DB $14,$14,$14,$FF
  1071. ;TUNE20: STATISTICS DISPLAY SOUND
  1072. TSTATS2 DB $51,$D,$D,$24,$1F,$1B,$1B,$17
  1073. DB $18,$18,$1F,$1B,$1B,$12,$14,$14
  1074. DB $1F,$1B,$1B,$17,$18,$18,$1F,$1B
  1075. DB $1B,$10,$F,$F,$11,$13,$13,$14
  1076. DB $17,$17,$1A,$1B,$1B,$2D,$B,$24,$11,$11
  1077. DB $F,$11,$11,$14,$12,$17,$1B,$14
  1078. ABCDE DB $14,$14,$14,$FF
  1079. ;TUNE21: TRACTOR BEAM
  1080. TTRACTOR DB $0E,$41,$0F,$41,$11,$41,$13,$41,$FE ;REPEATS
  1081. ;TUNE26 SECOND CHANNEL OF TRACTOR BEAM SOUND
  1082. TTRAC2 DB $41,$11,$41,$13,$41,$16,$41,$17,$FE ;REPEATS
  1083. ;TUNE22: HERO SHIP BEING CAPTURED
  1084. TCAPTURE DB $17,$13,$10,$0D,$0B
  1085. DB $0D,$10,$13,$FE ;REPEATS
  1086. TCAPTURV DB $02,$04,$06,$08,$08,$06,$04,$02
  1087. DB $03,$03,$03,$03,$03,$03,$03,$03
  1088. DB $07,$09,$0A,$0A,$0A,$0A,$09,$07
  1089. DB $04,$04,$04,$04,$04,$04,$04,$04
  1090. DB $03,$05,$07,$09,$09,$07,$05,$03
  1091. DB $04,$04,$04,$04,$04,$04,$04,$04
  1092. DB $0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A
  1093. DB $03,$FE ;REPEATS
  1094. ;TUNE23: HERO BEING TAKEN TO TOP OF SCREEN
  1095. TKIDNAP1 DB $0D,$42,$11,$42,$0F,$42,$12,$42
  1096. DB $11,$42,$14,$42,$12,$42,$15
  1097. DB $42,$14,$42,$1A,$42,$1C,$42,$1F
  1098. DB $42,$2D,$0B,$42,$0C,$42,$0D,$42
  1099. DB $0E,$42,$0D,$42,$0B,$42,$0C,$42
  1100. DB $24,$1F,$42,$2D,$0B,$42,$24,$1C,$42,$1F
  1101. DB $42,$1A,$42,$1C,$42,$14,$42,$16
  1102. DB $42,$14,$42,$12,$42,$1C,$42
  1103. DB $19,$42,$16,$42,$FF ;MAY END ABRUPTLY???
  1104. ;TUNE24: HERO BEING TAKEN TO TOP OF SCREEN
  1105. TKIDNAP2 DB $1C,$1C,$1C,$1C,$12,$12,$12,$12
  1106. DB $0D,$0D,$0D,$0D,$0D,$0D,$11
  1107. DB $11,$12,$12,$14,$14,$17,$17,$18
  1108. DB $18,$1C,$1C,$1E,$1E,$1C,$1C
  1109. DB $18,$18,$17,$17,$17,$17,$14,$14
  1110. DB $14,$14,$12,$12,$12,$12,$11
  1111. DB $11,$11,$11,$12,$12,$12,$12,$14
  1112. DB $14,$17,$17,$18,$18,$1C,$1C
  1113. DB $1D,$1D,$18,$18,$FF ;MAY END ABRUPTLY???
  1114. ;TUNE25: BACKGROUND MUSIC
  1115. TBACMUS DB $1F,$1D,$1B,$1A,$18 ;FREQ
  1116. DB $17,$15,$14,$13,$12
  1117. DB $15,$14,$13,$12,$1F
  1118. DB $1D,$1B,$1A,$18,$17
  1119. DB $15,$14,$13,$12,$1F
  1120. DB $1D,$1B,$1A,$18,$17
  1121. DB $15,$14,$13,$12,$1F
  1122. DB $1D,$1B,$1A,$18,$17
  1123. DB $15,$14,$13,$12,$13
  1124. DB $14,$15,$17,$12,$13
  1125. DB $14,$15,$17,$18,$1A
  1126. DB $1B,$1D,$1F,$12,$13
  1127. DB $14,$15,$17,$18,$1A
  1128. DB $1B,$1D,$1F,$12,$13
  1129. DB $14,$15,$17,$18,$1A
  1130. DB $1B,$1D,$1F,$12,$13
  1131. DB $14,$15,$17,$18,$1A
  1132. DB $1B,$1D,$1F,$FE
  1133. ;TUNE27 SUICIDE CHANNEL 1
  1134. TSUIC DB $0D,$40,$11,$40,$F,$40,$12,$40
  1135. DB $11,$40,$14,$40,$12,$40,$15,$40
  1136. DB $14,$40,$1C,$40,$1A,$40,$1F,$40
  1137. DB $1C,$40,$2D,$0B,$40,$24,$15,$40,$1A,$40
  1138. DB $14,$40,$1C,$40,$1A,$40,$1F,$40
  1139. DB $1C,$40,$2D,$0B,$40,$15,$40,$1F,$40
  1140. DB $14,$40,$FF
  1141. ;TUNE28 SUICIDE CHANNEL 2
  1142. TSUIC2 DB $1C,$1C,$1C,$1C,$12,$12,$12,$12
  1143. DB $D,$D,$D,$D,$D,$D,$11,$11
  1144. DB $12,$12,$12,$12,$14,$14,$14,$14
  1145. DB $17,$17,$17,$17,$18,$18,$18,$18
  1146. DB $17,$17,$17,$17,$14,$14,$14,$14
  1147. DB $12,$12,0,0,$12,$12,0,0
  1148. DB $1C,$1C
  1149. DB $FF