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_STAR