I love when games are accidentally compiled with files that shouldn't have been compiled. My favorite being source code. Do you know of any games that do this by accident (except for Sonic 2NA)? Here's a nice one: This comes from ESPN Baseball Tonight: Code (ASM): entry point: 00000200 no relocation info executable START END LENGTH FILE SECTION TYPE 00000000 00000007 000008 X.OUT >(ORG) T 00000000 00000007 000008 MAIN.O (ORG) T ORG 00000060 0000008f 000030 X.OUT >(ORG) T 00000060 0000008f 000030 MAIN.O (ORG) T ORG 00000100 00000100 000000 X.OUT >(ORG) T 00000100 00000100 000000 MAIN.O (ORG) T ORG 00000100 000001ff 000100 X.OUT >(ORG) T 00000100 000001ff 000100 MAIN.O (ORG) T ORG 00000200 00000ac3 0008c4 X.OUT >(ORG) T 00000200 00000ac3 0008c4 MAIN.O (ORG) T ORG 00000ac4 0001272b 011c68 X.OUT >.text T 00000ac4 00000baf 0000ec MAIN.O .text T 00000bb0 000069a7 005df8 WCS.O .text T 000069a8 0000fe73 0094cc AI.O .text T 0000fe74 00010f2f 0010bc LOGOS.O .text T 00010f30 0001101f 0000f0 LZWDECOM.O .text T 00011020 0001157f 000560 PPGE_PM.O .text T 00011580 0001159f 000020 PPGE_PMC.O .text T 000115a0 00012437 000e98 PPGE_GD.O .text T 00012438 00012507 0000d0 PPGE_GDC.O .text T 00012508 00012508 000000 GRAPHICS.O .text T 00012508 00012508 000000 FIELD.O .text T 00012508 00012508 000000 STRIPS.O .text T 00012508 00012508 000000 BATTART.O .text T 00012508 00012508 000000 LBATTART.O .text T 00012508 00012508 000000 FIELDART.O .text T 00012508 00012508 000000 FIELDRUN.O .text T 00012508 00012508 000000 FIELDTHR.O .text T 00012508 00012508 000000 FIELDCAT.O .text T 00012508 00012508 000000 RUNNER.O .text T 00012508 0001258b 000084 SOUND.O .text T 0001258c 0001272b 0001a0 STATS.O .text T 00020000 0005ac4b 03ac4c X.OUT >sounds D 00020000 0005ac4b 03ac4c GEMS.O .text T 0005ac4c 0005ac4c 000000 GEMS.O .data D 0005ac4c 0005ac4c 000000 GEMS.O .bss B (00) 0005ac4c 0006b3f7 0107ac X.OUT >field D 0005ac4c 0006b3f7 0107ac FIELD.O field D 0006b3f8 001dad87 16f990 X.OUT >graphics D 0006b3f8 0006b477 000080 LOGOS.O graphics D 0006b478 00088963 01d4ec GRAPHICS.O graphics D 00088964 0008fe1b 0074b8 FIELD.O graphics D 0008fe1c 000951bf 0053a4 STRIPS.O graphics D 000951c0 000bb8df 026720 BATTART.O graphics D 000bb8e0 000c4fbf 0096e0 LBATTART.O graphics D 000c4fc0 000e67a7 0217e8 FIELDART.O graphics D 000e67a8 00101297 01aaf0 FIELDRUN.O graphics D 00101298 0012ac7f 0299e8 FIELDTHR.O graphics D 0012ac80 001a1b67 076ee8 FIELDCAT.O graphics D 001a1b68 001dad87 039220 RUNNER.O graphics D 001dad88 001df02b 0042a4 X.OUT >tables D 001dad88 001dad88 000000 MAIN.O tables D 001dad88 001dbabb 000d34 WCS.O tables D 001dbabc 001dc83b 000d80 AI.O tables D 001dc83c 001dcc4b 000410 LOGOS.O tables D 001dcc4c 001dcf4b 000300 PPGE_PM.O tables D 001dcf4c 001dcf4c 000000 PPGE_PMC.O tables D 001dcf4c 001dcf6b 000020 PPGE_GD.O tables D 001dcf6c 001dcf6c 000000 PPGE_GDC.O tables D 001dcf6c 001dcf6c 000000 GRAPHICS.O tables D 001dcf6c 001dcf8b 000020 FIELD.O tables D 001dcf8c 001df02b 0020a0 STATS.O tables D 001df02c 001df02c 000000 X.OUT >.batt 001df02c 001f6323 0172f8 X.OUT >.graphic D 001df02c 001f6323 0172f8 LOGOS.O .graphic D 00ff0000 00fff197 00f198 X.OUT >.data D 00ff0000 00ff0000 000000 MAIN.O .data D 00ff0000 00ffce23 00ce24 WCS.O .data D 00ffce24 00ffce24 000000 AI.O .data D 00ffce24 00ffce24 000000 LOGOS.O .data D 00ffce24 00ffce24 000000 LZWDECOM.O .data D 00ffce24 00ffce33 000010 PPGE_PM.O .data D 00ffce34 00ffce34 000000 PPGE_PMC.O .data D 00ffce34 00fff013 0021e0 PPGE_GD.O .data D 00fff014 00fff014 000000 PPGE_GDC.O .data D 00fff014 00fff014 000000 GRAPHICS.O .data D 00fff014 00fff014 000000 FIELD.O .data D 00fff014 00fff014 000000 STRIPS.O .data D 00fff014 00fff014 000000 BATTART.O .data D 00fff014 00fff014 000000 LBATTART.O .data D 00fff014 00fff014 000000 FIELDART.O .data D 00fff014 00fff014 000000 FIELDRUN.O .data D 00fff014 00fff014 000000 FIELDTHR.O .data D 00fff014 00fff014 000000 FIELDCAT.O .data D 00fff014 00fff014 000000 RUNNER.O .data D 00fff014 00fff014 000000 SOUND.O .data D 00fff014 00fff197 000184 STATS.O .data D 00fff198 00fff1b3 00001c X.OUT >.bss B (00) 00fff198 00fff198 000000 MAIN.O .bss B (00) 00fff198 00fff1b3 00001c WCS.O .bss B (00) 00fff1b4 00fff1b4 000000 AI.O .bss B (00) 00fff1b4 00fff1b4 000000 LOGOS.O .bss B (00) 00fff1b4 00fff1b4 000000 LZWDECOM.O .bss B (00) 00fff1b4 00fff1b4 000000 PPGE_PM.O .bss B (00) 00fff1b4 00fff1b4 000000 PPGE_PMC.O .bss B (00) 00fff1b4 00fff1b4 000000 PPGE_GD.O .bss B (00) 00fff1b4 00fff1b4 000000 PPGE_GDC.O .bss B (00) 00fff1b4 00fff1b4 000000 GRAPHICS.O .bss B (00) 00fff1b4 00fff1b4 000000 FIELD.O .bss B (00) 00fff1b4 00fff1b4 000000 STRIPS.O .bss B (00) 00fff1b4 00fff1b4 000000 BATTART.O .bss B (00) 00fff1b4 00fff1b4 000000 LBATTART.O .bss B (00) 00fff1b4 00fff1b4 000000 FIELDART.O .bss B (00) 00fff1b4 00fff1b4 000000 FIELDRUN.O .bss B (00) 00fff1b4 00fff1b4 000000 FIELDTHR.O .bss B (00) 00fff1b4 00fff1b4 000000 FIELDCAT.O .bss B (00) 00fff1b4 00fff1b4 000000 RUNNER.O .bss B (00) 00fff1b4 00fff1b4 000000 SOUND.O .bss B (00) 00fff1b4 00fff1b4 000000 STATS.O .bss B (00) RESERVED SYMBOLS 00fff1b4 heap_org 00000e4c heap_len ff1b4 000000 FIELDART.O .bss B (00) 00fff1b4 00fff1b4 000000 FIELDRUN.O .bss B (00) 00fff1b4 00fff1b4 000000 FIELDTHR.O .bss B (00) 00fff1b4 00fff1b4</div> Here's some more from the same game: [CODE=ASM]* * * Project: Sony ESPN Baseball * * * * Module: AI.S * * * * Module Creation Date: March 1993 * * * * Author: Russell Shanks * * * * Development System: Sierra Systems * * * ***************************************************************************** include MACROS.I Include EQUATES.I include sound.inc *---------------------------------------------------------------------------- ***************************************************************************** * PPGE ***************************************************************************** include ppge_var.inc *---------------------------------------------------------------------------- * section tables xdef radar_ytable xdef radar_xtable InitialLogicTable ;entity descending order dc.l HaloLogic dc.l FieldXLogic,LookEntityLogic,LookEntityLogic dc.l LookEntityLogic,LookEntityLogic,InitialThirdLogic dc.l InitialSecondLogic,InitialFirstRunLogic dc.l InitialBatterLogic,InitialFielderLogic dc.l InitialFielderLogic,InitialFielderLogic dc.l InitialFielderLogic,InitialFielderLogic dc.l InitialFielderLogic,InitialFielderLogic dc.l InitialCatcherLogic,InitialPitcherLogic FielderSelectTable dc.w FBaseman_ptr,Fbaseman_ptr,Sbaseman_ptr,Pitcher_ptr dc.w ShortStop_ptr,Tbaseman_ptr,Tbaseman_ptr dc.w Fbaseman_ptr,Sbaseman_ptr,Sbaseman_ptr,ShortStop_ptr dc.w ShortStop_ptr,Tbaseman_ptr,Tbaseman_ptr dc.w RFielder_ptr,RFielder_ptr,RFielder_ptr,CFielder_ptr dc.w LFielder_ptr,LFielder_ptr,LFielder_ptr FielderRF_tbl dc.w 8,6,7,7,8,8,7,7 FielderThrowIS_tbl dc.w 3,3,4,4,3,3,4,4 ;only 3 and 4's good here dc.b 13,13,13,13,13,13,13,13 dc.b 13,13,13,13,13,13,13,13 dc.b 13,13,13,13,13,13,13,13 dc.b 13,13,13,13,13,13,13,13 dc.b 13,13,13,13,13,13,13,13 dc.b 13,13,13,13,13,13,13,13 dc.b 13,13,13,13,13,13,13,13 * dc.b 14,15,16,17,18,19,20,21 dc.b 13,13,13,13,13,13,13,13 ballvscale_table * dc.b 22,23,24,26,27,28,29,31 dc.b 13,13,14,14,15,16,17,18 * dc.b 32,33,34,36,37,38,39,41 dc.b 20,21,22,23,25,26,27,29 * dc.b 42,43,44,45,47,48,49,50 dc.b 30,31,32,33,35,36,37,38 * dc.b 52,53,54,55,57,58,59,60 dc.b 40,41,42,43,45,46,47,48 * dc.b 62,63,64,65,67,68,69,70 dc.b 50,51,52,53,54,55,56,57 * dc.b 71,73,74,75,76,78,79,80 dc.b 61,63,65,68,71,74,76,78 dc.b 81,83,84,85,86,88,89,90 dc.b 91,93,94,95,96,97,99,100 dc.b 101,102,104,105,106,107,109,110 dc.b 111,112,114,115,116,117,119,120 dc.b 121,122,123,125,126,127,128,130 dc.b 131,132,133,135,136,137,138,140 dc.b 141,142,143,145,146,147,148,150 dc.b 151,152,153,154,156,157,158,159 dc.b 161,162,163,164,166,167,168,169 dc.b 171,172,173,174,176,177,178,179 dc.b 180,182,183,184,185,187,188,189 dc.b 190,192,193,194,195,197,198,199 dc.b 200,202,203,204,205,206,208,209 dc.b 210,211,213,214,215,216,218,219 dc.b 220,221,223,224,225,226,228,229 dc.b 230,231,232,234,235,236,237,239 dc.b 240,241,242,244,245,246,247,249 dc.b 250,251,252,254,255,255 * dc.b 67,68,69,70,71,72,73,74 dc.b 31,33,35,37,39,41,43,47 runnervscale_table * dc.b 75,76,77,78,79,80,81,82 dc.b 49,51,53,57,59,61,63,65 * dc.b 83,84,85,86,87,88,89,90 dc.b 67,69,71,73,75,77,79,81 * dc.b 91,92,93,94,95,96,97,98 dc.b 83,85,87,89,91,93,95,96 * dc.b 99,100,100,100,100,100,100,100 dc.b 97,97,98,98,99,99,100,100 dc.b 100,100,100,100,100,100,100,100 dc.b 100,100,100,100,100,100,100,100 dc.b 100,100,100,100,100,100,100,100 dc.b 100,100,100,100,100,100,100,100 dc.b 101,102,104,105,106,107,109,110 dc.b 111,112,114,115,116,117,119,120 dc.b 121,122,123,125,126,127,128,130 dc.b 131,132,133,135,136,137,138,140 dc.b 141,142,143,145,146,147,148,150 dc.b 151,152,153,154,156,157,158,159 dc.b 161,162,163,164,166,167,168,169 dc.b 171,172,173,174,176,177,178,179 dc.b 180,182,183,184,185,187,188,189 dc.b 190,192,193,194,195,197,198,199 dc.b 200,202,203,204,205,206,208,209 dc.b 210,211,213,214,215,216,218,219 dc.b 220,221,223,224,225,226,228,229 dc.b 230,231,232,234,235,236,237,239 dc.b 240,241,242,244,245,246,247,249 dc.b 250,251,252,254,255,255 * dc.b 100,100,100,100,100,100,100,100 *runnervscale_table * dc.b 100,100,100,100,100,100,100,100 * dc.b 100,100,100,100,100,100,100,100 * dc.b 100,100,100,100,100,100,100,100 * dc.b 100,100,100,100,100,100,100,100 * dc.b 100,100,100,100,100,100,100,100 * dc.b 100,100,100,100,100,100,100,100 * dc.b 100,100,100,100,100,100,100,100 * dc.b 100,100,100,100,100,100,100,100 * dc.b 101,102,104,105,106,107,109,110 * dc.b 111,112,114,115,116,117,119,120 * dc.b 121,122,123,125,126,127,128,130 * dc.b 131,132,133,135,136,137,138,140 * dc.b 141,142,143,145,146,147,148,150 * dc.b 151,152,153,154,156,157,158,159 * dc.b 161,162,163,164,166,167,168,169 * dc.b 171,172,173,174,176,177,178,179 * dc.b 180,182,183,184,185,187,188,189 * dc.b 190,192,193,194,195,197,198,199 * dc.b 200,202,203,204,205,206,208,209 * dc.b 210,211,213,214,215,216,218,219 * dc.b 220,221,223,224,225,226,228,229 * dc.b 230,231,232,234,235,236,237,239 * dc.b 240,241,242,244,245,246,247,249 * dc.b 250,251,252,254,255,255 * dc.w #0,#430,#518,#573,#615,#647 dc.w #430,#430,#430,#430,#518,#573,#615,#647 walltable dc.w #686,#717,#742,#766,#792,#816,#838,#862 ;16 dc.w #878,#893,#913,#924,#925,#925,#925,#925 ;24 dc.w #925,#925,#925,#925,#925,#925,#925,#925 ;32 dc.w #926,#927,#928,#929,#930,#930,#930,#926 ;40 dc.w #922,#918,#914,#910,#906,#902,#898,#894 ;48 dc.w #890,#886,#882,#878,#874,#870,#866,#862 ;56 dc.w #858,#854,#850,#846,#842,#838,#834,#830 ;64 dc.w #826,#822,#818,#814,#810,#806,#802,#798 ;72 dc.w #794,#790,#786,#782,#768,#764,#760,#756 ;80 dc.w #752,#748,#744,#738,#734,#730,#726,#722 ;88 dc.w #718,#714,#710,#706,#704,#700,#696,#692 ;96 dc.w #688,#684,#680,#676,#672,#668,#664,#660 ;104 dc.w #656,#652,#648,#644,#640,#634,#630,#626 ;112 * dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;40 * dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;48 * dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;56 * dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;64 * dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;72 * dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;80 * dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;88 * dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;96 * dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;104 * dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;112 dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;120 dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;128 dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;136 dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;144 dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;152 dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;160 dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;168 dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;176 dc.w #961,#961,#961,#961,#961,#961,#961,#961 ;184 dc.b 8,8,8,8,8,8,8,8 To1AndHome * dc.b 8,8,8,8,8,8,8,8 ;0-7 dc.b 9,9,9,9,9,9,9,8 ;15 dc.b 8,8,8,8,8,7,7,7 ;23 dc.b 7,7,7,6,6,6,6,6 ;31 dc.b 6,5,5,5,5,5,5,4 ;39 dc.b 4,4,4,4,4,3,3,3 ;47 dc.b 3,3,3,3,2,2,2,2 ;55 dc.b 2,2,1,1,1,1,1,1 ;63 dc.b 1,1,1,1,1,1,1,1 ;71 dc.b 1,1,1,1,1,1,1,1 dc.b 1,1,1,1,1,1,1,1 dc.b 1,1,1,1,1,1,1,1 dc.b 1,1 dc.b 1,1,1,1,1,1,1,1 dc.b 1,1,1,1,1,1,1,1 dc.b 1,1,1,1,1,1,1,1 dc.b 4,4,4,4,4,4,4,4,4,4 To2And3 dc.b 4,4,4,4,4,4,4,4,4,4 dc.b 3,3,3,3,3,3,3,3,3,3 dc.b 2,2,2,2,2,2,2,2,2,2 dc.b 1,1,1,1,1,1,1,1,1,1 dc.b 0,0,0,0,0,0,0,0,0,0 * dc.b 0,0,0,0,0,0,0,0 * dc.b 0,0,0,0,0,0,0,0,0 * dc.b 0,0,0,0,0,0,0,0,0 FielderScaleTable dc.b 0,0,0,0,0,0,0,1 ;8 dc.b 1,1,1,1,1,1,2,2 ;16 dc.b 2,2,2,2,2,3,3,3 ;32 * dc.b 3,3,3,3,4,4,4,4 ;40 * dc.b 4,4,4,5,5,5,5,5 ;48 dc.b 3,4,4,4,4,5,5,5 ;40 dc.b 5,5,5,5,5,5,5,5 ;48 dc.b 5,6,6,6,6,6,6,6 ;56 dc.b 6,6,6,6,6,6,6,6 ;64 dc.b 6,6,6,6,6,6,6,6 ;72 dc.b 6,6,6,6,6,6,6,6 ; dc.b 6,6,6,6,6,6,6,6 ; dc.b 6,6,6,6,6,6,6,6 ; dc.b 6,6,6,6,6,6,6,6 ; dc.b 6,6,6,6,6,6,6,6 ; dc.b 6,6,6,6,6,6,6,6 ; dc.b 6,6,6,6,6,6,6,6 ; dc.b 6,6,6,6,6,6,6,6 ; dc.b 6,6,6,6,6,6,6,6 ; dc.b 6,6,6,6,6,6,6,6 ; dc.b 6,6,6,6,6,6,6,6 ; dc.b 6,6,6,6,6,6,6,6 ; dc.b 6,6,6,6,6,6,6,6 ; dc.b 6,6,6,6,6,6,6,6 ;184 Pdirectiontable dc.b #0,#128,#0,#128,#192,#160,#224,#224 dc.b #64,#96,#32,#64,#64,#64,#64,#64 dc.b 0,0,0,0,0,0,0,0 dc.b 0,0,0,0,0,0,0,0 dc.b 0,0,0,0,0,0,0,0 dc.b 0,0,0,0,0,0,0,0 dc.b 0,0,0,0,0,0,0,0 dc.b 0,0,0,0,0,0,0,0 dc.b 0,0,0,0,0,0,0,0 dc.b 1,2,3,4,5,6,7,8 ; -8 - -1 radar_ytable dc.b 9,10,11,12,13,14,15,16 ; 0-7 dc.b 17,18,19,20,21,21,22,23 ; 8-15 dc.b 23,24,25,25,26,27,27,28 ; 16-23 dc.b 29,29,30,30,31,31,32,32 ; 24-31 dc.b 33,33,34,34,34,35,35,35 ; 32-39 dc.b 36,36,36,37,37,37,38,38 ; 40-47 dc.b 38,39,39,40,40,41,41,42 ; 48-55 dc.b 42,43,43,44,44,45,45,46 ; 56-63 Pitcher's mound y=61 dc.b 46,46,47,47,47,47,48,48 ; 64-71 dc.b 48,48,48,49,49,49,49,49 dc.b 49,50,50,50,50,50,50,51 dc.b 51,51,51,51,51,52,52,52 dc.b 52,52,52,53,53,53,53,53 dc.b 53,54,54,54,54,54,54,55 dc.b 55,55,55,55,55,56,56,56 dc.b 56,56,56,57,57,57,57,57 dc.b 57,58,58,58,58,58,58,59 dc.b 59,59,59,59,60,60,60,60 dc.b 60,60,61,61,61,61,61,61 dc.b 62,62,62,62,62,62,63,63 dc.b 63,63,63,63,64,64,64,64 dc.b 64,64,65,65,65,65,65,65 dc.b 66,66,66,66,66,66,67,67 dc.b 67,67,67,67,68,68,68,68 Radar_xtable dc.b #0,#0,#0,#0,#0,#0,#0,#0 dc.b #0,#0,#0,#0,#0,#0,#0,#0 dc.b #0,#0,#0,#0,#0,#0,#0,#0 dc.b #0,#0,#0,#0,#0,#0,#0,#0 dc.b #0,#0,#0,#0,#0,#0,#0,#0 dc.b #1,#1,#1,#1,#1,#1,#1,#1 dc.b #1,#1,#1,#1,#1,#1,#1,#1 dc.b #1,#1,#1,#1,#1,#1,#1,#1 dc.b #1,#1,#1,#1,#1,#1,#1,#1 dc.b #1,#1,#1,#1,#1,#1,#1,#1 dc.b #2,#2,#2,#2,#2,#2,#2,#2 dc.b #2,#2,#2,#2,#2,#2,#2,#2 dc.b #2,#2,#2,#2,#2,#2,#2,#2 dc.b #2,#2,#2,#2,#2,#2,#2,#2 dc.b #2,#2,#2,#2,#2,#2,#2,#2 dc.b #3,#3,#3,#3,#3,#3,#3,#3 dc.b #3,#3,#3,#3,#3,#3,#3,#3 dc.b #3,#3,#3,#3,#3,#3,#3,#3 dc.b #3,#3,#3,#3,#3,#3,#3,#3 dc.b #3,#3,#3,#3,#3,#3,#3,#3 dc.b #4,#4,#4,#4,#4,#4,#4,#4 dc.b #4,#4,#4,#4,#4,#4,#4,#4 dc.b #4,#4,#4,#4,#4,#4,#4,#4 dc.b #4,#4,#4,#4,#4,#4,#4,#4 dc.b #4,#4,#4,#4,#4,#4,#4,#4 dc.b #5,#5,#5,#5,#5,#5,#5,#5 dc.b #5,#5,#5,#5,#5,#5,#5,#5 dc.b #5,#5,#5,#5,#5,#5,#5,#5 dc.b #5,#5,#5,#5,#5,#5,#5,#5 dc.b #5,#5,#5,#5,#5,#5,#5,#5 dc.b #6,#6,#6,#6,#6,#6,#6,#6 dc.b #6,#6,#6,#6,#6,#6,#6,#6 dc.b #6,#6,#6,#6,#6,#6,#6,#6 dc.b #6,#6,#6,#6,#6,#6,#6,#6 dc.b #6,#6,#6,#6,#6,#6,#6,#6 dc.b #7,#7,#7,#7,#7,#7,#7,#7 dc.b #7,#7,#7,#7,#7,#7,#7,#7 dc.b #7,#7,#7,#7,#7,#7,#7,#7 dc.b #7,#7,#7,#7,#7,#7,#7,#7 dc.b #7,#7,#7,#7,#7,#7,#7,#7 dc.b #8,#8,#8,#8,#8,#8,#8,#8 dc.b #8,#8,#8,#8,#8,#8,#8,#8 dc.b #8,#8,#8,#8,#8,#8,#8,#8 dc.b #8,#8,#8,#8,#8,#8,#8,#8 dc.b #8,#8,#8,#8,#8,#8,#8,#8 dc.b #9,#9,#9,#9,#9,#9,#9,#9 dc.b #9,#9,#9,#9,#9,#9,#9,#9 dc.b #9,#9,#9,#9,#9,#9,#9,#9 dc.b #9,#9,#9,#9,#9,#9,#9,#9 dc.b #9,#9,#9,#9,#9,#9,#9,#9 dc.b #10,#10,#10,#10,#10,#10,#10,#10 dc.b #10,#10,#10,#10,#10,#10,#10,#10 dc.b #10,#10,#10,#10,#10,#10,#10,#10 dc.b #10,#10,#10,#10,#10,#10,#10,#10 dc.b #10,#10,#10,#10,#10,#10,#10,#10 dc.b #11,#11,#11,#11,#11,#11,#11,#11 dc.b #11,#11,#11,#11,#11,#11,#11,#11 dc.b #11,#11,#11,#11,#11,#11,#11,#11 dc.b #11,#11,#11,#11,#11,#11,#11,#11 dc.b #11,#11,#11,#11,#11,#11,#11,#11 dc.b #12,#12,#12,#12,#12,#12,#12,#12 dc.b #12,#12,#12,#12,#12,#12,#12,#12 dc.b #12,#12,#12,#12,#12,#12,#12,#12 dc.b #12,#12,#12,#12,#12,#12,#12,#12 dc.b #12,#12,#12,#12,#12,#12,#12,#12 dc.b #13,#13,#13,#13,#13,#13,#13,#13 dc.b #13,#13,#13,#13,#13,#13,#13,#13 dc.b #13,#13,#13,#13,#13,#13,#13,#13 dc.b #13,#13,#13,#13,#13,#13,#13,#13 dc.b #13,#13,#13,#13,#13,#13,#13,#13 dc.b #14,#14,#14,#14,#14,#14,#14,#14 dc.b #14,#14,#14,#14,#14,#14,#14,#14 dc.b #14,#14,#14,#14,#14,#14,#14,#14 dc.b #14,#14,#14,#14,#14,#14,#14,#14 dc.b #14,#14,#14,#14,#14,#14,#14,#14 dc.b #15,#15,#15,#15,#15,#15,#15,#15 dc.b #15,#15,#15,#15,#15,#15,#15,#15 dc.b #15,#15,#15,#15,#15,#15,#15,#15 dc.b #15,#15,#15,#15,#15,#15,#15,#15 dc.b #15,#15,#15,#15,#15,#15,#15,#15 dc.b #16,#16,#16,#16,#16,#16,#16,#16 dc.b #16,#16,#16,#16,#16,#16,#16,#17 dc.b #17,#17,#17,#17,#17,#17,#17,#17 dc.b #17,#17,#17,#17,#17,#18,#18,#18 dc.b #18,#18,#18,#18,#18,#18,#18,#18 dc.b #18,#18,#18,#19,#19,#19,#19,#19 dc.b #19,#19,#19,#19,#19,#19,#19,#19 dc.b #19,#20,#20,#20,#20,#20,#20,#20 dc.b #20,#20,#20,#20,#20,#20,#20,#20 dc.b #21,#21,#21,#21,#21,#21,#21,#21 dc.b #21,#21,#21,#21,#21,#21,#22,#22 dc.b #22,#22,#22,#22,#22,#22,#22,#22 dc.b #22,#22,#22,#22,#23,#23,#23,#23 dc.b #23,#23,#23,#23,#23,#23,#23,#23 dc.b #23,#23,#24,#24,#24,#24,#24,#24 dc.b #24,#24,#24,#24,#24,#24,#24,#24 dc.b #24,#25,#25,#25,#25,#25,#25,#25 dc.b #25,#25,#25,#25,#25,#25,#25,#26 dc.b #26,#26,#26,#26,#26,#26,#26,#26 dc.b #26,#26,#26,#26,#26,#27,#27,#27 dc.b #27,#27,#27,#27,#27,#27,#27,#27 dc.b #27,#27,#27,#28,#28,#28,#28,#28 dc.b #28,#28,#28,#28,#28,#28,#28,#28 dc.b #28,#29,#29,#29,#29,#29,#29,#29 dc.b #29,#29,#29,#29,#29,#29,#29,#29 dc.b #30,#30,#30,#30,#30,#30,#30,#30 dc.b #30,#30,#30,#30,#30,#30,#31,#31 dc.b #31,#31,#31,#31,#31,#31,#31,#31 dc.b #31,#31,#31,#31,#32,#32,#32,#32 dc.b #32,#32,#32,#32,#32,#32,#32,#32 dc.b #32,#32,#33,#33,#33,#33,#33,#33 dc.b #33,#33,#33,#33,#33,#33,#33,#33 dc.b #33,#34,#34,#34,#34,#34,#34,#34 dc.b #34,#34,#34,#34,#34,#34,#34,#35 dc.b #35,#35,#35,#35,#35,#35,#35,#35 dc.b #35,#35,#35,#35,#35,#36,#36,#36 dc.b #36,#36,#36,#36,#36,#36,#36,#36 dc.b #36,#36,#36,#37,#37,#37,#37,#37 dc.b #37,#37,#37,#37,#37,#37,#37,#37 dc.b #37,#38,#38,#38,#38,#38,#38,#38 dc.b #38,#38,#38,#38,#38,#38,#38,#38 dc.b #39,#39,#39,#39,#39,#39,#39,#39 dc.b #39,#39,#39,#39,#39,#39,#40,#40 dc.b #40,#40,#40,#40,#40,#40,#40,#40 dc.b #40,#40,#40,#40,#41,#41,#41,#41 dc.b #41,#41,#41,#41,#41,#41,#41,#41 dc.b #41,#41,#42,#42,#42,#42,#42,#42 dc.b #42,#42,#42,#42,#42,#42,#42,#42 CPitchType_tbl dc.w 0,0,0 dc.w #Joy_U,#Joy_U,#Joy_U dc.w #Joy_D,#Joy_D,#Joy_D dc.w #Joy_L,#Joy_L,#Joy_L dc.w #Joy_R,#Joy_R,#Joy_R ; 0 down middle, 1 high, 2 low, 3 left, 4 right xdef PlayerPos_EntityNum_tbl PlayerPos_EntityNum_tbl dc.w #Pitcher_ptr,#Pitcher_ptr ; s/r pitcher dc.w #FBaseman_ptr dc.w #SBaseman_ptr dc.w #TBaseman_ptr dc.w #ShortStop_ptr dc.w #LFielder_ptr dc.w #RFielder_ptr dc.w #CFielder_ptr dc.w #Catcher_ptr dc.w #Batter_ptr AFFlipTable dc.w FBaseman_ptr,TBaseman_ptr dc.w SBaseman_ptr,ShortStop_ptr dc.w RFielder_ptr,LFielder_ptr section .text BatRangeTable dc.w BatLowHitRange,BatMidHitRange dc.w BatHighHitRange,BatMidHitRange xdef AI xdef NullLogic xdef BatSwing_000 xdef Pitch_000 xdef Bounds_RL xdef HaloLogic xdef FieldXLogic xdef LookEntityLogic xdef InitialBallLogic xdef BallShadowLogic xdef InitialCatcherLogic xdef InitialPitcherLogic xdef InitialBatterLogic xdef InitialCameraLogic xdef FractionalMultiply xdef InitialFielderLogic xdef InitialRunnerLogic xdef InitialFirstRunLogic xdef InitialSecondLogic xdef InitialThirdLogic *********************************************************************** Cosine MACRO movem.l \1/A0,-(sp) lea.l Cosine_Table,A0 lsl.w #1,\1 move.w (A0,\1.w),\3 muls.w \2,\3 movem.l (sp)+,\1/A0 ENDM Sine MACRO movem.l \1/A0,-(sp) lea.l Sine_Table,A0 lsl.w #1,\1 move.w (A0,\1.w),\3 muls.w \2,\3 movem.l (sp)+,\1/A0 ENDM Atan MACRO movem.l \1/\2/A0,-(sp) lea.l ArcTAN_Table,A0 lsr.l #8,\1 IFEQ ArcTan_Bytes-1 lsr.l #1,\1 ELSEC lsr.l #1,\1 ENDC add.l #$8000,\2 clr.w \2 swap \2 tst.l \2 bne .do_div\@ move.w #0,\3 bra .atx\@ .do_div\@ divu.w \2,\1 cmp.w #$80,\1 blt .adj\@ move.w #$20,\3 jmp .atx\@ .adj\@ sub.w #1,\1 bpl .do_shift\@ clr.w \1 .do_shift\@ IFEQ ArcTan_Bytes-1 move.w \1,\2 and.w #$7E,\1 move.w (A0,\1.w),\3 btst #0,\2 bne .got_atan\@ lsr.w #8,\3 .got_atan\@ and.w #$00FF,\3 ELSEC lsl.w #1,\1 move.w (A0,\1.w),\3 ENDC .atx\@ movem.l (sp)+,\1/\2/A0 ENDM AI movem.l D0-D7/A0-A6,-(sp) move.l sp,StackDebugPtr move.w Num_Entities,D7 NORL cmp.l StackDebugPtr,sp bne NORL lea.l VTentity,A0 sub.l #1,D7 bmi _AI_done move.l D7,D0 asl.l #Index_Shift,D0 * cmp.w #0,VTFon(A0,D0.w) ;is this entity to be processed? * beq NORL ;if not then get the next one cmp.w #2,RunnerExists ble .c1 cmp.w #Batter_ptr,d0 ble .c1 tst.w VTFrend(a0,d0.w) bne .c1 move.w d7,d6 and.w #1,d6 move.w VBlank_cnt,d5 and.w #1,d5 eor.w d5,d6 bne NORL .c1 move.l VTseq_step(A0,D0.w),D1 ;does this entity have AI? beq NORL ;if not then get the next one move.l D1,A1 jmp (A1) ;otherwise do AI _AI_done movem.l (sp)+,D0-D7/A0-A6 rts ***************************************************************************** NullLogic jmp NORL InfOutfline equ SBase_Y-$50000 BILine1y equ #$34 ;20 BILine2y equ #$c Grab_Radius equ $20000 BallSpeed equ $-200000 Pball_x equ 406 Pball_y equ -21 BatHitFrame equ 15 ;18 CheckSwingFrame equ 15 ;18 RBatBoxMin equ $ffcc RBatBoxMax equ $ffe0 ;$ffe5 LBatBoxMin equ $20 ;$1b LBatBoxMax equ $34 PitcherMaxL equ $fffc PitcherMaxR equ $4 BatHitToRunStrip equ $0 SlowPitchSpeed equ $08 SlowPitchSpeedz equ $2 MediumPitchSpeed equ $09 MediumPitchSpeedz equ $2 FastPitchSpeed equ $0b ;a FastPitchSpeedz equ $1 StraightPitch equ $0 RightCurvePitch equ $1 LeftCurvePitch equ $2 UpCurvePitch equ $4 DownCurvePitch equ $8 GroundFriction equ $00000b00 ;500 BatLowHit equ $0 BatMidHit equ $2 BatHighHit equ $4 Bunt equ $6 BatYRangeLow equ $95 ;$082 BatYRangeMid equ $a0 ;$095 BatYRangeHigh equ $0ac *BallRangeHigh equ $0b2 ;off bottom of screen BallRangeHigh equ $0c0 ;off bottom of screen BallMaxX equ $0400 ;off right of screen BallMinX equ $fc00 ;off left of screen HitBoxY equ $095 HitBoxTop equ $0b0 ;90 HitBoxBottom equ $030 HitBoxLeft equ $fff3 HitBoxRight equ $b Fielder_Reach equ $d0 FielderRunSpeed equ $5800 ;10000 Strike equ $0001 Ball equ $ffff HT_Home_Run equ #1 HT_Outf equ #2 HT_Ord equ #0 HT_Foul equ #3 HT_Bunt equ #4 HT_IFPop equ #5 BatLowHitRange equ 124 ;#$48 BatMidHitRange equ 153 ;#$90 BatHighHitRange equ 156 ;#$cb MaxZHeight equ #$400000 ballvscale_lo equ -7 ballvscale_high equ BallRangeHigh ***************************************************************************** WaitOnAnimation tst.w VTFrdir(a0,d0.w) ;if animation not running don't wait beq setnextseq tst.w VTFrend(a0,d0.w) beq .done setnextseq move.l VTNextSeq(a0,d0.w),VTSeq_step(a0,d0.w) clr.w VTFrdir(a0,d0.w) .done jmp NORL ***************************************************************************** WaitOnCatchAnimation jsr checktags tst.w VTFrdir(a0,d0.w) ;if animation not running don't wait beq .setnextseq tst.w VTFrend(a0,d0.w) beq .done .setnextseq move.l VTNextSeq(a0,d0.w),VTSeq_step(a0,d0.w) clr.w VTFrdir(a0,d0.w) .done jmp NORL ************************************************************** xdef HRDerbyLogic HRDerbyLogic tst.w DerbyDone bne .waitstart move.w Fcontrollers,d1 ;allow S to exit hrderby or.w BControllers,d1 btst #Joy_S,d1 beq .r1 lsr.w #8,d1 btst #Joy_S,d1 beq .waitstart .r1 lea.l DerbyBatterNum,a1 add.l BteamAdj,a1 move.w (a1),PlayerAtBat tst.w PlayerAtBat ;QUICK PATCH : FIND BUG IN DOSUBS! bge .bp1 clr.w PlayerAtBat .bp1 tst.w DerbyEvent beq .done jsr DisplayDerbyInfo cmp.w #15,DerbyPitchNum blt .done tst.w NumGamers beq .dr tst.w DerbyPlayer bne .dr jsr Clear_ScrollA .dr jsr DisplayDerbyRanking cmp.w #1,NumGamers ;derby over if 1 player mode blt .derbydone tst.w DerbyPlayer ;or if player 2 is done beq .c1 .derbydone move.w #1,DerbyDone clr.w VTFrdir(a0,d0.w) clr.w FComputer bra .done .c1 move.w #1,NeedNewBatter eor.l #2,FTeamAdj eor.l #2,BTeamAdj move.w BTeamNum,d1 move.w FTeamNum,BTeamNum move.w d1,FTeamNum clr.w DerbyPitchNum clr.w DerbyScore eor.w #1,DerbyPlayer jsr SwitchPlayerPal .done jmp NORL .waitstart clr.w VTfrdir(a0,d0.w) move.w Fcontrollers,d1 or.w BControllers,d1 btst #Joy_S,d1 beq .checkc lsr.w #8,d1 btst #Joy_S,d1 bne .checkc clr.w FComputer ;Reset Controllers clr.l FTeamAdj move.l #2,BTeamAdj clr.w killradarentities clr.w runsht clr.w runsvt move #0,FadeDirection ;Fade Down Field move #2,FadeSpeed clr.w PracticeMode StopSound #S_DIGITALCROWD jsr _Initgems JSR StartFadeDown jsr WaitForFadeUp move.l #VCTRL,A4 *; Macros use these registers move.w #$9000+000000,(A4) ;R16= | 0 | 0 |VS1|VS0| 0 | 0 |HS1|HS0| Scroll Size (00=32,01=64,10=XX,11=128) jmp WarmEntry ;DoGame .checkc btst #Joy_C,d1 beq .done lsr.w #8,d1 btst #Joy_C,d1 bne .done * jsr Clear_ScrollA clr.w DerbyDone clr.w DerbyPitchNum move.w #14,derbypitchnum clr.w DerbyScore move.w #1,DerbyEvent move.w #1,NeedNewBatter move.w #1,FComputer tst.w NumGamers bne .c1 clr.w DerbyPlayer jmp NORL ************************************************************** xdef PracticeModeLogic PracticeModeLogic move.w Fcontrollers,d1 or.w BControllers,d1 btst #Joy_S,d1 beq .c1 lsr.w #8,d1 btst #Joy_S,d1 bne .c1 bset #Joy_S,d1 move.w d1,BControllers move.w d1,FControllers jsr DisplayPractMsg add.w #1,temp4 cmp.w #2,temp4 blt .c1 jmp DoGame .c1 move.w Fcontrollers,d1 or.w BControllers,d1 btst #Joy_C,d1 beq .done lsr.w #8,d1 btst #Joy_C,d1 bne .done move.w #1,temp4 clr.w d1 ;set debounce next round bset #Joy_C,d1 move.w d1,BControllers move.w d1,FControllers eor.l #2,FTeamAdj eor.l #2,BTeamAdj move.w Fcomputer,d1 move.w Bcomputer,Fcomputer move.w d1,Bcomputer jsr DisplayPractMsg .done jmp NORL HeavyCameraLogic movem.l a2,-(sp) lea.l Vtentity+FieldX_ptr,a1 tst.w VTfon(a1) bne _YNotReset * lea.l Vtentity+ball_ent_ptr,a2 * move.l VTsped(a2),d2 * asl.l #4,d2 * move.w VTdir(a2),d1 * jsr GetEndPoint * add.l VTy(a2),d2 * move.l d2,d1 ;leading y coordinate move.l VTy(a0,d0.w),d1 cmp.w #BallHit_ps,Playstage beq .r0 move.w Active_Fielder,d3 ;if ball thrown move.l VTy(a0,d3.w),d1 ;follow active fielder * move.l VTy(a0,d0.w),d1 .r0 sub.l Oldy,d1 bge _DY_Positive asr.l #3,d1 cmp.l #-8*$10000,d1 bge _NDyok move.l #-8*$10000,d1 _NDyok move.l d1,PCamDy bra _CamDyDone _DY_Positive asr.l #3,d1 cmp.l #8*$10000,d1 ble _PDyok move.l #8*$10000,d1 _PDyok move.l d1,PCamDy _CamDyDone move.l Oldy,d1 add.l PCamDy,d1 move.l d1,VTy(a0,d0.w) bra _nowx _YNotReset move.l VTy(a0,d0.w),d1 cmp.w #BallHit_ps,Playstage beq .r1 move.w Active_Fielder,d3 move.l VTy(a0,d3.w),d1 .r1 move.l d1,d2 and.l #$ffff0000,d2 move.l Oldy,d3 and.l #$ffff0000,d3 cmp.l d2,d3 beq _nowx sub.l Oldy,d1 asr.l #4,d1 bpl _YDY_Positive cmp.l NCamDY,d1 bge _NsetNCamDy move.l NCamDy,d1 cmp.l #-8*$10000,d1 ble _YNDyok sub.l #$4000,d1 _NSetNCamDY move.l d1,NCamDy _YNDyok move.l d1,PCamDy bra _YCamDyDone _YDY_Positive cmp.l NCamDY,d1 ble _PSetNCamDY move.l NCamDy,d1 cmp.l #8*$10000,d1 bge _YPDyok add.l #$4000,d1 _PSetNCamDY move.l d1,NCamDY _YPDyok move.l d1,PCamDy _YCamDyDone move.l Oldy,d1 add.l PCamDy,d1 move.l d1,VTy(a0,d0.w) _nowx tst.w VTFon(a1) bne _XNotReset * lea.l Vtentity+ball_ent_ptr,a2 * move.l VTsped(a2),d2 * asl.l #4,d2 * move.w VTdir(a2),d1 * jsr GetEndPoint * add.l VTx(a2),d1 ;leading x Coordinate move.l Vtx(a0,d0.w),d1 cmp.w #BallHit_ps,Playstage beq .r2 move.w Active_Fielder,d3 move.l VTx(a0,d3.w),d1 .r2 * move.l Vtx(a0,d0.w),d1 sub.l Oldx,d1 bge _DX_Positive asr.l #3,d1 cmp.l #-16*$10000,d1 ;16 bge _NDxok move.l #-16*$10000,d1 ;16 _NDxok move.l d1,PCamDx bra _CamDxDone _DX_Positive asr.l #3,d1 cmp.l #16*$10000,d1 ;16 ble _PDxok move.l #16*$10000,d1 ;16 _PDxok move.l d1,PCamDx _CamDxDone move.l Oldx,d1 add.l PCamDx,d1 move.l d1,VTx(a0,d0.w) bra .done _XNotReset move.l VTx(a0,d0.w),d1 cmp.w #BallHit_ps,Playstage beq .r3 move.w Active_Fielder,d3 move.l VTx(a0,d3.w),d1 .r3 move.l d1,d2 and.l #$ffff0000,d2 move.l Oldx,d3 and.l #$ffff0000,d3 cmp.l d2,d3 beq .done sub.l Oldx,d1 asr.l #4,d1 bge _XDX_Positive cmp.l NCamDX,d1 bge _NsetNCamDx move.l NCamDx,d1 cmp.l #-16*$10000,d1 ;16 ble _XNDxok sub.l #$4000,d1 _NSetNCamDX move.l d1,NCamDx _XNDxok move.l d1,PCamDx bra _XCamDxDone _XDX_Positive cmp.l NCamDX,d1 ble _PSetNCamDX move.l NCamDx,d1 cmp.l #16*$10000,d1 ;16 bge _XPDxok add.l #$4000,d1 _PSetNCamDX move.l d1,NCamDX _XPDxok move.l d1,PCamDx _XCamDxDone move.l Oldx,d1 add.l PCamDx,d1 move.l d1,VTx(a0,d0.w) .done movem.l (sp)+,a2 rts InitialCameraLogic tst.w PanBack bne _ResetCamera tst.w InPitcherIF bne .done tst.w Catcherreturn bne .done bra _movewithball .done jmp NORL _movewithball tst.w BallLocation beq .chbs lea.l VTentity,a1 moveq.l #0,d1 move.w Balllocation,d1 asl.w #8,d1 add.l d1,a1 bra .smove .chbs lea.l VTEntity+BallShadow_Ent_ptr,a1 cmp.w #HT_Home_Run,Hittype bne .smove lea.l VTentity+Ball_ent_ptr,a1 ;follow ball bra .smove .smove * lea.l VTentity+Batter_ptr,a1 move.w #0,d0 lea.l VTentity,a0 move.w #1,d4 move.w VTx(a1),VTx(a0) move.w VTy(a1),VTy(a0) lea.l VTentity+FieldX_ptr,a1 tst.w VTfon(a1) beq .hcl move.w VTx(a1),VTx(a0) move.w VTy(A1),VTy(a0) .hcl jsr HeavyCameraLogic jsr ScrollXY .done lea.l Vtentity,a0 move.w #0,d0 move.l VTy(a0,d0.w),Oldy move.l VTx(a0,d0.w),Oldx jmp NORL _ResetCamera lea.l VTentity+ballshadow_ent_ptr,a1 move.w #3,VTx(a1) move.w #110,VTy(a1) move.w #CamULC_X,d0 move.w #CamULC_Y,d1 jsr StepPanCamera1 cmp.w #CamULC_X,Map_ULC_X bne .done cmp.w #CamULC_Y,Map_ULC_Y bne .done clr.w PanBack lea.l Vtentity,a0 move.w #CamCenterX,Vtx(a0) move.w #CamCentery,Vty(a0) move.w #CamCenterX,oldx move.w #CamCenterY,oldy .done jmp NORL setcamxy movem.l d1/a0-a1,-(sp) lea.l Vtentity,a0 lea.l VTentity+Ball_ent_ptr,a1 move.w VTx(a1),d1 add.w Map_Center_X,D1 sub.w #128,d1 move.w d1,VTx(a0) move.l VTy(a1),d1 sub.w #16,d1 add.w Map_Center_Y,D1 sub.w #110,d1 move.w d1,VTy(a0) movem.l (sp)+,d1/a0-a1 rts *_ResetCamera * clr.w PanBack * lea.l Field_Map,A0 * move.w #CamULC_X,D0 * move.w #CamULC_Y,D1 * jsr load_field * jmp NORL StepPanCamera1 * D0 = target x position * D1 = target y position * * Note: No bounds checking, scroll routines will not * scroll off screen, but camx,camy will get screwed up move.w d1,d6 sub.w Map_ULC_Y,d6 ; Targy - MapULCY = distanceY beq .panx bgt .pand ; if positive pan down neg.w d6 ; distanceY = abs(distanceY) move.w PanSpeed,d5 sub.w #8,d5 cmp.w d5,d6 * cmp.w PanSpeed,d6 ; move max 8 pixels this step ble .sfu1 move.w PanSpeed,d6 sub.w #8,d6 .sfu1 jsr scroll_field_up bra .panx .pand move.w PanSpeed,d5 sub.w #8,d5 cmp.w d5,d6 * cmp.w PanSpeed,d6 ble .sfd1 move.w PanSpeed,d6 sub.w #8,d6 .sfd1 jsr scroll_field_down .panx move.w d0,d6 ;get ball x sub.w Map_ULC_X,d6 beq .done bge .panr neg.w d6 cmp.w PanSpeed,d6 ble .sfl1 move.w PanSpeed,d6 .sfl1 jsr scroll_field_left bra .done .panr cmp.w PanSpeed,d6 ble .sfr1 move.w PanSpeed,d6 .sfr1 jsr scroll_field_right .done rts ScrollXY movem.l d6/a1,-(sp) lea.l vtentity,a1 move.w VTy(a1),d6 sub.w #16,d6 add.w Map_Center_Y,D6 sub.w #110,d6 sub.w Map_ULC_Y,d6 ; Targy - MapULCY = distanceY beq .panx bgt .pand ; if positive pan down neg.w d6 ; distanceY = abs(distanceY) move.w PanSpeed,d5 sub.w #8,d5 cmp.w d5,d6 ble .sfu1 move.w PanSpeed,d6 sub.w #8,d6 .sfu1 jsr scroll_field_up bra .panx .pand move.w PanSpeed,d5 sub.w #8,d5 cmp.w d5,d6 ble .sfd1 move.w PanSpeed,d6 sub.w #8,d6 .sfd1 jsr scroll_field_down .panx tst.w HScrol</div> Of course, it's incomplete (cuts off). But it's a lot, heh. Got anymore? :P
Yay here's some more, this is from Wayne Gretzsky NHLPA All-Stars (GEN): Code (ASM): CODEPLACE ; PLOTTING SHADOWS!; MOVE.L #DUDVAR,A5 ; GET POINTER TO SECTION MOVE.W #DUDCHUNKIND,D5 ; INDEX!; .PS1 TST.W (A5,D5) ; CHECK IF PLAYER ON BEQ.S .NOSHAD TST.W DUDSHADFR(A5,D5) BEQ.S .NOSHAD ; SKIP IF NO SHADOW TO PLOT!; MOVE DUDX(A5,D5),D0 MOVE DUDYS(A5,D5),D1 BEQ.S .NOSHAD ; IF Y = 0- SKIP HIM LSR.W #PSHIFT,D0 ; SAVE Y VALUE OF PUCK!; SUB D2,D1 ; GET POSITION OF PUCK LESS ALTITUDE MOVE.W D1,SPY SUB WINDOWX,D0 ; GET WINDOWY MOVE.W D0,SPX ;; MOVE PUCKFR,D0 ; AND PLOT THE PUCKER!; ;; JSR SAFEVIDEO_PLOT ; GENERAL PLOT TO VIDEO TAPE!; ; JSR SAFEGENERAL_PLOT POP D1 TST.W PERIODOVER ; IF REGULAR PERIOD OVER!; BNE.S .SKIPSHAD MOVE.W D1,SPY MOVE #$5,D0 ; AND PLOT THE SHADOW!; BSR SAFEVIDEO_PLOT ; GENERAL PLOT TO VIDEO TAPE!; .SKIPSHAD RTS XDEF INITDUDELIST INITDUDELIST CLR.W PTEMP MOVE #(NUMDUDS+2)*2,D2 ; MAKE BIGGER FOR PUCK AND GOALS.... MOVE.L #PLOTDUDELIST,A1 ; GET PLOT LIST!; .ID2 MOVE.W PTEMP,D0 ADD #$80,PTEMP MOVE D0,(A1)+ ; SAVE WHICH GUY TO PLOT!; SUBQ #2,D2 ; ONE LESS GUY!; BPL.S .ID2 ; NOT DONE YET!; MOVE.W #$FFFF,(A1)+ ; FLAG FOR END!; RTS SORTDUDES ; OK- THIS ONE GOES THROUGH DUDES AND JUST REA-ARRANGES THEM ONE AT A TIME... MOVE.L #DUDVAR,A5 ; GET POINTER TO SECTION tst.w gamenum beq.s .MAINGAME ; UHH- HERE CLEAR ALL PUCKX AND THAT SHIT... MOVE.W #LGOALDUD,D5 ; POINT TO LEFT GOAL... CLR.W DUDYS(A5,D5) CLR.W DUDFR(A5,D5) MOVE.W #RGOALDUD,D5 ; POINT TO LEFT GOAL... CLR.W DUDYS(A5,D5) CLR.W DUDFR(A5,D5) MOVE.W #PUCKDUD,D5 ; POINT TO LEFT GOAL... CLR.W DUDYS(A5,D5) CLR.W DUDFR(A5,D5) BRA .SORTEM .MAINGAME MOVE.W #LGOALDUD,D5 ; POINT TO LEFT GOAL... MOVE.W GOALX,D0 ASL #PSHIFT,D0 MOVE.W D0,DUDX(A5,D5) MOVE.W GOALY,D0 ASL #PSHIFT,D0 MOVE D0,DUDYS(A5,D5) ADD D0,D0 MOVE D0,DUDY(A5,D5) MOVE.W #4,DUDFR(A5,D5) MOVE.W #RGOALDUD,D5 ; POINT TO LEFT GOAL... MOVE.W GOALX+2,D0 ASL #PSHIFT,D0 MOVE.W D0,DUDX(A5,D5) MOVE.W GOALY+2,D0 ASL #PSHIFT,D0 MOVE D0,DUDYS(A5,D5) ADD D0,D0 MOVE D0,DUDY(A5,D5) MOVE.W #4+FLIP,DUDFR(A5,D5) MOVE.W #PUCKDUD,D5 ; POINT TO LEFT GOAL... ; MOVE.W #RGOALDUD,D5 ; POINT TO LEFT GOAL... MOVE.W PUCKX,DUDX(A5,D5) MOVE.W PUCKY,D0 MOVE.W D0,DUDY(A5,D5) SUB.W PUCKA,D0 ; TAKE OFF ALTITUDE!; LSR #1,D0 MOVE.W D0,DUDYS(A5,D5) MOVE.W PUCKFR,DUDFR(A5,D5) .SORTEM ; ANYWAYS SORT THE DAMN THING... MOVE.L #PLOTDUDELIST,A1 ; GET PLOT LIST!; .SDL MOVE.W (A1),D5 ; GET GUY.... MOVE.W 2(A1),D4 ; GET OTHER GUY!; BMI.S .SWAPDONE ; OK- DONE... MOVE DUDY(A5,D5),D0 CMP DUDY(A5,D4),D0 BHS .NOSWAP ; equal no swap!; ; WOW!; SWAP THEM!; MOVE D4,(A1) MOVE D5,2(A1) .NOSWAP ADDQ.L #2,A1 ; GO TO NEXT... BRA .SDL .SWAPDONE RTS ; END OF FILE ; COACH.A - ; ; ; HANDLES PAUSED OPTIONS AND COACHING OPTIONS DURING GAMEPLAY!; OPT NOABSPCADD,E,NOCASE NAME FLUFF ; SO LINE CHANGE CAN BE CALLED FROM COACHING SCREEN!; INCLUDE S:ASM.INC INCLUDE S:DMA.INC INCLUDE S:SOUNDS.INC SECTION CODE,,C XREF _gemspauseall XREF _gemsresumeall XREF SAVELINES ; OK- SAVE THE LINES XREF CLEARRVSCREEN XREF CLEARLVSCREEN XREF FROMCOACHLINE0 XREF FROMCOACHLINE1 XREF SETSTATS XREF CLEARMOSTVSCREEN XREF CLEARVSCREEN XREF CLEARSCREENA XREF CLEARSCREENB XREF SETALLPAL Here's some more from the same game: Code (ASM): MYIFL MACRO P1,P2,P3 CMP.W P2,P1 BLO.S P3 ENDM ;/* LONG JUMP IF LESS */ MYIFLL MACRO P1,P2,P3 CMP.W P2,P1 BLO P3 ENDM ; IF LESS THAN!; */ MYIFLE MACRO P1,P2,P3 CMP.W P2,P1 BLS.S P3 ENDM ; DOES A QUICKY COMPARISON!; */ MYIFG MACRO P1,P2,P3 CMP.W P2,P1 BHI.S P3 ENDM MYIFGL MACRO P1,P2,P3 CMP.W P2,P1 BHI P3 ENDM MYIFGE MACRO P1,P2,P3 CMP.W P2,P1 BHS.S P3 ENDM MYIFNE MACRO P1,P2,P3 CMP.W P2,P1 BNE.S P3 ENDM BOXCHECK MACRO X,Y,LEFT,RIGHT,TOP,BOTTOM LOCAL .NOTHIT,.BCDONE MYIFL X,LEFT,.NOTHIT MYIFG X,RIGHT,.NOTHIT MYIFL Y,TOP,.NOTHIT MYIFG Y,BOTTOM,.NOTHIT SETEQ BRA.S .BCDONE .NOTHIT SETNE .BCDONE ENDM RANGERLH MACRO REG,LOW,HIGH LOCAL L1,L2 ; CHECKS IF SOMETHING IN RANGE!; IFL LOW,REG,L1 ; IF WAY PAST THEN WRAPPED UNDER- NOT NEGATIVE!; MOVE.W LOW,REG ; IF SO, STOP!; BRA.S L2 ; WHY NEEDED? L1: IFG HIGH,REG,L2 ; IS IT LOWER THAN BOTTOM THEN KOSHER!;? MOVE.W HIGH,REG
Code (Text): ; UHH- HERE CLEAR ALL PUCKX AND THAT SHIT... Man, these guys are just as professional with their commenting as I am =P
Huge amount of source code for Dragon's Lair (EU) NES (aka the terrible game that AVGN reviewed a few years back): Code (ASM): ;-------------------------------------- B3B_END IF B3B_END>$BFFF PRINTF "**** BANK $3B too long !! ****" ENDIF ; End of bank $3A/$3B ; --- -- ---- ------- ;====================================== ; Start of bank $39 ; ----- -- ---- --- ORG $139,$A000 ;-------------------------------------- ; Sprite attribute tables ; ------ --------- ------ SPR3_ATAB_L DL A_B0 DL A_B1 DL A_B2 DL A_B3 DL A_B4 DL A_B5 DL A_B6 DL A_B7 DL A_B8 DL A_B9 DL A_B10 DL A_B11 DL A_B12 DL A_B13 DL A_B14 DL A_B15 DL A_B16 DL A_B17 DL A_B18 DL A_B19 DL A_B20 DL A_B21 DL A_B22 DL A_B23 DL A_B24 DL A_B25 DL A_B26 DL A_B27 DL A_B28 DL A_B29 DL A_B30 DL A_B31 DL A_B32 DL A_B33 SPR3_ATAB_H DH A_B0 DH A_B1 DH A_B2 DH A_B3 DH A_B4 DH A_B5 DH A_B6 DH A_B7 DH A_B8 DH A_B9 DH A_B10 DH A_B11 DH A_B12 DH A_B13 DH A_B14 DH A_B15 DH A_B16 DH A_B17 DH A_B18 DH A_B19 DH A_B20 DH A_B21 DH A_B22 DH A_B23 DH A_B24 DH A_B25 DH A_B26 DH A_B27 DH A_B28 DH A_B29 DH A_B30 DH A_B31 DH A_B32 DH A_B33 A_B0 DS 34,2 DS 22,1 DS 8,0 A_B1 DS 31,2 DS 24,1 DS 9,0 A_B2 DS 34,2 DS 25,1 DS 5,0 A_B3 DS 21,2 DS 16,1 DS 7,2 DS 8,1 DS 12,0 A_B4 DS 9,2 DS 12,1 DS 1,0 DS 18,2 DS 24,1 A_B5 DS 28,2 DS 31,1 DS 5,0 A_B6 DS 31,2 DS 21,1 DS 12,0 A_B7 DS 28,2 DS 23,1 DS 13,0 A_B8 DS 9,2 DS 15,1 DS 1,0 DS 24,2 DS 15,1 A_B9 DS 37,2 DS 20,1 DS 7,0 A_B10 DS 14,2 DS 10,1 DS 40,0 A_B11 DS 25,0 DS 11,2 DS 25,1 DS 3,0 A_B12 DS 15,2 DS 36,1 DS 13,0 A_B13 DS 9,2 DS 17,1 DS 1,0 DS 16,2 DS 21,1 A_B14 DS 31,2 DS 31,1 DS 2,0 A_B15 DS 9,2 DS 13,1 DS 1,0 DS 18,2 DS 23,1 A_B16 DS 29,2 DS 32,1 DS 3,0 A_B17 DS 12,2 DS 17,1 DS 1,0 DS 8,2 DS 22,1 DS 4,0 A_B18 DS 13,0 DS 6,1 DS 45,0 A_B19 DS 18,0 DS 2,1 DS 34,3 DS 10,1 A_B20 DS 52,3 DS 12,1 A_B21 DS 64,0 A_B22 DS 46,1 DS 18,0 A_B23 DS 11,0 DS 20,1 DS 10,2 DS 23,3 A_B24 DS 25,0 DS 23,3 DS 16,0 A_B26 DS 58,0 DS 6,1 A_B33 A_B27 DS 64,1 A_B28 DS 15,3 DS 17,0 DS 32,1 A_B29 DS 11,0 DS 20,2 DS 33,3 A_B30 DS 18,3 DS 46,0 A_B31 A_B25 DS 64,3 A_B32 DS 32,2 DS 23,1 DS 9,0 ;-------------------------------------- ; Gold bonus screen ; ---- ----- ------ ; IN ; -- ; A = 0-No bonus , 1-Normal bonus , 2-Big bonus G_BONUS1 TAX BNE !1 ;No bonus RTS !1 LDA #3 ;Preload with start adding to DEX ;10's digit. BEQ !2 LDA #2 ;Change to adding to 100's !2 ;digit. STA ZPAGE_BYTE9 ;Store which digit to start ;adding to. LDA PL_GOLD ORA PL_GOLD+1 ;Don't do gold bonus if no ORA PL_GOLD+2 ;gold. CMP #246 BNE !3 RTS !3 LDA #0 STA N_COLAP_CHR STA N_BONUS_FLAG JSR SET_S0 LDA #128 ;Stop music JSR START_TUNE JSR DISABLE_NC LDA #GR_1ST+24 ;Background bank for chrs STA N_BG_BANK1 LDA #GR_1ST+24+2 STA N_BG_BANK2 LDA #PAL_1 JSR CLS LDA #21 ;'GOLD BONUS' JSR DRAW_SCR39 JSR D_GB ;Draw gold bars JSR ENABLE_CN LDA #$FF STA CDF_A1+1 JSR SPR_CLEAR ;All sprite off screen LDA #39 ;Put on split CHR STA $200 ;Y LDA #64 STA $201 ;Character LDA #BIT5 STA $202 ;Ctr LDA #16 STA $203 ;X LDA #1 STA N_DMA_FLAG WAIT_FRAME JSR ENABLE_SPR LDX #0 JSR FADE_IN LDX #20 ;Wait before starting JSR M_WAIT_FRAME LDY #>SCR_START+(32*16)+10-2 LDX #<SCR_START+(32*16)+10-2 LDA PL_GOLD+2 ;1's of gold JSR GB_R LDY #>SCR_START+(32*20)+10-2 LDX #<SCR_START+(32*20)+10-2 LDA PL_GOLD+1 ;10's of gold JSR GB_R LDY #>SCR_START+(32*24)+10-2 LDX #<SCR_START+(32*24)+10-2 LDA PL_GOLD ;100's of gold JSR GB_R LDX #80 ;Wait before exiting JSR M_WAIT_FRAME LDX #0 JSR FADE_OUT RTS ;------------------ ; Draw gold bonus bars D_GB LDA #13 ;X1,X10,X100 JSR PR_STR_TAB LDA #14 JSR PR_STR_TAB LDA #15 JSR PR_STR_TAB LDY #>SCR_START+(32*16)+10 LDX #<SCR_START+(32*16)+10 LDA PL_GOLD+2 ;1's of gold JSR GB_D LDY #>SCR_START+(32*20)+10 LDX #<SCR_START+(32*20)+10 LDA PL_GOLD+1 ;10's of gold JSR GB_D LDY #>SCR_START+(32*24)+10 LDX #<SCR_START+(32*24)+10 LDA PL_GOLD ;100's of gold JSR GB_D RTS ;------------------ ; Draw a highlighted bar ; IN ; -- ; X - LSB Screen address of bar left ; Y - MSB Screen address of bar left ; A = Number in bar GB_D PHA LDA #0 STA ZPAGE_BYTE11 PLA SEC SBC #246 STA ZPAGE_BYTE10 ;Number highlighted BEQ !1 LDA #PAL_1 STA PR_ATTR ; Draw highlighted ones !2 JSR D_G2X2 INC ZPAGE_BYTE11 ;Number drawn DEC ZPAGE_BYTE10 BNE !2 ; Draw unhighlighted ones !1 LDA #PAL_3 STA PR_ATTR !4 LDA ZPAGE_BYTE11 CMP #10 BNE !3 RTS !3 JSR D_G2X2 INC ZPAGE_BYTE11 JMP !4 ; Draw a gold 2x2 ; ---- - ---- --- D_G2X2 STX ZPAGE_WORD1 STY ZPAGE_WORD1+1 ; Set attribute LDA PR_ATTR JSR SET_SCR_ATTR ;Set attribute for quad LDX ZPAGE_WORD1 LDY ZPAGE_WORD1+1 ; Draw top line STY VDP_VRAM_PTR STX VDP_VRAM_PTR LDA #$69 STA VDP_VRAM_DATA LDA #$6A STA VDP_VRAM_DATA ; Downline and draw second line TXA CLC ADC #32 TAX BCC !1 INY !1 STY VDP_VRAM_PTR STX VDP_VRAM_PTR LDA #$6B STA VDP_VRAM_DATA LDA #$6C STA VDP_VRAM_DATA LDX ZPAGE_WORD1 LDY ZPAGE_WORD1+1 INX INX RTS ;------------------ ; Clear a bar ; IN ; -- ; X - LSB Screen address of bar left ; Y - MSB Screen address of bar left ; A - Number in bar to start with GB_R SEC SBC #246 STA ZPAGE_BYTE10 STY ZPAGE_WORD11+1 STX ZPAGE_WORD11 !3 LDA ZPAGE_BYTE10 BEQ !5 ASL A ;Icons 2 chrs wide !1 LDY ZPAGE_WORD11+1 ;Add offset to screen address ADC ZPAGE_WORD11 TAX JSR CON_SCR_ATTR ;Calc attribute address STX N_BONUS_AADR ;Set up NMI to draw attribute STY N_BONUS_AADR+1 STA N_BONUS_ATTR ;PAL_3 in rlevant bits EOR #$FF STA N_BONUS_AMASK ;Hole for attribute LDA #1 STA N_BONUS_FLAG STA N_BG_FLAG LDA #24 STA ZPAGE_BYTE11 LDA #1 ;Add to score LDY ZPAGE_BYTE9 JSR SC_ADD LDY #18 ;Make sound FX JSR FX_TRIGGER !4 JSR PANEL_SCAN LDA #1 STA N_BG_FLAG WAIT_FRAME DEC ZPAGE_BYTE11 BNE !4 DEC ZPAGE_BYTE10 BNE !3 !5 DEC ZPAGE_BYTE9 RTS ;-------------------------------------- ; Setup NMI vars to change score digits ; ----- --- ---- -- ------ ----- ------ ; Scan the scores,lives and gold and if any need changing then ; setup one digit to be changed. PANEL_SCAN LDA N_P_FLAG BEQ !1 ;Still waiting for update RTS !1 ; Scan current player score,gold or lives LDX #PL_VARS_LEN-1 PS_LP LDA PL_SC,X CMP PL_DATA_SO,X ;Search for any differences BNE PS_FND DEX BPL PS_LP ; Scan dormat players score LDX #5-1 ;Just do score PS_LP2 LDA PL_SC+P_VARS_LEN,X CMP PL2_DATA_SO,X ;Search for any differences BNE PS_FND1 DEX BPL PS_LP2 RTS PS_FND1 STA PL2_DATA_SO,X ;Set onscreen for pl 2 score SEC SBC #246-$0A STA N_P_CHR ;Set character to draw LDA PL_NUM BNE PS_SNMI ;This is player 1's score(Lft) JMP PS_RGT ;This is player 2's score(Rgt) PS_FND STA PL_DATA_SO,X ;Set onscreen var SEC SBC #246-$0A STA N_P_CHR ;Set character to draw LDA PL_NUM BEQ PS_SNMI ;This is player 1's score(Lft) ;This is player 2's score(Rgt) PS_RGT TXA CMP #5 ;If Gold or lives alternate BCS !1 ;with whoose go it is CLC ADC #PL_VARS_LEN ;If score swap their sides TAX !1 ; Setup vars to get NMI to draw a score digit. PS_SNMI LDA P_ATAB,X STA N_P_SADR LDA #>SCR_START STA N_P_SADR+1 LDA #1 STA N_P_FLAG RTS ; Screen address offset table P_ATAB DB 96+96+9 ;Player 1 score DB 96+96+10 DB 96+96+11 DB 96+96+12 DB 96+96+13 DB 96+64+24 ; Gold DB 96+64+25 DB 96+64+26 DB 96+64+5 ; Lives DB 96+64+6 DB 96+96+18 ;Player 2 score DB 96+96+19 DB 96+96+20 DB 96+96+21 DB 96+96+22 Here's the largest chunk: Code (ASM): XSPEED STA D_VARS+D_XSP_OFF+1,X LDA ZPAGE_BYTE2 AND #SDC_DOWN BNE DI_CRAWLING_R ; Throw while standing up facing right LDA DIRK_X_ONSCR CLC ;Setup dagger starting X ADC #24 BCS !1 CMP #230 BCC !2 !1 RTS ; Error, Off edge !2 STA D_VARS+D_X_OFF,X LDA DIRK_Y SEC SBC #52 STA D_VARS+D_Y_OFF,X JMP DI_XVXY_END ; Throw while crawling right DI_CRAWLING_R LDA DIRK_X_ONSCR CLC ADC #38 BCC !1 RTS ; Error, Off edge !1 STA D_VARS+D_X_OFF,X LDA DIRK_Y SEC SBC #31 STA D_VARS+D_Y_OFF,X DI_XVXY_END LDA D_E_FRAC ;Subtract energy from Dirk CLC ;for each weapon thrown ADC #16 STA D_E_FRAC BCC !1 LDA #-1 JSR DIRK_NRG_ADD !1 LDY #1 ;Preload with normal dagger FX LDX WEAPON_TYPE DEX BNE !2 LDY #15 ;Axe throw FX !2 JMP FX_TRIGGER ;and 'RTS' ;------------------ ; Process all currently running daggers D_PROCESS LDX #2*D_VAR_LEN ;Offset to current dagger vars DP_LOOP LDA D_VARS+D_X_OFF,X BEQ16 DP_END ;This dagger isn't on LDA #D_GRAVITY CLC ADC D_VARS+D_YSP_OFF,X STA D_VARS+D_YSP_OFF,X ;Add gravity to BCC !1 ;speed INC D_VARS+D_YSP_OFF+1,X !1 CLC ADC D_VARS+D_YF_OFF,X STA D_VARS+D_YF_OFF,X ;Add Y speed to Yf LDA D_VARS+D_YSP_OFF+1,X ;and Y ADC D_VARS+D_Y_OFF,X STA D_VARS+D_Y_OFF,X LDA D_VARS+D_YSP_OFF+1,X BMI BP_STILL_GOING CMP #7 BCC BP_STILL_GOING ; Stop this dagger BP_STOP LDA #0 ;the end STA D_VARS+D_X_OFF,X ;If so,stop dagger JMP DP_END BP_STILL_GOING LDA D_VARS+D_XSP_OFF,X CLC ;Add X speed to ADC D_VARS+D_XF_OFF,X ;dagger X STA D_VARS+D_XF_OFF,X LDA D_VARS+D_XSP_OFF+1,X ADC D_VARS+D_X_OFF,X CMP #255-(D_XSPEED/256) BCS BP_STOP ;Gone off edge of STA D_VARS+D_X_OFF,X ;screen LDA D_VARS+D_TYP_OFF,X BEQ16 DP_DAG_SP ; Draw an axe and fireball DP_AF_SP LDA D_VARS+D_X_OFF,X STA ZPAGE_WORD5 LDA D_VARS+D_Y_OFF,X STA ZPAGE_WORD6 ;Setup X and Y's LDA #0 STA ZPAGE_WORD5+1 STA ZPAGE_WORD6+1 LDA D_VARS+D_TYP_OFF,X CMP #1 BEQ DP_AXE_SP ;Axe specific draw ; Specific draw for fireball LDA D_VARS+D_ANI_OFF,X CMP #3 BCC DP_FB_AOK LDA #0 DP_FB_AOK TAY ;Animate the fireball CLC ADC #1 STA D_VARS+D_ANI_OFF,X LDA D_VARS+D_XSP_OFF+1,X BMI DP_FB_LEFT SET16 ZPAGE_WORD2,DP_FB_LDEF LDA #BIT6 JMP DP_FB_DEF_END DP_FB_LEFT SET16 ZPAGE_WORD2,DP_FB_RDEF LDA #0 DP_FB_DEF_END STX ZPAGE_BYTE10 ;Preserve X TAX ;Setup X for SPR_DRAW TYA ASL A STA ZPAGE_BYTE1 ASL A CLC ;6 bytes per animation ADC ZPAGE_BYTE1 ;entry. ADD16_A ZPAGE_WORD2 LDA #128+1 ;Window number JSR SPR3_DRAW_39 ;Draw sprite LDX ZPAGE_BYTE10 ;Restore X JMP DP_END ; Specific draw for axe DP_AXE_SP LDA D_VARS+D_ANI_OFF,X CMP #4 BCC DP_AXE_AOK LDA #0 DP_AXE_AOK TAY ;Animate the dagger CLC ADC #1 STA D_VARS+D_ANI_OFF,X LDA D_VARS+D_XSP_OFF+1,X BMI DP_AXE_LEFT SET16 ZPAGE_WORD2,DP_AXE_LDEF LDA #0 JMP DP_AXE_DEF_END DP_AXE_LEFT SET16 ZPAGE_WORD2,DP_AXE_RDEF LDA #BIT6 DP_AXE_DEF_END STX ZPAGE_BYTE10 ;Preserve X TAX ;Setup X for SPR_DRAW TYA ASL A STA ZPAGE_BYTE1 ASL A CLC ;6 bytes per animation ADC ZPAGE_BYTE1 ;entry. ADD16_A ZPAGE_WORD2 LDA #128+1 ;Window number JSR SPR3_DRAW_39 ;Draw sprite LDX ZPAGE_BYTE10 ;Restore X JMP DP_END ; Draw a dagger DP_DAG_SP LDY #0 LDA D_VARS+D_Y_OFF,X STA (SD_PAGE_PTR),Y ;Setup Y of dagger sprites LDY #4 STA (SD_PAGE_PTR),Y LDA D_VARS+D_X_OFF,X DEY ; Y=3 STA (SD_PAGE_PTR),Y ;Setup X of dagger sprites CLC ADC #8 LDY #7 STA (SD_PAGE_PTR),Y LDA D_VARS+D_XSP_OFF+1,X BMI DP_CHR_LEFT ; Setup dagger characters for going right LDA #$14+64 LDY #1 STA (SD_PAGE_PTR),Y ;Characters LDA #$13+64 LDY #5 STA (SD_PAGE_PTR),Y LDA #0+SPR_CTR_X_FLIP JMP DP_CHR_SEND ; Setup dagger characters for going left DP_CHR_LEFT LDA #$13+64 LDY #1 STA (SD_PAGE_PTR),Y ;Characters LDA #$14+64 LDY #5 STA (SD_PAGE_PTR),Y LDA #0 DP_CHR_SEND LDY #2 STA (SD_PAGE_PTR),Y ;Attribute LDY #6 STA (SD_PAGE_PTR),Y LDA SD_PAGE_PTR ;Move over 2 sprites CLC ADC #8 BNE !1 LDA #4 !1 STA SD_PAGE_PTR DP_END TXA SEC ;Move to next daggers vars SBC #D_VAR_LEN TAX BCS16 DP_LOOP JMP SET_NORM_BANK ;and 'RTS' ;-------------------------------------- ; Cameo screens ; ----- ------- CAMEO LDA #128 ;Stop tune playing JSR START_TUNE LDX SCR_NUM ;Setup BG bank LDA CAM_B_TAB,X BEQ !1 STA N_BG_BANK1 CLC ADC #2 STA N_BG_BANK2 WAIT_FRAME LDA VDP_CTR_VAR0 ;Force screen 1 AND #NOT-HORI_SWAP ;to get rid of the STA VDP_CTR_VAR0 ;dash. STA VDP_CTR_REG0 LDA #-1 LDX SCR_NUM DEX BEQ !2 ;Don't scroll entrance cameo LDA #-6 !2 STA N_SC_X JSR DISABLE_NC ;Turn off NMI and CHR's LDA #PAL_1 JSR CLS ;Clear screen LDX SCR_NUM ;Draw screen LDA CAM_S_TAB,X JSR S7_DS LDX SCR_NUM ;Draw attributes LDA CAM_A_TABL,X STA ZPAGE_WORD1 LDA CAM_A_TABH,X STA ZPAGE_WORD1+1 SET_VRAM_PTR 27C8 LDX #56 JSR SI_SET_ATTR2 LDA #0 ;Leave dash on other screen STA N_SPLIT JSR ENABLE_CN LDX SCR_NUM LDA CAM_F_TAB,X PHA TAX JSR FADE_IN LDX #100 ;Wait for 100 frames JSR M_WAIT_FRAME PLA TAX JSR FADE_OUT !1 RTS CAM_B_TAB DB 0 ; 0 - Drawbridge DB GR_1ST+38 ; 1 - Entrance hall DB GR_1ST+42 ; 2 - Mines DB GR_1ST+46 ; 3 - Reaper DB 0 ; 4 - DB GR_1ST+50 ; 5 - Singe DB 0 ; 6 - Elevator DB 0 ; 7 - Treasury DB 0 ; 8 - Dungeon CAM_S_TAB DB 0 ; 0 - Drawbridge DB 31 ; 1 - Entrance hall DB 32 ; 2 - Mines DB 33 ; 3 - Reaper DB 0 ; 4 - DB 35 ; 5 - Singe DB 0 ; 6 - Elevator DB 0 ; 7 - Treasury DB 0 ; 8 - Dungeon CAM_F_TAB DB 0 ; 0 - Drawbridge DB 75 ; 1 - Entrance hall DB 80 ; 2 - Mines DB 85 ; 3 - Reaper DB 0 ; 4 - DB 90 ; 5 - Singe DB 0 ; 6 - Elevator DB 0 ; 7 - Treasury DB 0 ; 8 - Dungeon CAM_A_TABH DH 0 ; 0 - Drawbridge DH AM_C102_0 ; 1 - Entrance hall DH AM_C106_0 ; 2 - Mines DH AM_C110_0 ; 3 - Reaper DH 0 ; 4 - DH AM_C114_0 ; 5 - Singe DH 0 ; 6 - Elevator DH 0 ; 7 - Treasury DH 0 ; 8 - Dungeon CAM_A_TABL DL 0 ; 0 - Drawbridge DL AM_C102_0 ; 1 - Entrance hall DL AM_C106_0 ; 2 - Mines DL AM_C110_0 ; 3 - Reaper DL 0 ; 4 - DL AM_C114_0 ; 5 - Singe DL 0 ; 6 - Elevator DL 0 ; 7 - Treasury DL 0 ; 8 - Dungeon ; C102_0 ATTRIBUTE MAP ( 8 X 6 ) AM_C102_0 DB $65,$95,$65,$15,$45,$95,$65,$95 DB $EE,$BB,$EE,$33,$CC,$BB,$EE,$BB DB $AA,$22,$00,$00,$00,$00,$88,$AA DB $AA,$22,$00,$00,$00,$00,$88,$AA DB $AA,$22,$00,$00,$00,$00,$88,$AA DB $AA,$AA,$00,$00,$00,$00,$88,$AA DB $AA,$AA,$00,$00,$00,$00,$88,$AA ; C106_0 ATTRIBUTE MAP ( 8 X 6 ) AM_C106_0 DB $55,$B5,$A5,$A5,$A5,$A5,$F5,$11 DB $9D,$AA,$AA,$AA,$AA,$AA,$AE,$11 DB $99,$AA,$55,$55,$55,$99,$AA,$11 DB $99,$AA,$55,$95,$55,$99,$AA,$11 DB $99,$AA,$05,$09,$05,$89,$AA,$11 DB $99,$AA,$00,$00,$00,$88,$AA,$11 DB $99,$AA,$00,$00,$00,$88,$AA,$11 ; C110_0 ATTRIBUTE MAP ( 8 X 6 ) AM_C110_0 DB $55,$55,$55,$55,$55,$55,$55,$11 DB $55,$55,$05,$05,$05,$05,$45,$01 DB $15,$00,$00,$00,$00,$00,$44,$00 DB $00,$00,$C0,$FF,$33,$00,$44,$00 DB $00,$00,$FC,$FF,$FF,$00,$44,$20 DB $00,$C0,$FF,$00,$CC,$30,$A6,$22 DB $0F,$0F,$0F,$00,$0C,$0F,$0A,$02 ; C114_0 ATTRIBUTE MAP ( 8 X 6 ) AM_C114_0 DB $AA,$EF,$77,$55,$FF,$FF,$FF,$33 DB $BA,$EE,$77,$55,$FF,$FF,$FF,$33 DB $FF,$FA,$86,$55,$FF,$FF,$FF,$33 DB $FF,$BF,$AA,$65,$5F,$5F,$5F,$13 DB $FF,$FF,$FF,$76,$55,$55,$55,$11 DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$33 DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$33 ;-------------------------------------- B39_END IF B39_END>$BFFF PRINTF "**** BANK $39 too long !! ****" ENDIF ; End of bank $39 ; --- -- ---- --- ;====================================== ; Start of bank $38 ; ----- -- ---- --- ORG $138,$8000 ;-------------------------------------- ; Include all the BG animation data. ; ------- --- --- -- --------- ----- INCLUDE "BG_ANIM.SRC" ;ACB's and DCB's INCLUDE "BG_MAP1.SRC" ;Bg anims map data ;-------------------------------------- ; Table of pointers to palettes. ; ----- -- -------- -- --------- SPAL_PTR_TAB DW PAL_BLACK ;0 - Mines (Bright) DW MI_P1 ;1 DW MI_P2 ;2 DW MI_P3 ;3 DW S_PAL_S2 ;4 DW PAL_BLACK ;5 - Mines (Dark) DW MI_P1 ;6 DW MI_P2 ;7 DW MI_P4 ;8 DW S_PAL_S2 ;9 DW DIRK_FLASH_PAL ;10 DW PAL_BLACK ;11 - Elevator DW ELEV_PAL0 ;12 DW ELEV_PAL1 ;13 DW ELEV_PAL2 ;14 DW S_PAL_S6 ;15 DW MI_P5 ;16 - 2 entry candle lit mines DW MI_P6 ;17 - 2 entry bright mines DW S_PAL_S2A ;18 - 1 entry for lizard king DW S_PAL_S2B ;19 - 1 entry for normal DW PAL_BLACK ;20 - Grim reaper DW R00_PAL ;21 DW R01_PAL ;22 DW R02_PAL ;23 DW S_PAL_S2 ;24 DW FLASH_PAL ;25 - 4 ent Lighting flash DW PAL_BLACK ;26 - Drawbridge DW DB_PAL1 ;27 DW DB_PAL2 ;28 DW DB_PAL3 ;29 DW S_PAL_S0 ;30 DW PAL_BLACK ;31 - Name entry, DW AT_PAL1 ;32 - high score table DW AT_PAL2 ;33 - and title screen DW AT_PAL3 ;34 DW AT_SPR_PAL ;35 DW G1_PAL0 ;36 - 'Start' glow DW G1_PAL1 ;37 DW G1_PAL2 ;38 DW G1_PAL3 ;39 DW G1_PAL4 ;40 DW PAL_BLACK ;41 DW SG_PAL1 ;42 - Singe's Lair DW SG_PAL2 ;43 DW SG_PAL3 ;44 DW S_PAL_S0 ;45 DW SG_PAL4 ;46 - Dragon on DW PAL_BLACK ;47 - Entrance Hall DW PAL_BLACK ;48 DW EH2_PAL ;49 DW EH2_PAL ;50 DW S_PAL_S2 ;51 DW PAL_BLACK ;52 - Treasury DW T_PAL0 ;53 DW T_PAL1 ;54 DW T_PAL2 ;55 DW S_PAL_S7 ;56 DW SG_PAL ;57 - Singe bits palette DW PAL_BLACK ;58 - No fade set of palettes DW PAL_BLACK ;59 for use with mines drak DW PAL_BLACK ;60 section and grim reaper DW PAL_BLACK ;61 end. DW S_PAL_S2 ;62 DW SG_PAL5 ;63 - Singe 1 ent green DW SG_FLASH ;64 - Flash Reaper/Singe white DW R03_PAL ;65 - Reaper 1 ent blue DW PAL_BLACK ;66 - End screen palettes DW ES_PAL1 ;67 DW ES_PAL2 ;68 DW ES_PAL3 ;69 DW S_PAL_S0 ;70 DW S0_SNK ;71 - Green for snake s0 DW EH3_PAL ;72 - End screen (Entrance hall) DW EH3_F ;73 - Flash snake DW EH3_R ;74 - Restore snake DW PAL_BLACK ;75 - Entrance hall cameo DW PAL_BLACK ;76 DW CAM_PAL3 ;77 DW CAM_PAL3 ;78 DW S_PAL_S0 ;79 DW PAL_BLACK ;80 - Mines cameo DW PAL_BLACK ;81 DW MIN_PAL3 ;82 DW MIN_PAL3 ;83 DW S_PAL_S0 ;84 DW PAL_BLACK ;85 DW PAL_BLACK ;86 DW REAP_PAL3 ;87 DW REAP_PAL3 ;88 DW S_PAL_S0 ;89 DW PAL_BLACK ;90 DW PAL_BLACK ;91 DW SING_PAL3 ;92 DW SING_PAL3 ;93 DW S_PAL_S0 ;94 DW PAL_BLACK ;95 DW EH3_R ;96 - Restore snake DW EH3_R ;97 DW EH3_R ;98 DW S_PAL_S0 ;99 DW PAL_BLACK ;100 - Credit screens DW R00_PAL ;101 DW R01_PAL ;102 DW CS_PAL ;103 DW S_PAL_S2 ;104 ; BG palettes FLASH_PAL DB WHITE3,WHITE2,WHITE1,WHITE0 DB WHITE3,WHITE2,WHITE1,WHITE0 DB WHITE3,WHITE2,WHITE1,WHITE0 DB WHITE3,WHITE2,WHITE1,WHITE0 PAL_BLACK DB BLACK,BLACK,BLACK,BLACK DB BLACK,BLACK,BLACK,BLACK DB BLACK,BLACK,BLACK,BLACK DB BLACK,BLACK,BLACK,BLACK ; Sprite palettes ; Screen 0 - Drawbridge S_PAL_S0 DB BLACK,WHITE2,WHITE1,WHITE0 DB BLACK,ORANGE2,ORANGE3,YELLOW1 DB BLACK,WHITE2,YELLOW2,WHITE0 S0_SNK DB BLACK,GREEN3,GREEN2,MID_GREEN1 S_PAL_S2 DB BLACK,WHITE2,WHITE1,WHITE0 DB BLACK,ORANGE2,ORANGE3,YELLOW1 DB BLACK,WHITE2,YELLOW2,WHITE0 S_PAL_S2B DB BLACK,ORANGE3,ORANGE2,ORANGE1 ; Screen 6 - Elevator S_PAL_S6 DB BLACK,WHITE2,WHITE1,WHITE0 DB BLACK,ORANGE2,ORANGE3,YELLOW1 DB BLACK,WHITE2,YELLOW2,WHITE0 DB BLACK,ORANGE3,ORANGE2,ORANGE1 S_PAL_S7 DB BLACK,WHITE2,WHITE1,WHITE0 DB BLACK,ORANGE2,ORANGE3,YELLOW1 DB BLACK,WHITE2,YELLOW2,WHITE0 S_PAL_S2A DB BLACK,WHITE2,LT_GREEN1,LT_GREEN2 ;Lizard king palette DIRK_FLASH_PAL DB BLACK,WHITE2,WHITE1,WHITE0 DB BLACK,WHITE2,WHITE2,WHITE2 DB BLACK,WHITE2,WHITE2,WHITE2 ; DB BLACK,WHITE1,MID_GREEN1,MID_GREEN0 SG_FLASH DB BLACK,WHITE3,WHITE3,WHITE3 ; Attract mode sprite palette AT_SPR_PAL DB BLACK,BLUE2,BLUE2,BLUE1 DB BLACK,ORANGE2,ORANGE1,ORANGE0 DB BLACK,GREEN3,GREEN2,GREEN1 DB BLACK,ORANGE3,ORANGE2,ORANGE1 ; Sprite palette for Singe's bits SG_PAL DB BLACK,WHITE3,PURPLE2,PURPLE1 MI_F DB BLACK ;====================================== B38_END IF B38_END>$9FFF PRINTF "**** BANK $38 too long !! ****" ENDIF ; End of bank $38 ; --- -- ---- --- ;-------------------------------------- ; Start of bank $37 ; ----- -- ---- --- ORG $137,$A000 ; Include screen maps ; ------- ------ ---- INCLUDE "GR_SMAP2.SRC" B37_END IF B37_END>$BFFF PRINTF "**** BANK $37 too long !! ****" ENDIF ; End of bank $37 ; --- -- ---- --- ;-------------------------------------- ; Start of bank $36 ; ----- -- ---- --- ORG $136,$8000 ; Include the ZZ_ and BM_ data for SPR_DRAW ; ------- --- --- --- --- ---- --- -------- INCLUDE "GR_MAP.SRC" INCLUDE "GR_MAP2.SRC" INCLUDE "GR_MAP3.SRC" ; ZZ_ and BM_ maps for test sprite BM_TEST DB %11000000 DB %11000000 ZZ_TEST DB 30,30,30,30 B36_END IF B36_END>$9FFF PRINTF "**** BANK $36 too long !! ****" ENDIF ; End of bank $36 ; --- -- ---- --- ;-------------------------------------- ; Start of bank $34+35 ; ----- -- ---- ------ ORG $134,$8000 INCBIN "SCRBLK.INC" B35_END IF B35_END>$BFFF PRINTF "**** BANK $34+$35 too long !! ****" ENDIF ; End of bank $34+$35 ; --- -- ---- ------- ;-------------------------------------- ; Start of bank $32 ; ----- -- ---- --- ORG $132,$8000 ;-------------------------------------- INCBIN "ATTR.INC" ;-------------------------------------- ; Collapsing floor collision tables.(X,Screen address) ; ---------- ----- --------- ------ ---------------- ; Screen 0 - Drawbridge SCR0_COLAP_TAB DW 104,9024+13 DW 112,9024+14 DW 120,9024+15 DW $FFFF ; Screen 3 - Grim reaper SCR3_COLAP_TAB ; Gr #1 DW 88,9024+11 DW 96,9024+12 DW 104 more more! Code (ASM): ; Table 0 contains pointers to the top left hand corner screen address. SCR_DRAW_TAB0 DW DL_SCR_TLFT ;0 - Panel DW DL_SCR_TLFT+(5*32) ;1 - Draw Bridge DW SCR1_START+(26*32) ;2 - Reaper floor DW DL_SCR_TLFT+(5*32) ;3 - Treasury DW SCR1_START+(15*32)+22 ;4 - Reaper IF FCS=1 DW SCR_START+(9*32)+10 ;5 - SBIM logo DW SCR_START+(13*32)+13 ;6 - Presents DW SCR_START+(12*32)+24 ;7 - TM DW SCR_START+(19*32)+11 ;8 - Released by DW SCR_START+(21*32)+4 ;9 - EPIC logo DW SCR_START+(24*32)+5 ;10- Licensed by Nintendo DW SCR_START+(7*32)+7 ;11- EPIC release DW SCR_START+(12*32)+10 ;12- Developed by DW SCR_START+(14*32)+12 ;13- MotiveTime logo DW SCR_START+(18*32)+1 ;14- Copyright message DW SCR_START+(15*32)+10 ;15- Dragons Lair logo s1 ENDIF IF GBR=1 DW SCR_START+(5*32)+9 ;5 - SBIM logo DW SCR_START+(9*32)+11 ;6 - Presents DW SCR_START+(3*32)+9 ;7 - Don Bluth cs2 DW SCR_START+(14*32)+10 ;8 - Released by DW SCR_START+(16*32)+6 ;9 - Elite logo DW SCR_START+(24*32)+5 ;10- Licensed by Nintendo DW SCR_START+(7*32)+5 ;11- Elite release DW SCR_START+(12*32)+10 ;12- Developed by DW SCR_START+(14*32)+11 ;13- MotiveTime logo DW SCR_START+(18*32)+1 ;14- Copyright message DW SCR_START+(11*32)+8 ;15- Dragons Lair logo s1 ENDIF DW SCR_START+(3*32)+9 ;16- Dragons Lair logo s2 DW SCR_START+(4*32)+23 ;17- TM credits screen 2 DW SCR_START+(32*8)+7 ;18- SCORES DW SCR_START+(32*10)+8 ;19- PLAYERS DW SCR_START+(32*13)+8 ;20- MUSIC DW SCR_START+(32*10)+7 ;21- GOLD DW SCR_START+(32*23)+13 ;22- Mtime logo option screens DW SCR1_START+(32*8)+10 ;23- more!! Code (ASM): DL S6_TP_TAB ;6 - Elevator DL S7_TP_TAB ;7 - Treasury DL S8_TP_TAB ;8 - Dungeon SCR_TPTR_TABH DH S0_TP_TAB ;0 - Drawbridge IF HALL DH S1_TP_TAB ;1 - Entrance hall ELSE DH 0 ENDIF IF MINES DH S2_TP_TAB ;2 - Mines ELSE DH 0 ENDIF IF REAPER DH S3_TP_TAB ;3 - Grim reaper ELSE DH 0 ENDIF DH 0 ;4- IF SINGE DH S5_TP_TAB ;5 - Singe ELSE DH 0 ENDIF DH S6_TP_TAB ;6 - Elevator DH S7_TP_TAB ;7 - Treasury DH S8_TP_TAB ;8 - Dungeon ;-------------------------------------- ; Include graphics source files ; ------- -------- ------ ----- INCLUDE "GR_SMAP1.SRC" ;-------------------------------------- ; Sprite Collision boxes ; ------ --------- ----- ; Table of pointers to collision boxes SDC_COL_PTRS_L DL SCOL_0 DL SCOL_1 DL SCOL_2 DL SCOL_3 DL SCOL_4 DL SCOL_5 DL SCOL_6 DL SCOL_7 DL SCOL_8 DL SCOL_9 DL SCOL_10 DL SCOL_11 DL SCOL_12 DL SCOL_13 DL SCOL_14 DL SCOL_15 DL SCOL_16 DL SCOL_17 DL SCOL_18 DL SCOL_19 DL SCOL_20 DL SCOL_21 DL SCOL_22 DL SCOL_23 DL SCOL_24 DL SCOL_25 DL SCOL_26 DL SCOL_27 DL SCOL_25 ;28 DL SCOL_26 ;29 DL SCOL_27 ;30 DL SCOL_31 DL SCOL_32 DL SCOL_33 DL SCOL_34 DL SCOL_35 DL SCOL_36 DL SCOL_37 DL SCOL_38 DL SCOL_39 DL SCOL_40 DL SCOL_41 DL SCOL_42 DL SCOL_43 DL SCOL_44 DL SCOL_45 DL SCOL_46 DL SCOL_47 SDC_COL_PTRS_H DH SCOL_0 DH SCOL_1 DH SCOL_2 DH SCOL_3 DH SCOL_4 DH SCOL_5 DH SCOL_6 DH SCOL_7 DH SCOL_8 DH SCOL_9 DH SCOL_10 DH SCOL_11 DH SCOL_12 DH SCOL_13 DH SCOL_14 DH SCOL_15 DH SCOL_16 DH SCOL_17 DH SCOL_18 DH SCOL_19 DH SCOL_20 DH SCOL_21 DH SCOL_22 DH SCOL_23 DH SCOL_24 DH SCOL_25 DH SCOL_26 MORE! Code (ASM): DL SF_EL7 SF_ETABH DH SF_EL0 DH SF_EL1 DH SF_EL2 DH SF_EL3 DH SF_EL4 DH SF_EL5 DH SF_EL6 DH SF_EL7 SF_EL0 ;Drawbridge SF_EL1 DB 1,2,8,7 ;Entrance hall SF_EL2 DB 8,2,3,7 ;Mines SF_EL3 DB 5,8,3,7 ;Grim reaper SF_EL4 ;Not implemented SF_EL5 ;Singe SF_EL6 ;Elevator SF_EL7 ;Treasury SF_NOT_6 ; Stop exit off left of screen LDA DIRK_X_ONSCR CMP #L_EDGE BCS SF_LOK LDA SCR_NUM ;Dirk exits on the left CMP #7 ;in the treasury BNE !1 LDA END_LEVEL_FLAG ;Exit from treasury BNE SF_LEVEL_END !1 LDA #L_EDGE+4 ;Put Dirk at left JSR SF_CEP SF_LOK SF_SCROLL LDA SCROLL_FLAG ;Is it a scrolling section BEQ SF_NOT_SCROLL LDA SCROLL_XOFFSET+1 ;Test if finished scrolling CMP SCROLL_LENGTH+1 ;(16 bit compare) BCC SF_END BNE !1 LDA SCROLL_XOFFSET CMP SCROLL_LENGTH BCC SF_END ; Scroll has finished so allow Dirk freedom to walk right. !1 LDA #0 STA SCROLL_FLAG ;Clear scroll flag SF_NOT_SCROLL LDA DIRK_X_ON The rest isn't source code but some remnants of the OS the game was compiled on: Code (Text): All the memory in your machine has been exhausted. Do you want to save your files before exiting to DOS? I found source code to two pirate games that take advantage of the light gun. And of course, there's Air Fortress' leftover source code which has been mentioned on X-Cult.
Yay time to double post again. This time, let's do Dragons Lair (JP) (FYI - the US version doesn't have anything interesting). Please note, it might be similar to EU in some parts but there are new fragments of code not found in the EU version: Let's start with this: Code (ASM): DB 96+96+20 DB 96+96+21 DB 96+96+22 ;-------------------------------------- ; Throw a dagger control routines ; ----- - ------ ------- -------- ; Initialization, this routine starts a dagger if there is one free ; This routine was modifyed to cope with axes and fireballs ; IN ; -- ; A=Direction (BIT6=0 - Facing right 1 - Facing left) D_INIT STA ZPAGE_BYTE2 LDX WEAPON_TYPE BEQ DI_3ON ;3 daggers allowed DEX BEQ DI_2ON ;2 axes JMP DI_1ON ;1 fireball DI_3ON LDX #2*D_VAR_LEN LDA D_VARS+D_X_OFF+(2*D_VAR_LEN) BEQ DI_FREE DI_2ON LDX #1*D_VAR_LEN LDA D_VARS+D_X_OFF+(1*D_VAR_LEN) BEQ DI_FREE DI_1ON LDX #0*D_VAR_LEN LDA D_VARS+D_X_OFF+(0*D_VAR_LEN) BEQ DI_FREE RTS ; X holds offset of block to init. DI_FREE LDA WEAPON_TYPE STA D_VARS+D_TYP_OFF,X ;Store type in vars LDA #0 STA D_VARS+D_ANI_OFF,X ;Start at first anim ; Setup Y velocity LDA #<(-800) STA D_VARS+D_YSP_OFF,X LDA #>(-800) STA D_VARS+D_YSP_OFF+1,X ; Setup X velocitys and X,Y's LDA ZPAGE_BYTE2 AND #SDC_LEFT BEQ DI_GOING_RGT ; Going left ; Set velocity going left LDA #<0+(0-D_XSPEED) STA D_VARS+D_XSP_OFF,X LDA #>0+(0-D_XSPEED) STA D_VARS+D_XSP_OFF+1,X LDA ZPAGE_BYTE2 AND #SDC_DOWN BNE DI_CRAWLING_L ; Throw while standing up facing left LDA DIRK_X_ONSCR STA D_VARS+D_X_OFF,X LDA DIRK_Y SEC SBC #52 STA D_VARS+D_Y_OFF,X JMP DI_XVXY_END ; Throw while crawling left DI_CRAWLING_L LDA DIRK_X_ONSCR SEC SBC #18 BCS !1 RTS ; Error, Off edge !1 STA D_VARS+D_X_OFF,X LDA DIRK_Y SEC SBC #31 STA D_VARS+D_Y_OFF,X JMP DI_XVXY_END ; Going right DI_GOING_RGT ; Setup X velocity for going right LDA #<D_XSPEED STA D_VARS+D_XSP_OFF,X LDA #>D_XSPEED STA D_VARS+D_XSP_OFF+1,X LDA ZPAGE_BYTE2 AND #SDC_DOWN BNE DI_CRAWLING_R ; Throw while standing up facing right LDA DIRK_X_ONSCR CLC ;Setup dagger starting X ADC #24 BCS !1 CMP #230 BCC !2 !1 RTS ; Error, Off edge !2 STA D_VARS+D_X_OFF,X LDA DIRK_Y SEC SBC #52 STA D_VARS+D_Y_OFF,X JMP DI_XVXY_END ; Throw while crawling right DI_CRAWLING_R LDA DIRK_X_ONSCR CLC ADC #38 BCC !1 RTS ; Error, Off edge !1 STA D_VARS+D_X_OFF,X LDA DIRK_Y SEC SBC #31 STA D_VARS+D_Y_OFF,X DI_XVXY_END LDA D_E_FRAC ;Subtract energy from Dirk CLC ;for each weapon thrown ADC #16 STA D_E_FRAC BCC !1 LDA #-1 JSR DIRK_NRG_ADD !1 LDY #1 ;Preload with normal dagger FX LDX WEAPON_TYPE DEX BNE !2 LDY #15 ;Axe throw FX !2 JMP FX_TRIGGER ;and 'RTS' ;------------------ ; Process all currently running daggers D_PROCESS LDX #2*D_VAR_LEN ;Offset to current dagger vars DP_LOOP LDA D_VARS+D_X_OFF,X BEQ16 DP_END ;This dagger isn't on LDA #D_GRAVITY CLC ADC D_VARS+D_YSP_OFF,X STA D_VARS+D_YSP_OFF,X ;Add gravity to BCC !1 ;speed INC D_VARS+D_YSP_OFF+1,X !1 CLC ADC D_VARS+D_YF_OFF,X STA D_VARS+D_YF_OFF,X ;Add Y speed to Yf LDA D_VARS+D_YSP_OFF+1,X ;and Y ADC D_VARS+D_Y_OFF,X STA D_VARS+D_Y_OFF,X LDA D_VARS+D_YSP_OFF+1,X BMI BP_STILL_GOING CMP #7 BCC BP_STILL_GOING ; Stop this dagger BP_STOP LDA #0 ;the end STA D_VARS+D_X_OFF,X ;If so,stop dagger JMP DP_END BP_STILL_GOING LDA D_VARS+D_XSP_OFF,X CLC ;Add X speed to ADC D_VARS+D_XF_OFF,X ;dagger X STA D_VARS+D_XF_OFF,X LDA D_VARS+D_XSP_OFF+1,X ADC D_VARS+D_X_OFF,X CMP #255-(D_XSPEED/256) BCS BP_STOP ;Gone off edge of STA D_VARS+D_X_OFF,X ;screen LDA D_VARS+D_TYP_OFF,X BEQ16 DP_DAG_SP ; Draw an axe and fireball DP_AF_SP LDA D_VARS+D_X_OFF,X STA ZPAGE_WORD5 LDA D_VARS+D_Y_OFF,X STA ZPAGE_WORD6 ;Setup X and Y's LDA #0 STA ZPAGE_WORD5+1 STA ZPAGE_WORD6+1 LDA D_VARS+D_TYP_OFF,X CMP #1 BEQ DP_AXE_SP ;Axe specific draw ; Specific draw for fireball LDA D_VARS+D_ANI_OFF,X CMP #3 BCC DP_FB_AOK LDA #0 DP_FB_AOK TAY ;Animate the fireball CLC ADC #1 STA D_VARS+D_ANI_OFF,X LDA D_VARS+D_XSP_OFF+1,X BMI DP_FB_LEFT SET16 ZPAGE_WORD2,DP_FB_LDEF LDA #BIT6 JMP DP_FB_DEF_END DP_FB_LEFT SET16 ZPAGE_WORD2,DP_FB_RDEF LDA #0 DP_FB_DEF_END STX ZPAGE_BYTE10 ;Preserve X TAX ;Setup X for SPR_DRAW TYA ASL A STA ZPAGE_BYTE1 ASL A CLC ;6 bytes per animation ADC ZPAGE_BYTE1 ;entry. ADD16_A ZPAGE_WORD2 LDA #128+1 ;Window number JSR SPR3_DRAW_39 ;Draw sprite LDX ZPAGE_BYTE10 ;Restore X JMP DP_END ; Specific draw for axe DP_AXE_SP LDA D_VARS+D_ANI_OFF,X CMP #4 BCC DP_AXE_AOK LDA #0 DP_AXE_AOK TAY ;Animate the dagger CLC ADC #1 STA D_VARS+D_ANI_OFF,X LDA D_VARS+D_XSP_OFF+1,X BMI DP_AXE_LEFT SET16 ZPAGE_WORD2,DP_AXE_LDEF LDA #0 JMP DP_AXE_DEF_END DP_AXE_LEFT SET16 ZPAGE_WORD2,DP_AXE_RDEF LDA #BIT6 DP_AXE_DEF_END STX ZPAGE_BYTE10 ;Preserve X TAX ;Setup X for SPR_DRAW TYA ASL A STA ZPAGE_BYTE1 ASL A CLC ;6 bytes per animation ADC ZPAGE_BYTE1 ;entry. ADD16_A ZPAGE_WORD2 LDA #128+1 ;Window number JSR SPR3_DRAW_39 ;Draw sprite LDX ZPAGE_BYTE10 ;Restore X JMP DP_END ; Draw a dagger DP_DAG_SP LDY #0 LDA D_VARS+D_Y_OFF,X STA (SD_PAGE_PTR),Y ;Setup Y of dagger sprites LDY #4 STA (SD_PAGE_PTR),Y LDA D_VARS+D_X_OFF,X DEY ; Y=3 STA (SD_PAGE_PTR),Y ;Setup X of dagger sprites CLC ADC #8 LDY #7 STA (SD_PAGE_PTR),Y LDA D_VARS+D_XSP_OFF+1,X BMI DP_CHR_LEFT ; Setup dagger characters for going right LDA #$14+64 LDY #1 STA (SD_PAGE_PTR),Y ;Characters LDA #$13+64 LDY #5 STA (SD_PAGE_PTR),Y LDA #0+SPR_CTR_X_FLIP JMP DP_CHR_SEND ; Setup dagger characters for going left DP_CHR_LEFT LDA #$13+64 LDY #1 STA (SD_PAGE_PTR),Y ;Characters LDA #$14+64 LDY #5 STA (SD_PAGE_PTR),Y LDA #0 DP_CHR_SEND LDY #2 STA (SD_PAGE_PTR),Y ;Attribute LDY #6 STA (SD_PAGE_PTR),Y LDA SD_PAGE_PTR ;Move over 2 sprites CLC ADC #8 BNE !1 LDA #4 !1 STA SD_PAGE_PTR DP_END TXA SEC ;Move to next daggers vars SBC #D_VAR_LEN TAX BCS16 DP_LOOP JMP SET_NORM_BANK ;and 'RTS' ;-------------------------------------- ; Cameo screens ; ----- ------- CAMEO LDA #128 ;Stop tune playing JSR START_TUNE RTS LDX SCR_NUM ;Setup BG bank LDA CAM_B_TAB,X BEQ !1 STA N_BG_BANK1 CLC ADC #2 STA N_BG_BANK2 WAIT_FRAME LDA VDP_CTR_VAR0 ;Force screen 1 AND #NOT-HORI_SWAP ;to get rid of the STA VDP_CTR_VAR0 ;dash. STA VDP_CTR_REG0 LDA #-1 LDX SCR_NUM DEX BEQ !2 ;Don't scroll entrance cameo LDA #-6 !2 STA N_SC_X JSR DISABLE_NC ;Turn off NMI and CHR's LDA #PAL_1 JSR CLS ;Clear screen LDX SCR_NUM ;Draw screen LDA CAM_S_TAB,X JSR S7_DS LDX SCR_NUM ;Draw attributes LDA CAM_A_TABL,X STA ZPAGE_WORD1 LDA CAM_A_TABH,X STA ZPAGE_WORD1+1 SET_VRAM_PTR 27C8 LDX #56 JSR SI_SET_ATTR2 LDA #0 ;Leave dash on other screen STA N_SPLIT JSR ENABLE_CN LDX SCR_NUM LDA CAM_F_TAB,X PHA TAX JSR FADE_IN LDX #100 ;Wait for 100 frames JSR M_WAIT_FRAME PLA TAX JSR FADE_OUT !1 RTS CAM_B_TAB DB 0 ; 0 - Drawbridge DB GR_1ST+38 ; 1 - Entrance hall DB GR_1ST+42 ; 2 - Mines DB GR_1ST+46 ; 3 - Reaper DB 0 ; 4 - DB GR_1ST+50 ; 5 - Singe DB 0 ; 6 - Elevator DB 0 ; 7 - Treasury DB 0 ; 8 - Dungeon CAM_S_TAB DB 0 ; 0 - Drawbridge DB 31 ; 1 - Entrance hall DB 32 ; 2 - Mines DB 33 ; 3 - Reaper DB 0 ; 4 - DB 35 ; 5 - Singe DB 0 ; 6 - Elevator DB 0 ; 7 - Treasury DB 0 ; 8 - Dungeon CAM_F_TAB DB 0 ; 0 - Drawbridge DB 75 ; 1 - Entrance hall DB 80 ; 2 - Mines DB 85 ; 3 - Reaper DB 0 ; 4 - DB 90 ; 5 - Singe DB more: Code (ASM): $AA,$65,$5F,$5F,$5F,$13 DB $FF,$FF,$FF,$76,$55,$55,$55,$11 DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$33 DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$33 ;-------------------------------------- ; Lizard king ; ------ ---- LIZ_ON_TIME EQU 100 LIZARD_PROCESS LDA LIZARD_FLAG BEQ16 LP_NOT_ON ;Wait before bringing DEC LIZARD_FLAG ;another on. BNE LP_NOT_END ; Lizard has ended LDA FADE_PALETTE CLC ADC #4 LDX #4 LDY #4 JSR CHANGE_PAL ;Set sprite palette LDA SPR3_WIN2_R ;Reset back to normal STA SPR3_WIN2 ;sprite bank LDY #FLAG_OFF+1 LDA (LIZ_FCD_VARS),Y ORA #(FCD_SP1_BIT/256) ;Set death bit STA (LIZ_FCD_VARS),Y RTS LP_NOT_END LDA LIZARD_FLAG CMP #LIZ_ON_TIME-20 BEQ LP_EXPLODE ;Start lizard on explosions RTS ; Start lizard appear explosions LP_EXPLODE LDA #18 LDX #7 LDY #1 JSR CHANGE_PAL ; Start lizard king. SET16 ZPAGE_WORD2,FCD_LZ LDA #8 STA ZPAGE_BYTE1 ;Hit count LDA #ST_LZ STA ZPAGE_BYTE2 ;Sprite type JSR SI_39 ;Try to start FCD sprite. BNE LP_CANT_START LDA ZPAGE_WORD1 STA LIZ_FCD_VARS ;Store address of FCD vars LDA ZPAGE_WORD1+1 STA LIZ_FCD_VARS+1 LDA DIRK_Y SEC SBC #22 JSR SR_39 ;Start Lizard after waiting JSR LP_ST_SMOKE BNE LP_CANT_START ;Can't start smoke LDA DIRK_Y ;Start bottom smoke SEC SBC #44 JSR SR_39 JSR LP_ST_SMOKE BNE LP_CANT_START ;Can't start smoke LDA DIRK_Y ;Start top smoke SEC SBC #72 JSR SR_39 LP_CANT_START ; Change to correct sprite bank in window 2 LDA #23 STA SPR3_WIN2 ; Start lizard king fanfare LDY #31 JSR FX_TRIGGER LDY #32 JSR FX_TRIGGER LDY #33 JMP FX_TRIGGER ;and 'RTS' ; Lizard king is not on so check if he can be brought on LP_NOT_ON ; Don't bring on if no gold LDA PL_GOLD ORA PL_GOLD+1 ;Don't do gold bonus if no ORA PL_GOLD+2 ;gold. CMP #246 BNE !1 RTS !1 ; Check if allowed on at the current scroll position LDX SCR_NUM LDA LIZ_SCR_TABL,X STA ZPAGE_WORD1 ;Setup WORD1 as pointer to LDA LIZ_SCR_TABH,X ;ON/OFF data. STA ZPAGE_WORD1+1 LP_FLOOP LDY #0 LDA (ZPAGE_WORD1),Y STA ZPAGE_WORD2 INY ;WORD2 is ON x LDA (ZPAGE_WORD1),Y STA ZPAGE_WORD2+1 ORA ZPAGE_WORD2 CMP #$FF BNE LP_!END RTS LP_!END CMP16 ZPAGE_WORD2,SCROLL_XOFFSET BCS16 LP_FLOOP_NEXT LDY #2 LDA (ZPAGE_WORD1),Y STA ZPAGE_WORD2 INY ;WORD2 is OFF x LDA (ZPAGE_WORD1),Y STA ZPAGE_WORD2+1 CMP16 ZPAGE_WORD2,SCROLL_XOFFSET BCC LP_FLOOP_NEXT ; In range so bring lizard king on. JSR RND_A1 CMP #251 BCS LP_BO_S1 RTS LP_BO_S1 JSR RND_A1 CMP #18 BCC LP_BO_S2 RTS LP_BO_S2 ; Bring lizard king on. LDA #LIZ_ON_TIME STA LIZARD_FLAG ; Kill all other sprites LDX #MAX_FCD_UNITS SET16 ZPAGE_WORD1,SPR0 LDY #FLAG_OFF+1 LP_LP LDA (ZPAGE_WORD1),Y ORA #FCD_DEATH_BIT/256 STA (ZPAGE_WORD1),Y ADD16_8 ZPAGE_WORD1,FCD_VARS_LEN DEX BNE LP_LP RTS LP_FLOOP_NEXT ADD16_8 ZPAGE_WORD1,4 ;Move to next JMP LP_FLOOP LP_ST_SMOKE SET16 ZPAGE_WORD2,FCD_SMOKE LDA #200 STA ZPAGE_BYTE1 ;Hit count LDA #ST_NULL STA ZPAGE_BYTE2 ;Sprite type JMP SI_39 ;Start lizard appear smoke ;and 'RTS' LIZ_SCR_TABL DL LIZ_DUMMY DL LIZ_SCR1 DL LIZ_SCR2 DL LIZ_DUMMY DL LIZ_DUMMY DL LIZ_SCR5 DL LIZ_DUMMY DL LIZ_DUMMY DL LIZ_DUMMY LIZ_SCR_TABH DH LIZ_DUMMY DH LIZ_SCR1 DH LIZ_SCR2 DH LIZ_DUMMY DH LIZ_DUMMY DH LIZ_SCR5 DH LIZ_DUMMY DH LIZ_DUMMY DH LIZ_DUMMY ; Entrance hall ; Singe LIZ_SCR5 LIZ_SCR1 DW 0,980 DW $FFFF ; Mines LIZ_SCR2 DW 0,500 DW 1400,1500 DW $FFFF LIZ_DUMMY DW $FFFF B39_END IF B39_END>$BFFF PRINTF "**** BANK $39 too long !! ****" ENDIF ; End of bank $39 ; --- -- ---- --- ;====================================== ; Start of bank $38 ; ----- -- ---- --- ORG $138,$8000 ;-------------------------------------- ; Include all the BG animation data. ; ------- --- --- -- --------- ----- INCLUDE "BG_ANIM.SRC" ;ACB's and DCB's INCLUDE "BG_MAP1.SRC" ;Bg anims map data ;-------------------------------------- ; Table of pointers to palettes. ; ----- -- -------- -- --------- SPAL_PTR_TAB DW PAL_BLACK ;0 - Mines (Bright) DW MI_P1 ;1 DW MI_P2 ;2 DW MI_P3 ;3 DW S_PAL_S2 ;4 DW PAL_BLACK ;5 - Mines (Dark) DW MI_P1 ;6 DW MI_P2 ;7 DW MI_P4 ;8 DW S_PAL_S2 ;9 DW DIRK_FLASH_PAL ;10 DW PAL_BLACK ;11 - Elevator DW ELEV_PAL0 ;12 DW ELEV_PAL1 ;13 DW ELEV_PAL2 ;14 DW S_PAL_S6 ;15 DW MI_P5 ;16 - 2 entry candle lit mines DW MI_P6 ;17 - 2 entry bright mines DW S_PAL_S2A ;18 - 1 entry for lizard king DW S_PAL_S2B ;19 - 1 entry for normal DW PAL_BLACK ;20 - Grim reaper DW R00_PAL ;21 DW R01_PAL ;22 DW R02_PAL ;23 DW S_PAL_S2 ;24 DW FLASH_PAL ;25 - 4 ent Lighting flash DW PAL_BLACK ;26 - Drawbridge DW DB_PAL1 ;27 DW DB_PAL2 ;28 DW DB_PAL3 ;29 DW S_PAL_S0 ;30 DW PAL_BLACK ;31 - Name entry, DW AT_PAL1 ;32 - high score table DW AT_PAL2 ;33 - and title screen DW AT_PAL3 ;34 DW AT_SPR_PAL ;35 DW G1_PAL0 ;36 - 'Start' glow DW G1_PAL1 ;37 DW G1_PAL2 ;38 DW G1_PAL3 ;39 DW G1_PAL4 ;40 DW PAL_BLACK ;41 DW SG_PAL1 ;42 - Singe's Lair DW SG_PAL2 ;43 DW SG_PAL3 ;44 DW S_PAL_S0 ;45 DW SG_PAL4 ;46 - Dragon on DW PAL_BLACK ;47 - Entrance Hall DW PAL_BLACK ;48 DW EH2_PAL ;49 DW EH2_PAL ;50 DW S_PAL_S2 ;51 DW PAL_BLACK ;52 - Treasury DW T_PAL0 ;53 DW T_PAL1 ;54 DW T_PAL2 ;55 DW S_PAL_S7 ;56 DW SG_PAL ;57 - Singe bits palette DW PAL_BLACK ;58 - No fade set of palettes DW PAL_BLACK ;59 for use with mines drak DW PAL_BLACK ;60 section and grim reaper DW PAL_BLACK ;61 end. DW S_PAL_S2 ;62 DW SG_PAL5 ;63 - Singe 1 ent green DW SG_FLASH ;64 - Flash Reaper/Singe white DW R03_PAL ;65 - Reaper 1 ent blue DW PAL_BLACK ;66 - End screen palettes DW ES_PAL1 ;67 DW ES_PAL2 ;68 DW ES_PAL3 ;69 DW S_PAL_S0 ;70 DW S0_SNK ;71 - Green for snake s0 DW EH3_PAL ;72 - End screen (Entrance hall) DW EH3_F ;73 - Flash snake DW EH3_R ;74 - Restore snake DW PAL_BLACK ;75 - Entrance hall cameo DW PAL_BLACK ;76 DW CAM_PAL3 ;77 DW CAM_PAL3 ;78 DW S_PAL_S0 ;79 DW PAL_BLACK ;80 - Mines cameo DW PAL_BLACK ;81 DW MIN_PAL3 ;82 DW MIN_PAL3 ;83 DW S_PAL_S0 ;84 DW PAL_BLACK ;85 DW PAL_BLACK ;86 DW REAP_PAL3 ;87 DW REAP_PAL3 ;88 DW S_PAL_S0 ;89 DW PAL_BLACK ;90 DW PAL_BLACK ;91 DW SING_PAL3 ;92 DW SING_PAL3 ;93 DW S_PAL_S0 ;94 DW PAL_BLACK ;95 DW EH3_R ;96 - Restore snake DW EH3_R ;97 DW EH3_R ;98 DW S_PAL_S0 ;99 DW PAL_BLACK ;100 - Credit screens DW R00_PAL ;101 DW R01_PAL ;102 DW CS_PAL ;103 DW S_PAL_S2 ;104 ; BG palettes FLASH_PAL DB WHITE3,WHITE2,WHITE1,WHITE0 DB WHITE3,WHITE2,WHITE1,WHITE0 DB WHITE3,WHITE2,WHITE1,WHITE0 DB WHITE3,WHITE2,WHITE1,WHITE0 PAL_BLACK DB BLACK,BLACK,BLACK,BLACK DB BLACK,BLACK,BLACK,BLACK DB BLACK,BLACK,BLACK,BLACK DB BLACK,BLACK,BLACK,BLACK ; Sprite palettes ; Screen 0 - Drawbridge S_PAL_S0 DB BLACK,WHITE2,WHITE1,WHITE0 DB BLACK,ORANGE2,ORANGE3,YELLOW1 DB BLACK,WHITE2,YELLOW2,WHITE0 S0_SNK DB BLACK,GREEN3,GREEN2,MID_GREEN1 S_PAL_S2 DB BLACK,WHITE2,WHITE1,WHITE0 DB BLACK,ORANGE2,ORANGE3,YELLOW1 DB BLACK,WHITE2,YELLOW2,WHITE0 S_PAL_S2B DB BLACK,ORANGE3,ORANGE2,ORANGE1 ; Screen 6 - Elevator S_PAL_S6 DB BLACK,WHITE2,WHITE1,WHITE0 DB BLACK,ORANGE2,ORANGE3,YELLOW1 DB BLACK,WHITE2,YELLOW2,WHITE0 DB BLACK,ORANGE3,ORANGE2,ORANGE1 S_PAL_S7 DB BLACK,WHITE2,WHITE1,WHITE0 DB BLACK,ORANGE2,ORANGE3,YELLOW1 DB BLACK,WHITE2,YELLOW2,WHITE0 S_PAL_S2A DB BLACK,WHITE2,LT_GREEN1,LT_GREEN2 ;Lizard king palette DIRK_FLASH_PAL DB BLACK,WHITE2,WHITE1,WHITE0 DB BLACK,WHITE2,WHITE2,WHITE2 DB BLACK,WHITE2,WHITE2,WHITE2 ; DB BLACK,WHITE1,MID_GREEN1,MID_GREEN0 SG_FLASH DB BLACK,WHITE3,WHITE3,WHITE3 ; Attract mode sprite palette AT_SPR_PAL DB BLACK,BLUE2,BLUE2,BLUE1 DB BLACK,ORANGE2,ORANGE1,ORANGE0 DB BLACK,GREEN3,GREEN2,GREEN1 DB BLACK,ORANGE3,ORANGE2,ORANGE1 ; Sprite palette for Singe's bits SG_PAL DB BLACK,WHITE3,PURPLE2,PURPLE1 MI_F DB BLACK ;====================================== B38_END IF B38_END>$9FFF PRINTF "**** BANK $38 too long !! ****" ENDIF ; End of bank $38 ; --- -- ---- --- ;-------------------------------------- ; Start of bank $37 ; ----- -- ---- --- ORG $137,$A000 ; Include screen maps ; ------- ------ ---- INCLUDE "GR_SMAP2.SRC" B37_END IF B37_END>$BFFF PRINTF "**** BANK $37 too long !! ****" ENDIF ; End of bank $37 ; --- -- ---- --- ;-------------------------------------- ; Start of bank $36 ; ----- -- ---- --- ORG $136,$8000 ; Include the ZZ_ and BM_ data for SPR_DRAW ; ------- --- --- --- --- ---- --- -------- INCLUDE "GR_MAP.SRC" INCLUDE "GR_MAP2.SRC" INCLUDE "GR_MAP3.SRC" ; ZZ_ and BM_ maps for test sprite BM_TEST DB %11000000 DB %11000000 ZZ_TEST DB 30,30,30,30 B36_END IF B36_END>$9FFF PRINTF "**** BANK $36 too long !! ****" ENDIF ; End of bank $36 ; --- -- ---- --- ;-------------------------------------- ; Start of bank $34+35 ; ----- -- ---- ------ ORG $134,$8000 INCBIN "SCRBLK.INC" B35_END IF B35_END>$BFFF PRINTF "**** BANK $34+$35 too long !! ****" ENDIF ; End of bank $34+$35 ; --- -- ---- ------- ;-------------------------------------- ; Start of bank $32 ; ----- -- ---- --- ORG $132,$8000 ;-------------------------------------- INCBIN "ATTR.INC" ;-------------------------------------- ; Collapsing floor collision tables.(X,Screen address) ; ---------- ----- --------- ------ ---------------- ; Screen 0 - Drawbridge SCR0_COLAP_TAB DW 104,9024+13 DW 112,9024+14 DW 120,9024+15 DW $FFFF ; Screen 3 - Grim reaper SCR3_COLAP_TAB ; Gr #1 DW 88,9024+11 DW 96,9024+12 DW 104,9024+13 DW 136,9024+17 DW 144,9024+18 DW 152,9024+19 DW 184,9024+23 DW 192,9024+24 DW 200,9024+25 DW 232,9024+29 DW 240,9024+30 DW 248,9024+31 ; Gr #3 DW 512+152,8896+19 DW 512+160,8896+20 DW 512+168,8896+21 ; Gr #6 DW 1280+208,9984+26 DW 1280+216,9984+27 DW 1280+224,9984+28 DW 1280+232,9984+29 ; Gr #7 DW 1536+8,8960+1 DW 1536+16,8960+2 DW 1536+24,8960+3 DW 1536+32,8960+4 DW 1536+40,8960+5 DW 1536+72,8960+9 DW 1536+80,8960+10 DW 1536+88,8960+11 DW 1536+120,9024+15 DW 1536+128,9024+16 ; Gr #8 DW 1792+120,10048+15 DW 1792+128,10048+16 DW 1792+136,10048+17 DW 1792+168,10112+21 DW 1792+176,10112+22 DW 1792+184,10112+23 DW 1792+192,10112+24 DW 1792+200,10112+25 DW 1792+232,10112+29 DW 1792+240,10112+30 ; Gr #9 DW 2048+16,9088+2 DW 2048+24,9088+3 DW 2048+32,9088+4 DW 2048+40,9088+5 DW 2048+192,9024+24 DW 2048+200,9024+25 DW 2048+208,9024+26 DW 2048+216,9024+27 DW 2048+248,9024+31 ; Gr #10 DW 2304+0,10048+0 DW 2304+8,10048+1 DW 2304+16,10048+2 DW 2304+48,10048+6 DW 2304+56,10048+7 DW 2304+64,10048+8 DW 2304+72,10048+9 DW 2304+104,10048+13 DW 2304+112,10048+14 ; Gr #11 DW 2560+32,9024+4 DW 2560+40,9024+5 DW 2560+48,9024+6 DW 2560+80,9024+10 DW 2560+88,9024+11 DW 2560+200,9024+25 DW 2560+232,9024+29 DW 2560+240,9024+30 ; Gr DW $FFFF ;-------------------------------------- B32_END IF B32_END>$BFFF PRINTF "**** BANK $32 too long !! ****" ENDIF ; End of bank $32 ; --- -- ---- --- ;-------------------------------------- ; Start of bank $30/31 ; ----- -- ---- ------ ORG $130,$8000 MUSIC_BASE INCBIN "MUSIC.INC" FX_INIT EQU MUSIC_BASE+0 FX_TRIGGER1 EQU MUSIC_BASE+3 FX_PROCESS EQU MUSIC_BASE+6 MUSIC_TRIGGER EQU MUSIC_BASE+9 MUSIC_PROCESS EQU MUSIC_BASE+12 B30_END IF B30_END>$BFFF PRINTF "**** BANK $30 too long !! ****" ENDIF ; End of bank $30/$31 ; --- -- ---- ------- ;====================================== IF EPROM=99 SEND COMPUTER1 ENDIF IF EPROM=98 SEND MSDOS,"C:\PDSMAST\DLAIRFCS\EPROM\DL.PDS" ENDIF ; ------------------------------------------------------------- ; Print memory usage messages ; ----- ------ ----- -------- PRINTF "Bank $3F has %d bytes free",$FFFF-B3F_END PRINTF "Bank $3C/D has %d bytes free",$C000-B3D_END PRINTF "Bank $3A/B has %d bytes free",$C000-B3B_END PRINTF "Bank $39 has %d bytes free",$C000-B39_END PRINTF "Bank $38 has %d bytes free",$A000-B38_END PRINTF "Bank $37 has %d bytes free",$C000-B37_END PRINTF "Bank $36 has %d bytes free",$A000-B36_END PRINTF "Bank $34 has %d bytes free",$C000-B35_END PRINTF "Bank $32/3 has %d bytes free",$C000-B32_END PRINTF "Bank $30/1 has %d bytes free",$C000-B30_END END ; End of file: DLAIR.ASM ; --- -- ---- --------- ize LDA #2 STA ZPAGE_BYTE2 ;Ysize JSR DRAW_CHR_BLOCK ;Draw disc SET16 ZPAGE_WORD1,ATTRWALL0 JSR SI_SET_ATTR ;Set screen attributes JSR SET_PA ;Reset panel attributes JSR SET_S0 ;Set to screen 0 LDA #104 STA DIRK_X LDA #167 STA DIRK_Y LDX #0 STX ELEV_CNT ;Brick scroll position LDY #1 JMP INIT_SCR_END ; 1a) Normal screen INIT_STATIC INY LDA (ZPAGE_WORD10),Y ;Screen number JSR DRAW_SCREEN ;Draw normal screen LDY #2 LDA (ZPAGE_WORD10),Y STA ZPAGE_WORD1 ;Setup WORD1 as pointer INY ;to attribute map LDA (ZPAGE_WORD10),Y STA ZPAGE_WORD1+1 JSR SI_SET_ATTR ;Draw screen attributes JSR SET_S0 ;Set to screen 0 LDY #4 LDA (ZPAGE_WORD10),Y STA DIRK_Y LDA #12 STA DIRK_X LDY #5 JMP INIT_SCR_END ; 1b) Draw scrolling screen INIT_SCROLLING ; Setup screen height and Y offset to top of strip LDX SCR_NUM LDA IS_SCR_YS,X STA SCROLL_YS LDA IS_SCR_YOFF,X STA SCROLL_YOFF ; Find correct reset point and setup parms for Dirk start pos and screen ; draw. INY LDA (ZPAGE_WORD10),Y STA ZPAGE_WORD1 INY ;Setup WORD1 pointing LDA (ZPAGE_WORD10),Y ;at reset point STA ZPAGE_WORD1+1 ;table LDY #0 SI_FPOS_LOOP LDA (ZPAGE_WORD1),Y STA ZPAGE_WORD2 INY ;WORD2 is reset X LDA (ZPAGE_WORD1),Y STA ZPAGE_WORD2+1 CMP16 DIRK_X_DIE,ZPAGE_WORD2 ;Compare against how far Dirk ;got last go. BCC SI_POS_FOUND ;Exit if reset X is greater TYA CLC ADC #9-1 ;Move to next entry TAY JMP SI_FPOS_LOOP SI_POS_FOUND TYA SEC SBC #9+1 ;Move back to last entry TAY LDA (ZPAGE_WORD1),Y STA SCROLL_XOFFSET INY ;Setup Dirk's X position LDA (ZPAGE_WORD1),Y STA SCROLL_XOFFSET+1 L</div> moremore: [CODE=ASM] DL 0 ENDIF DL 0 ;4- IF SINGE DL S5_TP_TAB ;5 - Singe ELSE DL 0 ENDIF DL S6_TP_TAB ;6 - Elevator DL S7_TP_TAB ;7 - Treasury SCR_TPTR_TABH DH S0_TP_TAB ;0 - Drawbridge IF HALL DH S1_TP_TAB ;1 - Entrance hall ELSE DH 0 ENDIF IF MINES DH S2_TP_TAB ;2 - Mines ELSE DH 0 ENDIF IF REAPER DH S3_TP_TAB ;3 - Grim reaper ELSE DH 0 ENDIF DH 0 ;4- IF SINGE DH S5_TP_TAB ;5 - Singe ELSE DH 0 ENDIF DH S6_TP_TAB ;6 - Elevator DH S7_TP_TAB ;7 - Treasury ;-------------------------------------- ; Include graphics source files ; ------- -------- ------ ----- INCLUDE "GR_SMAP1.SRC" ;-------------------------------------- ; Sprite Collision boxes ; ------ --------- ----- ; Table of pointers to collision boxes SDC_COL_PTRS_L DL SCOL_0 DL SCOL_1 DL SCOL_2 DL SCOL_3 DL SCOL_4 DL SCOL_5 DL SCOL_6 DL SCOL_7 DL SCOL_8 DL SCOL_9 DL SCOL_10 DL SCOL_11 DL SCOL_12 DL SCOL_13 DL SCOL_14 DL SCOL_15 DL SCOL_16 DL SCOL_17 DL SCOL_18 DL SCOL_19 DL SCOL_20 DL SCOL_21 DL SCOL_22 DL SCOL_23 DL SCOL_24 DL SCOL_25 DL SCOL_26 DL SCOL_27 DL SCOL_25 ;28 DL SCOL_26 ;29 DL SCOL_27 ;30 DL SCOL_31 DL SCOL_32 DL SCOL_33 DL SCOL_34 DL SCOL_35 DL SCOL_36 DL SCOL_37 DL SCOL_38 DL SCOL_39 DL SCOL_40 DL SCOL_41 DL SCOL_42 DL SCOL_43 DL SCOL_44 DL SCOL_45 DL SCOL_46 DL SCOL_47 SDC_COL_PTRS_H DH SCOL_0 DH SCOL_1 DH SCOL_2 DH SCOL_3 DH SCOL_4 DH SCOL_5 DH SCOL_6 DH SCOL_7 DH SCOL_8 DH SCOL_9 DH SCOL_10 DH SCOL_11 DH SCOL_12 DH SCOL_13 DH SCOL_14 DH SCOL_15 DH SCOL yeah bro more!! Code (ASM): DA SCR_NUM CMP #6 BNE SF_NOT_6 ; Screen 6 (Elevator) LDA DIRK_FLAG AND #FCD_SEC_BIT ;Only check for exit if on BEQ SF_NOT_6 ;platform, else do normal bump ;into sides. LDA DIRK_X ;Test if walked off left CMP #L_EDGE ;or right edge of elevator BCC SF_OFF_ELEV CMP #R_EDGE BCS SF_OFF_ELEV RTS ; Walked off edge SF_OFF_ELEV LDX SCR_NUM_OLD ;Start correct screen LDA SF_ETABL,X STA ZPAGE_WORD1 LDA SF_ETABH,X ;Setup W1 as pointer to STA ZPAGE_WORD1+1 ;exit list LDY ELEV_ENUM ;Number of exit from elevator LDA (ZPAGE_WORD1),Y ;Screen to go to CMP #7 ;If new screen is treasury BEQ !1 ;don't update SCR_NUM_OLD so CMP #8 BEQ !1 STA SCR_NUM_OLD ;It's the same elev next time !1 STA SCR_NUM JMP SCR_E_END SF_ETABL DL SF_EL0 DL SF_EL1 DL SF_EL2 DL SF_EL3 DL SF_EL4 DL SF_EL5 DL SF_EL6 DL SF_EL7 SF_ETABH DH SF_EL0 DH SF_EL1 DH SF_EL2 DH SF_EL3 DH SF_EL4 DH SF_EL5 DH SF_EL6 DH SF_EL7 SF_EL0 ;Drawbridge SF_EL1 DB 1,2,0,7 ;Entrance hall SF_EL2 DB 1,2,3,7 ;Mines SF_EL3 DB 5,2,3,7 ;Grim reaper SF_EL4 ;Not implemented SF_EL5 ;Singe SF_EL6 ;Elevator SF_EL7 ;Treasury SF_NOT_6 ; Stop exit off left of screen LDA DIRK_X_ONSCR CMP #L_EDGE BCS SF_LOK LDA SCR_NUM ;Dirk exits on the left CMP #7 ;in the treasury BNE !1 LDA END_LEVEL_FLAG ;Exit from treasury BNE SF_LEVEL_END !1 LDA #L_EDGE+4 ;Put Dirk at left JSR SF_CEP SF_LOK SF_SCROLL LDA SCROLL_FLAG ;Is it a scrolling section BEQ SF_NOT_SCROLL LDA SCROLL_XOFFSET+1 ;Test if finished scrolling CMP SCROLL_LENGTH+1 ;(16 bit compare) BCC SF_END BNE !1 LDA SCROLL_XOFFSET CMP SCROLL_LENGTH BCC SF_END ; Scroll h and finally Code (ASM): DH BG_COL_S2 ;Scr 2 - Mines DH BG_COL_S3 ;Scr 3 - Grim reaper DH 0 ;Scr 4 - DH BG_COL_S5 ;Scr 5 - Singe DH BG_COL_S6 ;Scr 6 - Elevator DH BG_COL_S7 ;Scr 7 - Treasury DH BG_COL_S8 ;Scr 8 - Dungeon ; Bonus collision data ; ----- --------- ---- BONUS_TABL DL BTAB_S0 DL BTAB_S1 DL BTAB_S2 DL BTAB_S3 DL 0 DL BTAB_S5 DL BTAB_S6 DL BTAB_S7 DL BTAB_S8 BONUS_TABH DH BTAB_S0 DH BTAB_S1 DH BTAB_S2 DH BTAB_S3 DH 0 DH BTAB_S5 DH BTAB_S6 DH BTAB_S7 DH BTAB_S8 INCLUDE "BG_COL.SRC" ;Background Probably the most interesting part is this: Code (ASM): IF EPROM=99 SEND COMPUTER1 ENDIF IF EPROM=98 SEND MSDOS,"C:\PDSMAST\DLAIRFCS\EPROM\DL.PDS" ENDIF PDSMAST seems to be a very obscure DOS program that archives/backs up code from a master tape. As you can see, the game (even though it's the Japanese revision) still compiles with DOS. Yet the backup directory is DLAIRFCS meaning it's for the FAMICOM SYSTEM. Nifty, I hope Nintendo still has these backups somewhere...
Oh, god, ahahahaha, there is another upside to official code left in stuff, you get to see how lovely programmers were. How does this stuff find it's way into roms in the first place, do they accidentally incbin instead of include or something stupid like that?
In the Dinosaur Hunting Sim series, Carnivores the Carnivores 2 and Ice Age Source code have left overs from the Carnivores 1 source code. Unfortunately, I don't have the source code and even if I did I wouldn't be able to share it due to an agreement with the developers not to redistribute it. However, I do know that they exist because I'm friends with a couple of dudes who are creating a mod with the source code. Of course this is because the game engine was based off the Carnivores 1 game engine so its no surprise really.
More likely they assembled the program, then dumped a section of memory to disk to make the binary, not realizing (or not caring) that the memory also had bits of code in it as well as the assembled code.
Besides the usual pirate, here's one more NES game that caught my eye. Nothing substantial but it's one of a Japanese game. No it's not Air Fortress, but it's a game called Puss n Boots. This snippet is only in the US version AFAIK and I can't find a EU version. The Japanese version doesn't have anything. The comments are in Japanese too - neato. Code (ASM): JSR STEKA LDA #0 STA NWK JSR RANDOM AND #11B BNE :NOTAI ; 3/4 not taikyaku LDA #1 ; Taikyaku bit on (icchokusen ni mukau) :NOTAI: ORA TEKSTS,X BNE :JPCUT STSHIP: SMOGU: JSR STTEKY JSR X0orFF JSR RN3F20 ; 20H..60H STA TEKTIM,X JMP :CNT3 SHCATA: SHCATC: JSR STTEKY LDA #0FFH STA TEKXH,X RTS STPLANE: STBALOON: STSENSUI: JSR STTEKY JSR X0orFF ASL TEKANG,X ASL TEKANG,X; 0 or 4 :CNT3: LDA #3-1 STA TEKHIT,X; 3 patsu de shinu ! RTS SHAMB: SUP1: SBOOTS: SD1000: SD2000: SD3000: PROC JSR STTEKY LDA #0FFH STA TEKXH,X LDA TEKKND,X SEC SBC #28 TAY ; Y=0..5 LDA :BOONO,Y STA TEKPNO,X; Pattern number set LDA #0 STA TEKCTL,X; Control & color set RTS :BOONO: DB 19,11,16,18,18,18 RN3F20: JSR RANDOM AND #3FH ADC #20H RTS ;@@@@@@@@ KOKOKARAHAJIME 04/27 @@@@@@@@@ ; 89/04/27 Tsuika STARU: ;40: Taru SSHA: ;41: Sharin SUMA: ;43: Uma ! But alas, it's just a small fragment.
@ChillyWilly: was there no equiv to /dev/zero on DOS nor an align macro in their assembler, or were they just lazy. =P (Sorry for no quote, on PSP)
I'm not aware of anything similar to /dev/zero on DOS, and assemblers vary considerably. Some assemblers had "align", some required you to make a macro for it, and other had other facilities for alignment, like the "even" directive. Even when you had "align", some assemblers use the argument directly while others use the argument as a power of 2.
I believe a few Satellaview ROM dumps have examples of these, but I can't read it all that well. Hrm.
I'm just saying, you said they probably dumped memory to write the ROM to the right size, why not just zero or nop it out =P.
If they are so lazy they just dump memory to get the binary, what makes you think they'd bother to clear the parts that aren't part of the actual binary? :specialed:
Yay, if it weren't for SegaSaturno yesterday this topic would've been dead yet. Yesterday SegaSaturno released yet another unreleased 32X game ~ the abandoned 32X port of SoulStar X from the Sega CD. There are TONS of code fragments, DOS files (I think the actual editor for the source code is partially in the rom), a bat file for compiling, as well as other unknown stuff (a symbol list maybe?). I need your help with this one, because there's A LOT. I'm only going through the stuff that's formatted. There are tons of other strings in the prototype as well. For reference, you can download the prototype here. Let's begin! Code (ASM): ; PWM Sample Program ; SH2 Master Main ; ; Copyright SEGA ENTERPRISES,LTD. 1994 ;---------------------------------------------------------------* ;**************************************************************** cnop 0,4 ****************************************** * Initialize the PWM interupt and driver * ****************************************** initPWM move #$20004030,r2 move #1047,r0 ;1047 set cycle register (22Khz) move.w r0,(2,r2) move #$0305,r0 ;105 set control register move.w r0,(r2) move #$20004030,r2 ;fill mono fifo move #1,r0 move.w r0,(8,r2) move.w r0,(8,r2) move.w r0,(8,r2) rts nop cnop 0,4 lits cnop 0,4 ************************************************ * Play an 8 bit sample throught the PWM ciruit * ************************************************ ; input ; R1 = Address of sample ; R2 = length of sample ; R3 = channel number ; R4 = step value PlayPWM move #comport1,r0 move.w (r0)+,r1 ;get sfx number move.w (r0)+,r4 ;get step rate move.w (r0)+,r2 ;get volume move #sample_table,r0 shll2 r1 shll r1 add r1,r0 move (r0)+,r2 ;get length move (r0)+,r1 ;get address move #sfx_chan,r5 ;get channel to play move (r5),r0 add #1,r0 and #3,r0 move r0,(r5) move r0,r3 move r2,r0 shll8 r0 move #pwmstructs+TH,r2 shll2 r3 shll2 r3 add r3,r2 move r0,(r2) ;store sample length (bytes) cmpeq #0,r0 bt .done_pwm move r4,(PWMSTEP,r2) ;store step rate shll8 r1 move r1,(PWMADDR,r2) ;store sample address .done_pwm rts nop cnop 0,4 sfx_chan dc.l 0 lits ************************* * PWM interrupt handler * ************************* cnop 0,4 spwm_irq push r0 push r1 push r2 push r3 push r4 push r5 push r6 move #$20004038,r2 move.b (r2),r0 ;is pwm fifo full? tst #$80,r0 bf .exit push pr bsr process_pwm nop pop pr .exit move #_FRT,r1 ;tweak FRT move.b (_TOCR,r1),r0 xor #$02,r0 move.b r0,(_TOCR,r1) move #$2000401C,r2 ;clear irq move.w r0,(r2) move.w (r2),r0 pop r6 pop r5 pop r4 pop r3 pop r2 pop r1 pop r0 rts nop LITS cnop 0,4 NUMCHANNELS equ 4 PWMSIZE equ 4 ; number of elemts in the PWM structure PWMADDR equ 4 PWMSTEP equ 8 ***************** * Fill PWM FIFO * ***************** process_pwm move #$20004038,r2 .loop move #pwmstructs+TH,r3 move #NUMCHANNELS,r4 move #0,r5 .channelloop move (r3),r0 ;is channel on? cmppz r0 bf/s .skip move.w #$80,r1 ;if channel off, use $7f (flat) move (PWMSTEP,r3),r6 sub r6,r0 move r0,(r3) move (PWMADDR,r3),r0 ;get the next pcm byte move r0,r1 add r6,r0 move r0,(PWMADDR,r3) shlr8 r1 move #samp_base,r0 move.b (r0,r1),r1 extu.b r1,r1 .skip add #PWMSIZE*4,r3 add #1,r1 ;make sure it's not 0 add r1,r5 dt r4 bf .channelloop move.w r5,(r2) ;store into mono width move.b (r2),r0 ;is pwm fifo full? tst #$80,r0 bt .loop rts nop LITS pwmstructrotate_player_sprite More! Code (ASM): * rotate sprite routine * ************************* cnop 0,4 rotate_player move #comport1,r0 ;get level move.w (r0)+,r1 move.w (r0)+,r2 move.w (r0)+,r3 move.w (r0)+,r4 shll2 r4 move #frame_table,r0 move (r0,r4),r4 * R1 = xpos * R2 = ypos * R3 = angle * R4 = ptr to source data rot_spr move #divider_unit,r14 push r1 ;xpos push r2 ;ypos shll r3 move #sintab,r0 move.w (r0,r3),r13 ;sine (Dy) move #costab,r0 move.w (r0,r3),r12 ;cosine (Dx) move.w (r4)+,r8 ;xsize move.w (r4)+,r9 ;ysize move r12,r10 ;xadd move r13,r11 ;yadd add r10,r10 add r11,r11 move #rline_buf,r0 ;offset table move #0,r1 ;dstX move #0,r2 ;dstY move #320,r3 move r8,r7 .loop swap.w r2,r14 ;Yint * 320 exts.w r14,r14 dmuls r3,r14 swap.w r1,r5 exts.w r5,r5 move macl,r14 add r5,r14 ;+ Xint move.w r14,(r0) ;store xy pos add #2,r0 add r10,r1 add r11,r2 dt r7 bf .loop pop r2 pop r1 shll16 r1 shll16 r2 move r4,r0 add #4,r0 .yloop move #overwrite,r3 move r1,r5 shlr16 r5 exts.w r5,r5 add r5,r3 move r2,r5 shlr16 r5 exts.w r5,r5 move #320,r4 dmuls r4,r5 move macl,r5 add r5,r3 move r8,r5 move #rline_buf,r7 .oloop move.w (r7)+,r6 ;get screen offset add r3,r6 ;add screen base addr move.b (r0)+,r4 dt r5 ;R7 = line length move.b r4,(r6) ;store pixel add #1,r6 bf/s .oloop move.b r4,(r6) ;store pixel sub r11,r1 add r10,r2 dt r9 bf .yloop rts nop lits cnop 0,4 rline_buf ds.w 128*2 ;;rotate_player ;; move #comport1,r0 ;get level ;; move.w (r0)+,r1 ;; move.w (r0)+,r2 ;; move.w (r0)+,r3 ;; move.w (r0)+,r4 ;; ;; move #sp_pl_ship00,r4 ;; ;;* R1 = xpos ;;* R2 = ypos ;;* R3 = angle ;;* R4 = ptr to source data ;; ;; cnop 0,4 ;; ;;rot_spr ;; move #divider_unit,r14 ;; ;; push r1 ;xpos ;; push r2 ;ypos ;; ;; shll r3 ;; move #sintab,r0 ;; move.w (r0,r3),r13 ;sine (Dy) ;; move #costab,r0 ;; move.w (r0,r3),r12 ;cosine (Dx) ;; ;; move.w (r4)+,r7 ;get line length ;; dmuls r12,r7 ;; move r7,r9 ;; move macl,r7 ;; add r7,r7 ;; shlr16 r7 ;; exts.w r7,r7 ;; ;; move r9,r1 ;get line y height ;; dmuls r13,r1 ;; move macl,r1 ;; add r1,r1 ;; shlr16 r1 ;; exts.w r1,r1 ;; ;; shll16 r9 ;calc line source x add ;; divs r7,r9 ;r9 = x adder,r7 = line length ;; ;; move r13,r6 ;get x adder for draw loop ;; shll2 r6 ;; ;; move.w (r4)+,r8 ;get sprite height ;; dmuls r12,r8 ;; move r8,r10 ;; move macl,r8 ;; add r8,r8 ;; shlr16 r8 ;; exts.w r8,r8 ;; ;; shll16 r10 ;; divs r0,r10 ;r10 = y adder,r8 = height ;; ;; push r7 ; ;; push r8 ; ;; push r10 ; ;; ;; move #320,r10 ;address yadd ;; cmppz r1 ;; bt .1 ;; neg r10,r10 ;; neg r1,r1 ;;.1 ;; move r1,r0 ;; cmpeq #0,r0 ;; bt .2 ;; ;; shll16 r1 ;; divs r8,r1 ;; shll16 r1 ;yadder ;;.2 ;; move r1,r2 ;yfraction ;; shar r2 ;yfraction/2 ;; ;; move #rline_buf,r0 ;offset table ;; move #0,r8 ;sourceX******************************** * 32X Initial 68K Header Code. * ******************************** opt l. cramw equ $C0000000 icramw macro .val = ((\1)>>14) .vala = ((\1)<<16)&111111111111110000000000000000 .val = cramw!.val!.vala move.l #.val,(a6) endm include debug.inc l_type equ 1 0=eur,1=jap,2=USA eur = 0 jap = 1 usa = 0 marsipl equ $880000 acomm0 equ $20 * * Communcation Reg. acomm2 equ $22 * * Communcation Reg. acomm4 equ $24 * * Communcation Reg. acomm6 equ $26 * * Communcation Reg. acomm8 equ $28 * * Communcation Reg. acomm9 equ $29 * * Communcation Reg. acomm10 equ $2a * * Communcation Reg. acomm12 equ $2c * * Communcation Reg. acomm14 equ $2e * * Communcation Reg. vectors group header group code68k group ramcode68k group ramcodesh2 group xref master_start,slave_start,master_vbr,slave_vbr *************************** * 68000 vector ($000000). * *************************** regs pc=$3f0 regs sr=$2700 entry_point equ $000003f0 stack_top equ $00000000 vdp_d equ $c00000 vdp_c equ $c00004 cp_0 equ $a15120 cp_2 equ $a15122 cp_4 equ $a15124 cp_6 equ $a15126 cp_8 equ $a15128 cp_a equ $a1512a cp_c equ $a1512c cp_e equ $a1512e pollhost equ $fc0000 ;downloader ROM. exception equ $fc0004 ;entry points. if debug=1 polhost macro ; dc.w $a000 ;poll host machine. endm ; break macro ; dc.w $a002 ;software breakpoint. endm ; softentry macro ; dc.w $a003 ;link to host machine. endm ; else polhost macro ; endm ; break macro ; endm ; softentry macro ; endm ; endc exc_buserror equ $02000000+exception exc_addrerr equ $03000000+exception exc_illinst equ $04000000+exception exc_div0 equ $05000000+exception exc_chk equ $06000000+exception exc_trapv equ $07000000+exception exc_priv equ $08000000+exception exc_trace equ $09000000+exception exc_linea equ pollhost section vecs,vectors dc.l stack_top ;Initial SSP and PC. dc.l entry_point dc.l $0220800c ;EX_BusError dc.l $0320800c ;EX_AddressError dc.l $0420800c ;EX_IllegalInstruction dc.l $0520800c ;EX_DivideBy0 dc.l $0620800c ;EX_CHK dc.l $0720800c ;EX_TrapV dc.l $0820800c ;EX_Priviledge dc.l $0920800c ;EX_Trace dc.l EXC_LineA dc.l EXC_LineF * Reserved by motorola dcb.l 12,0 ; EX_Motorola * Hardware interrupts dc.l EXC_Spurious dc.l EXC_Level1 dc.l EXC_Level2 dc.l EXC_Level3 dc.l EXC_Level4 dc.l EXC_Level5 dc.l EXC_Level6 dc.l EXC_Level7 dc.l $20208008 ;EX_Trap0 dc.l EXC_Trap1 dc.l EXC_Trap2 dc.l EXC_Trap3 dc.l EXC_Trap4 dc.l EXC_Trap5 dc.l EXC_Trap6 dc.l EXC_Trap7 dc.l EXC_Trap8 dc.l EXC_Trap9 dc.l EXC_TrapA dc.l EXC_TrapB dc.l EXC_TrapC dc.l EXC_TrapD dc.l EXC_TrapE dc.l EXC_TrapF * Reserved by motorola dcb.l 16,_error0 ************************* * Genesis ID ($000100). * ************************* section hdr,header dc.b 'SEGA 32X ' dc.b '©T115 1995.APR' dc.b 'SOULSTAR X ' dc.b 'SOULSTAR X ' dc.b 'T-11505B-50 ' ;stuff dc.w 0 ;checksum. dc.b 'J ' ;joystick. dc.l $000000 ;rom start. dc.l $1fffff ;rom end. dc.l $ff0000 ;ram start. dc.l $ffffff ;ram end. dc.b 'MR',0,0 dc.l 0,0 dc.b ' '******************** * Game Code Start. * ******************** include mequates.68k include obj_equ.s ****************************************************************************** include coms_equ.s com macro move #com_\1,d0 jsr send_com endm com4 macro move #com_\1,d0 jsr send_com4 endm jcom macro move #com_\1,d0 jmp send_com endm jcom4 macro move #com_\1,d0 jmp send_com4 endm ****************************************************************************** no_traps equ 1 briefings equ 0 ****************************************************************************** button_a equ 0 button_b equ 1 button_c equ 2 button_pause equ 3 button_option equ 4 button_y equ 5 button_z equ 6 ****************************************************************************** ram_duration equ 31*20 bonus_hits equ 10 sh_del equ 4 mt_countdown08 equ 4 ****************************************************************************** music macro move #cdm_\1,d0 jsr start_music endm cdm_title equ $00 cdm_boss equ $2d cdm_l360 equ $41 cdm_death equ $59 cdm_fame equ $5a cdm_credits equ $6b cdm_level123 equ $7b cdm_kutra equ $93 cdm_gigun equ $a9 cdm_bulkan equ $c1 cdm_twingha equ $d6 cdm_guha equ $ea cdm_metafus equ $101 cdm_krast equ $11a ****************************************************************************** ****************************************** ntempsp equ 16 nweaps equ 16 nenweap equ 16 nenemy equ 20 nfxspr equ 32 wbase equ 128 maxshield equ 30 maxacc equ 224 ****************************************************************************** ****************************************************************************** hp_mult equ 4 hp_shift equ 2 cpu_hits equ 128*hp_mult guha_hits equ 512*hp_mult bulkan_hits equ 128*hp_mult ; Mid-Boss bulkan2_hits equ (256/2)*hp_mult ; BOSS metafus_hits equ 256*hp_mult gigun_hits equ 256*hp_mult hp_a0 macro move #(\1)*hp_mult,en_hp(a0) endm hp_a5 macro move #(\1)*hp_mult,en_hp(a5) endm hp_a6 macro move #(\1)*hp_mult,en_hp(a6) endm ****************************************************************************** sclip equ 200 ************************************************* pickup macro dc (pu_\1<<12)+\2 ;tttt0mmmssssssss endm pu_shield equ 0 pu_energy equ 1 pu_shot equ 2 pu_hunter equ 3 pu_ring equ 4 pu_laser equ 5 pu_missile equ 6 pu_bomb equ 7 pu_rocket equ 8 pu_charge equ 9 ****************************************************************************** odb macro dc \1 ;col-dist dc \2,\3 ;x1,x2 dc \4,\5 ;y1,y2 dc.l \6 ;hit handler dc.l \7 ;logic handler dc.l \8 ;360 logic handler dc.l \9 ;output handler dc.l \10 ;initialiser dc.b \11 ;targetable dc.b \12 ;radarable endm push macros move. \1,-(sp) pop macros move. (sp)+,\1 pushm macros movem. \1,-(sp) popm macros movem. (sp)+,\1 pushal macros movem d3-d5,-(sp) popal macros movem (sp)+,d3-d5 pusha macros movem.l d0-d7/a0-a6,-(sp) popa macros movem.l (sp)+,d0-d7/a0-a6 enemy macro dc \1,ot_\2 dc \3,\4,\5 endm set_ld macro IF l_type=0 move.b #\1-1,ldel ELSE move.b #\1-1,ldel ENDIF * bsr modify_fire_rate endm set_ld2 macro IF l_type=0 move.b #\1-1,ldel2 ELSE move.b #\1-1,ldel2 ENDIF endm mp_sfx macro pushm.l d1-d3 moveq #sam_\1,d1 move #(\2)/2,d2 move #\3,d3 com4 play_sfx popm.l d1-d3 rts endm ****************************************************************************** scratch_ram equ $ffff0000 ;guess wot? v_spratt equ $fc00 ;SAT base. v_hscrl equ $f000 ;H-scroll table base. include equates.68k ;equates + macros. game_code SOFTENTRY lea $880000+grouporg(ramcode68k),a0 lea $ffff8000,a1 move.l #groupend(ramcode68k)-grouporg(ramcode68k)-1,d7 .ccl move.b (a0)+,(a1)+ dbf d7,.ccl move.l sp,sp_save jsr setup_player ****************** * Game RAM Code. * ****************** game_start di ;disable interrupts. jsr init_vdp ;write initial values to VDP. jsr init_joy ;read joystick types. ei main_start jsr screen_on clr level ; MOVE #2,LEVEL ; MOVE #3,LEVEL bsr restart_life_lost move #3,lives sf diff_level clr.l score bsr level_setup moveq #0,d0 jsr add_to_score ******************************************************************************* lea node_head,a0 lea node_tail,a1 move.l a1,node_next(a0) move.l a0,node_prev(a1) clr game_del clr fade_delay ******************************************************************************* ; jsr scroff move.b #2,vbl_count clr startup_count st in_game mloop .1 jsr wait_vbl tst.b vbl_count bne.s .1 IF l_type=1 move.b #3,vbl_count ELSE move.b #2,vbl_count ENDIF lea vdp_c,a6 ivramw v_hscrl move back_x,-4(a6) move back_x,-4(a6) *************************************** jsr level_flipper *************************************** jsr level_output *************************************** addq #1,game_del and #$7fff,game_del bne.s .ng_roll or #$1000,game_del .ng_roll: *************************************** move scr_spd,d0 IF l_type=0 muls #$3334,d0 swap d0 add scr_spd,d0 ENDIF move d0,scr_spd2 *************************************** tst sh_hit_num beq.s .sh_hit_ok tst dying_cnt bne.s .sh_hit_ok subq #1,sh_hit_del bpl.s .sh_hit_ok subq #1,sh_hit_num jsr do_low_shield_sfx move #sh_del,sh_hit_del .sh_hit_ok: *************************************** jsr pickup_system cmp #04,level bne.s .not_gigun jsr gigun_checks .not_gigun: jsr end_fader *************************************** sf hit_sfx_already *************************************** clr tmp_slot *************************************** * Do all processing here! * *************************** subq #1,gcnt3 bpl.s .gcnt3 move #3-1,gcnt3 .gcnt3: subq #1,gcnt5 bpl.s .gcnt5 move #5-1,gcnt5 .gcnt5: subq #1,gcnt6 bpl.s .gcnt6 move #6-1,gcnt6 .gcnt6: subq #1,gcnt9 bpl.s .gcnt9 move #9-1,gcnt9 .gcnt9: subq #1,gcnt10 bpl.s .gcnt10 move #9-1,gcnt10 .gcnt10: subq #1,gcnt12 bpl.s .gcnt12 move #12-1,gcnt12 .gcnt12: subq #1,gcnt19 bpl.s .gcnt19 move #19-1,gcnt19 .gcnt19: tst dying_cnt beq.s .not_dying jsr do_player_dying bra.s .no_ctl .not_dying: tst startup_count bne.s .no_ctl jsr do_v_control .no_ctl: tst.b is_360 beq.s .no_360 jsr set_360_map_pos .no_360: *************************************** bsr level_control *************************************** jsr create_enemies jsr get_all_enemies jsr get_all_weapons jsr do_next_weapon ****************************************************************************** * Check for 2nd player * ************************ tst.b ply2mode beq.s .1player_only jsr do_next_weapon_2 jsr player_2_control jsr player_2_weapons bra.s .2player_done .1player_only: jsr power_transfer_1p cmp #2,vehicle bne.s .not_walker1 jsr do_1p_walker_targetting tst poptarg beq.s .no_poptarg subq #1,poptarg move.l mtarget,d0 beq.s .no_poptarg move.l d0,a6 move mob_x(a6),d0 move mob_y(a6),d1 moveq #0,d2 moveq #0,d6 lea node_msight,a6 movem d0/d1/d2/d6/d7,node_data(a6) move #ot_msight,mob_type(a6) jsr insert_sprite .no_poptarg: bra.s .2player_done .not_walker1: lea weapon_tab,a0 add weapon,a0 cmp.b #pw_bomblet,(a0) bne.s .2player_done jsr handle_missile_sight .2player_done: ****************************************************************************** jsr plot_rams jsr plot_player tst charge_cnt beq.s .not_charging jsr insert_charge_spr .not_charging: *************************************** bsr draw_sprites jsr draw_panel com flip_screen jsr wait_com btst #button_pause,joy1 bne.s .no_pause .paused jsr wait_vbl btst #button_pause,joy1 beq.s .paused .paused1 jsr wait_vbl btst #button_pause,joy1 bne.s .paused1 .paused2 jsr wait_vbl btst #button_pause,joy1 beq.s .paused2 .no_pause MOVE.B #16,shield bra mloop ****************************************************************************** * CPIC backgrounds * ******************** back_00a incbin backs\space1.cpi even back_00b incbin backs\space2.cpi even back_03 incbin backs\warpship.cpi even ****************************************************************************** * 360 object data * ******************* zone_03_dat incbin stages\zone03.dat even zone_05_dat incbin stages\zone05.dat even zone_08_dat incbin stages\zone08.dat even zone_11_dat incbin stages\zone11.dat even zone_17_dat incbin stages\zone17.dat even zone_24_dat incbin stages\zone24.dat even zone_26_dat incbin stages\zone26.dat even ****************************************************************************** * Decompress background (2 playfields) * **************************************** * A0 = playfield #1 * A1 = playfield #2 decomp_68k_backgr push.l a1 lea scratch_ram,a1 jsr unpack lea scratch_ram,a0 move #$e000,d0 move #64*2,d1 jsr decomp_cpic pop.l a0 move.l a0,d0 ;if -I've, only decomp 1st screen bmi.s .skip ;skip unpack lea scratch_ram,a1 jsr unpack .skip lea scratch_ram,a0 move #$c000,d0 move #64*2,d1 *************** * decomp CPIC * *************** * A0 = ptr to CPIC file * D0 = dest. adr * D1 = dest CMAP width*2 decomp_cpic lea vdp_c,a6 vreg 15,2 bsr dc_palette movem d0/d1,-(sp) bsr dc_chars movem (sp)+,d0/d1 dc_cmap move d0,d4 move d1,dest_xsize moveq #0,d2 move cpic_map(a0),d2 beq.s .map_done lea (a0,d2.l),a2 moveq #0,d5 move.b cpic_x(a0),d5 moveq #0,d6 move.b cpic_y(a0),d6 subq #1,d6 .yloop move d4,d2 move.l a2,d1 move d5,d0 add d5,a2 add d5,a2 bsr dma_trans_wr add dest_xsize,d4 dbf d6,.yloop .map_done rts dc_chars move cpic_dchar(a0),d2 move cpic_char(a0),d3 lea (a0,d3),a1 move.l a1,d1 move cpic_nchar(a0),d0 bra dma_trans_wr dc_palette move.l a4,-(sp) lea palette_store,a4 move cpic_opal(a0),d3 beq.s .no_palette lea 2(a0,d3),a1 move cpic_cpal(a0),d2 add d2,a4 or #$c000,d2 ;CRAM write move d2,(a6) move #0,(a6) lea -4(a6),a5 move.l (a1),(a4)+ move.l (a1)+,(a5) move.l (a1),(a4)+ move.l (a1)+,(a5) move.l (a1),(a4)+ move.l (a1)+,(a5) move.l (a1),(a4)+ move.l (a1)+,(a5) move.l (a1),(a4)+ move.l (a1)+,(a5) move.l (a1),(a4)+ move.l (a1)+,(a5) move.l (a1),(a4)+ move.l (a1)+,(a5) move.l (a1),(a4)+ move.l (a1)+,(a5) .no_palette move.l (sp)+,a4 rts dma_trans_wr push.l a0 lea vdp_c,a6 vreg 15,2 addq #1,d0 lsr #1,d0 move.l d1,a0 move d2,d1 and #$3fff,d2 or #$4000,d2 and #$c000,d1 rol #2,d1 swap d2 move d1,d2 move.l d2,(a6) lea -4(a6),a5 .loop move.l (a0)+,(a5) dbf d0,.loop pop.l a0 rts ******************* * Disable Screen. * ******************* screen_off and #~$0040,reg1_shadow ;disable screen output. move reg1_shadow,vdp_c ;write reg1 (screen enable). rts ****************** * Enable Screen. * ****************** screen_on or #$0040,reg1_shadow ;enable screen output. move reg1_shadow,vdp_c ;write reg1 (screen enable). rts *********************** * Read PAL/NTSC Flag. * *********************** get_tv lea vdp_c,a6 ; moveq #1,d0 ;read PAL/NTSC flag. and (a6),d0 ; lea cp_a,a6 ;write result to smooth-scroll A. move d0,(a6) ; rts *************** * Clear VRAM. * *************** clear_vram lea vdp_c,a6 vreg 15,2 ; ivramw 0 ;clear VRAM. move #(65536/4)-1,d7 ; .cvl move.l #0,-4(a6) dbf d7,.cvl rts ****************************************************************************** reset_specials move.l #$08090aff,weapon_tab+4 tst.b ply2mode beq.s .1p move.l #$08090a00,weapon_tab+4 .1p rts ****************************************************************************** restart_life_lost lea vars_start,a0 move #((vars_end-vars_start)/2)-1,d7 .cvars clr (a0)+ dbf d7,.cvars lea STRUCT_START,a0 move #((STRUCT_END-STRUCT_START)/4)-1,d0 .c2loop clr.l (a0)+ dbf d0,.c2loop move #128,msight_x move #88,msight_y moveq #4,d1 tst.b ply2mode beq.s .n_2mw move.l #$00070003,d1 .n_2mw move.l d1,weapon lea weapon_tab,a0 move.l #$00ffff04,(a0)+ move.l #$08090aff,(a0)+ tst.b ply2mode beq.s .1p move.l #$ffffff04,-8(a0) move.l #$08090a00,-4(a0) .1p st oweapon st oweapon2 st opower sf ram_weapon clr ram_count clr torpedo_count move.b #maxshield/2,shield move #(maxacc-1)/3,acc clr bombs_rem clr rockets_rem move #40,missiles_rem clr player_x move #$48,player_y move #sclip,yclip rts ****************************************************************************** set_hp_a0 move d0,mob_hp(a0) rts ****************************************************************************** scroff jmp screen_off set_scron_delay move #3,scron_delay rts ****************************************************************************** getrand move.b rand_num,d0 move.b rand_num+1,rand_num move.b d0,rand_num+1 ; move $ff800c,d0 add rand_num,d0 ror rand_num rts ****************************************************************************** play_music add_qsound remove_qsound_a5 do_pl_startup rts rotate_player_sprite move node_player+mob_x,d1 move node_player+mob_y,d2 move pbank,d3 asr #3,d3 and #$7ff,d3 move node_player+mob_def,d4 jcom4 rotate_player ****************************************************************************** include planet.s include surface.s include sprite.s include levels.s include elogic.s include mapping.s include bulkan.s include guha.s include twingha.s include metafus.s include gigun.s include krast.s include map360.s include weapons.s include weapons2.s ;2nd player include music.s include control2.s include title.s include options.s include panel.s include cosin.s odb_table odb -001,$000,-$000,$000,-$000,0,h_null,h_null,h_null,h_null,0,0 rept 127 odb $400,$200,-$200,$200,-$200,hit_enemy,do_path_anim,0,plot_spr,init_path_alien,0,0 endr * player weapons (20) odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_hunter_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_pl_laser,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_pl_rocket,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_chargeable_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_pl_laser,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 rept 107 odb -001,$000,-$000,$000,-$000,0,do_path_anim,0,plot_spr,hnull,0,0 endr odb -001,$000,-$000,$000,-$000,0,h_null2,0,plot_spr,hnull,0,0 * explosions odb -001,$000,-$000,$000,-$000,0,h_g_exp,h_g_exp_360,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_a_exp,h_a_exp_360,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_g_exp,h_g_exp_360,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_a_exp,h_a_exp_360,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_g_exp,h_g_exp_360,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_a_exp,h_a_exp_360,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_a_exp,h_a_exp_360,plot_spr,hnull,0,0 * sm exp (or/bl) odb -001,$000,-$000,$000,-$000,0,h_sm_exp_or,h_sm_exp_or_360,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_sm_exp_bl,h_sm_exp_bl_360,plot_spr,hnull,0,0 * small tank smoke odb -001,$000,-$000,$000,-$000,0,h_st_smoke,h_st_smoke_360,plot_spr,hnull,0,0 * small exp (stage #09 BOSS) odb -001,$000,-$000,$000,-$000,0,h_smexp09,0,plot_spr,h_null,0,0 * small smoke (GIGUN) odb -001,$000,-$000,$000,-$000,0,h_sm_exp_bl2,0,plot_spr,h_null,0,0 * player explosions odb -001,$000,-$000,$000,-$000,0,h_a_exp,h_a_exp_360,plot_spr,hnull,0,0 * enemy weaps (32) odb -001,$000,-$000,$000,-$000,0,h_eweap00,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap01,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_grzap_laser,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap04,0,plot_tlaser_16,hnull,0,0 odb $400,$200,-$200,$200,-$200,hit_enemy_missile,h_eweap_missile05,0,plot_spr,hnull,0,0 odb $400,$300,-$300,$200,-$200,hit_enemy,h_eweap06,0,plot_spr,init_3hp,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap07,0,plot_spr,hnull,0,0 odb $400,$200,-$200,$200,-$200,hit_enemy_missile,h_eweap08,0,plot_spr,hnull,0,0 odb $c00,$080,-$000,$080,-$080,hit_enemy_missile,h_eweap09,h_eweap09_360,plot_spr,hnull,1,$4 odb -001,$000,-$000,$000,-$000,0,h_eweap0B,h_eweap0A_360,plot_spr,hnull,0,0 odb $c00,$080,-$000,$080,-$080,hit_28_shot,h_eweap0B,h_eweap0B_360,plot_spr,hnull,0,$f odb -001,$000,-$000,$000,-$000,0,h_eweap0E,h_eweap0C_360,plot_tlaser_360,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap0E,h_eweap0D_360,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap0E,h_eweap0E_360,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap0F,h_eweap0F_360,plot_tlaser_360,hnull,0,0 odb $400,$200,-$200,$200,-$200,hit_enemy_missile,h_eweap10,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0 * player ship odb -001,$000,-$000,$000,-$000,0,h_null,0,rotate_player_sprite,h_null,0,0 * player walker odb -001,$000,-$000,$000,-$000,0,hnull,0,plot_player_walker,hnull,0,0 * missile sight odb -001,$000,-$000,$000,-$000,0,hnull,0,plot_msight,hnull,0,0 * stage 08 warping orb odb -001,$000,-$000,$000,-$000,0,h_worb08,0,plot_spr,h_null,0,0 * stage 05 laser sight odb -001,$000,-$000,$000,-$000,0,h_null,hl_05_lsight,plot_05_lsight,h_null,0,0 * stage 05 laser beam odb -001,$000,-$000,$000,-$000,0,h_null,hl_05_lbeam,plot_05_lbeam,h_null,0,0 * asteroid odb -001,$000,-$000,$000,-$000,0,h_asteroid00,0,plot_star,h_null,0,0 * building fragments odb -001,$000,-$000,$000,-$000,0,h_leira_bf1,h_leira_bf_360,plot_frag_spr,h_null,0,0 odb -001,$000,-$000,$000,-$000,0,h_leira_bf2,h_leira_bf_360,plot_frag_spr,h_null,0,0 odb -001,$000,-$000,$000,-$000,0,h_leira_bf3,h_leira_bf_360,plot_frag_spr,h_null,0,0 odb -001,$000,-$000,$000,-$000,0,h_leira_bf4,h_leira_bf_360,plot_frag_spr,h_null,0,0 * panel palette fragments odb -001,$000,-$000,$000,-$000,0,h_pfrag1,h_leira_bf_360,plot_spr,h_null,0,0 odb -001,$000,-$000,$000,-$000,0,h_pfrag2,h_leira_bf_360,plot_spr,h_null,0,0 odb -001,$000,-$000,$000,-$000,0,h_pfrag3,h_leira_bf_360,plot_spr,h_null,0,0 odb -001,$000,-$000,$000,-$000,0,h_pfrag4,h_leira_bf_360,plot_spr,h_null,0,0 odb -001,$000,-$000,$000,-$000,0,h_pfrag1s,h_leira_bf_360,plot_spr,h_null,0,0 odb -001,$000,-$000,$000,-$000,0,h_pfrag2s,h_leira_bf_360,plot_spr,h_null,0,0 odb -001,$000,-$000,$000,-$000,0,h_pfrag3s,h_leira_bf_360,plot_spr,h_null,0,0 odb -001,$000,-$000,$000,-$000,0,h_pfrag4s,h_leira_bf_360,plot_spr,h_null,0,0 * player hit odb -001,$000,-$000,$000,-$000,0,h_plyhit,0,plot_spr,hnull,0,0 * player RAM unit odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0 * enemy 2 - down odb -001,$000,-$000,$000,-$000,0,h_enemy2_down,0,plot_spr,hnull,0,0 * leira lander down odb $400,$200,-$200,$200,-$200,0,h_leira_lander_down,0,plot_spr,hnull,0,0 * falling mine odb -001,$000,-$000,$000,-$000,0,h_falling_mine,0,plot_mine_spr,hnull,0,0 * sand spray odb -001,$000,-$000,$000,-$000,0,h_sand_spray,hl_sand_spray_360,plot_spr,hnull,0,0 * sand spray (small) odb -001,$000,-$000,$000,-$000,0,h_sand_spray2,hl_sand_spray2_360,plot_spr,hnull,0,0 * snakey sand spray odb -001,$000,-$000,$000,-$000,0,h_sand_spray_s,0,plot_spr,hnull,0,0 * guha crater odb -001,$000,-$000,$000,-$000,0,h_guha_crater,hl_guha_crater_360,plot_spr,hnull,0,0 * guha boss shield hit! odb -001,$000,-$000,$000,-$000,0,h_guha_bhit,hl_guha_bhit,plot_spr,hnull,0,0 * twingha water splashes (vlarge/large/small) odb -001,$000,-$000,$000,-$000,0,h_vl_splash10,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_l_splash10,0,plot_spr,hnull,0,0 odb -001,$000,-$000,$000,-$000,0,h_s_splash10,0,plot_spr,hnull,0,0 ; rept 384-ot_fxlast ; odb -001,$000,-$000,$000,-$000,0,0,0,0,hnull,0,0 ; endr * bonus 1a-c ci_bonus1 odb $400,$300,-$300,$300,-$300,hit_bonus1abc,h_bonus1a,0,plot_bonus,hnull,0,0 odb $400,$300,-$300,$300,-$300,hit_bonus1abc,h_bonus1b,0,plot_bonus,hnull,0,0 odb $400,$300,-$300,$300,-$300,hit_bonus1abc,h_bonus1c,0,plot_bonus,hnull,0,0 * leira rocks odb $400,$100,-$100,$100,-$c00,hit_indestructible,h_leira_trock,0,plot_spr,hnull,0,0 odb $400,$100,-$100,$100,-$800,hit_indestructible,h_leira_mrock,0,plot_spr,hnull,0,0 odb $400,$100,-$100,$100,-$400,hit_indestructible,h_leira_srock,0,plot_spr,hnull,0,0 * warpship boss odb $c00,$100,-$000,$100,-$000,hit_indestructible_360,h_boss03,0,plot_spr,hnull,0,$a * warpship pilon odb $c00,$0c0,-$000,$180,-$000,hit_indestructible_360,h_wpilon03,0,plot_spr,hnull,0,$a * warpship shield odb $c00,$0c0,-$000,$070,-$070,hit_indestructible_360,h_shields03,0,plot_spr,hnull,0,$a * warpship warpgate odb -001,$000,-$000,$000,-$000,0,h_warpgate03,0,plot_spr,hnull,0,$f * cpu malfunction odb -000,$000,-$000,$000,-$000,0,h_malf03,0,plot_spr,hnull,0,0 * warpship pylon odb -001,$000,-$000,$000,-$000,0,h_wp_pilon,0,plot_spr,hnull,0,$a * warpship small pylon odb $c00,$080,-$000,$100,-$000,0,h_sm_pilon03,0,plot_spr,hnull,0,$a * warpship fragment W,A,B odb -001,$000,-$000,$000,-$000,0,h_fragment03w,0,h_null,h_null,0,0 odb $c00,$0e0,-$000,$120,-$000,hit_indestructible_360,h_fragment03a,h_fragment_03_360,plot_spr,hnull,0,0 odb $c00,$0e0,-$000,$120,-$000,hit_indestructible_360,h_fragment03b,0,plot_spr,hnull,0,$3 * guha rocks odb $c00,$0c0,-$000,$100,-$000,hit_indestructible_360,h_guha_rock1,0,plot_spr,h_null,0,0 odb $c00,$080,-$000,$080,-$000,hit_indestructible_360,h_guha_rock2,0,plot_spr,h_null,0,0 * guha dome odb $c00,$100,-$000,$0c0,-$000,hit_guha_dome360,h_guha_dome1,0,plot_spr,init_guha_dome,1,$2 odb $c00,$100,-$000,$0c0,-$000,hit_guha_dome360,h_guha_dome2,0,plot_spr,h_null,1,$2 odb $c00,$100,-$000,$050,-$000,hit_indestructible_360,h_guha_dome3,0,plot_spr,h_null,0,0 * guha small tower odb $c00,$080,-$000,$0c0,-$000,hit_guha_smtower360,h_guha_smtower1,0,plot_spr,h_null,1,$3 odb $c00,$080,-$000,$080,-$000,hit_indestructible_360,h_guha_smtower2,0,plot_spr,h_null,0,0 * guha pilon odb $c00,$080,-$000,$180,-$000,hit_guha_pilon360,h_guha_pilon,0,plot_guha_pilon,h_null,0,$3 ******************************************************************** * twingha rocks * ***************** * flat rock odb $400,$180,-$180,$100,-$100,hit_indestructible,h_fl_rock10,0,plot_spr,hnull,0,0 * small rock odb $400,$180,-$180,$100,-$400,hit_indestructible,h_s_rock10,0,plot_spr,hnull,0,0 * tall rock odb $400,$180,-$180,$100,-$d00,hit_indestructible,h_t_rock10,0,plot_spr,hnull,0,0 * tall umbrella rock odb $400,$180,-$180,$100,-$d00,hit_indestructible,h_tu_rock10,0,plot_spr,hnull,0,0 ******************************************************************** ; rept 512-ot_htlast ; odb -001,$000,-$000,$000,-$000,0,0,0,0,hnull,0,0 ; endr * bonus 1 ci_bonus2 odb $400,$200,-$200,$200,-$200,hit_bonus1,h_bonus1,0,plot_spr,init_bonus1,$1,0 ************* * STAGE #00 * ************* * small starbase odb -001,$000,-$000,$000,-$000,0,h_enemy4,0,plot_spr,init_en4,$0,0 ************* * STAGE #01 * ************* * leira buildings odb $400,$300,-$300,$100,-$800,hit_ground_obj_f,h_leira_od,0,plot_spr,init_1hp,$1,0 odb -001,$300,-$300,$100,-$400,hit_indestructible,h_leira_od_d,0,plot_spr,hnull,0,0 odb $400,$200,-$200,$100,-$b00,hit_ground_obj_f,h_leira_b1,0,plot_spr,init_3hp,$1,0 odb -001,$200,-$200,$100,-$200,hit_indestructible,h_leira_b1_d,0,plot_spr,hnull,0,0 odb $400,$300,-$400,$100,-$1000,hit_ground_obj_f,h_leira_rb2,0,plot_spr,init_6hp,$1,0 odb -001,$300,-$400,$100,-$600,hit_indestructible,h_leira_rb2_d,0,plot_spr,hnull,0,0 odb $400,$300,-$400,$100,-$1000,hit_ground_obj_f,h_leira_lb2,0,plot_spr,init_6hp,$1,0 odb -001,$300,-$400**************** * Control file * **************** do_v_control tst dying_cnt beq.s .not_dying rts .not_dying move.b joy0,d1 tst.b in_lava beq.s .not_lava1 or.b #$0c,d1 .not_lava1 move vehicle,d0 subq #1,d0 bmi striker_ctrl beq copter_ctrl walker_ctl cmp #2+4,walker_count beq.s .t2 cmp #2,walker_count bne.s .t1 .t2 move walker_count,d3 cmp l_walker_count,d3 beq.s .t2a tst warp_count bne.s .t2a jsr do_walker_foot_sfx .t2a clr scr_spd clr walker_dir sf walker_turn .t1 tst warp_count bne .we_are_warping move pbank,d3 btst #2,d1 bne.s .nl st walker_turn move #-1,walker_dir add #$080,d3 cmp #$200,d3 blt.s .pbd move #$200,d3 bra.s .pbd .nl btst #3,d1 bne.s .nr st walker_turn move #-1,walker_dir sub #$080,d3 cmp #-$200,d3 bgt.s .pbd move #-$200,d3 bra.s .pbd .nr tst.b walker_turn bne.s .pbd tst d3 beq.s .pbd bmi.s .pbadd .pbsub sub #$80,d3 bra.s .pbd .pbadd add #$80,d3 .pbd move d3,pbank move walker_count,l_walker_count tst slide_count beq .no_slide btst #0,d1 beq.s .up_ok cmp #6,slide_count ble.s .fuel_ok_97 move #6,slide_count ; bra.s .fuel_ok_97 .up_ok ; moveq #7,d0 ; and game_del,d0 ; bne.s .fuel_ok_97 ; subq #1,acc .fuel_ok_97 sf walker_turn move slide_count,d0 cmp #(20*3)-6,d0 ble.s .slide2 moveq #(20*3)-1,d0 sub slide_count,d0 lsl #4,d0 bra.s .slide1 .slide2 ; tst acc ; bne.s .fuel_ok_98 ; subq #2,scr_spd ; bpl .all_done ; clr scr_spd ; clr slide_count ;.fuel_ok_98 subq #1,d0 add d0,d0 add d0,d0 cmp #$60,d0 ble.s .slide1 moveq #$60,d0 .slide1 move d0,scr_spd bra .all_done .no_slide tst jump_mode beq .no_jump cmp #1,jump_mode bne.s .not_jm1 subq #1,jump_count2 bpl .all_done move.b joy_spc1,d0 btst d0,joy1 beq.s .jmp1_ok clr jump_mode bsr find_next_target jsr do_ntarg_sfx bra .no_jump .jmp1_ok addq #1,jump_mode .not_jm1 cmp #2,jump_mode bne.s .not_jm2 addq #1,jump_count cmp #(20+(20/2))/2,jump_count bne .update_jmp addq #1,jump_mode move #20*3,jump_count2 bra .update_jmp .not_jm2 cmp #3,jump_mode bne.s .not_jm3 cmp #$58,jump_thrust beq.s .jmp_th_ok add #$0b,jump_thrust .jmp_th_ok move.b joy_spc1,d0 btst d0,joy1 bne.s .jump_x ; tst acc ; beq.s .jump_x ; moveq #7,d0 ; and game_del,d0 ; bne.s .fuel_ok_99 ; subq #1,acc ;.fuel_ok_99 subq #1,jump_count2 bpl .update_jmp .jump_x addq #1,jump_mode clr jump_count2 bra.s .update_jmp .not_jm3 tst jump_thrust beq.s .jmp_th_ok2 subq #4,jump_thrust bpl.s .jmp_th_ok2 clr jump_thrust .jmp_th_ok2 addq #1,jump_count cmp #20,jump_count bne.s .update_jmp subq #1,jump_count move jump_thrust,d0 asr #1,d0 move d0,scr_spd clr player_y cmp #20/2,jump_count2 beq.s .th_ok3 addq #1,jump_count2 .th_ok3 tst jump_thrust bne .all_done cmp #20/2,jump_count2 bne .all_done clr jump_mode clr player_y rts .update_jmp lea sintab,a0 move jump_count,d0 muls #1024/20,d0 add d0,d0 move.b (a0,d0),d0 ext d0 push d0 asr #2,d0 move d0,player_y asr #1,d0 add d0,player_y pop d0 asr #1,d0 add jump_thrust,d0 asr #1,d0 move d0,scr_spd bra .all_done .no_jump btst #0,d1 bne.s .no_act_slide cmp #20/4,bb_down ble.s .no_act_slide ; tst acc ; beq.s .no_act_slide move #20*3,slide_count move #2,walker_count clr walker_dir sf walker_turn bra .all_done .no_act_slide move.b joy_spc1,d0 btst d0,joy1 bne.s .no_act_jump move #1,jump_mode clr jump_count move #20/5,jump_count2 move #2,walker_count clr scr_spd clr walker_dir sf walker_turn bra .all_done .no_act_jump tst.b in_lava bne.s .not_down btst #0,d1 bne.s .not_up move #1,walker_dir move #$12,scr_spd .not_up btst #1,d1 bne.s .not_down move #-1,walker_dir move #-$12,scr_spd .not_down .we_are_warping move walker_dir,d3 btst #0,game_del+1 beq.s .walk2 moveq #0,d3 .walk2 add d3,walker_count and #7,walker_count .all_done rts ****************************************************************************** copter_ctrl tst.b ctl_off beq.s .ctl1 move.b ctl_off2,d1 bra.s .ctl2 .ctl1 move.b joy_spc1,d0 btst d0,joy1 ;* beq .okay .ctl2 btst #0,d1 bne.s .not_up cmp #6,pitch_ang ;6 bge.s .okay addq #2,pitch_ang bra.s .okay .not_up btst #1,d1 bne.s .not_down cmp #-6,pitch_ang ;-6 ble.s .okay subq #2,pitch_ang bra.s .okay .not_down tst pitch_ang beq.s .okay bmi.s .add .sub subq #1,pitch_ang bra.s .okay .add addq #1,pitch_ang .okay move pitch_ang,d2 move d2,d0 asr #1,d0 neg d0 move d0,pitch_ang2 tst warp_count ;WARPSHIP bne.s .sp_okay moveq #8,d3 move d1,ccr bcc.s .is_8 bvc.s .is_8 moveq #4,d3 .is_8 add d2,d2 add d2,d2 add d2,d2 tst cpu_rspd bne.s .boss03act add d2,d2 .boss03act move scr_spd,d0 cmp d2,d0 beq.s .sp_okay bge.s .sp_sub .sp_add add d3,scr_spd bra.s .sp_okay .sp_sub sub d3,scr_spd .sp_okay tst xspeed beq.s .xpbd bmi.s .xpbadd .xpbsub sub #$80,xspeed bra.s .xpbd .xpbadd add #$80,xspeed .xpbd move.b joy_spc1,d0 btst d0,joy1 bne.s .no_xmove btst #2,d1 bne.s .xnl cmp #$400,xspeed bge.s .xnr add #$100,xspeed bra.s .xnr .xnl btst #3,d1 bne.s .xnr cmp #-$400,xspeed ble.s .xnr sub #$100,xspeed .xnr bra .nr .no_xmove btst #2,d1 bne.s .nl cmp #$400,pbank bge.s .pbd add #$100,pbank bra.s .pbd .nl btst #3,d1 bne.s .nr cmp #-$400,pbank ble.s .pbd sub #$100,pbank bra.s .pbd .nr tst pbank beq.s .pbd bmi.s .pbadd .pbsub sub #$80,pbank bra.s .pbd .pbadd add #$80,pbank .pbd tst.b ctl_off bne.s .not_cd move.b joy_spc1,d0 btst d0,joy1 bne .not_cd btst #0,d1 bne .not_cu cmp #6,yspd bge.s .cud_okay addq #2,yspd bra.s .cud_okay .not_cu btst #1,d1 bne .not_cd cmp #-6,yspd ble.s .cud_okay subq #2,yspd bra.s .cud_okay .not_cd tst yspd beq.s .cud_okay bmi.s .cud_add .cud_sub subq #1,yspd bra.s .cud_okay .cud_add addq #1,yspd .cud_okay move yspd,d0 add player_y,d0 cmp min_player_y,d0 bge.s .cud_1 move min_player_y,d0 .cud_1 cmp #112-2,d0 ble.s .cud_2 move #112-2,d0 .cud_2 move d0,player_y rts ****************************************************************************** striker_ctrl tst.b ctl_off beq.s .ctl1 move.b ctl_off2,d1 .ctl1 move pbank,d0 btst #2,d1 bne.s .nl add #$180,d0 ;$100 cmp #$400,d0 ble.s .pbd move #$400,d0 bra.s .pbd .nl btst #3,d1 bne.s .nr sub #$180,d0 ;$100 cmp #-$400,d0 bge.s .pbd move #-$400,d0 bra.s .pbd .nr tst d0 beq.s .pbd bmi.s .pbadd .pbsub sub #$c0,d0 ;$80 bpl.s .pbd moveq #0,d0 bra.s .pbd .pbadd add #$c0,d0 ;$80 bmi.s .pbd moveq #0,d0 .pbd move d0,pbank ASR #4+3+1,D0 ;4+3 move d0,d2 ; asr #1,d2 ; add d2,d0 ; NEG D0 ********************************************** ADD d0,player_x ********************************************** cmp #-$65,player_x bge.s .xd1 move #-$65,player_x .xd1 cmp #$5b,player_x ble.s .xd2 move #$5b,player_x .xd2 moveq #8,d2 moveq #-8,d3 moveq #0,d5 ; move yspd,d0 move.b joy_do1,d4 btst d4,d1 bne.s .nd cmp d3,d0 beq.s .ydone subq #4,d0 ;4 bra.s .ydone .nd move.b joy_up include coms_equ.s include obj_equ.s dcmp macros dc.w (\1)*4,\2 dup macros dc.w -((\1)*4),\2 dupf macros dc.w -(((\1)*4)+1),\2 divs MACRO ** move #divider_unit,r14 ;use R14 as ptr to divide unit move \1,(_d_jr,r14) move \2,(_d_hrl32,r14) move (_d_rsr,r14),\2 ENDM ************************* * SLAVE Wait-Task Loop. * ************************* game_slave_start: nop .game_slave_loop: move #comport7,r1 ; move #0,r0 ;clear SLAVE control comport. move.w r0,(r1) ; .wait_task_loop: POLHOST move.w (r1),r0 ; cmpeq #0,r0 ;wait for task. bt .wait_task_loop ; move #task_address+th,r0 move (15*4,r0),r1 move r1,gbr move (1*4,r0),r1 move (2*4,r0),r2 move (3*4,r0),r3 move (4*4,r0),r4 move (5*4,r0),r5 move (6*4,r0),r6 ; move (7*4,r0),r7 ;setup SLAVE r1-r14 & GBR. move (8*4,r0),r8 ; move (9*4,r0),r9 move (10*4,r0),r10 move (11*4,r0),r11 move (12*4,r0),r12 move (13*4,r0),r13 move (14*4,r0),r14 move (r0),r0 nop ; jsr (r0) ;call task address. nop ; bra .game_slave_loop ;return to task loop. nop cnop 0,4 ;align to longword boundry. task_address: dc.l 0 ;slave task address. task_registers: dc.l 0,0,0,0,0,0,0 ;r1-r7. dc.l 0,0,0,0,0,0,0 ;r8-r14. dc.l 0 ;GBR. lits ************************** * MASTER Wait-Task Loop. * ************************** game_master_start: ; mcom $000c ; move #comport5,r1 ; ; move.w (r1),r0 ;read Megadrive PAL/NTSC flag. ; move #pal_ntsc,r1 ; ; move.w r0,(r1) move #_sysreg,r1 ;allow SH2 to access VDP + move.w #$8008+PWMIRQ_ON,r0 ;enable VBL interrupts. move.w r0,(r1) ; move.w r0,(vintclr,r1) ;clear VINT ACK register. move.w r0,(vintclr,r1) ; move #_frt,r1 move #0,r0 move.b r0,(_tier,r1) move #$c2,r0 move.b r0,(_tocr,r1) move #0,r0 move.b r0,(_ocr_h,r1) ; move #1,r0 ;set free run timer. move.b r0,(_ocr_l,r1) ; move #0,r0 move.b r0,(_tcr,r1) move #1,r0 move.b r0,(_tcsr,r1) move #0,r0 move.b r0,(_frc_l,r1) move.b r0,(_frc_h,r1) move #initPWM,r0 jsr (r0) nop move #$20,r0 ;SH interrupt enable. move r0,sr ; bsr setup_screen ;clear both screens nop MOVE #COMPORT6,R0 ; MOVE #$8000,R1 ;ENABLE FADE. MOVE.W R1,(R0) ; .loop move #comport0,r1 ;get command move.w (r1),r0 cmpeq #0,r0 bt .loop move.w (r1),r3 ;allow port to settle cmpeq r3,r0 bf .loop move #com_last,r3 cmphi r3,r0 bt .loop move #.jump_tab-4,r2 add r0,r2 move (r2),r0 jsr (r0) ;...and call it nop move #comport0,r1 ;get command move #0,r3 ;clear command port move.w r3,(r1) bra .loop nop cnop 0,4 dc.l 0 .jump_tab dc.l wait_vbl dc.l flip_screen dc.l clear_screen dc.l plot_sc_sprite dc.l plot_pixel dc.l plot_sprite dc.l decompress_level dc.l decompress_360_level dc.l draw_360_floor dc.l alloc_reset dc.l PlayPWM dc.l rotate_player lits pal_ntsc dc.w 0 ;PAL/NTSC flag from Megadrive. ************************ * Plot point to screen * ************************ cnop 0,4 plot_pixel move #comport1,r0 move.w (r0)+,r1 ;get x move.w (r0)+,r2 ;get y move.w (r0)+,r3 ;get colour move.w #224,r4 cmphs r4,r2 bt .exit move.w #320,r4 muls r4,r2 cmphs r4,r1 bt .exit move #screen,r0 move macl,r2 add r1,r0 add r2,r0 move.b r3,(r0) .exit rts nop lits ************************* * Draw sprite to screen * ************************* cnop 0,4 plot_sprite move #comport1,r0 move.w (r0)+,r2 ;get x move.w (r0)+,r3 ;get y move.w (r0),r8 ;get def shll2 r8 move #frame_table,r0 add r8,r0 move (r0),r0 cmpeq #0,r0 ;frame unused? bf .skip move #sp_ringcannon,r0 ;.exit ; rts ; nop .skip move.w (r0)+,r4 ;get xsize move.w (r0)+,r5 ;get ysize add #4,r0 bra draw_sprite move r0,r1 ;R1 = source data ************************* * Draw sprite to screen * ************************* cnop 0,4 plot_sc_sprite move #comport1,r0 move.w (r0)+,r2 ;get x move.w (r0)+,r3 ;get y move.w (r0)+,r6 ;get scale move.w (r0),r8 ;get def shll2 r8 move #frame_table,r0 add r8,r0 move (r0),r0 cmpeq #0,r0 ;frame unused? bf .skip move #sp_ringcannon,r0 ;.exit ; rts ; nop .skip move #1,r11 ;flip flag into R11 (0 = unflipped , 1 = flipped) and r0,r11 ; sub r11,r0 ; move.w (r0)+,r4 ;get xsize move.w (r0)+,r5 ;get ysize move.w (r0)+,r8 ;get x-off move.w (r0)+,r9 ;get y-off shll8 r8 shll8 r9 shll2 r8 shll2 r9 shll r8 shll r9 move r0,r1 ;R1 = source data move r11,r0 move #divider_unit,r10 move r6,(_d_jr,r10) move r8,(_d_hrl32,r10) move (_d_rsr,r10),r8 cmpeq #0,r0 bt .2 neg r8,r8 .2 sub r8,r2 move r6,(_d_jr,r10) ;is this trashed?? move r9,(_d_hrl32,r10) move (_d_rsr,r10),r9 sub r9,r3 shll2 r6 shll2 r6 shll r6 cmpeq #0,r0 bf/s .1 move r6,r7 ;yscale = xscale bra scale_sprite nop .1 bra scale_flip_sprite nop lits ********************* * DMAC clear screen * ********************* cnop 0,4 dmac_clear move #_dmasource1,r8 ;point to DMAC. move #0,r3 move.w r3,(r1) move (12,r8),r0 ;read (clear TE flag) move #0,r0 ;stop DMA. move r0,(12,r8) ; move #01,r0 ;enable DMA. move r0,(32,r8) ; move r1,(r8) ;store DMA source address. move r1,(4,r8) ;store DMA destination address. move r2,r0 ;store DMA size. move r0,(8,r8) ; move #%0100011000000001,r0 ;start DMA. move r0,(12,r8) ; rts nop lits **************************** * Clear Screen - 360 stage * **************************** clear_screen_360 stack swait move #task_address+th,r5 ;point to SLAVE task setup. move #screen+(136*160),r1 move r1,(1*4,r5) move #.clear,r0 move r0,(r5) move #comport7,r14 move #1,r0 move.w r0,(r14) bsr .clear move #screen,r1 unstack rts nop cnop 0,4 .clear move #(136*320)/4,r0 move #0,r2 .clr_loop: move.w r2,(r1) dt r0 bf/s .clr_loop add #2,r1 rts nop cnop 0,4 **************** * Clear Screen * **************** clear_screen stack swait move #task_address+th,r5 ;point to SLAVE task setup. move #screen+(224*160),r1 move r1,(1*4,r5) move #.clear,r0 move r0,(r5) move #comport7,r14 move #1,r0 move.w r0,(r14) bsr .clear move #screen,r1 swait unstack rts nop cnop 0,4 .clear move #(224*320)/4,r0 move #0,r2 .clr_loop: move.w r2,(r1) dt r0 bf/s .clr_loop add #2,r1 rts nop lits wait_slave push r1 move #comport7,r1 ;point to slave control comport. .wait_slave move.w (r1),r0 ; cmpeq #0,r0 ;wait slave. bf .wait_slave ; rts pop r1 start_slave push r1 move r0,(r5) move #comport7,r1 move #1,r0 move.w r0,(r1) rts pop r1 ************************************* * Clear Screen + Setup Line-Tables. * ************************************* setup_screen: stack move #fb_cont_reg,r14 move #bm_mode_reg+1,r0 ; move.w #%10000001,r1 ;byte per pixel mode. move.b r1,(r0) ; move #$8000,r1 move #palette,r0 move.w r1,(r0) move #1,r13 bsr .clear_flip ; nop ;clear both flipscreens. move #0,r13 ; bsr .clear_flip nop unstack rts nop .clear_flip stack move.w r13,(r14) ; bsr wait_vbl ;select frame buffer. nop ; move #screen,r0 ; move #(240*320)/2,r1 ;setup screen clear loop. move #0,r2 ; .clr_loop: move.w r2,(r0) ; add #2,r0 ;clear screen buffer. dt r1 ; bf .clr_loop move #line_table,r0 ; move.w #$1e0/2,r1 ;setup linestart setup loop. move.w #160,r2 ; move.w #240,r3 .set_line_loop: move.w r1,(r0) ;write linestart. add r2,r1 ; add #2,r0 ;setup all linestarts. dt r3 ; bf .set_line_loop unstack rts nop lits **************** * Flip Screen. * **************** flip_screen: move #flip_enable+th,r1 ;point to flip flag. .wait: move.w (r1),r0 ; cmpeq #0,r0 ;buffer flips. bf .wait ; move #1,r0 ;flag flip. move.w r0,(r1) ; rts nop lits ******************* * Wait for A VBL. * ******************* wait_vbl: move #vbl_count+th,r1 ;setup VBL wait loop. move.w (r1),r0 ; .loop: move.w (r1),r2 ; cmpeq r0,r2 ;wait for VBL_COUNT to change. bt .loop ; rts nop lits ************************************ * Enable,Disable & Set Fade Level. * ************************************ set_fade: push r0 move #comport6,r0 ;write fade value to comport. move.w r4,(r0) ; pop r0 rts nop ***************************** * Setup Pointer to Palette. * ***************************** set_palette: move #pal_ptr,r0 ;setup pointer for VBL. move r4,(r0) ; rts nop ************************* * Master VBL Interrupt. * ************************* vblank: move #vbl_count+th,r1 ; move.w (r1),r0 ;update VBL count. add #1,r0 ; move.w r0,(r1) move #flip_enable+th,r1 ; move.w (r1),r0 ;flip screen? cmpeq #0,r0 ; bt .no_flip move #0,r0 ;flag screen flipped. move.w r0,(r1) ; move #fb_cont_reg+1,r1 ; move.b (r1),r0 ;flip VDP bank. not r0,r0 ; move.b r0,(r1) .no_flip: move #comport6,r0 ; move.w (r0),r0 ;fade screen? cmppz r0 ; bt .no_fade push r2 push r3 push r4 push r5 push r6 push r7 push r8 push r9 push r10 push r11 move r0,r6 ;copy fade value. move #game_pal+2,r0 ; move #palette+2,r1 ;setup palette fade loop. move #256-1,r2 ; move #0000000011111,r3 ; move #0001111100000,r4 ;setup palette fade masks. move #%111110000000000,r5 ; and r3,r6 ;mask out fade value (0-31). move r6,r7 shll2 r7 shll2 r7 ; shll r7 ;setup palette subtractors. move r6,r8 ; shll8 r8 shll2 r8 .fade_pal_loop: move.w (r0)+,r9 ; move r9,r10 ;read RGB value. move r9,r11 ; and r3,r9 sub r6,r9 ; cmppz r9 ;reduce blue componant. bt .no_blue ; move #0,r9 .no_blue: and r4,r10 sub r7,r10 ; cmppz r10 ;reduce green componant. bt .no_green ; move #0,r10 .no_green: and r5,r11 sub r8,r11 ; cmppz r11 ;reduce red componant. bt .no_red ; move #0,r11 .no_red: or r10,r9 ; or r11,r9 ;write RGB value. move.w r9,(r1) ; dt r2 ; bf/s .fade_pal_loop ;fade whole palette. add #2,r1 ; pop r11 pop r10 pop r9 pop r8 pop r7 pop r6 pop r5 pop r4 pop r3 pop r2 .no_fade: push r2 move.w #($0F<<10)+($17<<5),r2 move #vbl_count+th,r1 move.w (r1),r0 tst #1,r0 bt .skip move #0,r2 .skip move #engine_glow,r0 move.w (r0),r1 xor r2,r1 move.w r1,(r0) move #palette+(192*2),r0 move.w r1,(r0) pop r2 POLHOST rts nop lits cnop 0,4 floor_map dc.l 0 floor_blocks dc.l 0 map_lookup dc.l 0 ;128*8*2 = 90 blocks,8 rotations,2 longwords each. tvb_table dc.l 0 ;ysize*4 vcnt dc.l $ff00 scr_ptr dc.l screen pal_ptr dc.l game_pal+2 alloc_ptr2 dc.l 0 vbl_count dc.w 0 flip_enable dc.w 0 engine_glow dc.w ($1F<<10)+($1F<<5) ship1_pal incbin sprites\ship1\ship.pal ship2_pal incbin sprites\ship2\ship2.pal game_pal incbin panel.pal incbin sprites\ship2\ship2.pal game2_pal incbin level02.pal incbin sprite.pal ****************************************************************************** include sprite.sh2 include floor.sh2 include pwm.sh2 include rotspr.sh2 cnop 0,4 frame_table dc.l sp_pl_ship00 dc.l sp_pl_ship01 dc.l sp_pl_ship02 dc.l sp_pl_ship03 dc.l sp_pl_ship04 dc.l sp_pl_ship05 dc.l sp_pl_ship06 dc.l sp_pl_ship07 dc.l sp_pl_ship08 dc.l sp_pl_ship09 dc.l sp_pl_ship10 dc.l sp_pl_ship11 dc.l sp_pl_ship12 dc.l sp_pl_ship13 dc.l sp_pl_ship14 dc.l sp_pl_ship05+1 dc.l sp_pl_ship06+1 dc.l sp_pl_ship07+1 dc.l sp_pl_ship08+1 dc.l sp_pl_ship09+1 dc.l sp_pl_ship00+1 dc.l sp_pl_ship01+1 dc.l sp_pl_ship02+1 dc.l sp_pl_ship03+1 dc.l sp_pl_ship04+1 ds.l 25 dc.l sp_tc_ship09 dc.l sp_tc_ship10 dc.l sp_tc_ship11 dc.l sp_tc_ship12 dc.l sp_tc_ship13 dc.l sp_tc_ship14 dc.l sp_tc_ship15 dc.l sp_tc_ship16 dc.l sp_tc_ship17 dc.l sp_tc_ship00 dc.l sp_tc_ship01 dc.l sp_tc_ship02 dc.l sp_tc_ship03 dc.l sp_tc_ship04 dc.l sp_tc_ship05 dc.l sp_tc_ship06 dc.l sp_tc_ship07 dc.l sp_tc_ship08 dc.l sp_tc_ship09+1 dc.l sp_tc_ship10+1 dc.l sp_tc_ship11+1 dc.l sp_tc_ship12+1 dc.l sp_tc_ship13+1 dc.l sp_tc_ship14+1 dc.l sp_tc_ship15+1 dc.l sp_tc_ship16+1 dc.l sp_tc_ship17+1 dc.l sp_plasma_shot ;o_weap1 ds.l 4 ;o_srocks ds.l 42 ;o_enemy1 dc.l sp_gro_exp00 ;o_gro_exp dc.l sp_gro_exp01 dc.l sp_gro_exp02 dc.l sp_gro_exp03 dc.l sp_gro_exp04 dc.l sp_gro_exp05 dc.l sp_gro_exp06 dc.l sp_gro_exp07 dc.l sp_gro_exp08 dc.l sp_gro_exp09 dc.l sp_gro_exp10 dc.l sp_gro_exp11 dc.l sp_gro_exp12 dc.l sp_gro_exp13 dc.l sp_gro_exp14 dc.l sp_air_exp00 ;o_air_exp dc.l sp_air_exp01 dc.l sp_air_exp02 dc.l sp_air_exp03 dc.l sp_air_exp04 dc.l sp_air_exp05 dc.l sp_air_exp06 dc.l sp_air_exp07 dc.l sp_air_exp08 dc.l sp_air_exp09 dme_del bne.s .ng_roll or #$1000,game_del .ng_roll: *************************************** move scr_spd,d0 IF l_type=0 muls #$3334,d0 swap d0 add scr_spd,d0 ENDIF move d0,scr_spd2 *************************************** tst sh_hit_num beq.s .sh_hit_ok tst dying_cnt bne.s .sh_hit_ok subq #1,sh_hit_del bpl.s .sh_hit_ok subq #1,sh_hit_num jsr do_low_shield_sfx move #sh_del,sh_hit_del .sh_hit_ok: *************************************** jsr pickup_system cmp #04,level bne.s .not_gigun jsr gigun_checks .not_gigun: jsr end_fader *************************************** sf hit_sfx_already tst torpedo_count beq.s .normal_pals subq #1,torpedo_count moveq #1,d0 and torpedo_count,d0 beq.s .normal_pals move #$777f,torp_fade bra.s .p4 .normal_pals: clr torp_fade .p4: *************************************** jsr level_flipper *************************************** clr tmp_slot *************************************** * Do all processing here! * *************************** subq #1,gcnt3 bpl.s .gcnt3 move #3-1,gcnt3 .gcnt3: subq #1,gcnt5 bpl.s .gcnt5 move #5-1,gcnt5 .gcnt5: subq #1,gcnt6 bpl.s .gcnt6 move #6-1,gcnt6 .gcnt6: subq #1,gcnt9 bpl.s .gcnt9 move #9-1,gcnt9 .gcnt9: subq #1,gcnt10 bpl.s .gcnt10 move #9-1,gcnt10 .gcnt10: subq #1,gcnt12 bpl.s .gcnt12 move #12-1,gcnt12 .gcnt12: subq #1,gcnt19 bpl.s .gcnt19 move #19-1,gcnt19 .gcnt19: tst dying_cnt beq.s .not_dying jsr do_player_dying bra.s .no_ctl .not_dying: tst startup_count bne.s .no_ctl jsr do_v_control .no_ctl: tst.b is_360 beq.s .no_360 jsr set_360_map_pos .no_360: *************************************** bsr level_control *************************************** jsr handle_qsounds *************************************** jsr create_enemies jsr get_all_enemies jsr get_all_weapons jsr do_next_weapon ****************************************************************************** * Check for 2nd player * ************************ tst.b ply2mode beq.s .1player_only jsr do_next_weapon_2 jsr player_2_control jsr player_2_weapons bra.s .2player_done .1player_only: jsr power_transfer_1p cmp #2,vehicle bne.s .not_walker1 jsr do_1p_walker_targetting tst poptarg beq.s .no_poptarg subq #1,poptarg move.l mtarget,d0 beq.s .no_poptarg move.l d0,a6 move mob_x(a6),d0 move mob_y(a6),d1 moveq #0,d2 moveq #0,d6 lea node_msight,a6 movem d0/d1/d2/d6/d7,node_data(a6) move #ot_msight,mob_type(a6) jsr insert_sprite .no_poptarg: bra.s .2player_done .not_walker1: lea weapon_tab,a0 add weapon,a0 cmp.b #pw_bomblet,(a0) bne.s .2player_done jsr handle_missile_sight .2player_done: ****************************************************************************** jsr plot_rams jsr plot_player tst charge_cnt beq.s .not_charging jsr insert_charge_spr .not_charging: *************************************** moveq #1,d0 and torpedo_count,d0 bne .no_pause cmp #16,game_del ble .no_pause tst end_fade bne .no_pause tst fade_count bne .no_pause tst.b ply2mode beq.s .not_2ply_99 btst #button_pause,joy1_2 beq.s .pausing .not_2ply_99: btst #button_pause,joy1 bne .no_pause .pausing: move.l cs_reltime,-(sp) jsr pause_sound .pw1: jsr wait_vbl jsr readpad tst.b ply2mode beq.s .not_2ply_98 btst #button_pause,joy1_2 beq .pw1 .not_2ply_98: btst #button_pause,joy1 beq .pw1 .pw2: jsr wait_vbl jsr readpad tst.b ply2mode beq.s .not_2ply_97 btst #button_pause,joy1_2 beq.s .pw3 .not_2ply_97: btst #button_pause,joy1 bne.s .pw2 .pw3: jsr wait_vbl jsr readpad btst #button_pause,joy1 beq.s .pw3 tst.b ply2mode beq.s .not_2ply_96 btst #button_pause,joy1_2 beq.s .pw3 .not_2ply_96: jsr unpause_sound move.l (sp)+,cs_reltime .no_pause: ****************************************************************************** jsr term_list cmp #26,level beq.s .bodge_26 cmp #08,level bne.s .not_bodge_08 .bodge_26: jsr draw_underside .not_bodge_08: move.l floorB,d0 move.l floorF,floorB move.l d0,floorF move.l scrB,d0 move.l scrF,scrB move.l d0,scrF move.l listB,d0 move.l listF,listB move.l d0,listF ; MOVE.B #16,shield ****************************************************************************** cmp.b #2,reset_flag beq main_start ****************************************************************************** tst dying_cnt bne.s .die1 cmp.b #-2,shield bge mloop tst timer_val beq.s .no_stop_music jsr stop_music .no_stop_music: st deact_weaps jsr do_exp2_sfx .die1: cmp #20*2,dying_cnt bne.s .die2 clr last_plyhit .die2: jsr dying_fader addq #1,dying_cnt cmp #20*4,dying_cnt bne mloop sf in_game jsr scroff jsr set_scron_delay lea stack,sp subq #1,lives bne continue_game * All lives gone! ; lea the_end_seq_file,a1 ; jsr play_anim ; jsr fade_out_anim clr dying_fade_val moveq #TITLE_FILE,d0 jsr load_files jsr hiscore_game_over jmp main_start2 continue_game: bsr restart_life_lost bsr level_setup ************************************************* lea node_head,a0 lea node_tail,a1 move.l a1,node_next(a0) move.l a0,node_prev(a1) clr game_del ************************************************* bra mloop ****************************************************************************** init_startup: move #63+20,startup_count jmp do_thrusting_sfx do_pl_startup: moveq #$00000037,d0 move.l d0,player_x moveq #0,d6 cmp #62,d1 bge.s .1 add d1,d1 move pl_st_table-2(pc,d1),d6 move #256/2,d0 moveq #88,d1 .1: subq #1,startup_count move vehicle,d7 move.b .table2(pc,d7),d7 cmp #32,startup_count ble.s .2 move #510,d7 .2: rts .table2: dc.b 11,13 even pl_st_table: dc $801,$802,$804,$808,$810,$820,$830,$840 dc $860,$880,$8a0,$8c0,$8e0,$900,$940,$980 dc $9b0,$9e0,$a10,$a40,$a70,$aa0,$ac0,$ae0 dc $ae8,$af0,$af8,$afc,$afe,$afd,$afc,$afa dc $af8,$af4,$af0,$ae8,$ae0,$ad8,$ad0,$ac0 dc $ab0,$aa0,$a80,$a60,$a40,$a00,$9c0,$980 dc $940,$900,$880,$800,$780,$700,$680,$600 dc $580,$500,$480,$400,$380 dump_gpu_floor: lea lin_gpu,a0 lea overlays,a1 move #lin_gpuL/4,d7 .loop: move.l (a0)+,(a1)+ dbf d7,.loop rts dump_gpu_360: lea l360_gpu,a0 lea overlays,a1 move #l360_gpuL/4,d7 .loop: move.l (a0)+,(a1)+ dbf d7,.loop rts ****************************************************************************** draw_360_gpu: lea vars,a0 move.l floorF,(a0)+ move.l map,(a0)+ move.l blocks,(a0)+ move.l #sintab,(a0)+ move.l #costab,(a0)+ move oax,d0 ext.l d0 move.l d0,(a0)+ move alt,d0 ext.l d0 move.l d0,(a0)+ movem v360_off_ox,d0 movem v360_off_oy,d1 move.l d0,(a0)+ move.l d1,(a0)+ move.l #$54,(a0)+ move.l #calc_floor_360,semaphore_adr moveq #1,d0 move.l d0,semaphore rts draw_360_08_gpu: lea vars,a0 move.l floorF,d0 add.l #104*256,d0 move.l d0,(a0)+ move.l map,(a0)+ move.l blocks,(a0)+ move.l #sintab,(a0)+ move.l #costab,(a0)+ move oax,d0 ext.l d0 move.l d0,(a0)+ move alt,d0 ext.l d0 move.l d0,(a0)+ movem v360_off_ox,d0 movem v360_off_oy,d1 move.l d0,(a0)+ move.l d1,(a0)+ move.l #100-4,(a0)+ move.l #calc_floor_360,semaphore_adr moveq #1,d0 move.l d0,semaphore rts draw_linear_10_gpu: sub #$2000,map_xpos ;KLUDGE move.l #draw_linear_floor_10,d1 bsr.s draw_linear_gpu2 add #$2000,map_xpos ;KLUDGE rts draw_linear_city_gpu: move.l #draw_linear_floor_city,d1 bra.s draw_linear_gpu2 draw_linear_gpu: move.l #draw_linear_floor,semaphore_adr moveq #1,d0 move.l d0,semaphore jmp waitgpu draw_linear_gpu2: moveq #0,d2 lea vars,a0 move.l floorB,(a0)+ move.l d2,(a0)+ move.l fbuff_ptr,(a0)+ move.l d2,(a0)+ move.l d2,(a0)+ move.l d2,(a0)+ move alt,d0 ext.l d0 move.l d0,(a0)+ movem map_xpos,d0 move.l d0,(a0)+ movem map_zpos,d0 move.l d0,(a0)+ move.l d1,semaphore_adr moveq #1,d0 move.l d0,semaphore bra waitgpu run_gpu_linear1: bsr waitgpu move.l #calc_linear_floor,semaphore_adr moveq #1,d0 move.l d0,semaphore rts waitgpu: lea semaphore,a0 .wait: moveq #1,d0 divs d0,d0 divs d0,d0 tst.l (a0) bne.s .wait rts waitgpu3: push.l a0 push.l d0 lea G_FLAGS,a0 .loop: moveq #1,d0 divu d0,d0 move.l (a0),d0 btst #6,d0 bne.s .loop pop.l d0 pop.l a0 rts ****************************************************************************** rotate_player_sprite: tst vehicle bne rotate_player_sprite_copter rotate_player_sprite_striker: ; lea player_ptr,a0 ; move node_player+mob_def,a5 ; cmp #25,a5 ; blt.s .1 ; move #12,a5 ;.1: ; add a5,a5 ; add a5,a5 ; move.l (a0,a5),a0 move last_frame,a5 add a5,a5 add a5,a5 lea player_ship,a0 tst startup_count beq.s .3 move.l a0,a1 jmp blit_sprite .3: lea 8(a0),a2 sub.l a3,a3 move node_player+mob_x,d4 sub #(96/2),d4 bpl.s .no_x1_clip neg d4 move d4,a3 .no_x1_clip: move node_player+mob_x,d4 add #(96/2),d4 sub #256,d4 bmi.s .no_x2_clip move d4,a3 .no_x2_clip: bsr waitblit ;set source... move.l a2,A1_BASE move.l #PITCH1|PIXEL16|WID96|XADDINC,A1_FLAGS ;a1 = source move.l (a0),d4 swap d4 move.l d4,A1_CLIP move 6(a0),d3 move d3,pyoff move 2(a0),d3 move.l #(72<<16)+96,d0 sub a3,d0 move.l d0,B_COUNT ****************************************** * outer loop line increment * ***************************** move xspeed,d0 add pbank,d0 cmp #$400,d0 ble.s .zb1 move #$400,d0 .zb1: cmp #-$400,d0 bge.s .zb2 move #-$400,d0 .zb2: cmp #15*4,a5 bge.s .2 neg d0 .2: asr #2,d0 and #$ffe,d0 lea costab,a2 move (a2,d0),d5 move d5,sp_cos lea sintab,a2 move (a2,d0),d5 move d5,sp_sin move 4(a0),d4 ;get Offx neg d4 lsl #3,d4 move d4,sp_midx move 6(a0),d1 ;get Offy add #12,d1 lsl #3,d1 move d1,sp_mid neg d1 move sp_midx,d4 move sp_cos,d0 move d0,d2 move sp_sin,d7 move d7,d6 muls d4,d0 muls d1,d7 sub.l d0,d7 add.l d7,d7 swap d7 neg d7 muls d1,d2 muls d4,d6 add.l d2,d6 add.l d6,d6 swap d6 sub sp_midx,d7 add sp_mid,d6 add #(-12*8),d6 ext.l d6 ext.l d7 moveq #16-3,d2 lsl.l d2,d6 lsl.l d2,d7 move d6,d2 swap d2 move d7,d2 move.l d2,A1_FPIXEL swap d7 move d7,d6 move.l d6,A1_PIXEL ;set inner loop move sp_cos,d0 ext.l d0 add.l d0,d0 move sp_sin,d1 ext.l d1 add.l d1,d1 move d1,d2 swap d2 move d0,d2 move.l d2,A1_FINC swap d0 move d0,d1 move.l d1,A1_INC *** moveq #-96,d4 add a3,d4 moveq #1,d1 move sp_cos,d3 move d3,d2 move sp_sin,d7 move d7,d6 muls d4,d3 muls d1,d7 sub.l d3,d7 add.l d7,d7 muls d1,d2 muls d4,d6 add.l d2,d6 add.l d6,d6 *** neg.l d7 move d6,d2 swap d2 move d7,d2 move.l d2,A1_FSTEP swap d7 move d7,d6 move.l d6,A1_STEP ****************************************** * set dest * ************ move.l scrB,A2_BASE move node_player+mob_y,d1 sub pyoff,d1 sub #24,d1 swap d1 add node_player+mob_x,d1 sub #(96/2),d1 move.l #(1<<16)+(-96&$ffff),d2 add a3,d2 move.l #PITCH1|PIXEL16|WID256|XADDPIX,d3 ;a2 = dest (screen) cmp #15*4,a5 bge.s .99 add #96,d1 neg d2 bset #19,d3 .99: move.l d1,A2_PIXEL move.l d2,A2_STEP move.l d3,A2_FLAGS move striker_fade,d0 swap d0 clr d0 move.l d0,B_IINC move.l d0,B_PATD move.l #CLIP_A1|SRCSHADE|GOURZ|SRCEN|LFU_S|UPDA1F|UPDA2|DSTA2|DCOMPEN,B_CMD ;Start the BLTTER .exit: bsr waitblit rts rotate_player_sprite_copter: lea player_ptr,a0 move node_player+mob_def,a5 sub #50,a5 add a5,a5 add a5,a5 move.l (a0,a5),a0 lea 8(a0),a2 bsr waitblit ;set source... move.l a2,A1_BASE move.l #PITCH1|PIXEL16|WID80|XADDINC,A1_FLAGS ;a1 = source move.l (a0),d4 swap d4 move.l d4,A1_CLIP move 6(a0),d3 move d3,pyoff move 2(a0),d3 move.l #(72<<16)+80,B_COUNT ****************************************** * outer loop line increment * ***************************** move xspeed,d0 add pbank,d0 cmp #$400,d0 ble.s .zb1 move #$400,d0 .zb1: cmp #-$400,d0 bge.s .zb2 move #-$400,d0 .zb2: cmp #15*4,a5 blt.s .2 neg d0 .2: asr #2,d0 and #$ffe,d0 lea costab,a2 move (a2,d0),d5 move d5,sp_cos lea sintab,a2 move (a2,d0),d5 move d5,sp_sin move 4(a0),d4 ;get Offx neg d4 lsl #3,d4 move d4,sp_midx move 6(a0),d1 ;get Offy add #12,d1 lsl #3,d1 move d1,sp_mid neg d1 move sp_midx,d4 move sp_cos,d0 move d0,d2 move sp_sin,d7 move d7,d6 muls d4,d0 muls d1,d7 sub.l d0,d7 add.l d7,d7 swap d7 neg d7 muls d1,d2 muls d4,d6 add.l d2,d6 add.l d6,d6 swap d6 sub sp_midx,d7 add sp_mid,d6 add #(-12*8),d6 ext.l d6 ext.l d7 moveq #16-3,d2 lsl.l d2,d6 lsl.l d2,d7 move d6,d2 swap d2 move d7,d2 move.l d2,A1_FPIXEL swap d7 move d7,d6 move.l d6,A1_PIXEL ;set inner loop move sp_cos,d0 ext.l d0 add.l d0,d0 move sp_sin,d1 ext.l d1 add.l d1,d1 move d1,d2 swap d2 move d0,d2 move.l d2,A1_FINC swap d0 move d0,d1 move.l d1,A1_INC *** moveq #-80,d4 moveq #1,d1 move sp_cos,d3 move d3,d2 move sp_sin,d7 move d7,d6 muls d4,d3 muls d1,d7 sub.l d3,d7 add.l d7,d7 muls d1,d2 muls d4,d6 add.l d2,d6 add.l d6,d6 *** neg.l d7 move d6,d2 swap d2 move d7,d2 move.l d2,A1_FSTEP swap d7 move d7,d6 move.l d6,A1_STEP ****************************************** * set dest * ************ move.l scrB,A2_BASE move node_player+mob_y,d1 sub pyoff,d1 sub #40,d1 swap d1 add node_player+mob_x,d1 sub #(80/2),d1 cmp #18*4,a5 blt.s .98 subq #8,d1 bra.s .97 .98: cmp #9*4,a5 bge.s .97 addq #8,d1 .97: move.l #(1<<16)+(-80&$ffff),d2 move.l #PITCH1|PIXEL16|WID256|XADDPIX,d3 ;a2 = dest (screen) cmp #15*4,a5 blt.s .99 add #80,d1 neg d2 bset #19,d3 .99: move.l d1,A2_PIXEL move.l d2,A2_STEP move.l d3,A2_FLAGS move striker_fade,d0 bne.s .96 move copter_flare,d0 lsl #4,d0 More More! Code (Text): 4.49a #readram3 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #readram2 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #readram1 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #readram0 00000000 003FD7FF 00880000 009FFFFF 00FF0000 00FFFFFF #writeram3 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #writeram2 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #writeram1 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #writeram0 00000000 003FBFFF 00880000 009FFFFF 00FF0000 00FFFFFF #update FF 0008 #video 03 50 32 #label level 02 00 00 #colour attributes 17 20 60 40 1F 2F 6F 4F 3E B0 4F 5E 0C 70 C0 87 8E 8E F0 90 4F 87 7C 0E 0A 70 #mono attributes 07 07 07 07 0F 0F 0F 0F 70 70 07 70 0F 70 01 07 0F 0F 70 0F 07 07 70 07 07 70 #default tabs 68K 0F 17 28 30 00 00 00 00 658 0F 17 28 30 00 00 00 00 Z80 0F 17 28 30 00 00 00 00 C 04 00 00 00 00 00 00 00 #expression C/ASM flags 00 00 00 00 00 #window 01 00 00 00 00 01 4F 0A 3D 05 00000000 #window 82 00 00 00 00 0A 4F 21 08 0B 0088675A #window 03 01 00 00 00 21 4F 2D 08 22 FFFFFFEE #history 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 0A $ffff802e 0A ffff802e 0A ff802e 0A sp 0A pwmstructs 0A playpwm 0A pwm_irq 0A frame_table+(o_digit*4) More! (the same thing as above, only different slightly): Code (Text): #version 4.49a #readram3 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #readram2 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #readram1 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #readram0 00000000 003FD7FF 00880000 009FFFFF 00FF0000 00FFFFFF #writeram3 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #writeram2 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #writeram1 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #writeram0 00000000 003FBFFF 00880000 009FFFFF 00FF0000 00FFFFFF #update FF 0008 #video 03 50 32 #label level 02 00 00 #colour attributes 17 20 60 40 1F 2F 6F 4F 3E B0 4F 5E 0C 70 C0 87 8E 8E F0 90 4F 87 7C 0E 0A 70 #mono attributes 07 07 07 07 0F 0F 0F 0F 70 70 07 70 0F 70 01 07 0F 0F 70 0F 07 07 70 07 07 70 #default tabs 68K 0F 17 28 30 00 00 00 00 658 0F 17 28 30 00 00 00 00 Z80 0F 17 28 30 00 00 00 00 C 04 00 00 00 00 00 00 00 #expression C/ASM flags 00 00 00 00 00 #window 01 00 00 02 00 01 4F 0A 0A 02 00000000 #window 02 00 00 02 00 0A 4F 21 08 0B 060004BC #window 83 02 00 02 00 21 4F 2D 0A 22 020FF8C2 #history 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 0A $ffff802e 0A ffff802e 0A ff802e 0A sp 0A pwmstructs 0A playpwm 0A pwm_irq 0A frame_table+(o_digit*4) Here's a batch file for compiling all that crap: Code (Text): \psylink /m /z /I @soul.lnk,soul,soul.sym,soul.map musdat.obj: musdat.68k \psyq\asm68k /I /l /zd /g /w /z musdat.68k,musdat soul68k.obj: soul.68k main.68k music.68k joystick.68k \psyq\asm68k /I /l /zd /g /w /z main,main68k soulsh2.obj: main.sh2 soul.sh2 sprite.sh2 \psyq\asmsh /z /I /l /zd /g /w main.sh2,mainsh2 debug: \psyq\dbug32x soul /u1 soul /u2 soul /e same thing mentioned again: Code (Text): #version 4.49a #readram3 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #readram2 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #readram1 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #readram0 00000000 003FD7FF 00880000 009FFFFF 00FF0000 00FFFFFF #writeram3 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #writeram2 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #writeram1 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #writeram0 00000000 003FBFFF 00880000 009FFFFF 00FF0000 00FFFFFF #update FF 0008 #video 03 50 32 #label level 02 00 00 #colour attributes 17 20 60 40 1F 2F 6F 4F 3E B0 4F 5E 0C 70 C0 87 8E 8E F0 90 4F 87 7C 0E 0A 70 #mono attributes 07 07 07 07 0F 0F 0F 0F 70 70 07 70 0F 70 01 07 0F 0F 70 0F 07 07 70 07 07 70 #default tabs 68K 0F 17 28 30 00 00 00 00 658 0F 17 28 30 00 00 00 00 Z80 0F 17 28 30 00 00 00 00 C 04 00 00 00 00 00 00 00 #expression C/ASM flags 00 00 00 00 00 #window 01 00 00 00 00 01 4F 0A 3D 05 00000000 #window 82 00 00 00 00 0A 4F 21 08 0B 0088675A #window 03 01 00 00 00 21 4F 2D 08 22 FFFFFFEE #history 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 0A $ffff802e 0A ffff802e 0A ff802e 0A sp 0A pwmstructs 0A playpwm 0A pwm_irq 0A frame_table+(o_digit*4) Again, more of the same. (These must be for different OBJ files) Code (Text): #version 4.49a #readram3 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #readram2 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #readram1 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #readram0 00000000 003FD7FF 00880000 009FFFFF 00FF0000 00FFFFFF #writeram3 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #writeram2 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #writeram1 00000000 00003FFF 02000000 023FFFFF 04000000 0403FFFF 06000000 0603FFFF 20000000 20003FFF 22000000 223FFFFF 24000000 2403FFFF 26000000 2603FFFF #writeram0 00000000 003FBFFF 00880000 009FFFFF 00FF0000 00FFFFFF #update FF 0008 #video 03 50 32 #label level 02 00 00 #colour attributes 17 20 60 40 1F 2F 6F 4F 3E B0 4F 5E 0C 70 C0 87 8E 8E F0 90 4F 87 7C 0E 0A 70 #mono attributes 07 07 07 07 0F 0F 0F 0F 70 70 07 70 0F 70 01 07 0F 0F 70 0F 07 07 70 07 07 70 #default tabs 68K 0F 17 28 30 00 00 00 00 658 0F 17 28 30 00 00 00 00 Z80 0F 17 28 30 00 00 00 00 C 04 00 00 00 00 00 00 00 #expression C/ASM flags 00 00 00 00 00 #window 01 00 00 01 00 01 4F 0A 0A 02 00000000 #window 85 00 40 01 00 0A 4F 21 08 12 00000016 #file C:\SOULSTAR.32X\ROTSPR.SH2 #tabs 08 00 00 00 00 00 00 00 #window 03 02 00 01 00 21 4F 2D 16 22 06001B48 #history 02 rotspr.sh2 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 07 $fffff0 0A $ffff802e 0A ffff802e 0A ff802e 0A sp 0A pwmstructs 0A playpwm 0A pwm_irq 0A frame_table+(o_digit*4) This seems to be another copy of the PWM Sample Program source, but changed slightly near the end: Code (ASM): ; PWM Sample Program ; SH2 Master Main ; ; Copyright SEGA ENTERPRISES,LTD. 1994 ;---------------------------------------------------------------* ;**************************************************************** cnop 0,4 ****************************************** * Initialize the PWM interupt and driver * ****************************************** initPWM move #$20004030,r2 move #1047,r0 ;1047 set cycle register (22Khz) move.w r0,(2,r2) move #$0305,r0 ;105 set control register move.w r0,(r2) move #$20004030,r2 ;fill mono fifo move #1,r0 move.w r0,(8,r2) move.w r0,(8,r2) move.w r0,(8,r2) rts nop cnop 0,4 lits cnop 0,4 ************************************************ * Play an 8 bit sample throught the PWM ciruit * ************************************************ ; input ; R1 = Address of sample ; R2 = length of sample ; R3 = channel number ; R4 = step value PlayPWM move #comport1,r0 move.w (r0)+,r1 ;get sfx number move.w (r0)+,r4 ;get step rate move.w (r0)+,r2 ;get volume move #sample_table,r0 shll2 r1 shll r1 add r1,r0 move (r0)+,r2 ;get length move (r0)+,r1 ;get address move #sfx_chan,r5 ;get channel to play move (r5),r0 add #1,r0 and #3,r0 move r0,(r5) move r0,r3 move r2,r0 shll8 r0 move #pwmstructs+TH,r2 shll2 r3 shll2 r3 add r3,r2 move r0,(r2) ;store sample length (bytes) cmpeq #0,r0 bt .done_pwm move r4,(PWMSTEP,r2) ;store step rate shll8 r1 move r1,(PWMADDR,r2) ;store sample address .done_pwm rts nop cnop 0,4 sfx_chan dc.l 0 lits ************************* * PWM interrupt handler * ************************* cnop 0,4 spwm_irq push r0 push r1 push r2 push r3 push r4 push r5 push r6 move #$20004038,r2 move.b (r2),r0 ;is pwm fifo full? tst #$80,r0 bf .exit push pr bsr process_pwm nop pop pr .exit move #_FRT,r1 ;tweak FRT move.b (_TOCR,r1),r0 xor #$02,r0 move.b r0,(_TOCR,r1) move #$2000401C,r2 ;clear irq move.w r0,(r2) move.w (r2),r0 pop r6 pop r5 pop r4 pop r3 pop r2 pop r1 pop r0 rts nop LITS cnop 0,4 NUMCHANNELS equ 4 PWMSIZE equ 4 ; number of elemts in the PWM structure PWMADDR equ 4 PWMSTEP equ 8 ***************** * Fill PWM FIFO * ***************** process_pwm move #$20004038,r2 .loop move #pwmstructs+TH,r3 move #NUMCHANNELS,r4 move #0,r5 .channelloop move (r3),r0 ;is channel on? cmppz r0 bf/s .skip move.w #$80,r1 ;if channel off, use $7f (flat) move (PWMSTEP,r3),r6 sub r6,r0 move r0,(r3) move (PWMADDR,r3),r0 ;get the next pcm byte move r0,r1 add r6,r0 move r0,(PWMADDR,r3) shlr8 r1 move #samp_base,r0 move.b (r0,r1),r1 extu.b r1,r1 .skip add #PWMSIZE*4,r3 add #1,r1 ;make sure it's not 0 add r1,r5 dt r4 bf .channelloop move.w r5,(r2) ;store into mono width move.b (r2),r0 ;is pwm fifo full? tst #$80,r0 bt .loop * player ship Like I said, there are TONS of other stuff in here. Possibly some snippets from the actual computer it was compiled on. Definetly needs checking out. More to come, hopefully.
I seem to recall Link's Awakening having some uncompiled code in it; interestingly, there was some sort of reference to QBasic inside.
I remember this. It's nothing interesting. This is from a Russian translation (hacked) version of the game, which the translators disassembled the rom to help them add space for characters, etc.