;stern ali include "..\common\stern13.asm" bell=1 ;uncomment to compile version where knocker fires once at ball start, and 3 times at ball end org $1000 ;switch matrix L1000: ;column 0 dw L16FE ;row 7 slam dw L16FF ;row 6 tilt dw L152B ;row 5 credit dw L1A04 ;row 4 bottom rollover button dw L1BFA ;row 3 n/u (eliminated switch) dw L164C ;row 2 coin3 dw L1618 ;row 1 coin2 dw L15AC ;row 0 coin1 L1010: ;fast react column 1 dw L1942 ;row 7 left sling dw L1948 ;row 6 right sling dw L1952 ;row 5 mid pop dw L1952 ;row 4 left pop dw L1952 ;row 3 right pop dw L1939 ;row 2 mid rollover button (2) dw L192A ;row 1 n/u dw L1B86 ;row 0 top left rollover button & special target L1020: ;column 2 dw L1967 ;row 7 left top bank dw L196F ;row 6 left mid bank dw L1977 ;row 5 left bot bank dw L1AD9 ;row 4 top right bank dw L1ACF ;row 3 top mid bank dw L1AD4 ;row 2 top left bank dw L1B7A ;row 1 n/u dw L1728 ;row 0 n/u L1030: ;column 3 dw L173A ;row 7 top r saucer dw L174B ;row 6 top m saucer dw L1729 ;row 5 top l saucer dw L183E ;row 4 T s/u dw L1835 ;row 3 A s/u dw L1824 ;row 2 E s/u dw L181B ;row 1 R s/u dw L1803 ;row 0 G s/u L1040: ;column 4 dw L1728 ;row 7 n/u dw L1BAE ;row 6 mid l rollover dw L1C12 ;row 5 mid saucer dw L17D9 ;row 4 left inlane dw L17E7 ;row 3 right inlane dw L17C2 ;row 2 left outlane dw L17D3 ;row 1 right outlane dw L16FB ;row 0 outhole L1050: ;timed virtual col 5 dw L1D53 ;4e ;row 7 move GRES letters around center rollover button dw L1B54 ;4f ;row 6 reset drop bank switches periodically to catch missed switches dw L1D70 ;50 ;row 5 used for various countdowns dw L1DDA ;51 ;row 4 dw L1204 ;52 ;row 3 attract mode display dw L1241 ;53 ;row 2 attract mode lamps dw L1ABF ;54 ;row 1 dw L17A4 ;55 ;row 0 L1060: ;timed virtual col 6 dw L1C33 ;56 ;row 7 clear right eject solenoid flags dw L18BA ;57 ;row 6 flash GI dw L1728 ;58 ;row 5 n/u dw L1728 ;59 ;row 4 n/u dw L1728 ;5a ;row 3 n/u dw L1728 ;5b ;row 2 n/u dw L1728 ;5c ;row 1 n/u dw L10C1 ;5d ;row 0 background sound ramp L1070: ;direct virtual col 7 dw L16AA ;row 7 replay level 1 dw L16B1 ;row 6 replay level 2 dw L16B8 ;row 5 replay level 3 dw L1728 ;row 4 n/u dw L1728 ;row 3 n/u dw L1728 ;row 2 n/u dw L148F ;row 1 game start dw L16E9 ;row 0 L1080: bsr L109A jmp L5EDA L1085: ldx #$3010 stx $02F7 ldx #$0000 stx $006D L1090: ldx #$3000 stx $02F9 lda #$1E sta $005D L109A: lda $21 ;dips 9-16 anda #$20 ;check dip 14, background sound on/off bne L10A1 ;on, branch rts ;no background sound, return L10A1: ldx $02F7 stx $00A2 ldx $02F9 stx $00A4 ldx #$0100 stx $00A0 inx stx $00A0 ldx #$9293 stx $00A0 clra sta $00C0 sta $004C dec $02FF L10C0: rts ;ramp background sound L10C1: ila lda $48 cmpa #$19 bcs L1102 lda $02FF beq L1102 clr $02FF lda $02F7 cmpa #$01 beq L10E7 lda #$FF ldb #$00 addb $02F8 adca $02F7 sta $02F7 stb $02F8 L10E7: lda #$FF ldb #$00 addb $02FA adca $02F9 sta $02F9 stb $02FA tsta bne L1102 ldx #$0180 stx $02F7 bra L1090 L1102: lda $02F9 ldb #$1E ;setup reentry timer cmpa #$1D bcc L1119 ldb #$2D ;setup reentry timer cmpa #$0D bcc L1119 ldb #$3C ;setup reentry timer cmpa #$05 bcc L1119 ldb #$78 ;setup reentry timer L1119: stb $005D ;save timer ldx $006D bne L10C0 lda $48 cmpa #$19 bcs L10C0 jmp L109A L1128: lampbvalueoff $33 ;tilt xloadgoto L12A8 ;clear action registers for virtual timed columns 5 and 6 loadb $23 storebmem $0077 lampbvalueon $32 ;game over lampbvalueoff $67 ;clear active game flag cont_solenoid_off_flipper ;kill flipper relay update_match ila ldx $02C9 stx $0010 lda $02CB sta $0012 ldx #$0280 L1146: ; jsr L119C db $bd dw L119C L1149: ; jsr L119C db $bd dw L119C L114C: ; jsr L119C db $bd dw L119C L114F: ; jsr L119C db $bd dw L119C L1152: swi rcflagset loadbmem $000e ;get match # L1157: bxcomp $0002 ;compare to player 1 10-1 digits eqgosub L16C4 ;award match loadbmem $02ef ;# of players current game bacomp $01 L1162: eqgoto L1190 loadbmem $000e ;get match # L1168: bxcomp $0005 ;compare to player 2 10-1 digits eqgosub L16C4 ;award match loadbmem $02ef ;# of players current game bacomp $02 eqgoto L1190 loadbmem $000e ;get match # bxcomp $0008 ;compare to player 3 10-1 digits eqgosub L16C4 ;award match loadbmem $02ef ;# of players current game bacomp $03 eqgoto L1190 loadbmem $000e ;get match # bxcomp $000b ;compare to player 4 10-1 digits L118D: eqgosub L16C4 ;award match L1190: sound_play_primary L58E4 ;game over loadb $ff storebmem $0052 storebmem $0053 return L119C: lda $10 cmpa $00,x bcs L11B4 bne L11F5 lda $11 cmpa $01,x bcs L11B4 bne L11F5 lda $12 cmpa $02,x bcs L11B4 bra L11F5 L11B4: swi rcflagset bcdinc $03,$02d8 checklampvalue $76 ifsetgosub L16C4 checklampvalue $77 ifcleargoto L11CA gosub L16C4 gosub L16C4 L11CA: ila lda $02C9 cmpa $00,x bcs L11E6 bne L11F5 lda $02CA cmpa $01,x bcs L11E6 bne L11F5 lda $02CB cmpa $02,x bcs L11E6 bra L11F5 L11E6: lda 0,x sta $02C9 lda $01,x sta $02CA lda $02,x sta $02CB L11F5: stx $02F0 lda #$10 adda $02F1 sta $02F1 ldx $02F0 rts ;virtual switch c5r3 timer $52 attract mode display thread L1204: loadbmem $0020 ;flags $68-$6f (dips 1-8) aandb $7f ;specifically clear dip 8 in case operator insisting on turning dip 8 on even though manual says to leave off storebmem $0020 ;save flags $68-$6f checklampvalue $30 ;check hstd lamp ifsetgoto L123B ;showing hstd, branch to show previous games' scores instead show_hstd ;was showing previous games' scores, show hstd instead loadb $3c ;setup timer for re-entrancy L1214: storebmem $0052 ;reset timer for this thread loadbmem $003c ;switch column 3 initial register aandb $1f ;clear top saucer switches to allow reactivation storebmem $003c ;save loadbmem $003d ;switch column 4 initial register aandb $9f ;clear middle saucer and middle rollover button switches to allow reactivation storebmem $003d ;save lxiw $0077 ;increase display thread counter loadbmem $0077 ;get display thread counter bacomp $30 ;completed $30 times? notereturn ;no, end thread loadbmem $0046 ;get continuous timer aandb $03 ;limit to values of 00-03 storebmem $0077 ;save goto L18CB ;setup GI flashing/attract mode sound effect ;hstd was on displays, put the previous games' scores there instead L123B: xfer_scores_to_displays ;put previous games' scores on displays loadb $64 ;setup timer goto L1214 ;branch to set timer ;virtual switch c5r2 timer $53 attract mode lamps ;process attract mode lamps $00-$0f L1241: loadb $00 ;start with lamp arch 'g' L1243: checklampregbon ;see if on ifsetgoto L1252 ;yes, branch binc ;off, move to next lamp bacomp $0f ;stop if lamp 0f notegoto L1243 ;not done, keep going L124D: lampbvalueon $00 ;lamps 00-0f were all off, turn on lamp 00, arch 'g' goto L125A ;branch to cycle next set of lamps ;found lamp 00-$0f on, turn it off and turn next lamp on L1252: lampregboff ;turn lamp off binc ;move to next lamp bacomp $10 ;moved pass lamp $0f? eqgoto L124D ;yes, branch to turn on lamp $00 lampregbon ;no, turn next lamp on ;process next set of attract mode lamps $10-$1f L125A: loadb $10 ;start with lamp $10 'top drop 5k' L125C: checklampregbon ;see if on ifsetgoto L126B ;yes, branch binc ;off, move to next lamp bacomp $20 ;made it to lamp $20? notegoto L125C ;not done, keep going L1266: lampbvalueon $10 ;lamps $10-$1f were all off, turn on lamp $10, 'top drop 5k' goto L1273 ;branch to cycle next set of lamps ;found lamp $10-$1f on, turn it off and turn next lamp on L126B: lampregboff ;turn lamp off binc ;move to next lamp bacomp $20 ;moved pass lamp $1f? eqgoto L1266 ;yes, branch to turn on lamp $10 lampregbon ;no, turn next lamp on ;process next set of attract mode lamps $20-$2f L1273: loadb $20 ;start with lamp $20 '???' L1275: checklampregbon ;see if on ifsetgoto L1284 ;yes, branch binc ;off, move to next lamp bacomp $30 ;made it to lamp $30? notegoto L1275 ;not done, keep going L127F: lampbvalueon $20 ;lamps $20-$2f were all off, turn on lamp $20 '???' goto L128C ;branch to cycle remaining lamps ;found lamp $20-$2f on, turn it off and turn next lamp on L1284: lampregboff ;turn lamp off binc ;move to next lamp bacomp $30 ;moved pass lamp $2f? eqgoto L127F ;yes, branch to turn on lamp $20 lampregbon ;no, turn next lamp on ;setup timeout between this thread running L128C: loadb $02 ;setup timeout value storebmem $0053 ;save in timer for re-entry into this routine return ;end thread ;check score queues and process until empty L1292: ila ;exit pigs interpreter (unreferenced) L1293: lda $67 ;1's queue (should never be populated in game unless this is a /10 romset) ora $68 ;10's queue ora $69 ;100's queue ora $6A ;1k queue ora $6B ;10k queue ora $6C ;100k queue ora $6F ;??? beq L12A8 ;all empty, branch to clear virtual action registers and virtual switch timers jsr L532B ;process score queues as part of switch dispatch routine bra L1293 ;keep checking queues ;clear action registers for virtual timed columns 5 and 6 L12A8: lda #$00 ;setup clear sta $0043 ;save virtual column 5 action register sta $0044 ;save virtual column 6 action register ;clear all timers for virtual columns 5 and 6 ldx #$004E ;start of timers, virtual column 5 row 7 L12B1: clr $00,x ;clear timer inx ;next index cpx #$005E ;done? bne L12B1 ;no, keep going rts ;return ;clear all switch matrix action registers for columns 1-6 L12BA: ldx #$0000 ;setup clear stx $003F ;columns 1/2 action registers stx $0041 ;columns 3/4 action registers stx $0043 ;columns 5/6 action registers rts ;GREATEST standups completed, check awards L12C4: loadbmem $0014 ;get lamp column 1, lamps $08-$0f, standup GREATEST aandb $7f ;clear lamp $0f, 2nd 'T' bacomp $7f ;GREATES- completed? notereturn ;no, end thread checklampvalue $46 ifsetreturn checklampvalue $6f ;check dip 8, 'MUST BE OFF' or ball will get stuck in eject pocket (way to cover a bug/removed feature, Stern!!) ifsetgoto L12E9 checklampvalue $6e ;check dip 7, balls per game, off=3, on=5 ifcleargoto L12E4 ;set to 3 balls per game, branch ;check if extra balls/specials should light in 5 ball mode checklampvalue $37 ;saucer 5k ifcleargoto L12E1 ;not lit, branch to check if 10k is lit instead goto L12E9 ;branch to reset standups L12E1: checklampvalue $2f ;saucer 10k (ALI has been completed once) ifclearreturn ;not lit, return ;check if extra balls/specials should light in 3 ball mode L12E4: checklampvalue $7f ;check dip 24, special lamp control ifsetgoto L12EE L12E9: loadb $00 ;setup to clear lamps $08-$0f, standup GREATEST storebmem $0014 ;save in lamp column 1 lamps $08-$0f L12EE: lampbvalueon $50 ;set flag that GREATEST/ALI has been completed checklampvalue $81 ;check dip 26, extra ball control: off=no extra ball, on=extra ball allowed ifclearreturn ;off, do nothing with extra ball checklampvalue $55 ;extra ball waiting flag ifsetreturn checklampvalue $27 ;left extra ball ifcleargoto L12FF lampregboff lampbvalueon $26 ;right extra ball return ;end thread L12FF: lampregbon lampbvalueoff $26 ;right extra ball return ; L1303: checklampvalue $43 ifsetreturn checklampvalue $46 ifclearreturn L1309: checklampvalue $44 ifsetreturn L130C: loadbmem $0023 aandb $c0 eqgoto L140A L1314: checklampvalue $6f ;check dip 8, 'always off' ifsetgoto L132E ;never branches checklampvalue $6e ;check dip 7, balls per game, off=3 on=5 ifcleargoto L1323 ;set to 3 balls per game, branch checklampvalue $7f ;check dip 24, special light control ifcleargoto L132B ;off, branch L1323: checklampvalue $37 ;saucer 5k ifcleargoto L132B ;not lit, branch goto L132E L132B: checklampvalue $2f ;saucer 10k ifclearreturn ;not lit, return L132E: checklampvalue $7e ;check dip 23, # of specials to light, off=one, on=all 3 ifcleargoto L133C ;set to 1, branch L1333: lampbvalueon $44 ;set special lit flag lampbvalueon $34 ;saucer special lampbvalueon $36 ;right outlane special lampbvalueon $35 ;left outlane special return L133C: lampbvalueon $44 ;set special lit flag lampbvalueon $35 ;left outlane special return ;handle rotating special lamps L1341: checklampvalue $6f ;check dip 8 'always off' ifsetgosub L1389 ;never branch L1346: checklampvalue $44 ifclearreturn checklampvalue $43 ifsetgoto L136E checklampvalue $7e ;dip 23, # of specials lit at a time, off=one at a time rotating, on=all 3 at once ifsetreturn ;dip 23 on, return ;dip 23 off, check lit special lamps and rotate if lit checklampvalue $34 ;saucer special ifsetgoto L1367 ;it's lit, branch to clear it and light lamp 35, left outlane special checklampvalue $35 ;left outlane special ifsetgoto L1367 ;it's lit, branch to clear it and light lamp 36, right outlane special checklampvalue $36 ;right outlane special ifclearreturn ;not lit, return lampregboff ;turn off right outlane special checklampvalue $6f ;check dip 8 'always off' ifsetgoto L136B ;this should never branch lampbvalueon $34 ;saucer special return ;end subroutine ;clear special lamp in B, light next special lamp ;only works for lamps 34 and 35 L1367: lampregboff ;turn off special lamp in B binc ;move to next special lamp lampregbon ;turn on next special lamp return ;return ;never runs due to dip 8 L136B: lampbvalueon $35 ;left outlane special lamp return L136E: lampbvalueoff $34 ;saucer special lampbvalueoff $35 ;left outlane special lampbvalueoff $36 ;right outlane special lampbvalueoff $44 lampbvalueon $43 checklampvalue $6e ;check dip 7, balls per game, off=3, on=5 ifsetreturn ;set to 5 balls per game, return checklampvalue $7f ;check dip 24, special lamp control ifclearreturn ;dip 24 off lampbvalueoff $38 ;top 'A' lampbvalueoff $39 ;top 'L' lampbvalueoff $3a ;top 'I' lampbvalueoff $37 ;saucer 5k lampbvalueoff $2f ;saucer 10k return L1389: checkactivegame checklampvalue $27 ifsetgoto L139C checklampvalue $26 ifclearreturn L1392: lampregboff lampbvalueon $27 checklampvalue $6f ;check dip 8, 'always off' ifsetreturn ;never returns sound_play_secondary L599C ;play sound return L139C: lampregboff lampbvalueon $26 checklampvalue $6f ;check dip 8, 'always off' ifsetreturn ;never returns sound_play_secondary L599C ;play sound return ;advance bonus ;advance the 2k-8k first L13A6: loadb $29 ;start with bonus 2k lamp L13A8: checklampregbon ;see if lamp is on ifsetgoto L13BE ;lamp on, branch to advance bonus 2k-8k binc ;advance lamp test to next lamp bacomp $2c ;bonus 8k lamp notegoto L13A8 ;not done, keep searching for lit lamp in 2k-6k range checklampvalue $2e ;bonus 20k ifsetgoto L13C4 ;20k lit, branch checklampvalue $2d ;bonus 10k ifsetgoto L13CE ;10k lit, branch ;no bonus lamp 29-2b, 2e, 2d lit, 8k must have been lit L13BC: loadb $2c ;bonus 8k L13BE: lampregboff ;turn off lamp binc ;advance lamp lampregbon ;turn on next bonus lamp goto L13DE ;branch to finish up ;20k was lit L13C4: checklampvalue $2c ;see if bonus 8k lit ifsetgoto L13DE ;it is, branch lampbvalueon $29 ;light bonus 2k goto L13DE ;branch to finish up ;10k was lit L13CE: checklampvalue $2c ;see if bonus 8k lit ifsetgoto L13D8 ;it is, branch lampbvalueon $29 ;light bonus 2k goto L13DE ;branch to finish up ;8k/10k lit L13D8: lampbvalueoff $2d ;bonus 10k lampbvalueoff $2c ;bonus 8k lampbvalueon $2e ;bonus 20k L13DE: checklampvalue $6f ;check dip 8 ifclearreturn ;per instruction manual - always off. What are they hiding? ;the following code should never run checklampvalue $29 ifsetgoto L1402 checklampvalue $2a ifsetgoto L13FF checklampvalue $2b ifsetgoto L1402 checklampvalue $2c ifsetgoto L13FA checklampvalue $2d ifsetgoto L1407 L13FA: checklampvalue $2e ifsetgoto L1407 L13FF: lampbvalueoff $31 return L1402: checklampvalue $2e ifsetgoto L13FF L1407: lampbvalueon $31 return ;end of code that never runs due to dip 8 L140A: checklampvalue $7d ifcleargosub L136E checklampvalue $46 ifcleargoto L141F loadb $00 storebmem $0014 lampbvalueoff $47 lampbvalueoff $46 lampbvalueoff $50 L141F: bcdinc $02,$02e7 ;increase audit 14, total specials checklampvalue $87 ifsetgoto L142E checklampvalue $86 ifclearreturn addtoscoreq $4a ;special set to pay out 100k return L142E: checklampvalue $86 ifsetgoto L16C4 ;award extra ball L1433: lampbvalueon $28 ;shoot again lampbvalueon $55 ;extra ball waiting flag lampbvalueoff $27 ;rope a dope left extra ball lampbvalueoff $26 ;rope a dope right extra ball sound_play_primary L597B ;play sound bcdinc $02,$02e5 ;advance audit 13, total extra balls awarded return ;outhole L1443: gameoverreturn ;return if not in an active game checklampvalue $51 ;check outhole re-entrancy flag ifsetreturn ;already running, return lampregbon ;set flag 51 if bell=0 gosub L151E ;make bell sound else gosub triple_bell endif lampbvalueoff $67 ;clear active ball flag delay $1e ;short delay checklampvalue $3c ;check score flag ifcleargoto L14C4 ;no score, branch xloadgoto L1293 ;check score queues and process until empty gosub L1C40 ;countdown bonus gosub L1D39 ;clear all bonus step lamps save_current_player update_current_player checklampvalue $55 ;extra ball waiting flag ifcleargoto L1469 blinklampbvalueon $28 ;blink shoot again goto L148F L1469: loadbmem $0032 ;get currently up player bxcomp $02ef ;current # of players in game notegoto L148C checklampvalue $6e ;check dip 7, balls per game, off=3 on=5 loadbmem $0031 ;get current ball in play notegoto L147F bacomp $03 goto L1481 L147F: bacomp $05 L1481: ifcleargoto L1128 lxiw $0031 ;increase ball in play loadb $00 storebmem $0032 ;currently up player reset L148C: lxiw $0032 ;increase currently up player ;direct activated column 7 row 6 L148F: restore_current_player bcdinc $02,$02e3 ;increase audit 12, total balls loadbmem $0013 ;current ball in play storebmem $0074 ;save current ball in play lampbvalueoff $3c lampbvalueoff $43 lampbvalueoff $55 gosub L1D39 ;clear all bonus step lamps lampbvalueon $29 lampbvalueon $31 show_ball_in_play checklampvalue $28 ;check shoot again ifcleargoto L14AF ;not on, branch blinklampbvalueon $28 ;blink shoot again L14AF: checklampvalue $6e loadbmem $0031 ifsetgoto L14BC bacomp $03 ifcleargoto L14C1 L14BC: bacomp $05 ifsetgoto L14C4 L14C1: show_hstd ;show hstd at the start of the last ball in play delay $14 ;wait L14C4: if bell=0 gosub L151E ;make bell sound endif gosub L1B34 gosub L19A6 enable_solenoid_0b $0f ;reset drop bank enable_solenoid_0f $01 lampbvalueoff $5b lampbvalueoff $58 lampbvalueoff $5a lampbvalueoff $5c lampbvalueoff $59 enable_solenoid_0a $0a ;launch ball enable_solenoid_0a $01 xloadgosub L12BA ;clear all switch matrix action registers for columns 1-6 xfer_scores_to_displays update_current_player show_current_player cont_solenoid_on_flipper lampbvalueoff $33 ;tilt loadbmem $0039 aandb $bf storebmem $0039 lampbvalueoff $51 ;clear outhole re-entrancy flag lampbvalueoff $20 ; lampbvalueoff $21 loadb $00 storebmem $0016 ;clear lamps $18-$1f storebmem $0043 storebmem $0044 storebmem $006f storebmem $0073 loadb $02 storebmem $004e storebmem $004f storebmem $0050 storebmem $0051 lampbvalueon $67 ;set game active flag xloadgosub L1085 ;start background sound if bell=0 gosub L151E ;make bell sound return L151E: checklampvalue $6f ;check dip 8, 'always off' ifsetgoto L1527 ;never branch sound_play_primary L59BE ;play bell sound return ;deprecated dip 8 code L1527: sound_play_primary L57DE return else goto L151E triple_bell: enable_solenoid_0f $0f enable_solenoid_05 $05 ;knocker enable_solenoid_0f $0f enable_solenoid_05 $05 ;knocker L151E: enable_solenoid_0f $0f enable_solenoid_05 $05 ;knocker return db $3b org $152b endif ;switch c0r5 credit button L152B: loadbmem $02ce ;check current credits bacomp $00 ;zero? eqreturn ;yes, just return checklampvalue $32 ;check game over lamp ifsetgoto L1556 ;game over, always ok to start a new game loadbmem $0031 ;already in a game - see if on ball 1 bacomp $01 notegoto L1556 ;not on ball 1, branch to restart game loadbmem $02ef ;in a game, on ball 1, get current # of players bacomp $04 ;maxed? eqreturn ;maxed out players on ball 1, just return lxiw $02ef ;increase current # of players L1547: bcddec $01,$02cf ;current credits-- show_credits ;ensure credits displayed matches current credits bcdinc $03,$02d2 ;increase audit 6, # of games started save_current_player xfer_scores_to_displays sound_play_primary L587D return L1556: ;start a new game loadb $01 ;initialize values of $01 storebmem $02ef ;# of players in current game storebmem $0032 ;currently up player storebmem $0031 ;current ball in play show_ball_in_play ;ensure displayed ball in play matches actual ball in play clear_var xloadgoto L12A8 ;clear action registers for virtual timed columns 5 and 6 loadb $00 ;initialize values of $00 storebmem $0045 storebmem $0067 storebmem $0068 storebmem $0069 storebmem $006a storebmem $006b storebmem $006c loadb $18 storebmem $0070 checklampvalue $6e ifsetgoto L158B lampbvalueon $14 ;left drop bank 4k lampbvalueon $10 L158B: save_current_player lxiw $0032 save_current_player lxiw $0032 save_current_player lxiw $0032 save_current_player loadb $01 storebmem $0032 ;setup currently up player back to player 1 cont_solenoid_on_flipper xloadgoto L1085 gosub L1547 loadb $02 ;initialize values of $02 storebmem $0045 xloadgoto L520D L15AC: bcdinc $03,$02db checklampvalue $54 ifsetgoto L15E5 checklampvalue $85 ifsetgoto L15F8 loadbmem $0023 aandb $1c eqgoto L16D8 bacomp $04 eqgoto L15F5 bacomp $08 eqgoto L1695 bacomp $0c eqgoto L15F5 bacomp $10 eqgoto L1692 bacomp $14 eqgoto L15F2 bacomp $18 eqgoto L169E bacomp $1c eqgoto L169B L15E5: lampbvalueoff $54 loadbmem $0023 aandb $18 eqgoto L16D8 goto L1695 L15F2: gosub L16D8 L15F5: lampbvalueon $54 return L15F8: gosub L169E gosub L1695 checklampvalue $84 ifsetgosub L169E checklampvalue $83 ifsetgosub L1695 checklampvalue $82 ifsetgosub L16D8 loadbmem $0023 aandb $3c bacomp $3c notereturn goto L16D8 L1618: bcdinc $03,$02de loadbmem $0020 aandb $1e eqgoto L1680 checklampvalue $53 ifsetgoto L1631 checklampvalue $68 ifcleargoto L1633 lampbvalueon $53 return L1631: lampbvalueoff $53 L1633: checklampvalue $69 ifsetgosub L16D8 checklampvalue $6a ifsetgosub L1695 checklampvalue $6b ifsetgosub L169E checklampvalue $6c ifclearreturn gosub L169E gosub L169E return L164C: bcdinc $03,$02e1 loadbmem $0021 aandb $1e eqgoto L1689 checklampvalue $52 ifsetgoto L1665 checklampvalue $70 ifcleargoto L1667 lampbvalueon $52 return L1665: lampbvalueoff $52 L1667: checklampvalue $71 ifsetgosub L16D8 checklampvalue $72 ifsetgosub L1695 checklampvalue $73 ifsetgosub L169E checklampvalue $74 ifclearreturn gosub L169E gosub L169E return L1680: checklampvalue $53 L1682: ifsetgoto L168E lampregbon goto L16D8 L1689: checklampvalue $52 goto L1682 L168E: lampregboff goto L1695 L1692: gosub L16D8 L1695: gosub L16D8 goto L16D8 L169B: gosub L16D8 L169E: gosub L16D8 gosub L16D8 gosub L16D8 goto L16D8 ;coin L16AA: bcdinc $02,$02eb goto L16BC ;coin L16B1: bcdinc $02,$02ed L16B5: goto L16BC ;coin L16B8: bcdinc $02,$02ef L16BC: checklampvalue $6d ifsetgoto L16C4 goto L1433 ;award extra ball L16C4: loadbmem $0092 aandb $20 notereturn ;credits maxed, return enable_solenoid_0f $0f enable_solenoid_05 $05 ;knocker bcdinc $01,$02cf ;advance current credits show_credits ;ensure displayed credits match current credits bcdinc $03,$02d5 return L16D8: loadbmem $0092 aandb $20 notereturn bcdinc $01,$02cf ;advance current credits show_credits ;ensure displayed credits match current credits enable_solenoid_0f $0f sound_play_secondary L58C2 return L16E9: checkactivegame lampbvalueoff $54 lampbvalueoff $53 lampbvalueoff $52 loadb $1c storebmem $005d checklampvalue $55 ifsetreturn lampbvalueoff $28 ;shoot again lamp return ;switch c4r0 outhole L16FB: goto L1443 ;jump to outhole handling ;slam switch L16FE: reboot ;tilt L16FF: checklampvalue $33 ;check tilt lamp ifsetreturn ;already tilted, return gameoverreturn ;if game over, no tilt play cont_solenoid_off_flipper ;kill flippers sound_play_primary L583F ;play tilt sound effect loadb $00 storebmem $0050 storebmem $005d storebmem $006f loadbmem $0043 aandb $df storebmem $0043 loadbmem $0074 storebmem $0013 lampbvalueoff $67 ;clear active game flag lampbvalueon $33 ;light tilt lamp lampbvalueoff $55 ;clear extra ball waiting flag (boo!) lampbvalueoff $28 ;clear shoot again lamp (boo!) ;not used switch entries L1728: return ;switch s3r5 top left saucer L1729: checklampvalue $6f ;check dip 8, 'always off' ifsetreturn ;never returns checklampvalue $67 ;check active game flag ifcleargoto L179B ;not in an active game, branch checklampvalue $4e ;check saucer occupied flag ifsetreturn ;already processing, return lampregbon ;set saucer re-entrant flag loadb $38 ;setup saucer A lamp goto L1768 ;switch c3r7 top right saucer L173A: checklampvalue $6f ;check dip 8, 'always off' ifsetreturn ;never returns checklampvalue $67 ;check active game flag ifcleargoto L179B ;not in an active game, branch checklampvalue $4e ;check saucer occupied flag ifsetreturn ;already processing, return lampregbon ;set saucer re-entrant flag loadb $3a ;setup saucer I lamp goto L1768 ;switch c3r6 top middle saucer L174B: checklampvalue $6f ;check dip 8, 'always off' ifsetreturn ;never returns checklampvalue $67 ;check active game flag ifcleargoto L179B ;not in an active game, branch checklampvalue $4e ;check saucer occupied flag ifsetreturn ;already processing, return lampregbon ;set saucer re-entrant flag checklampvalue $34 ;saucer special ifsetgosub L140A ;lit, award special checklampvalue $37 ;saucer 5k ifsetgoto L17BB ;lit, branch to award 5k checklampvalue $2f ;saucer 10k ifsetgoto L17B9 ;lit, branch to award 10k loadb $39 ;setup saucer L lamp L1768: addtoscoreq $25 ;score 500 L176A: lampregbon ;put lamp for corresponding saucer on ;see if ALI completed loadb $38 ;start with saucer A lamp L176D: checklampregbon ;see if on ifcleargoto L179B ;not on, branch to eject from top saucers binc ;move to next lamp bacomp $3b ;checked all 3? notegoto L176D ;no, keep going ;ALI just completed checklampvalue $37 ;saucer 5k ifcleargoto L1788 ;not lit, check other lamps lampregboff ;saucer 5k off lampbvalueon $2f ;saucer 10k on gosub L1303 L1782: gosub L12C4 ;GREATEST standups completed, check awards goto L179B ;saucer 5k is off, see if saucer 10k is lit L1788: checklampvalue $2f ;saucer 10k ifsetgoto L179B ;lit, branch lampbvalueon $37 ;light saucer 5k gosub L1303 gosub L12C4 ;GREATEST standups completed, check awards lampbvalueoff $38 ;saucer A lampbvalueoff $39 ;saucer L lampbvalueoff $3a ;saucer I L179B: checklampvalue $6f ;check dip 8, 'always off' ifsetreturn ;never returns loadb $1e ;setup timer storebmem $0055 return L17A4: enable_solenoid_06 $0a ;eject saucer enable_solenoid_0f $01 ;ensure that previous solenoid command executes loadbmem $003c ;get switch column 3 initial register aandb $1f ;clear saucer switches storebmem $003c ;save switch column 3 initial register to allow saucer re-activation lampbvalueoff $4e ;clear saucer occupied flag checklampvalue $33 ;check tilt lamp ifsetreturn ;tilted, just return sound_play_primary L5965 ;play sound return L17B9: addtoscoreq $35 ;enqueue score 5000 L17BB: addtoscoreq $35 ;enqueue score 5000 loadb $39 goto L176A L17C2: checkactivegame ;return if not in an active game checklampvalue $35 L17C5: ifsetgosub L140A addtoscoreq $35 ;enqueue score 5000 gosub L13A6 ;add bonus gosub L13A6 ;add bonus goto L13A6 ;add bonus L17D3: checkactivegame ;return if not in an active game checklampvalue $36 goto L17C5 L17D9: checkactivegame ;return if not in an active game gosub L1341 ;handle rotating special lamps gosub L13A6 ;add bonus addtoscoreq $33 ;ensure score 3000 loadb $0d goto L186D ;turn on GREATEST lamp sent in B and corresponding arch lamp ;switch c4r3 right inlane L17E7: checkactivegame ;return if not in an active game gosub L1341 ;handle rotating special lamps gosub L13A6 ;add bonus addtoscoreq $33 ;enqueue score 3000 checklampvalue $6f ;check dip 8 'always off' ifsetgoto L17FE ;should never branch checklampvalue $80 ;dip 25, spot T in greatest, off=one T per switch, on=light both T's ifcleargoto L17FE ;dip 25 off, do not spot both T's lampbvalueon $0c ;standup 'T' lampbvalueon $04 ;arch 'S' L17FE: loadb $0e goto L186D ;turn on GREATEST lamp sent in B and corresponding arch lamp ;switch c3r0 g standup L1803: checklampvalue $59 ;check flag 59, g lit ifsetreturn ;already collected, return lampregbon ;set flag 59 checklampvalue $6f ;check dip 8 'always off' ifcleargoto L1816 ;branch always ;following code never runs checklampvalue $80 ;dip 25, spot T in greatest, off=one T per switch, on=light both T's ifcleargoto L1816 ;dip 25 off, do not spot both T's checkactivegame ;return if not in an active game lampbvalueon $0c ;standup 'T' lampbvalueon $04 ;arch 'S' L1816: loadb $08 goto L1860 ;switch c3r1 r standup L181B: checklampvalue $58 ifsetreturn lampregbon ;setup flag 58 loadb $09 goto L1860 L1824: checklampvalue $5a ifsetreturn lampregbon checklampvalue $6f ;check dip 8 'always off' ifsetgoto L1830 ;should never branch L182D: checkactivegame ;return if not in an active game lampbvalueon $07 L1830: loadb $0a goto L1860 L1835: checklampvalue $5c ifsetreturn lampregbon L1839: loadb $0b goto L1860 L183E: checklampvalue $5b ifsetreturn lampregbon checklampvalue $6f ;check dip 8, 'always off' ifcleargoto L1854 ;branch always ;more dip 8 deprecated code checklampvalue $80 ifcleargoto L185E checkactivegame ;return if not in an active game lampbvalueon $08 lampbvalueon $00 goto L185E L1854: checklampvalue $80 ifcleargoto L185E checkactivegame ;return if not in an active game lampbvalueon $0e lampbvalueon $06 L185E: loadb $0c L1860: checkactivegame ;return if not in an active game push addtoscoreq $25 ;enqueue score 500 gosub L1341 ;handle rotating special lamps checklampvalue $6f ;check dip 8, 'always off' ifcleargosub L13A6 ;always gosub to add bonus pop ;turn on GREATEST lamp sent in B and corresponding arch lamp L186D: lampregbon ;turn on lamp aandb $07 ;clear lamps > 08 lampregbon ;turn on arch lamp on as well ila ;return to assembly ldb $0074 ;get saved GREATEST letters orb $0013 ;add to just lit letters stb $0074 ;save GREATEST letters swi ;start pigs interpreter rcflagset ;set multiple pigs flag checklampvalue $6f ;dip 8 'always off' ifcleargoto L1885 ;branch always gosub L18E1 ;this code never runs goto L188F ;this code never runs L1885: lampbvalueoff $59 lampbvalueoff $58 lampbvalueoff $5a lampbvalueoff $5c lampbvalueoff $5b L188F: loadbmem $0014 aandb $7f bacomp $7f notereturn checklampvalue $47 ifsetgoto L18AD lampregbon gosub L18CB ;setup GI flashing/attract mode sound effect checklampvalue $6e ifsetgoto L12C4 ;GREATEST standups completed, check awards checklampvalue $7f ifcleargoto L12C4 ;GREATEST standups completed, check awards gosub L12C4 ;GREATEST standups completed, check awards L18AD: checklampvalue $50 ifclearreturn checklampvalue $46 ifsetreturn lampregbon gosub L18CB ;setup GI flashing/attract mode sound effect goto L1303 ;virtual switch c6r6 timer $57 flash GI relay depending on contents of $71 L18BA: loadbmem $0071 ;check counter bacomp $00 ;zero? eqreturn ;yes, end thread enable_solenoid_0d $05 ;GI relay ixdw $0071 ;decrease counter loadb $03 ;setup re-entrancy timer for this routine storebmem $0057 ;save timer return ;end thread ;setup GI flashing/attract mode sound effect L18CB: loadb $02 ;setup timer for flash routine storebmem $0057 loadb $1e storebmem $0071 checklampvalue $67 ;check active game flag ifsetgoto L18DD ;game active, always make sounds checklampvalue $78 ;check dip 17, attract mode sounds, off=GI flash only, on=GI flash + sound ifclearreturn ;dip 17 off, no sounds L18DD: sound_play_primary L58E4 ;make sound return ;return L18E1: checklampvalue $6f ;check dip 8 (set to always off) ifclearreturn ;following routine next runs! removed/modified playfield feature? checklampvalue $59 ifclearreturn checklampvalue $58 ifclearreturn checklampvalue $5a ifclearreturn checklampvalue $5c ifclearreturn checklampvalue $5b ifclearreturn addtoscoreq $35 ;enqueue score 5000 lampbvalueoff $59 lampbvalueoff $58 lampbvalueoff $5a lampbvalueoff $5c lampbvalueoff $5b checklampvalue $37 ;saucer 5k ifcleargoto L190D addtoscoreq $3a ;enqueue score 10k lampbvalueoff $37 ;saucer 5k lampbvalueon $2f ;saucer 10k goto L191B L190D: checklampvalue $2f ;saucer 10k ifcleargoto L1919 addtoscoreq $3a ;enqueue score 10k addtoscoreq $3a ;enqueue score 10k goto L191B L1919: lampbvalueon $37 L191B: enable_solenoid_0b $0f enable_solenoid_0f $01 loadbmem $0041 aandb $e0 storebmem $0041 goto L1B46 ;switch c1r1 'not used' <-perhaps a deprecated standup? L192A: checkactivegame ;return if not in an active game checklampvalue $6f ;check dip 8 'always off' ifclearreturn ;return always score $31 ;score 1000 sound_play_primary L5790 ;play sound gosub L1341 ;handle rotating special lamps goto L13A6 ;add bonus ;switch c1r2 mid rollover buttons (2) L1939: checkactivegame ;return if not in an active game gosub L1341 ;handle rotating special lamps addtoscoreq $11 ;enqueue score 10 goto L13A6 ;add bonus ;left sling L1942: checkactivegame ;return if not in an active game checklampvalue $6f ;check dip 8, always off ifsetgoto L1953 ;should never be set ;right sling L1948: checkactivegame ;return if not in an active game gosub L1341 ;handle rotating special lamps score $11 ;score 10 sound_play_primary L57A4 ;brian bannon says this sound is terrible return ;end thread ;pop bumpers L1952: checkactivegame ;return if not in an active game L1953: gosub L1341 ;handle rotating special lamps checklampvalue $6e ifsetgoto L1961 ;3 balls per game score $31 ;score 1k sound_play_primary L58A4 return ;5 balls per game L1961: score $21 ;score 100 sound_play_primary L57F3 return ;switch c2r7 left drop top L1967: checklampvalue $6f ;dip 8 'must be off' ifsetreturn ;can never return checklampvalue $42 ;check drop flag goto L197C ;switch c2r6 left drop middle L196F: checklampvalue $6f ;dip 8 'must be off' ifsetreturn ;can never return checklampvalue $41 ;check drop flag goto L197C ;switch c2r5 left drop bottom L1977: checklampvalue $6f ;dip 8 'must be off' ifsetreturn ;can never return checklampvalue $40 ;check drop flag L197C: checkactivegame ;return if not in an active game ifsetreturn ;refers to flag $40/41/42 lampregbon ;set flag gosub L1341 ;handle rotating special lamps score $25 ;score 500 sound_play_primary L58CE ;play sound ;check if all drops down checklampvalue $42 ;check flag for top drop ifclearreturn ;not set, return checklampvalue $41 ;check flag for middle drop ifclearreturn ;not set, return checklampvalue $40 ;check flag for bottom drop ifclearreturn ;not set, return ;all drop flags set, all 3 down, process awards checklampvalue $17 ;left drop 10k ifsetgoto L19C0 ;lit, branch to score 10k checklampvalue $16 ;left drop 8k ifsetgoto L19CA ;lit, branch to score 8k checklampvalue $15 ;left drop 6k ifsetgoto L19D4 ;lit, branch to score 6k checklampvalue $14 ;left drop 4k ifsetgoto L19DE ;lit, branch to score 4k lampbvalueon $14 ;none were lit, light 4k L19A6: enable_solenoid_08 $0f ;reset left bank enable_solenoid_0f $01 ;ensure previous solenoid fires loadb $02 ;setup timer storebmem $0050 ;save to process GREATEST score lampbvalueoff $42 ;clear flag top drop lampbvalueoff $41 ;clear flag middle drop lampbvalueoff $40 ;clear flag bottom drop loadbmem $0040 ;get switch column 2 action register aandb $1f ;clear left bank switches to prevent reactivation on reset stroke storebmem $0040 ;save switch column 2 action register goto L1B46 ;clear virtual switch column 5 action register ;score 10k, advance value to award for greatest letters L19C0: push ;save current silo (not sure why this is needed) addtoscoreq $32 ;enqueue score 2k lxiw $006f ;increase greatest score 1k lxiw $006f ;increase greatest score 1k pop ;restore silo ;score 8k, advance value to award for greatest letters L19CA: push ;save current silo (not sure why this is needed) addtoscoreq $32 ;enqueue score 2k lxiw $006f ;increase greatest score 1k lxiw $006f ;increase greatest score 1k pop ;restore silo ;score 6k, advance value to award for greatest letters L19D4: push ;save current silo (not sure why this is needed) addtoscoreq $32 ;enqueue score 2k lxiw $006f ;increase greatest score 1k lxiw $006f ;increase greatest score 1k pop ;restore silo ;score 4k, advance value to award for greatest letters L19DE: push ;save current silo addtoscoreq $34 ;enqueu score 4k lxiw $006f ;increase greatest score 1k lxiw $006f ;increase greatest score 1k lxiw $006f ;increase greatest score 1k lxiw $006f ;increase greatest score 1k loadbmem $0074 ; bacomp $00 notegoto L19F8 storebmem $006f ;clears greatest score value L19F8: pop ;restore silo L19F9: bacomp $17 ;contents of $74 eqgoto L19A6 lampregboff binc lampregbon goto L19A6 ;go back to reset the left bank and finish up ;switch c0r4 bottom rollover button L1A04: checkactivegame ;return if not in an active game gosub L1346 checklampvalue $4f ;check re-entrancy flag ifsetreturn ;already set, return loadbmem $0043 ;get virtual switch column 5 action register aandb $7f ;clear row 0 storebmem $0043 ;save virtual switch column 5 action register loadb $32 ;setup timer storebmem $004e ;save timer for routine to stop blinking lampbvalueon $4f ;set re-entrancy flag checklampvalue $6f ;dip 8 'always off' ifsetgoto L1A62 ;will never branch sound_play_primary L5853 ;play sound addtoscoreq $22 ;enqueue score 200 checklampvalue $18 ;200 G ifsetgoto L1A43 ;spot letter addtoscoreq $22 ;enqueue score 200 checklampvalue $19 ;400 R ifsetgoto L1A49 ;spot letter addtoscoreq $22 ;enqueue score 200 checklampvalue $1a ;600 E ifsetgoto L1A4F ;spot letter addtoscoreq $22 ;enqueue score 200 checklampvalue $1b ;800 S ifsetgoto L1A55 ;spot letter addtoscoreq $22 ;enqueue score 200 blinklampbvalueon $1c ;blink center rollover button return ;200 G L1A43: lampregbblinkon ;blink the G around the rollover button loadb $08 ;G standup goto L186D ;turn on GREATEST lamp sent in B and corresponding arch lamp ;400 R L1A49: lampregbblinkon ;blink the R around the rollover button loadb $09 ;R standup goto L186D ;turn on GREATEST lamp sent in B and corresponding arch lamp ;600 E L1A4F: lampregbblinkon ;blink the E around the rollover button loadb $0d ;E2 goto L186D ;turn on GREATEST lamp sent in B and corresponding arch lamp ;800 A L1A55: lampregbblinkon ;blink the S around the rollover button lampbvalueon $07 ;arch E2 (???) loadb $0a ;E standup goto L186D ;turn on GREATEST lamp sent in B and corresponding arch lamp ;unreferenced code L1A5D: loadb $0e ;E2 goto L186D ;turn on GREATEST lamp sent in B and corresponding arch lamp ;more unreferenced code due to dip 8 being always off L1A62: checklampvalue $18 ifsetgoto L1AA2 checklampvalue $19 ifsetgoto L1A9B checklampvalue $1a ifsetgoto L1AAB checklampvalue $1b ifsetgoto L1A99 checklampvalue $1c ifsetgoto L1AAB checklampvalue $1d ifsetgoto L1A97 checklampvalue $1e ifsetgoto L1AAB checklampvalue $1f ifsetgoto L1A9B checklampvalue $20 ifsetgoto L1AAB checklampvalue $21 ifsetgoto L1A95 return L1A95: addtoscoreq $35 ;enqueue score 5000 L1A97: addtoscoreq $35 ;enqueue score 5000 L1A99: addtoscoreq $35 ;enqueue score 5000 L1A9B: addtoscoreq $3a ;enqueue score 10k lampregbblinkon gosub L1AB7 return L1AA2: addtoscoreq $35 ;enqueue score 5000 lampregbblinkon gosub L1AB7 goto L1433 ;award extra ball L1AAB: addtoscoreq $35 ;enqueue score 5000 lampregbblinkon gosub L1AB7 loadb $03 storebmem $0054 return L1AB7: ila ldb $006A aslb aslb stb $004E rts ;end of dip 8 unreferenced code L1ABF: checklampvalue $2e ifcleargoto L1AC7 checklampvalue $2c ifsetreturn L1AC7: loadb $03 storebmem $0054 goto L13A6 ;add bonus ;switch c2r3 top bank middle drop L1ACF: checklampvalue $4a ;setup drop flag to check/set goto L1ADB ;switch c2r2 top bank left drop L1AD4: checklampvalue $48 ;setup drop flag to check/set goto L1ADB ;switch c2r4 top bank right drop L1AD9: checklampvalue $49 ;setup drop flag to check/set L1ADB: checkactivegame ;return if not in an active game ifsetreturn ;refers to drop flags 48/49/4a - already set, return lampregbon ;set drop flag gosub L1341 ;handle rotating special lamps score $25 ;score 500 sound_play_primary L5917 ;play sound ;see if all 3 drops are down checklampvalue $4a ;check middle drop flag ifclearreturn ;not set, return checklampvalue $48 ;check left drop flag ifclearreturn ;not set, return checklampvalue $49 ;check right drop flag ifclearreturn ;not set, return checklampvalue $13 ;top drop 20k ifsetgoto L1B07 ;on, branch checklampvalue $12 ;top drop 15k ifsetgoto L1B12 ;on, branch checklampvalue $11 ;top drop 10k ifsetgoto L1B1F ;on, branch checklampvalue $10 ;top drop 5k ifsetgoto L1B2C ;on, branch lampregbon ;turn top drop 5k on goto L1B34 ;branch to reset bank and finish up ;top drop 20k was lit L1B07: lampbvalueon $25 ;5x multiplier lampbvalueoff $24 ;4x multiplier addtoscoreq $3a ;enqueue score 10k addtoscoreq $3a ;enqueue score 10k goto L1B34 ;branch to reset bank and finish up ;top drop 15k was lit L1B12: lampbvalueoff $23 ;3x multiplier lampbvalueon $24 ;4x multiplier lampbvalueoff $12 ;top drop 15k lampbvalueon $13 ;top drop 20k addtoscoreq $3f ;enqueue score 15k goto L1B34 ;branch to reset bank and finish up ;top drop 10k was lit L1B1F: lampbvalueoff $22 ;2x multiplier lampbvalueon $23 ;3x multiplier lampbvalueoff $11 ;top drop 10k lampbvalueon $12 ;top drop 15k addtoscoreq $3a ;enqueue score 10k goto L1B34 ;branch to reset bank and finish up ;top drop 5k was lit L1B2C: lampbvalueon $22 ;2x multiplier lampbvalueoff $10 ;top drop 5k lampbvalueon $11 ;top drop 10k addtoscoreq $35 ;enqueue score 5k L1B34: enable_solenoid_07 $0f ;reset top drop bank enable_solenoid_0f $01 ;ensure that previous solenoid command executes L1B38: lampbvalueoff $49 ;reset drop flag lampbvalueoff $48 ;reset drop flag lampbvalueoff $4a ;reset drop flag loadbmem $0040 ;get switch column 2 action register aandb $e3 ;clear top bank drop switches to prevent activation on reset stroke storebmem $0040 ;save switch column 2 action register L1B46: loadbmem $0043 ;get virtual switch column 5 action register aandb $bf ;clear row 5 action storebmem $0043 ;save virtual switch column 5 action register L1B4E: loadb $1e ;setup timer storebmem $004f ;save in virtual timer for column 5, row 6 return ;virtual switch c5r6 periodic reset of drop bank switches to catch missed switches L1B54: ila ;return to assembly lda $3B ;get switch column 2 initial register anda #$03 ;clear all drops from rows, leave rows 0/1 sta $003B ;save column 2 initial register lda $3D ;get switch column 4 initial register anda #$9E ;clear sta $003D ;save switch column 4 initial register lda $3C ;get switch column 3 initial register anda #$1F ;clear sta $003C ;save switch column 3 initial register swi ;start pigs interpreter rcflagset ;set multiple pigs flag loadb $1e ;setup timer for this routine storebmem $004f ;save in virtual switch timer checklampvalue $6f ;check dip 8 'always off' ifclearreturn ;return always ;more deprecated code loadbmem $003c ;get switch column 3 initial register aandb $e0 storebmem $003c ;save switch column 3 initial register return ;switch c2r1 listed as 'not used' - deprecated switch L1B7A: checkactivegame ;return if not in an active game checklampvalue $6f ;check dip 8, 'always off' ifclearreturn ;return always ;more deprecated code addtoscoreq $35 ;score 5k checklampvalue $26 ;right rope a dope extra ball ifsetgoto L1BA6 ;branch to score extra ball return ;switch c1r0 rope-a-dope rollover button/special target (there's no special target!) L1B86: checkactivegame ;return if not in an active game checklampvalue $6f ;check dip 8 'always off' ifcleargoto L1B94 ;branch always! addtoscoreq $35 ;enqueue score 5k checklampvalue $27 ;left extra ball ifsetgoto L1BA6 ;lit, branch for extra ball return L1B94: checklampvalue $27 ;rope a dope left extra ball ifsetgoto L1BA6 ;lit, branch checklampvalue $26 ;rope a dope right extra ball ifsetgoto L1BA6 ;lit, branch sound_play_primary L5869 ;play sound score $32 ;score 2k L1BA3: goto L1341 ;handle rotating special lamps ;rope a dope extra ball was lit L1BA6: gosub L1433 ;award extra ball score $3a ;score 10k L1BAB: goto L1341 ;handle rotating special lamps L1BAE: checklampvalue $60 ifsetreturn L1BB1: lampregbon checklampvalue $67 ;check active ball flag ifcleargoto L1BDA gosub L1341 ;handle rotating special lamps addtoscoreq $31 L1BBC: loadbmem $0074 bacomp $00 eqgoto L1BDA checklampvalue $6f ifcleargoto L1BD2 L1BC9: loadbmem $004e L1BCC: bacomp $00 dispatch ;keep processing switches/scoring notegoto L1BC9 L1BD2: lxiw $006f loadb $01 storebmem $0050 L1BDA: checklampvalue $6f ifcleargoto L1BF7 loadbmem $006f bacomp $00 dispatch notegoto L1BDA enable_solenoid_0c $0f enable_solenoid_0f $01 L1BEC: checklampvalue $33 ;check tilt lamp ifsetgoto L1C25 sound_play_primary L5965 L1BF4: goto L1C25 L1BF7: lampbvalueoff $60 return ;switch c0r3 'n/u' - eliminated switch L1BFA: checkactivegame ;return if not in an active game checklampvalue $6f ;check dip 8, 'always off' ifclearreturn ;always return ;more deprecated dip 8 code gosub L1341 ;handle rotating special lamps checklampvalue $31 ;unassigned lamp ifsetgoto L1C0C ;on, branch score $21 ;score 100 sound_play_primary L5869 return L1C0C: score $31 ;score 1k sound_play_primary L5811 return ;switch c4r5 middle right saucer L1C12: checklampvalue $4c ;check the re-entrancy flag ifsetreturn ;it's set, return lampregbon ;set the re-entancy flag checklampvalue $67 ;check active game flag ifcleargoto L1C1E ;not in an active game, branch gosub L1C40 ;countdown bonus L1C1E: gosub L1341 ;handle rotating special lamps enable_solenoid_09 $0f ;fire eject solenoid enable_solenoid_0f $01 ;ensure the previous solenoid command completes L1C25: loadb $1e ;setup timer storebmem $0056 ;save timer for virtual switch c6r7 to clear the re-entrancy flag for the saucer loadbmem $0044 ;get virtual switch column 6 action register aandb $7f ;clear row 7 storebmem $0044 ;save virtual switch column 6 action register return ;virtual switch c6r7 clear the right eject saucer flag and the left rollover flag L1C33: loadbmem $003d ;get switch column 4 initial register aandb $9f ;clear middle left rollover and mid right saucer switches to allow reactivation (was left supposed to be a saucer?) storebmem $003d ;save switch column 4 initial register lampbvalueoff $60 ;clear left rollover active flag lampbvalueoff $4c ;clear right saucer active flag return ;countdown bonus L1C40: loadbmem $0018 ;save bonus lamps storebmem $0075 ;save loadbmem $0017 ;save multiplier lamps storebmem $0076 ;save checklampvalue $25 ;5x bonus ifsetgoto L1C63 ;lit, countdown bonus 5x checklampvalue $24 ;4x bonus ifsetgoto L1C6D ;lit, countdown bonus 4x checklampvalue $23 ;3x bonus ifsetgoto L1C77 ;lit, countdown bonus 3x checklampvalue $22 ;2x bonus ifsetgoto L1C81 ;lit, countdown bonus 2x goto L1C89 ;no multipliers lit, countdown bonus 1x ;bonus countdown 5x L1C63: gosub L1CC5 ;actually countdown the bonus lampbvalueoff $25 ;5x lampbvalueon $24 ;4x gosub L1CB5 ;restore bonus lamps ;bonus countdown 4x L1C6D: gosub L1CC5 ;actually countdown the bonus lampbvalueoff $24 ;4x lampbvalueon $23 ;3x gosub L1CB5 ;restore bonus lamps ;bonus countdown 3x L1C77: gosub L1CC5 ;actually countdown the bonus lampbvalueoff $23 ;3x lampbvalueon $22 ;2x gosub L1CB5 ;restore bonus lamps ;bonus countdown 2x L1C81: gosub L1CC5 ;actually countdown the bonus lampbvalueoff $22 ;2x L1C86: gosub L1CB5 ;restore bonus lamps ;bonus countdown 1x L1C89: gosub L1CC5 ;actually countdown the bonus gosub L1D39 ;clear all bonus step lamps lampbvalueon $31 lampbvalueon $29 checklampvalue $33 ;check tilt lamp ifsetgoto L1C9D ;tilt, branch sound_play_primary L59A8 ;play sound delay $18 ;wait L1C9D: checklampvalue $6f ;check dip 8, 'always off' ifsetgoto L1CA5 ;never branches gosub L1CB5 ;restore bonus lamps ;restore multiplier lamps L1CA5: ila ldb $76 andb #$3c lda $17 anda #$C3 sta $0017 orb $0017 stb $0017 rts ;restore bonus lamps L1CB5: ila ldb $0075 andb #$7E lda $18 anda #$81 sta $0018 orb $0018 stb $0018 rts ;actually countdown the bonus L1CC5: loadb $2c L1CC7: checklampregbon ifsetgoto L1CF1 bdec bacomp $28 notegoto L1CC7 L1CD1: checklampvalue $2e ifcleargoto L1CEB lampregboff delay $02 gosub L1D39 ;clear all bonus step lamps loadb $2d gosub L1CF7 L1CE1: delay $02 gosub L1D39 ;clear all bonus step lamps loadb $2d goto L1CF7 L1CEB: checklampvalue $2d ifclearreturn goto L1CE1 L1CF1: gosub L1CF7 goto L1CD1 ;actually score the current bonus step L1CF7: score $32 ;score 2000 lampregbon bdec push checklampvalue $33 ;check tilt lamp ifsetgoto L1D30 ;tilted, branch checklampvalue $25 ;5x bonus ifcleargoto L1D0C ;not lit, branch sound_play_primary L592D ;play 5x bonus sound/ramp goto L1D30 L1D0C: checklampvalue $24 ;4x bonus ifcleargoto L1D17 ;not lit, branch sound_play_primary L5936 ;play 4x bonus sound/ramp goto L1D30 L1D17: checklampvalue $23 ;3x bonus ifcleargoto L1D22 ;not lit, branch sound_play_primary L593F ;play 3x bonus sound/ramp goto L1D30 L1D22: checklampvalue $22 ;2x bonus ifcleargoto L1D2D ;not lit, branch sound_play_primary L5948 ;play 2x bonus sound/ramp goto L1D30 L1D2D: sound_play_primary L5951 ;play 1x bonus sound/ramp L1D30: pop bacomp $28 ;finished all bonus lamps? delay $02 ;but wait first.... notegoto L1CF7 ;not done, keep going return ;clear all bonus step lamps L1D39: lampbvalueoff $2d ;bonus 10k lampbvalueoff $2e ;bous 20k lampbvalueoff $2c ;bonus 8k lampbvalueoff $2b ;bonus 6k lampbvalueoff $2a ;bonus 4k lampbvalueoff $29 ;bonus 2k return L1D46: loadbmem $0070 lampregboff binc bacomp $22 notegoto L1D66 goto L1D64 ;timed virtual switch c5r7 move GERS lamps around L1D53: lampbvalueoff $4f checklampvalue $6f ;check dip 8 'always off' ifsetgoto L1D46 ;never branches loadbmem $0070 lampregboff binc bacomp $1d notegoto L1D66 L1D64: loadb $18 L1D66: lampregbon storebmem $0070 loadb $0f storebmem $004e return L1D70: loadb $02 L1D72: storebmem $0050 loadbmem $006f bacomp $00 eqreturn L1D7B: loadbmem $0073 bacomp $08 notegoto L1D95 loadb $00 L1D85: storebmem $0073 ixdw $006f loadbmem $0074 storebmem $0013 sound_play_primary L5886 return L1D95: checklampvalue $6f loadbmem $0073 ifsetgoto L1DAC bacomp $05 eqgoto L1DCB bacomp $06 eqgoto L1DD5 bacomp $07 eqgoto L1DD0 L1DAC: checklampregbon ifcleargoto L1DBF lampregboff score $31 sound_play_primary L5853 loadb $03 L1DB8: storebmem $0050 lxiw $0073 return L1DBF: bacomp $07 loadb $02 notegoto L1DC8 loadb $05 L1DC8: goto L1DB8 L1DCB: loadb $07 goto L1DAC L1DD0: loadb $06 goto L1DAC L1DD5: loadb $05 goto L1DAC L1DDA: checklampvalue $6f ;check dip 8, 'always off' ifsetreturn ;never returns loadb $07 storebmem $0051 goto L1389 L1DE5: ;filler db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff org $1fff L1FFF: db $5b ;checksum org $5000 ;stern function table L5000: dw L5233 ;$00 enable_solenoid_00 db $time dw L5233 ;$01 enable_solenoid_01 db $time dw L5233 ;$02 enable_solenoid_02 db $time dw L5233 ;$03 enable_solenoid_03 db $time dw L5233 ;$04 enable_solenoid_04 db $time dw L5233 ;$05 enable_solenoid_05 db $time dw L5233 ;$06 enable_solenoid_06 db $time dw L5233 ;$07 enable_solenoid_07 db $time dw L5233 ;$08 enable_solenoid_08 db $time dw L5233 ;$09 enable_solenoid_09 db $time dw L5233 ;$0a enable_solenoid_0a db $time dw L5233 ;$0b enable_solenoid_0b db $time dw L5233 ;$0c enable_solenoid_0c db $time dw L5233 ;$0d enable_solenoid_0d db $time dw L5233 ;$0e enable_solenoid_0e db $time dw L5233 ;$0f enable_solenoid_0f db $time dw L5248 ;$10 cont_solenoid_on_gi - dw L5248 ;$11 cont_solenoid_on_flipper - dw L5248 ;$12 cont_solenoid_on_coin - dw L5248 ;$13 cont_solenoid_on_ef - dw L525B ;$14 cont_solenoid_off_gi - dw L525B ;$15 cont_solenoid_off_flipper - dw L525B ;$16 cont_solenoid_off_coin - dw L525B ;$17 cont_solenoid_off_ef - dw L5DA8 ;$18 rcflagset - dw L5DAE ;$19 ila(in line assembly) - dw L5270 ;$1a lampregbon [implied cpu register B] dw L526D ;$1b lampbvalueon db $lamp [00-3b]/$flag [3c-87] dw L5281 ;$1c lampregboff [implied cpu register B] dw L527E ;$1d lampbvalueoff db $lamp [00-3b]/$flag [3c-87] dw L5292 ;$1e altlampregb [implied cpu register B] dw L528F ;$1f altlampbvalueon db $lamp [00-3b]/$flag [3c-87] dw L52A6 ;$20 checklampregbon [implied cpu register B] dw L52A3 ;$21 checklampvalue db $lamp [00-3b]/$flag [3c-87] dw L529C ;$22 lampregbblinkon [implied cpu register B] dw L5299 ;$23 blinklampbvalueon db $lamp [00-3b] dw L530B ;$24 clearplayflags - dw L531A ;$25 delay db $time dw L532B ;$26 dispatch - dw L53AF ;$27 goto dw location dw L53D4 ;$28 notegoto dw location dw L53CC ;$29 eqgoto dw location dw L54F0 ;$2a save_current_player - dw L5515 ;$2b restore_current_player - dw L53E1 ;$2c gosub dw location dw L5406 ;$2d notegosub dw location dw L53FD ;$2e eqgosub dw location dw L540F ;$2f return - dw L5427 ;$30 notereturn - dw L5420 ;$31 eqreturn - dw L542E ;$32 tiltreturn - dw L5432 ;$33 gameoverreturn - dw L5439 ;$34 checkactivegame - dw L5490 ;$35 binc - dw L549A ;$36 lxi/lxiw db $msb,$lsb/dw location dw L5495 ;$37 bdec - dw L54A0 ;$38 ixd/ixdw db $location/dw location dw L54A6 ;$39 loadb db $value dw L54AA ;$3a loadbmem dw location dw L54B3 ;$3b storebmem dw location dw L54B9 ;$3c bacomp db $value dw L54BE ;$3d bxcomp dw value dw L54CC ;$3e aorb db $value dw L54D8 ;$3f aeorb db $value dw L54E4 ;$40 aandb db $value dw L53EB ;$41 func41 - dw L5440 ;$42 func42 - dw L543E ;$43 push - dw L5452 ;$44 pop - dw L55BB ;$45 update_current_player - dw L55A6 ;$46 blank_current_player - dw L55B2 ;$47 show_current_player - dw L5584 ;$48 update_match - dw L5599 ;$49 show_ball_in_play - dw L5539 ;$4a show_credits - dw L5613 ;$4b show_hstd - dw L5639 ;$4c all_displays_valid - dw L5646 ;$4d all_displays_invalid - dw L564B ;$4e xfer_scores_to_displays - dw L56AE ;$4f score [directly] db $parameter dw L53E6 ;$50 spawn_thread - dw L572D ;$51 clear_var - dw L5468 ;$52 bcdinc db $i,$j,$k dw L547C ;$53 bcddec db $i,$j,$k dw L5C65 ;$54 reboot - dw L53DC ;$55 xloadgoto dw location dw L5744 ;$56 addtoscoreq db $parameter dw L576A ;$57 sound_play_primary dw location dw L5770 ;$58 sound_play_secondary dw location L50B2: lda $8b bpl L50C0 ldb #$34 stb $008B lda $8A cli jmp L5DBE L50C0: lda $89 bpl L50D2 lda $4A bne L50CF coma sta $005E lda #$48 sta $004A L50CF: lda $88 rti L50D2: jmp L5C65 ;nmi s33 switch press L50D5: lda #$FF sta $0060 rti L50DA: lda $91 bpl L50B2 lda $90 lda $8B psha lda $88 psha lda $5F bne L50F7 coma ldb #$30 stb $008B sta $008A ldb #$34 stb $008B sta $008A L50F7: sta $0088 ldb #$3C stb $008B ldb #$3D stb $0091 ldb #$34 stb $008B ldb #$35 stb $0091 ldx #$0003 lda $0F bne L5113 jmp L51A1 L5113: dex asla bcs L511B asla bcc L5113 clc L511B: lda #$35 sta $0089 lda 0,x ora $0062 bcs L5129 anda #$F0 bra L512E L5129: asla asla asla asla sec L512E: ora #$0E sta $0088 ldb $03,x orb $0063 ora #$0F L5138: sta $0088 L513A: bcs L5140 L513C: andb #$F0 L513E: bra L5145 L5140: aslb L5141: aslb L5142: aslb L5143: aslb L5144: sec L5145: orb #$0D L5147: stb $0088 L5149: lda $06,x L514B: ora $0064 L514D: orb #$0F L514F: stb $0088 L5151: bcs L5157 L5153: anda #$F0 L5155: bra L515C L5157: asla L5158: asla L5159: asla L515A: asla L515B: sec L515C: ora #$0B L515E: sta $0088 L5160: ldb $09,x L5162: orb $0065 L5164: ora #$0F L5166: sta $0088 L5168: lda $0F L516A: sta $0090 L516C: bcs L5172 L516E: andb #$F0 L5170: bra L5177 L5172: aslb L5173: aslb L5174: aslb L5175: aslb L5176: sec L5177: orb #$07 L5179: stb $0088 L517B: lda $0C,x L517D: ora $0066 L517F: orb #$0F L5181: stb $0088 L5183: bcc L518A L5185: asla L5186: asla L5187: asla L5188: asla L5189: sec L518A: ora #$0F L518C: sta $0088 L518E: ldb $0090 L5190: andb #$FE L5192: stb $0090 L5194: orb #$01 L5196: stb $0090 L5198: lda #$3D L519A: sta $0089 L519C: lda $0F L519E: asla L519F: bcc L51A3 L51A1: lda #$04 L51A3: sta $000F L51A5: pula L51A6: sta $0088 L51A8: lda $5F L51AA: bne L51BC L51AC: ldb #$30 L51AE: stb $008B L51B0: sta $008A L51B2: ldb #$34 L51B4: stb $008B L51B6: ldb #$23 L51B8: decb L51B9: bne L51B8 L51BB: coma L51BC: sta $008A L51BE: pula L51BF: tab L51C0: lsra L51C1: bcs L51C5 L51C3: lda $8A L51C5: stb $008B L51C7: dec $0046 L51CA: rti L51CB: lds #$027F L51CE: bsr L5215 L51D0: lda #$20 L51D2: ldx #$0020 L51D5: sta $0088 L51D7: ldb #$22 L51D9: decb L51DA: bne L51D9 L51DC: ldb $008A L51DE: stb $00,x L51E0: inx L51E1: asla L51E2: bne L51D5 L51E4: sta $0088 L51E6: lda #$3D L51E8: sta $008B L51EA: ldb #$22 L51EC: decb L51ED: bne L51EC L51EF: ldb $008A L51F1: stb $00,x L51F3: cli L51F4: lda #$01 L51F6: sta $0052 L51F8: sta $0053 L51FA: ldx $0020 L51FC: bne L5205 L51FE: ldx $0022 L5200: bne L5205 L5202: jmp L59D7 L5205: swi rcflagset lampbvalueon $32 ;game over show_credits show_hstd update_match ila L520D: lds #$027F L5210: jsr L532B L5213: bra L520D L5215: ldx #$0000 L5218: clra L5219: sta $00,x L521B: inx L521C: cpx #$0080 L521F: bne L5219 L5221: ldx #$FFFF L5224: stx $0034 L5226: stx $0036 L5228: stx $0038 L522A: stx $003A L522C: stx $003C L522E: stx $0062 L5230: stx $0064 L5232: rts L5233: lsra L5234: ldb #$F0 L5236: andb $0092 L5238: aba L5239: ldb $0047 L523B: bne L5239 L523D: dec $0047 L5240: sta $0092 L5242: jsr L52F4 L5245: sta $0047 L5247: rts L5248: ldb #$80 L524A: lsra L524B: anda #$03 L524D: beq L5253 L524F: lsrb L5250: deca L5251: bne L524F L5253: comb L5254: sei L5255: andb $0092 L5257: stb $0092 L5259: cli L525A: rts L525B: ldb #$80 L525D: lsra L525E: anda #$03 L5260: beq L5266 L5262: lsrb L5263: deca L5264: bne L5262 L5266: sei L5267: orb $0092 L5269: stb $0092 L526B: cli L526C: rts L526D: jsr L5301 L5270: bsr L52BE L5272: psha L5273: ora $00,x L5275: sta $00,x L5277: pula L5278: coma L5279: anda $11,x L527B: sta $11,x L527D: rts L527E: jsr L5301 L5281: bsr L52BE L5283: coma L5284: psha L5285: anda $00,x L5287: sta $00,x L5289: pula L528A: anda $11,x L528C: sta $11,x L528E: rts L528F: ; jsr L5301 db $bd dw L5301 L5292: bsr L52BE L5294: eora $00,x L5296: sta $00,x L5298: rts L5299: ; jsr L5301 db $bd dw L5301 L529C: bsr L52BE L529E: ora $11,x L52A0: sta $11,x L52A2: rts L52A3: ; jsr L5301 db $bd dw L5301 L52A6: bsr L52BE L52A8: pshb L52A9: psha L52AA: tba L52AB: ldb $00,x L52AD: cmpa #$68 L52AF: bcc L52B3 L52B1: orb $11,x L52B3: pula L52B4: pshb L52B5: tsx L52B6: anda $00,x L52B8: tpa L52B9: sta $05,x L52BB: pulb L52BC: pulb L52BD: rts L52BE: tba L52BF: lsra L52C0: lsra L52C1: lsra L52C2: adda #$13 L52C4: psha L52C5: clra L52C6: psha L52C7: tsx L52C8: ldx $00,x L52CA: ins L52CB: ins L52CC: pshb L52CD: lda #$01 L52CF: andb #$07 L52D1: beq L52D7 L52D3: asla L52D4: decb L52D5: bne L52D3 L52D7: pulb L52D8: rts L52D9: tsx L52DA: ldx $0A,x L52DC: lda $01,x L52DE: psha L52DF: lda 0,x L52E1: psha L52E2: tsx L52E3: inc $0D,x L52E5: bne L52E9 L52E7: inc $0C,x L52E9: inc $0D,x L52EB: bne L52EF L52ED: inc $0C,x L52EF: ldx $00,x L52F1: pula L52F2: pula L52F3: rts L52F4: tsx L52F5: ldx $0A,x L52F7: lda 0,x L52F9: tsx L52FA: inc $0B,x L52FC: bne L5300 L52FE: inc $0A,x L5300: rts L5301: tsx L5302: ldx $0A,x L5304: ldb $00,x L5306: tsx L5307: stb $06,x L5309: bra L52FA L530B: clra L530C: ldx #$0013 L530F: sta $11,x L5311: sta $00,x L5313: inx L5314: cpx #$0020 L5317: bne L530F L5319: rts L531A: ; jsr L52F4 db $bd dw L52F4 L531D: psha L531E: bsr L532B L5320: pula L5321: ldx #$0A00 L5324: dex L5325: bne L5324 L5327: deca L5328: bne L531D L532A: rts L532B: pshb L532C: ldx #$1000 L532F: stx $02F0 L5332: clrb L5333: ldx #$003E L5336: lda 0,x L5338: bne L538F L533A: inx L533B: addb #$10 L533D: cmpb #$80 L533F: bne L5336 L5341: lda $5E L5343: beq L5348 L5345: jmp L59D7 L5348: pulb L5349: lda $4B L534B: beq L5351 L534D: ldx $006D L534F: bne L5363 L5351: lda #$0C L5353: sta $004B L5355: lda #$51 L5357: ldx #$006C L535A: tst $00,x L535C: bne L5364 L535E: dex L535F: suba #$10 L5361: bpl L535A L5363: rts L5364: dec $00,x L5366: stx $02F2 L5369: jsr L56B7 L536C: lda $19 L536E: anda #$08 L5370: bne L5363 L5372: lda $02F3 L5375: suba #$67 L5377: asla L5378: adda #$84 L537A: sta $02F3 L537D: lda #$57 L537F: adca #$00 L5381: sta $02F2 L5384: ldx $02F2 L5387: ldx $00,x L5389: stx $006D L538B: clr $004C L538E: rts L538F: stb $02F1 L5392: ldb #$80 L5394: asla L5395: bcs L53A0 L5397: inc $02F1 L539A: inc $02F1 L539D: lsrb L539E: bra L5394 L53A0: sei L53A1: eorb $00,x L53A3: stb $00,x L53A5: cli L53A6: ldx $02F0 L53A9: ldx $00,x L53AB: swi spawn_thread bra L5341 L53AF: tsx ldx $08,x lda 0,x pshb ldb $01,x tsx stb $0A,x sta $09,x pulb rts L53BE: tsx inc $09,x bne L53C5 inc $08,x L53C5: inc $09,x bne L53CB inc $08,x L53CB: rts L53CC: tsx lda $03,x tap beq L53AF bra L53BE L53D4: tsx lda $03,x tap bne L53AF bra L53BE L53DC: jsr L52D9 jmp 0,x L53E1: jsr L52D9 swi func41 L53E6: tsx ldx $06,x swi func41 L53EB: tsx lda $06,x sta $08,x lda $07,x sta $09,x lda #$FF ;set rcflag sta $02,x ;save in silo lda $0D,x sta $03,x rts L53FD: tsx lda $03,x tap beq L53E1 ; jmp L53BE db $7e dw L53BE L5406: tsx L5407: lda $03,x L5409: tap L540A: bne L53E1 L540C: ; jmp L53BE db $7e dw L53BE L540F: ins ins ins ins ins ins ins ins ins ins tpa tsx stb $04,x sta $03,x rts L5420: tsx lda $03,x tap beq L540F rts L5427: tsx lda $03,x tap bne L540F rts L542E: lda #$08 bra L5434 L5432: lda #$04 L5434: anda $0019 bne L540F rts L5439: lda $1F bpl L540F rts L543E: swi func42 L5440: tsx L5441: lda $0E,x L5443: sta $04,x L5445: lda $12,x L5447: sta $08,x L5449: lda $13,x L544B: sta $09,x L544D: lda #$FF L544F: sta $02,x L5451: rts L5452: tsx L5453: ldb $0E,x L5455: lda $08,x L5457: sta $12,x L5459: lda $09,x L545B: sta $13,x L545D: ins ins ins ins ins ins ins ins ins ins rts L5468: jsr L5301 jsr L52D9 L546E: lda #$01 dex adda $00,x daa sta $00,x bcc L547B decb bne L546E L547B: rts L547C: jsr L5301 jsr L52D9 L5482: lda #$99 dex adda $00,x daa sta $00,x bcs L548F decb L548D: bne L5482 L548F: rts L5490: tsx incb stb $04,x rts L5495: tsx decb stb $04,x rts L549A: jsr L52D9 inc $00,x rts L54A0: jsr L52D9 dec $00,x rts L54A6: jsr L5301 rts L54AA: jsr L52D9 ldb $00,x tsx stb $04,x rts L54B3: jsr L52D9 stb $00,x rts L54B9: jsr L52F4 bra L54C3 L54BE: jsr L52D9 lda 0,x L54C3: psha tsx cmpb $00,x pula tpa sta $04,x rts L54CC: jsr L52F4 L54CF: psha L54D0: tsx L54D1: orb $00,x L54D3: pula L54D4: tpa L54D5: sta $04,x L54D7: rts L54D8: jsr L52F4 L54DB: psha L54DC: tsx L54DD: eorb $00,x L54DF: pula L54E0: tpa L54E1: sta $04,x L54E3: rts L54E4: jsr L52F4 L54E7: psha L54E8: tsx L54E9: andb $00,x L54EB: pula L54EC: tpa L54ED: sta $04,x L54EF: rts L54F0: bsr L5522 L54F2: stx $02F2 L54F5: ldx #$0010 L54F8: stx $02F0 L54FB: pshb L54FC: ldb #$10 L54FE: ldx $02F0 L5501: lda 0,x L5503: inx L5504: stx $02F0 L5507: ldx $02F2 L550A: sta $00,x L550C: inx L550D: stx $02F2 L5510: decb L5511: bne L54FE L5513: pulb L5514: rts L5515: bsr L5522 L5517: stx $02F0 L551A: ldx #$0010 L551D: stx $02F2 L5520: bra L54FB L5522: pshb L5523: lda $32 L5525: ldb #$70 L5527: lda $32 L5529: addb #$10 L552B: deca L552C: bne L5529 L552E: pshb L552F: ldb #$02 L5531: pshb L5532: tsx L5533: ldx $00,x L5535: pulb L5536: pulb L5537: pulb L5538: rts L5539: pshb L553A: lda #$FF L553C: ldb $0022 L553E: andb #$08 L5540: beq L5545 L5542: lda $02CE L5545: psha L5546: lsra L5547: lsra L5548: lsra L5549: lsra L554A: ora #$F0 L554C: sta $000C L554E: pula L554F: asla L5550: asla L5551: asla L5552: asla L5553: ora #$0F L5555: sta $000D L5557: ldb $0022 L5559: andb #$06 L555B: lda #$10 L555D: asrb L555E: beq L556C L5560: lda #$15 L5562: decb L5563: beq L556C L5565: lda #$25 L5567: decb L5568: beq L556C L556A: lda #$40 L556C: cmpa $02CE L556F: pulb L5570: bhi L557B L5572: sei L5573: lda #$20 L5575: ora $0092 L5577: sta $0092 L5579: cli L557A: rts L557B: sei L557C: lda #$DF L557E: anda $0092 L5580: sta $0092 L5582: cli L5583: rts L5584: lda $22 L5586: anda #$10 L5588: bne L558E L558A: lda #$EE L558C: bra L5596 L558E: lda #$08 L5590: ora $001A L5592: sta $001A L5594: lda $33 L5596: sta $000E L5598: rts L5599: lda $31 ora #$F0 sta $000E lda #$F7 anda $001A sta $001A rts L55A6: bsr L55E1 L55A8: coma L55A9: anda $0061 L55AB: sta $0061 L55AD: lda #$FF L55AF: sta $00,x L55B1: rts L55B2: bsr L55E1 L55B4: ora $0061 L55B6: sta $0061 L55B8: clr $00,x L55BA: rts L55BB: pshb L55BC: lda #$FD L55BE: ldb $0032 L55C0: adda #$03 L55C2: decb L55C3: bne L55C0 L55C5: psha L55C6: pshb L55C7: tsx L55C8: ldx $00,x L55CA: pulb L55CB: pulb L55CC: lda $10 L55CE: ldb $0011 L55D0: bsr L55F2 L55D2: lda $12 L55D4: sta $00,x L55D6: pulb L55D7: bsr L55E1 L55D9: coma L55DA: anda $0061 L55DC: sta $0061 L55DE: clr $00,x L55E0: rts L55E1: lda #$80 L55E3: ldx #$0062 L55E6: pshb L55E7: ldb $0032 L55E9: decb L55EA: beq L55F0 L55EC: inx L55ED: lsra L55EE: bra L55E9 L55F0: pulb L55F1: rts L55F2: tsta L55F3: bne L55F8 L55F5: deca L55F6: bra L5605 L55F8: bita #$F0 L55FA: bne L55FE L55FC: ora #$F0 L55FE: sta $00,x L5600: inx L5601: stb $00,x L5603: inx L5604: rts L5605: tstb L5606: bne L560B L5608: decb L5609: bra L55FE L560B: bitb #$F0 L560D: bne L55FE L560F: orb #$F0 L5611: bra L55FE L5613: ldx #$0000 pshb lda $02C9 ldb $02CA bsr L55F2 lda $02CB sta $00,x pulb ldx $0000 sta $0005 stx $0003 sta $0008 stx $0006 sta $000B stx $0009 lda #$01 ora $0019 sta $0019 L5639: ldx #$0000 L563C: clr $0061 stx $0065 stx $0062 stx $0064 rts L5646: ldx #$FFFF bra L563C L564B: ldx #$0000 pshb lda $0280 ldb $0281 bsr L55F2 lda $0282 sta $00,x inx lda $0290 ldb $0291 bsr L55F2 lda $0292 sta $00,x inx lda $02A0 ldb $02A1 jsr L55F2 lda $02A2 sta $00,x inx lda $02B0 ldb $02B1 jsr L55F2 lda $02B2 sta $00,x pulb clr $0061 lda #$FE anda $0019 sta $0019 lda $02EF deca anda #$03 inca ldx #$0062 L569C: clr $00,x inx deca bne L569C deca L56A3: cpx #$0066 beq L56AD sta $00,x inx bra L56A3 L56AD: rts L56AE: lda #$01 L56B0: ora $0045 L56B2: sta $0045 L56B4: jsr L52F4 L56B7: psha L56B8: lda $19 L56BA: anda #$08 L56BC: pula L56BD: beq L56C0 L56BF: rts L56C0: pshb L56C1: tab L56C2: anda #$0F L56C4: lsrb L56C5: lsrb L56C6: lsrb L56C7: lsrb L56C8: lsrb L56C9: bcc L56CF L56CB: asla L56CC: asla L56CD: asla L56CE: asla L56CF: ldx #$0012 L56D2: tstb L56D3: beq L56D9 L56D5: dex L56D6: decb L56D7: bne L56D5 L56D9: adda $00,x L56DB: daa L56DC: sta $00,x L56DE: dex L56DF: cpx #$000F L56E2: beq L56ED L56E4: lda 0,x L56E6: adca #$00 L56E8: daa L56E9: sta $00,x L56EB: bra L56DE L56ED: swi rcflagset update_current_player show_current_player lampbvalueon $3c ila L56F4: lda #$FF L56F6: sta $0048 L56F8: ldx #$02C0 L56FB: clr $02F0 L56FE: ldb #$80 L5700: lda 0,x L5702: beq L5710 L5704: cmpa $0010 L5706: bhi L5710 L5708: tba L5709: orb $02F0 L570C: stb $02F0 L570F: tab L5710: lsrb L5711: inx L5712: inx L5713: inx L5714: cpx #$02C9 L5717: bne L5700 L5719: lda $1A L571B: anda #$E0 L571D: coma L571E: anda $02F0 L5721: tab L5722: ora $0045 L5724: sta $0045 L5726: tba L5727: ora $001A L5729: sta $001A L572B: pulb L572C: rts ;pigs function $51 clear_var L572D: ldx #$0010 L5730: clr $00,x inx cpx #$0020 bne L5730 ldx #$0024 L573B: clr $00,x inx cpx #$0031 bne L573B rts L5744: lda #$01 L5746: ora $0045 L5748: sta $0045 L574A: jsr L52F4 L574D: ldx #$0067 L5750: cmpa #$10 L5752: bcs L5759 L5754: inx L5755: suba #$10 L5757: bra L5750 L5759: adda $00,x L575B: sta $00,x L575D: bcc L5769 L575F: inx L5760: cpx #$006D L5763: beq L5769 L5765: lda #$01 L5767: bra L5759 L5769: rts L576A: lda #$FF L576C: sta $004B L576E: bra L577B L5770: jsr L52D9 lda $4B cmpa #$20 bcc L5783 bra L577E L577B: jsr L52D9 L577E: stx $006D clr $004C L5783: rts L5784: dw L5811 dw L57A4 dw L5811 dw L58A4 dw L57DE dw L57A4 ;sound 'not used' L5790: db $a4,$04,$c1,$a2,$00,$e4 L5796: db $0e,$05 db $02,$02,$09 L579B: db $00,$03,$06,$00,$40,$03 dw L579B db $08 L57A4: db $a2,$01,$00,$a4,$08,$00,$05,$02 db $0e,$00,$03,$a2,$02,$00,$a4,$03 db $00,$02,$0d L57B7: db $07,$ff,$fb,$ff,$f0,$00,$01,$07 db $ff,$f0,$ff,$e0,$00,$01,$07,$ff db $e0,$ff,$c0,$00,$01,$07,$ff,$d0 db $ff,$a0,$00,$02,$07,$00,$45,$01 db $00,$00,$02,$03 dw L57B7 db $08 L57DE: db $a2,$08,$00,$a4,$08,$00,$0e,$05 db $00,$02,$14 L57E9: db $00,$03,$07,$00,$10,$ff,$c0,$03 dw L57E9 L57F3: db $a2,$02,$3e,$a4,$00,$80,$0e,$05 db $00,$00,$01,$a4,$05,$56,$a2,$02 db $d5,$02,$0a L5806: db $00,$03,$07,$02,$00,$00,$40,$03 dw L5806 db $08 L5811: db $a2,$00,$00,$a4,$01,$00,$05,$02 db $0e,$02,$1e L581C: db $00,$01,$07,$00,$30,$02,$00,$03 dw L581C L5826: db $00,$0a,$08,$a2,$01,$00,$a4,$80 db $00,$0e,$05,$02,$02,$14 L5834: db $00,$02,$07,$01,$00,$f8,$00,$03 dw L5834 db $08 L583F: db $a2,$0a,$00,$a4,$08,$00,$0e,$05 db $02,$02,$23 L584A: db $00,$05,$06,$00,$c0,$03 dw L584A db $08 ;sound bottom rollover button L5853: db $a2,$04,$00,$a4,$20,$00,$05,$02 db $0e,$02,$0a L585E: db $00,$02,$07,$ff,$80,$fe,$00,$03 dw L585E db $08 ;sound rope a dope rollover button L5869: db $a2,$00,$9c,$a6,$c0,$00,$05,$5b db $0d,$02,$34 L5874: db $00,$02,$06,$00,$30,$03 dw L5874 db $08 ;add player sound L587D: db $a4,$02,$8e,$a2,$05,$a8,$04 dw L5796 L5886: db $a2,$01,$60,$a4,$03,$a8,$05,$02 db $0e,$02,$14 L5891: db $00,$03,$06,$00,$40,$03 dw L5891 db $02,$06 L589B: db $00,$01,$06,$ff,$e0,$03 dw L589B db $08 L58A4: db $a2,$0d,$00,$a4,$05,$fe,$0e,$05 db $02,$02,$10 L58AF: db $00,$02,$06,$ff,$90,$03 dw L58AF db $02,$20 L58B9: db $00,$01,$06,$00,$d0,$03 dw L58B9 db $08 L58C2: db $a4,$26,$54,$a6,$80,$00,$0b,$05 db $7a,$00,$78,$08 ;sound top drops L58CE: db $a2,$02,$00,$a4,$03,$80,$05,$00 db $0e,$02,$28 L58D9: db $00,$02,$07,$ff,$c0,$ff,$e0,$03 dw L58D9 db $08 ;sound game over (exactly the same as meteor) L58E4: db $a6,$a0,$00,$a0,$01,$00,$a0,$92 db $01,$05,$3a,$00,$08,$05,$4a,$00 db $0a,$05,$5a,$00,$0c,$05,$6a,$00 db $10,$05,$7a,$00,$18,$05,$8a,$00 db $20,$05,$9a,$00,$30,$05,$aa,$00 db $38,$05,$ba,$a0,$00,$01,$00,$60 db $05,$00,$08 ;sound top drop bank targets L5917: db $a2,$00,$00,$a4,$01,$00,$0e,$05 db $00,$02,$28 L5922: db $00,$02,$07,$00,$40,$00,$20,$03 dw L5922 db $08 ;sound 5x bonus L592D: db $a4,$05,$00,$a2,$06,$00,$04 dw L5957 ;sound 4x bonus L5936: db $a4,$04,$00,$a2,$05,$00,$04 dw L5957 ;sound 3x bonus L593F: db $a4,$3,$00,$a2,$04,$00,$04 dw L5957 ;sound 2x bonus L5948: db $a4,$02,$00,$a2,$03,$00,$04 dw L5957 ;sound 1x bonus L5951: db $a4,$01,$00,$a2,$02,$00 L5957: db $0e,$05,$00,$02,$0a L595C: db $00,$02,$06,$00,$30,$03 dw L595C db $08 ;sound saucer L5965: db $a2,$06,$00,$a4,$20,$20,$05,$02 db $0e,$02,$0a L5970: db $00,$02,$07,$ff,$00,$fe,$00,$03 dw L5970 db $08 ;sound L597B: db $a2,$10,$00,$a4,$10,$00,$05,$00 db $0e,$02,$10 L5986: db $07,$ff,$00,$ff,$10,$00,$02,$03 dw L5986 db $02,$30 L5992: db $07,$00,$48,$00,$24,$00,$02,$03 dw L5992 ;sound L599C: db $a6,$28,$00,$a4,$08,$00,$05,$22 db $0b,$00,$1e,$08 ;sound bonus countdown L59A8: db $a4,$08,$00,$a2,$08,$00,$05,$04 db $0e,$02,$32 L59B3: db $00,$05,$07,$ff,$e0,$ff,$d5,$03 dw L59B3 db $08 ;sound bell L59BE: db $a6,$80,$00,$a4,$02,$c0,$a2,$02 db $80,$0f,$05,$02,$00,$04,$05,$02 db $00,$04,$a2,$00,$00,$05,$02,$00 db $f0,$08 ;self-test/burn-in L59D7: ldx #$2000 stx $0071 lda #$80 sta $001F clra sta $006D sta $006E sta $0070 sta $006F sta $005E jsr L5B3A swi all_displays_valid swi clearplayflags L59F3: bsr L5A67 jsr L5AA8 jsr L5AEE jsr L5A85 beq L59F3 swi all_displays_invalid jsr L5B3A L5A05: bsr L5A67 bsr L5A85 beq L5A05 swi clearplayflags swi all_displays_valid lda #$FF sta $006F L5A13: jsr L5AA8 bsr L5A85 beq L5A13 lda #$FF sta $0070 L5A1E: jsr L5AEE jsr L5B16 bsr L5A85 beq L5A1E jsr L5B3A L5A2B: clr $0070 ldx #$0039 L5A31: ldb #$08 lda 0,x L5A35: inc $0070 L5A38: lsra bcs L5A5A decb bne L5A35 inx cpx #$003E bne L5A31 ldx #$FFFF stx $0062 stx $0064 ldb #$F0 stb $000E ldx #$FFFF stx $000C lda #$08 sta $0061 bra L5A60 L5A5A: dec $0070 jsr L5B16 L5A60: bsr L5A85 beq L5A2B jmp L5B43 L5A67: ldx #$0013 L5A6A: com $00,x inx cpx #$001B bne L5A6A rts L5A73: ldx #$0000 L5A76: lda 0,x sta $03,x sta $06,x sta $09,x inx cpx #$0003 bne L5A76 rts L5A85: jsr L5B31 jsr L5B31 deca sta $0092 lda $60 beq L5A96 ldx $0071 jsr 0,x L5A96: clr $0060 lda $5E clr $005E tsta rts L5AA0: tsta beq L5AA7 inx deca bra L5AA0 L5AA7: rts L5AA8: lda $6F inca cmpa #$10 bcs L5AB0 clra L5AB0: sta $006F ldx #L5BED bsr L5AA0 lda 0,x cmpa #$9A bcc L5AC5 sta $0000 sta $0001 sta $0002 bra L5AE3 L5AC5: ldx #$FFFF stx $0000 stx $0001 suba #$A0 tab asrb ldx #$0000 L5AD3: tstb beq L5ADA inx decb bra L5AD3 L5ADA: ldb #$8F asra bcc L5AE1 ldb #$F8 L5AE1: stb $00,x L5AE3: bsr L5A73 ldx $0000 stx $000C lda $02 sta $000E rts L5AEE: lda $70 inca cmpa #$1D bcs L5AF6 clra L5AF6: sta $0070 cmpa #$13 bge L5B06 ldx #L5BD9 bsr L5AA0 lda 0,x sta $0092 rts L5B06: suba #$13 ldx #L5BFD psha bsr L5AA0 pula bsr L5AA0 ldx $00,x stx $006D rts L5B16: swi all_displays_valid lda #$FF sta $0066 lda $70 tab clra incb L5B21: adda #$01 daa decb bne L5B21 sta $0002 ldx #$FFFF stx $0000 jmp L5A73 L5B31: lda #$1A sta $0047 L5B35: lda $47 bne L5B35 rts L5B3A: lda #$01 sta $00A1 sta $00A0 sta $00C0 rts L5B43: ldx #L5BC9 stx $0071 lda #$01 sta $0032 sta $000E swi all_displays_valid ldx #$FFFF stx $000C ldx #$02C0 L5B58: stx $02F2 lda $0E cmpa #$12 bcs L5B6E clra sta $0010 lda 0,x sta $0011 lda $01,x sta $0012 bra L5B7A L5B6E: lda 0,x sta $0010 lda $01,x sta $0011 lda $02,x sta $0012 L5B7A: swi update_current_player jsr L5A73 ldx $02F2 lda $0E cmpa #$05 bcc L5BA7 lda $39 anda #$20 beq L5BA7 swi score $41 ;add 10k to the replay level/hstd level jsr L5A73 ldx $02F2 lda $10 sta $00,x lda $11 sta $01,x lda $12 sta $02,x bsr L5B31 bra L5B58 L5BA7: jsr L5A85 beq L5B58 ldx $02F2 inx inx lda $0E cmpa #$12 bcc L5BB8 inx L5BB8: cpx #$02EF beq L5BC6 lda $0E adda #$01 daa sta $000E bra L5B58 L5BC6: jmp L5C65 L5BC9: ldx $02F2 clr $00,x clr $01,x lda $0E cmpa #$12 bcc L5BD8 clr $02,x L5BD8: rts ;solenoid list L5BD9: db $f1,$f0,$f5,$f6,$f2,$f3,$f4,$f7 db $fa,$fb,$fd,$fc,$f8,$f9,$bf,$fe db $ef,$7f,$df,$ff ;display digits L5BED: db $00,$11,$22,$33,$44,$55,$66,$77 db $88,$99,$a0,$a1,$a2,$a3,$a4,$a5 ;sound test table L5BFD: dw L5C11 dw L5C2C dw L5C47 dw L5C4E dw L5C51 dw L5C54 dw L5C57 dw L5C5A dw L5C5D dw L5C60 L5C11: db $a2,$00,$80,$0c,$00,$06,$a2,$01 db $00,$00,$06,$a2,$02,$00,$00,$06 db $a2,$04,$00,$00,$06,$a2,$08,$00 db $00,$06,$08 L5C2C: db $a4,$00,$80,$0a,$00,$06,$a4,$01 db $00,$00,$06,$a4,$02,$00,$00,$06 db $a4,$04,$00,$00,$06,$a4,$08,$00 db $00,$06,$08 L5C47: db $a6,$60,$00,$09,$05,$08,$01 L5C4E: db $05,$19,$01 L5C51: db $05,$2a,$01 L5C54: db $05,$3b,$01 L5C57: db $05,$4c,$01 L5C5A: db $05,$5d,$01 L5C5D: db $05,$6e,$01 L5C60: db $05,$7f,$00,$78,$08 ;reset L5C65: sei lds #$007F lda #$04 sta $0089 sta $0093 ldx #$FF00 stx $0088 stx $008A stx $0090 stx $0092 L5C7A: dex bne L5C7A clra sta $00A1 lda #$92 sta $00A0 inca sta $00A1 clr $00A0 ldx #$8000 stx $00A6 ldx #$0200 stx $00A4 lda #$02 sta $00C0 lda #$30 sta $0091 ldx #$55F0 L5C9F: dex bne L5C9F ;rom checksum clra ldx #$1000 L5CA6: adda $00,x inx cpx #$2000 bne L5CA6 ldx #$5000 L5CB1: adda $00,x inx cpx #$6000 bne L5CB1 tsta L5CBA: bne L5CBA bsr L5D0B ;rom checksum passed, blink LED/ding #1 ;test u7 6810 ram L5CBE: clra L5CBF: inca sta $00,x cmpa $00,x L5CC4: bne L5CC4 tsta bne L5CBF inx cpx #$0080 bne L5CBE bsr L5D0B ;6810 ram test passed, blink LED/ding #2 ;test u8/u13 5101 rams L5CD1: ldx #$0200 L5CD4: ldb $00,x clra L5CD7: inca sta $00,x cmpa $00,x L5CDC: bne L5CDC tsta bne L5CD7 stb $00,x inx cpx #$0300 bne L5CD4 bsr L5D0B ;5101 rams test passed, blink LED/ding #3 ;test u10 6821 pia L5CEB: ldx #$008B ;base address of u10 bsr L5D24 ;test pia with base address in X bsr L5D0B ;u10 6821 pia test passed, blink LED/ding #4 ;test u11 6821 pia L5CF2: ldx #$0093 ;base address of u11 L5CF5: bsr L5D24 ;test pia with base address in X L5CF7: bsr L5D0B ;u11 6821 pia test passed, blink LED/ding #5 ; L5CF9: lda $90 L5CFB: lda $91 bpl L5CFB bsr L5D0B ; L5D01: lda $8A L5D03: lda $8B bpl L5D03 bsr L5D0B bra L5D59 ;blink LED/ding L5D0B: lda #$38 sta $0091 lda #$02 sta $00C0 ldx #$E530 L5D16: dex bne L5D16 lda #$30 sta $0091 ldx #$A5F0 L5D20: dex bne L5D20 rts ;test pia with base address in X L5D24: bsr L5D26 L5D26: lda #$31 bsr L5D3F lda #$39 bsr L5D3F dex bsr L5D49 inx lda #$35 bsr L5D3F lda #$3D bsr L5D3F dex bsr L5D49 dex rts L5D3F: sta $00,x ldb $00,x andb #$3F cba L5D46: bne L5D46 rts L5D49: clra L5D4A: sta $00,x ldb #$03 L5D4E: decb bne L5D4E cmpa $00,x L5D53: bne L5D53 inca bne L5D4A rts L5D59: lda #$38 sta $0089 sta $008B sta $0091 sta $0093 ldb #$FF stb $0088 stb $0090 stb $0092 comb stb $008A lda #$34 sta $0093 lda #$35 sta $0089 sta $008B sta $0091 lda #$FF sta $0092 jmp L51CB ;swi pigs interpreter L5D81: clra ;setup marker psha ;save marker tsx ;get data silo address lda 0,x ;get saved condition register tap L5D87: ldx $06,x ;get script address lda 0,x ;get pigs token asla ;double A for eventual lsb of pigs routine address psha ;save lsb lda #hi L5000 ;get pigs pointer table msb adca #$00 ;handle any carries from the doubling psha ;save msb tsx ;get data silo address back inc $09,x ;increment script pointer lsb bne L5D99 ;no carry, branch inc $08,x ;increment script pointer msb L5D99: ldx $00,x ;get pigs pointer ldx $00,x ;get pigs routine into X ins ;discard msb pula ;get lsb back jsr 0,x ;execute pigs routine tsx ;get data silo pointer lda 0,x ;get multiprocessing flag bne L5D87 ;not zero, keep processing pigs pula ;clear marker rti ;end pigs interpreter ;pigs function 18 rcflagset set pigs multiprocessing flag L5DA8: lda #$FF ;setup flag tsx ;get current data silo sta $02,x ;save multiprocessing flag rts ;return ;pigs function 19 ila clear pigs multiprocessing flag/return to assembly L5DAE: tsx ;get current data silo clr $02,x ;clear multiprocessing flag rts ;return L5DB2: asla tst $00,x beq L5DBC dec $00,x bne L5DBC inca L5DBC: inx rts L5DBE: ldx #$0046 dec $00,x inx L5DC4: lda 0,x beq L5DCA dec $00,x L5DCA: inx cpx #$004D bne L5DC4 dec $00,x bne L5DF1 lda #$04 sta $004D inx clra L5DDA: bsr L5DB2 cpx #$0056 bne L5DDA ora $0043 sta $0043 clra L5DE6: bsr L5DB2 cpx #$005E bne L5DE6 ora $0044 sta $0044 ;advance match L5DF1: lda $33 ;get match adda #$10 ;increase cmpa #$A0 ;rolled over? bcs L5DFA ;no, branch clra ;yes, make match 00 L5DFA: sta $0033 ;save match L5DFC: lda $47 bne L5E06 lda #$0F ora $0092 sta $0092 L5E06: lda #$0A L5E08: deca bne L5E08 ldx #$0013 ldb #$F0 L5E10: cli stb $0088 lda #$3C sei sta $008B lda #$34 sta $008B lda 0,x coma bitb #$01 bne L5E28 asla asla asla asla dex L5E28: sta $0088 inx incb bne L5E10 cli lda #$30 sei stb $005F sta $008B stb $008A ldb #$34 stb $008B cli ldx #$0039 lda #$20 L5E42: dex lsra sta $0088 beq L5E65 ldb #$1E L5E4A: decb bne L5E4A psha lda 0,x eora $05,x anda $05,x ldb $05,x stb $00,x ldb $008A stb $05,x anda $05,x ora $0A,x sta $0A,x pula bra L5E42 L5E65: coma ldb #$30 sei stb $008B sta $008A sta $005F ldb #$35 lda $8A stb $008B cli lda $61 beq L5E8E ldb $0048 bne L5E8E ldb #$18 stb $0048 ldx #$0062 tsta L5E86: bpl L5E8A com $00,x L5E8A: inx asla bne L5E86 L5E8E: lda $49 bne L5EA5 lda #$0C sta $0049 ;handle bulb blinking L5E96: ldx #$0013 ldb #$08 L5E9B: lda 0,x eora $11,x sta $00,x inx decb bne L5E9B L5EA5: lda $4C beq L5EAC L5EA9: jmp L5F84 L5EAC: ldx $006D beq L5EA9 L5EB0: lda 0,x inx sta $02F6 bpl L5ECC clr $02F5 lda 0,x ldb $01,x inx inx stx $006D ldx $02F5 sta $00,x stb $01,x bra L5EAC L5ECC: bne L5ED7 lda 0,x inx sta $004C L5ED3: stx $006D bra L5EA9 L5ED7: deca bne L5EDF L5EDA: ldx #$0000 bra L5ED3 L5EDF: deca bne L5EEA lda 0,x inx sta $02F4 bra L5EB0 L5EEA: deca bne L5EF6 dec $02F4 bne L5EF9 inx inx bra L5EB0 L5EF6: deca bne L5EFD L5EF9: ldx $00,x bra L5EB0 L5EFD: deca bne L5F07 lda 0,x inx sta $00C0 bra L5EB0 L5F07: deca bne L5F2F lda #$01 sta $00A0 lda $A2 ldb $00A3 addb $01,x adca $00,x sta $00A2 stb $00A3 L5F1A: lda $A4 ldb $00A5 addb $01,x adca $00,x sta $00A4 stb $00A5 lda #$92 sta $00A0 inx inx ; jmp L5EB0 db $7e dw L5EB0 L5F2F: deca bne L5F46 lda #$01 sta $00A0 lda $A2 ldb $00A3 addb $01,x adca $00,x inx inx sta $00A2 stb $00A3 bra L5F1A L5F46: deca bne L5F63 lda #$00 ldb #$01 sta $00A1 sta $00A0 stb $00A1 stb $00A0 sta $00C0 lda $1F anda #$80 bne L5F60 jmp L5EDA L5F60: jmp L1080 L5F63: ldb #$92 clr $00A1 clr $00A0 asra bcc L5F70 stb $00A0 L5F70: asra bcs L5F74 clrb L5F74: incb stb $00A1 clr $00A0 asra bcc L5F81 ldb #$92 stb $00A0 L5F81: jmp L5EB0 L5F84: lda $1F anda #$80 beq L5FBD lda $3A eora $0035 anda $003A anda #$F8 beq L5FBD ldb #$00 asla bcs L5FAE ldb #$01 asla bcs L5FAE ldb #$03 asla bcs L5FAE ldb #$02 asla bcs L5FAE ldb #$04 asla bcs L5FAE rti L5FAE: lda $47 bne L5FBD lda #$F0 anda $0092 aba sta $0092 lda #$05 sta $0047 L5FBD: rti L5FBE: ;filler db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff db $ff,$ff ;what's your vector, victor? org $5ff8 dw L50DA ;irq dw L5D81 ;swi dw L50D5 ;nmi dw L5C65 ;reset