processor 6502 include "vcs.h" include "macro.h" include "2600basic.h" include "2600basic_variable_redefs.h" ifconst bankswitch if bankswitch == 8 ORG $1000 RORG $D000 endif if bankswitch == 16 ORG $1000 RORG $9000 endif if bankswitch == 32 ORG $1000 RORG $1000 endif else ORG $F000 endif ; This is a 2-line kernel! kernel sta WSYNC lda #255 sta TIM64T lda #1 sta VDELBL sta VDELP0 ldx ballheight inx inx stx temp4 lda player1y sta temp3 ifconst shakescreen jsr doshakescreen else ldx missile0height inx endif inx stx stack1 lda bally sta stack2 lda player0y ldx #0 sta WSYNC stx GRP0 stx GRP1 stx PF1 stx PF2 stx CXCLR ifconst readpaddle stx paddle else sleep 3 endif sta temp2,x ;store these so they can be retrieved later ifnconst pfres ldx #128-44 else ldx #132-pfres*4 endif inc player1y lda missile0y sta temp5 lda missile1y sta temp6 lda playfieldpos sta temp1 ifconst pfrowheight lda #pfrowheight+2 else ifnconst pfres lda #10 else lda #(96/pfres)+2 ; try to come close to the real size endif endif clc sbc playfieldpos sta playfieldpos jmp .startkernel .skipDrawP0 lda #0 tay jmp .continueP0 .skipDrawP1 lda #0 tay jmp .continueP1 .kerloop ; enter at cycle 59?? continuekernel sleep 2 continuekernel2 lda ballheight ifconst pfres ldy playfield+pfres*4-132,x sty PF1 ;3 ldy playfield+pfres*4-131,x sty PF2 ;3 ldy playfield+pfres*4-129,x sty PF1 ; 3 too early? ldy playfield+pfres*4-130,x sty PF2 ;3 else ldy playfield+44-128,x ;4 sty PF1 ;3 ldy playfield+45-128,x ;4 sty PF2 ;3 ldy playfield+47-128,x ;4 sty PF1 ; 3 too early? ldy playfield+46-128,x;4 sty PF2 ;3 endif dcp bally rol rol ; rol ; rol goback sta ENABL .startkernel lda player1height ;3 dcp player1y ;5 bcc .skipDrawP1 ;2 ldy player1y ;3 lda (player1pointer),y ;5; player0pointer must be selected carefully by the compiler ; so it doesn't cross a page boundary! .continueP1 sta GRP1 ;3 ifnconst player1colors lda missile1height ;3 dcp missile1y ;5 rol;2 rol;2 sta ENAM1 ;3 else lda (player1color),y sta COLUP1 ifnconst playercolors sleep 7 else lda.w player0colorstore sta COLUP0 endif endif ifconst pfres lda playfield+pfres*4-132,x sta PF1 ;3 lda playfield+pfres*4-131,x sta PF2 ;3 lda playfield+pfres*4-129,x sta PF1 ; 3 too early? lda playfield+pfres*4-130,x sta PF2 ;3 else lda playfield+44-128,x ;4 sta PF1 ;3 lda playfield+45-128,x ;4 sta PF2 ;3 lda playfield+47-128,x ;4 sta PF1 ; 3 too early? lda playfield+46-128,x;4 sta PF2 ;3 endif ; sleep 3 lda player0height dcp player0y bcc .skipDrawP0 ldy player0y lda (player0pointer),y .continueP0 sta GRP0 ifnconst no_blank_lines ifnconst playercolors lda missile0height ;3 dcp missile0y ;5 sbc stack1 sta ENAM0 ;3 else lda (player0color),y sta player0colorstore sleep 6 endif dec temp1 bne continuekernel else dec temp1 beq altkernel2 ifconst readpaddle ldy currentpaddle lda INPT0,y bpl noreadpaddle inc paddle jmp continuekernel2 noreadpaddle sleep 2 jmp continuekernel else ifnconst playercolors ifconst PFcolors txa tay lda (pfcolortable),y ifnconst backgroundchange sta COLUPF else sta COLUBK endif jmp continuekernel else sleep 12 endif else lda (player0color),y sta player0colorstore sleep 4 endif jmp continuekernel endif altkernel2 txa sbx #252 bmi lastkernelline ifconst pfrowheight lda #pfrowheight else ifnconst pfres lda #8 else lda #(96/pfres) ; try to come close to the real size endif endif sta temp1 jmp continuekernel endif altkernel ifconst PFmaskvalue lda #PFmaskvalue else lda #0 endif sta PF1 sta PF2 ;sleep 3 ;28 cycles to fix things ;minus 11=17 ; lax temp4 ; clc txa sbx #252 bmi lastkernelline ifconst PFcolorandheight ldy playfieldcolorandheight-87,x ifnconst backgroundchange sty COLUPF else sty COLUBK endif lda playfieldcolorandheight-88,x sta.w temp1 endif ifconst PFheights lsr lsr tay lda (pfheighttable),y sta.w temp1 endif ifconst PFcolors tay lda (pfcolortable),y ifnconst backgroundchange sta COLUPF else sta COLUBK endif ifconst pfrowheight lda #pfrowheight else ifnconst pfres lda #8 else lda #(96/pfres) ; try to come close to the real size endif endif sta temp1 endif ifnconst PFcolorandheight ifnconst PFcolors ifnconst PFheights ifnconst no_blank_lines ; read paddle 0 ; lo-res paddle read ; bit INPT0 ; bmi paddleskipread ; inc paddle0 ;donepaddleskip sleep 10 ifconst pfrowheight lda #pfrowheight else ifnconst pfres lda #8 else lda #(96/pfres) ; try to come close to the real size endif endif sta temp1 endif endif endif endif lda ballheight dcp bally sbc temp4 jmp goback ifnconst no_blank_lines lastkernelline ifnconst PFcolors sleep 10 else ldy #124 lda (pfcolortable),y sta COLUPF endif ifconst PFheights ldx #1 sleep 4 else ldx playfieldpos sleep 3 endif jmp enterlastkernel else lastkernelline ifconst PFheights ldx #1 sleep 5 else ldx playfieldpos sleep 4 endif cpx #1 bne .enterfromNBL jmp no_blank_lines_bailout endif if ((<*)>$d5) align 256 endif ; this is a kludge to prevent page wrapping - fix!!! .skipDrawlastP1 sleep 2 lda #0 jmp .continuelastP1 .endkerloop ; enter at cycle 59?? nop .enterfromNBL ifconst pfres ldy.w playfield+pfres*4-4 sty PF1 ;3 ldy.w playfield+pfres*4-3 sty PF2 ;3 ldy.w playfield+pfres*4-1 sty PF1 ; possibly too early? ldy.w playfield+pfres*4-2 sty PF2 ;3 else ldy.w playfield+44 sty PF1 ;3 ldy.w playfield+45 sty PF2 ;3 ldy.w playfield+47 sty PF1 ; possibly too early? ldy.w playfield+46 sty PF2 ;3 endif enterlastkernel lda ballheight ; tya dcp bally ; sleep 4 ; sbc stack3 rol rol sta ENABL lda player1height ;3 dcp player1y ;5 bcc .skipDrawlastP1 ldy player1y ;3 lda (player1pointer),y ;5; player0pointer must be selected carefully by the compiler ; so it doesn't cross a page boundary! .continuelastP1 sta GRP1 ;3 ifnconst player1colors lda missile1height ;3 dcp missile1y ;5 else lda (player1color),y sta COLUP1 endif dex ;dec temp4 ; might try putting this above PF writes beq endkernel ifconst pfres ldy.w playfield+pfres*4-4 sty PF1 ;3 ldy.w playfield+pfres*4-3 sty PF2 ;3 ldy.w playfield+pfres*4-1 sty PF1 ; possibly too early? ldy.w playfield+pfres*4-2 sty PF2 ;3 else ldy.w playfield+44 sty PF1 ;3 ldy.w playfield+45 sty PF2 ;3 ldy.w playfield+47 sty PF1 ; possibly too early? ldy.w playfield+46 sty PF2 ;3 endif ifnconst player1colors rol;2 rol;2 sta ENAM1 ;3 else ifnconst playercolors sleep 7 else lda.w player0colorstore sta COLUP0 endif endif lda.w player0height dcp player0y bcc .skipDrawlastP0 ldy player0y lda (player0pointer),y .continuelastP0 sta GRP0 ifnconst no_blank_lines lda missile0height ;3 dcp missile0y ;5 sbc stack1 sta ENAM0 ;3 jmp .endkerloop else ifconst readpaddle ldy currentpaddle lda INPT0,y bpl noreadpaddle2 inc paddle jmp .endkerloop noreadpaddle2 sleep 4 jmp .endkerloop else ; no_blank_lines and no paddle reading sleep 14 jmp .endkerloop endif endif ; ifconst donepaddleskip ;paddleskipread ; this is kind of lame, since it requires 4 cycles from a page boundary crossing ; plus we get a lo-res paddle read ; bmi donepaddleskip ; endif .skipDrawlastP0 sleep 2 lda #0 jmp .continuelastP0 ifconst no_blank_lines no_blank_lines_bailout ldx #0 endif endkernel ; 6 digit score routine stx PF1 stx PF2 stx PF0 clc ifconst pfrowheight lda #pfrowheight+2 else ifnconst pfres lda #10 else lda #(96/pfres)+2 ; try to come close to the real size endif endif sbc playfieldpos sta playfieldpos txa ifconst shakescreen bit shakescreen bmi noshakescreen2 ldx #$3D noshakescreen2 endif sta WSYNC,x ; STA WSYNC ;first one, need one more sta REFP0 sta REFP1 STA GRP0 STA GRP1 ; STA PF1 ; STA PF2 sta HMCLR sta ENAM0 sta ENAM1 sta ENABL lda temp2 ;restore variables that were obliterated by kernel sta player0y lda temp3 sta player1y ifnconst player1colors lda temp6 sta missile1y endif ifnconst playercolors ifnconst readpaddle lda temp5 sta missile0y endif endif lda stack2 sta bally ifconst no_blank_lines sta WSYNC endif lda INTIM clc ifnconst vblank_time adc #43+12+87 else adc #vblank_time+12+87 endif ; sta WSYNC sta TIM64T ifconst minikernel jsr minikernel endif ; now reassign temp vars for score pointers ; score pointers contain: ; score1-5: lo1,lo2,lo3,lo4,lo5,lo6 ; swap lo2->temp1 ; swap lo4->temp3 ; swap lo6->temp5 ifnconst noscore lda scorepointers+1 ; ldy temp1 sta temp1 ; sty scorepointers+1 lda scorepointers+3 ; ldy temp3 sta temp3 ; sty scorepointers+3 sta HMCLR tsx stx stack1 ldx #$10 stx HMP0 sta WSYNC ldx #0 STx GRP0 STx GRP1 ; seems to be needed because of vdel lda scorepointers+5 ; ldy temp5 sta temp5,x ; sty scorepointers+5 lda #>scoretable sta scorepointers+1 sta scorepointers+3 sta scorepointers+5,x sta temp2,x sta temp4,x sta temp6,x LDY #7 STA RESP0 STA RESP1 LDA #$03 STA NUSIZ0 STA NUSIZ1,x STA VDELP0 STA VDELP1 LDA #$20 STA HMP1 LDA scorecolor ; STA HMCLR ; STA WSYNC; second one STA HMOVE ; cycle 73 ? STA COLUP0 STA COLUP1 lda (scorepointers),y sta GRP0 ifconst pfscore lda pfscorecolor sta COLUPF endif lda (scorepointers+8),y sta WSYNC sleep 2 jmp beginscore if ((<*)>$d4) align 256 ; kludge that potentially wastes space! should be fixed! endif loop2 lda (scorepointers),y ;+5 68 204 sta GRP0 ;+3 71 213 D1 -- -- -- ifconst pfscore lda.w pfscore1 sta PF1 else sleep 7 endif ; cycle 0 lda (scorepointers+$8),y ;+5 5 15 beginscore sta GRP1 ;+3 8 24 D1 D1 D2 -- lda (scorepointers+$6),y ;+5 13 39 sta GRP0 ;+3 16 48 D3 D1 D2 D2 lax (scorepointers+$2),y ;+5 29 87 txs lax (scorepointers+$4),y ;+5 36 108 sleep 3 ifconst pfscore lda pfscore2 sta PF1 else sleep 6 endif lda (scorepointers+$A),y ;+5 21 63 stx GRP1 ;+3 44 132 D3 D3 D4 D2! tsx stx GRP0 ;+3 47 141 D5 D3! D4 D4 sta GRP1 ;+3 50 150 D5 D5 D6 D4! sty GRP0 ;+3 53 159 D4* D5! D6 D6 dey bpl loop2 ;+2 60 180 ldx stack1 txs ; lda scorepointers+1 ldy temp1 ; sta temp1 sty scorepointers+1 LDA #0 sta PF1 STA GRP0 STA GRP1 STA VDELP0 STA VDELP1;do we need these STA NUSIZ0 STA NUSIZ1 ; lda scorepointers+3 ldy temp3 ; sta temp3 sty scorepointers+3 ; lda scorepointers+5 ldy temp5 ; sta temp5 sty scorepointers+5 endif ;noscore LDA #%11000010 sta WSYNC STA VBLANK RETURN ifconst shakescreen doshakescreen bit shakescreen bmi noshakescreen sta WSYNC noshakescreen ldx missile0height inx rts endif start sei cld ldy #0 lda $D0 cmp #$2C ;check RAM location #1 bne MachineIs2600 lda $D1 cmp #$A9 ;check RAM location #2 bne MachineIs2600 dey MachineIs2600 ldx #0 txa clearmem inx txs pha bne clearmem sty temp1 ifconst pfrowheight lda pfrowheight else ifconst pfres lda #(96/pfres) else lda #8 endif endif sta playfieldpos ldx #5 initscore lda #(game-1) pha lda #<(game-1) pha pha pha ldx #1 jmp BS_jsr endif ; playfield drawing routines ; you get a 32x12 bitmapped display in a single color :) ; 0-31 and 0-11 pfclear ; clears playfield - or fill with pattern ifconst pfres ldx #pfres*4-1 else ldx #47 endif pfclear_loop ifnconst superchip sta playfield,x else sta playfield-128,x endif dex bpl pfclear_loop RETURN setuppointers stx temp2 ; store on.off.flip value tax ; put x-value in x lsr lsr lsr ; divide x pos by 8 sta temp1 tya asl asl ; multiply y pos by 4 clc adc temp1 ; add them together to get actual memory location offset tay ; put the value in y lda temp2 ; restore on.off.flip value rts pfread ;x=xvalue, y=yvalue jsr setuppointers lda setbyte,x and playfield,y eor setbyte,x ; beq readzero ; lda #1 ; readzero RETURN pfpixel ;x=xvalue, y=yvalue, a=0,1,2 jsr setuppointers ifconst bankswitch lda temp2 ; load on.off.flip value (0,1, or 2) beq pixelon_r ; if "on" go to on lsr bcs pixeloff_r ; value is 1 if true lda playfield,y ; if here, it's "flip" eor setbyte,x ifconst superchip sta playfield-128,y else sta playfield,y endif RETURN pixelon_r lda playfield,y ora setbyte,x ifconst superchip sta playfield-128,y else sta playfield,y endif RETURN pixeloff_r lda setbyte,x eor #$ff and playfield,y ifconst superchip sta playfield-128,y else sta playfield,y endif RETURN else jmp plotpoint endif pfhline ;x=xvalue, y=yvalue, a=0,1,2, temp3=endx jsr setuppointers jmp noinc keepgoing inx txa and #7 bne noinc iny noinc jsr plotpoint cpx temp3 bmi keepgoing RETURN pfvline ;x=xvalue, y=yvalue, a=0,1,2, temp3=endx jsr setuppointers sty temp1 ; store memory location offset inc temp3 ; increase final x by 1 lda temp3 asl asl ; multiply by 4 sta temp3 ; store it ; Thanks to Michael Rideout for fixing a bug in this code ; right now, temp1=y=starting memory location, temp3=final ; x should equal original x value keepgoingy jsr plotpoint iny iny iny iny cpy temp3 bmi keepgoingy RETURN plotpoint lda temp2 ; load on.off.flip value (0,1, or 2) beq pixelon ; if "on" go to on lsr bcs pixeloff ; value is 1 if true lda playfield,y ; if here, it's "flip" eor setbyte,x ifconst superchip sta playfield-128,y else sta playfield,y endif rts pixelon lda playfield,y ora setbyte,x ifconst superchip sta playfield-128,y else sta playfield,y endif rts pixeloff lda setbyte,x eor #$ff and playfield,y ifconst superchip sta playfield-128,y else sta playfield,y endif rts setbyte .byte $80 .byte $40 .byte $20 .byte $10 .byte $08 .byte $04 .byte $02 .byte $01 .byte $01 .byte $02 .byte $04 .byte $08 .byte $10 .byte $20 .byte $40 .byte $80 .byte $80 .byte $40 .byte $20 .byte $10 .byte $08 .byte $04 .byte $02 .byte $01 .byte $01 .byte $02 .byte $04 .byte $08 .byte $10 .byte $20 .byte $40 .byte $80 pfscroll ;(a=0 left, 1 right, 2 up, 4 down, 6=upup, 12=downdown) bne notleft ;left ifconst pfres ldx #pfres*4 else ldx #48 endif leftloop lda playfield-1,x lsr ifconst superchip lda playfield-2,x rol sta playfield-130,x lda playfield-3,x ror sta playfield-131,x lda playfield-4,x rol sta playfield-132,x lda playfield-1,x ror sta playfield-129,x else rol playfield-2,x ror playfield-3,x rol playfield-4,x ror playfield-1,x endif txa sbx #4 bne leftloop RETURN notleft lsr bcc notright ;right ifconst pfres ldx #pfres*4 else ldx #48 endif rightloop lda playfield-4,x lsr ifconst superchip lda playfield-3,x rol sta playfield-131,x lda playfield-2,x ror sta playfield-130,x lda playfield-1,x rol sta playfield-129,x lda playfield-4,x ror sta playfield-132,x else rol playfield-3,x ror playfield-2,x rol playfield-1,x ror playfield-4,x endif txa sbx #4 bne rightloop RETURN notright lsr bcc notup ;up lsr bcc onedecup dec playfieldpos onedecup dec playfieldpos beq shiftdown bpl noshiftdown2 shiftdown ifconst pfrowheight lda #pfrowheight else ifnconst pfres lda #8 else lda #(96/pfres) ; try to come close to the real size endif endif sta playfieldpos lda playfield+3 sta temp4 lda playfield+2 sta temp3 lda playfield+1 sta temp2 lda playfield sta temp1 ldx #0 up2 lda playfield+4,x ifconst superchip sta playfield-128,x lda playfield+5,x sta playfield-127,x lda playfield+6,x sta playfield-126,x lda playfield+7,x sta playfield-125,x else sta playfield,x lda playfield+5,x sta playfield+1,x lda playfield+6,x sta playfield+2,x lda playfield+7,x sta playfield+3,x endif txa sbx #252 ifconst pfres cpx #(pfres-1)*4 else cpx #44 endif bne up2 lda temp4 ifconst superchip ifconst pfres sta playfield+pfres*4-129 lda temp3 sta playfield+pfres*4-130 lda temp2 sta playfield+pfres*4-131 lda temp1 sta playfield+pfres*4-132 else sta playfield+47-128 lda temp3 sta playfield+46-128 lda temp2 sta playfield+45-128 lda temp1 sta playfield+44-128 endif else ifconst pfres sta playfield+pfres*4-1 lda temp3 sta playfield+pfres*4-2 lda temp2 sta playfield+pfres*4-3 lda temp1 sta playfield+pfres*4-4 else sta playfield+47 lda temp3 sta playfield+46 lda temp2 sta playfield+45 lda temp1 sta playfield+44 endif endif noshiftdown2 RETURN notup ;down lsr bcs oneincup inc playfieldpos oneincup inc playfieldpos lda playfieldpos ifconst pfrowheight cmp #pfrowheight+1 else ifnconst pfres cmp #9 else cmp #(96/pfres)+1 ; try to come close to the real size endif endif bcc noshiftdown lda #1 sta playfieldpos ifconst pfres lda playfield+pfres*4-1 sta temp4 lda playfield+pfres*4-2 sta temp3 lda playfield+pfres*4-3 sta temp2 lda playfield+pfres*4-4 else lda playfield+47 sta temp4 lda playfield+46 sta temp3 lda playfield+45 sta temp2 lda playfield+44 endif sta temp1 ifconst pfres ldx #(pfres-1)*4 else ldx #44 endif down2 lda playfield-1,x ifconst superchip sta playfield-125,x lda playfield-2,x sta playfield-126,x lda playfield-3,x sta playfield-127,x lda playfield-4,x sta playfield-128,x else sta playfield+3,x lda playfield-2,x sta playfield+2,x lda playfield-3,x sta playfield+1,x lda playfield-4,x sta playfield,x endif txa sbx #4 bne down2 lda temp4 ifconst superchip sta playfield-125 lda temp3 sta playfield-126 lda temp2 sta playfield-127 lda temp1 sta playfield-128 else sta playfield+3 lda temp3 sta playfield+2 lda temp2 sta playfield+1 lda temp1 sta playfield endif noshiftdown RETURN ;standard routines needed for pretty much all games ; just the random number generator is left - maybe we should remove this asm file altogether? ; repositioning code and score pointer setup moved to overscan ; read switches, joysticks now compiler generated (more efficient) randomize lda rand lsr ifconst rand16 rol rand16 endif bcc noeor eor #$B4 noeor sta rand ifconst rand16 eor rand16 endif RETURN drawscreen ifconst debugscore ldx #14 lda INTIM ; display # cycles left in the score ifconst mincycles lda mincycles cmp INTIM lda mincycles bcc nochange lda INTIM sta mincycles nochange endif ; cmp #$2B ; bcs no_cycles_left bmi cycles_left ldx #64 eor #$ff ;make negative cycles_left stx scorecolor and #$7f ; clear sign bit tax lda scorebcd,x sta score+2 lda scorebcd1,x sta score+1 jmp done_debugscore scorebcd .byte $00, $64, $28, $92, $56, $20, $84, $48, $12, $76, $40 .byte $04, $68, $32, $96, $60, $24, $88, $52, $16, $80, $44 .byte $08, $72, $36, $00, $64, $28, $92, $56, $20, $84, $48 .byte $12, $76, $40, $04, $68, $32, $96, $60, $24, $88 scorebcd1 .byte 0, 0, 1, 1, 2, 3, 3, 4, 5, 5, 6 .byte 7, 7, 8, 8, 9, $10, $10, $11, $12, $12, $13 .byte $14, $14, $15, $16, $16, $17, $17, $18, $19, $19, $20 .byte $21, $21, $22, $23, $23, $24, $24, $25, $26, $26 done_debugscore endif ifconst debugcycles lda INTIM ; if we go over, it mucks up the background color ; cmp #$2B ; BCC overscan bmi overscan sta COLUBK bcs doneoverscan endif overscan lda INTIM ;wait for sync bmi overscan doneoverscan ;do VSYNC lda #2 sta WSYNC sta VSYNC STA WSYNC STA WSYNC LDA #0 STA WSYNC STA VSYNC sta VBLANK ifnconst overscan_time lda #37+128 else lda #overscan_time+128 endif sta TIM64T ifconst legacy if legacy < 100 ldx #4 adjustloop lda player0x,x sec sbc #14 ;? sta player0x,x dex bpl adjustloop endif endif if (<*)>$F0 align 256, $EA endif sta WSYNC ldx #4 SLEEP 3 HorPosLoop ; 5 lda player0x,X ;+4 9 sec ;+2 11 DivideLoop sbc #15 bcs DivideLoop;+4 15 sta temp1,X ;+4 19 sta RESP0,X ;+4 23 sta WSYNC dex bpl HorPosLoop;+5 5 ; 4 ldx #4 ldy temp1,X lda repostable-256,Y sta HMP0,X ;+14 18 dex ldy temp1,X lda repostable-256,Y sta HMP0,X ;+14 32 dex ldy temp1,X lda repostable-256,Y sta HMP0,X ;+14 46 dex ldy temp1,X lda repostable-256,Y sta HMP0,X ;+14 60 dex ldy temp1,X lda repostable-256,Y sta HMP0,X ;+14 74 sta WSYNC sta HMOVE ;+3 3 ifconst legacy if legacy < 100 ldx #4 adjustloop2 lda player0x,x clc adc #14 ;? sta player0x,x dex bpl adjustloop2 endif endif ;set score pointers lax score+2 jsr scorepointerset sty scorepointers+5 stx scorepointers+2 lax score+1 jsr scorepointerset sty scorepointers+4 stx scorepointers+1 lax score jsr scorepointerset sty scorepointers+3 stx scorepointers vblk ; run possible vblank bB code ifconst vblank_bB_code jsr vblank_bB_code endif vblk2 LDA INTIM bmi vblk2 jmp kernel .byte $80,$70,$60,$50,$40,$30,$20,$10,$00 .byte $F0,$E0,$D0,$C0,$B0,$A0,$90 repostable scorepointerset and #$0F asl asl asl adc # -128) bcc .L046fortitlecolor else bcs .0skipL046fortitlecolor jmp .L046fortitlecolor .0skipL046fortitlecolor endif .L050 ; goto menu jmp .menu . ; .startgame ; startgame .L051 ; pfclear LDA #0 jsr pfclear .L052 ; gosub trackindy jsr .trackindy .L053 ; AUDV0 = 0 LDA #0 STA AUDV0 .L054 ; AUDV1 = 0 LDA #0 STA AUDV1 .L055 ; player0score = $00 LDA #$00 STA player0score .L056 ; player1score = $00 LDA #$00 STA player1score .L057 ; player2score = $00 LDA #$00 STA player2score .L058 ; player3score = $00 LDA #$00 STA player3score .L059 ; player0scorecolor = 0 LDA #0 STA player0scorecolor .L060 ; player1scorecolor = 222 LDA #222 STA player1scorecolor .L061 ; player2scorecolor = 68 LDA #68 STA player2scorecolor .L062 ; player3scorecolor = 52 LDA #52 STA player3scorecolor .L063 ; car0velocity = 1 : car1velocity = 1 : car2velocity = 1 : car3velocity = 1 LDA #1 STA car0velocity STA car1velocity STA car2velocity STA car3velocity . ; .L064 ; rem The paddle buttons map to joystick directions: . ; .L065 ; rem paddle 0 = joy0right 'z' .L066 ; rem paddle 1 = joy0left 'c' .L067 ; rem paddle 2 = joy1right 'b' .L068 ; rem paddle 3 = joy1left 'm' . ; .mainloop ; mainloop . ; .L069 ; rem *** read paddle 0 .L070 ; currentpaddle = 0 LDA #0 STA currentpaddle . ; .L071 ; rem *** set player0 sprite with car0x/car0y/car0dir255max and player1 sprite with car1x/car1y/car1dir255max .L072 ; gosub spritegroupa jsr .spritegroupa . ; .L073 ; rem *** drawscreen and get paddle variable .L074 ; drawscreen jsr drawscreen . ; .L075 ; rem *** set car0 direction (0-255) .L076 ; tempdir255max = car0dir255max : gosub readdir : car0dir255max = tempdir255max LDA car0dir255max STA tempdir255max jsr .readdir LDA tempdir255max STA car0dir255max . ; .L077 ; rem *** if paddle 0 button pressed accelerate, otherwise decelerate .L078 ; if joy0right then car0velocity = car0velocity + 1 : if car0velocity > 45 then car0velocity = 45 lda #$80 bit SWCHA BNE .skipL078 .condpart2 INC car0velocity LDA #45 CMP car0velocity BCS .skip2then .condpart3 LDA #45 STA car0velocity .skip2then .skipL078 .L079 ; if !joy0right then car0velocity = car0velocity - 1 : if car0velocity < 1 then car0velocity = 1 lda #$80 bit SWCHA BEQ .skipL079 .condpart4 DEC car0velocity LDA car0velocity CMP #1 BCS .skip4then .condpart5 LDA #1 STA car0velocity .skip4then .skipL079 . ; .L080 ; rem *** car0 sound .L081 ; AUDV0 = 15 : AUDC0 = 7 : AUDF0 = ( 31 - ( car0velocity / 8 ) ) LDA #15 STA AUDV0 LDA #7 STA AUDC0 ; complex statement detected LDA #31 PHA LDA car0velocity lsr lsr lsr TAY PLA TSX STY $00,x SEC SBC $100,x STA AUDF0 . ; .L082 ; rem *** lower car0 velocity and make beeping sound if car collides with wall .L083 ; if collision(playfield,player0) then if car0velocity > 2 then car0velocity = 1 : AUDC0 = 4 BIT CXP0FB BPL .skipL083 .condpart6 LDA #2 CMP car0velocity BCS .skip6then .condpart7 LDA #1 STA car0velocity LDA #4 STA AUDC0 .skip6then .skipL083 . ; .L084 ; rem *** set x and y coordinate deltas for car0 .L085 ; tempvel = car0velocity : gosub setdeltas LDA car0velocity STA tempvel jsr .setdeltas . ; .L086 ; rem *** car0 direction is 1-16 so convert 0-255 direction to 1-16 .L087 ; tempdir16max = ( car0dir255max / 16 ) + 1 ; complex statement detected LDA car0dir255max lsr lsr lsr lsr CLC ADC #1 STA tempdir16max . ; .L088 ; rem *** change car0 position using deltas and car direction .L089 ; tempx = car0x : tempy = car0y : gosub changepos : car0x = tempx : car0y = tempy LDA car0x STA tempx LDA car0y STA tempy jsr .changepos LDA tempx STA car0x LDA tempy STA car0y . ; .L090 ; rem *** car0 cannot go off of screen .L091 ; if car0x > 136 then car0x = 136 : car0velocity = 1 LDA #136 CMP car0x BCS .skipL091 .condpart8 LDA #136 STA car0x LDA #1 STA car0velocity .skipL091 .L092 ; if car0x < 17 then car0x = 17 : car0velocity = 1 LDA car0x CMP #17 BCS .skipL092 .condpart9 LDA #17 STA car0x LDA #1 STA car0velocity .skipL092 .L093 ; if car0y > 91 then car0y = 91 : car0velocity = 1 LDA #91 CMP car0y BCS .skipL093 .condpart10 LDA #91 STA car0y LDA #1 STA car0velocity .skipL093 .L094 ; if car0y < 7 then car0y = 7 : car0velocity = 1 LDA car0y CMP #7 BCS .skipL094 .condpart11 LDA #7 STA car0y LDA #1 STA car0velocity .skipL094 . ; .L095 ; rem *** car0 lap counter .L096 ; if car0x = 75 then player0score = addbcd ( player0score , 1 ) : rem Adds 1 to player0score LDA car0x CMP #75 BNE .skipL096 .condpart12 LDY #1 LDA player0score jsr addbcd STA player0score .skipL096 . ; .L097 ; rem *** car0 win check .L098 ; if player0score > $09 then goto gameover LDA #$09 CMP player0score BCS .skipL098 .condpart13 jmp .gameover .skipL098 . ; .L099 ; rem *** read paddle 1 .L0100 ; currentpaddle = 1 LDA #1 STA currentpaddle . ; .L0101 ; rem *** set player0 sprite with car2x/car2y/car2dir255max and player1 sprite with car3x/car3y/car3dir255max .L0102 ; gosub spritegroupb jsr .spritegroupb . ; .L0103 ; rem *** drawscreen and get paddle variable .L0104 ; drawscreen jsr drawscreen . ; .L0105 ; rem *** set car1 direction (0-255) .L0106 ; tempdir255max = car1dir255max : gosub readdir : car1dir255max = tempdir255max LDA car1dir255max STA tempdir255max jsr .readdir LDA tempdir255max STA car1dir255max . ; .L0107 ; rem *** if paddle 1 button pressed accelerate, otherwise decelerate .L0108 ; if joy0left then car1velocity = car1velocity + 1 : if car1velocity > 45 then car1velocity = 45 lda #$40 bit SWCHA BNE .skipL0108 .condpart14 INC car1velocity LDA #45 CMP car1velocity BCS .skip14then .condpart15 LDA #45 STA car1velocity .skip14then .skipL0108 .L0109 ; if !joy0left then car1velocity = car1velocity - 1 : if car1velocity < 1 then car1velocity = 1 lda #$40 bit SWCHA BEQ .skipL0109 .condpart16 DEC car1velocity LDA car1velocity CMP #1 BCS .skip16then .condpart17 LDA #1 STA car1velocity .skip16then .skipL0109 . ; .L0110 ; rem *** car1 sound .L0111 ; AUDV1 = 15 : AUDC1 = 7 : AUDF1 = ( 31 - ( car1velocity / 8 ) ) LDA #15 STA AUDV1 LDA #7 STA AUDC1 ; complex statement detected LDA #31 PHA LDA car1velocity lsr lsr lsr TAY PLA TSX STY $00,x SEC SBC $100,x STA AUDF1 . ; .L0112 ; rem *** lower car1 velocity and make beeping sound if car collides with wall .L0113 ; if collision(playfield,player1) then if car1velocity > 2 then car1velocity = 1 : AUDC1 = 4 BIT CXP1FB BPL .skipL0113 .condpart18 LDA #2 CMP car1velocity BCS .skip18then .condpart19 LDA #1 STA car1velocity LDA #4 STA AUDC1 .skip18then .skipL0113 . ; .L0114 ; rem *** set x and y coordinate deltas for car1 .L0115 ; tempvel = car1velocity : gosub setdeltas LDA car1velocity STA tempvel jsr .setdeltas . ; .L0116 ; rem *** car1 direction is 1-16 so convert 0-255 direction to 1-16 .L0117 ; tempdir16max = ( car1dir255max / 16 ) + 1 ; complex statement detected LDA car1dir255max lsr lsr lsr lsr CLC ADC #1 STA tempdir16max . ; .L0118 ; rem *** change car1 position using deltas and car direction .L0119 ; tempx = car1x : tempy = car1y : gosub changepos : car1x = tempx : car1y = tempy LDA car1x STA tempx LDA car1y STA tempy jsr .changepos LDA tempx STA car1x LDA tempy STA car1y . ; .L0120 ; rem *** car1 cannot go off of screen .L0121 ; if car1x > 136 then car1x = 136 : car1velocity = 1 LDA #136 CMP car1x BCS .skipL0121 .condpart20 LDA #136 STA car1x LDA #1 STA car1velocity .skipL0121 .L0122 ; if car1x < 17 then car1x = 17 : car1velocity = 1 LDA car1x CMP #17 BCS .skipL0122 .condpart21 LDA #17 STA car1x LDA #1 STA car1velocity .skipL0122 .L0123 ; if car1y > 91 then car1y = 91 : car1velocity = 1 LDA #91 CMP car1y BCS .skipL0123 .condpart22 LDA #91 STA car1y LDA #1 STA car1velocity .skipL0123 .L0124 ; if car1y < 7 then car1y = 7 : car1velocity = 1 LDA car1y CMP #7 BCS .skipL0124 .condpart23 LDA #7 STA car1y LDA #1 STA car1velocity .skipL0124 . ; .L0125 ; rem *** car1 lap counter .L0126 ; if car1x = 75 then player1score = addbcd ( player1score , 1 ) : rem Adds 1 to player1score LDA car1x CMP #75 BNE .skipL0126 .condpart24 LDY #1 LDA player1score jsr addbcd STA player1score .skipL0126 . ; .L0127 ; rem *** car1 win check .L0128 ; if player1score > $09 then goto gameover LDA #$09 CMP player1score BCS .skipL0128 .condpart25 jmp .gameover .skipL0128 . ; .L0129 ; rem *** read paddle 2 .L0130 ; currentpaddle = 2 LDA #2 STA currentpaddle . ; .L0131 ; rem *** set player0 sprite with car0x/car0y/car0dir255max and player1 sprite with car1x/car1y/car1dir255max .L0132 ; gosub spritegroupa jsr .spritegroupa . ; .L0133 ; rem *** drawscreen and get paddle variable .L0134 ; drawscreen jsr drawscreen . ; .L0135 ; rem *** set car2 direction (0-255) .L0136 ; tempdir255max = car2dir255max : gosub readdir : car2dir255max = tempdir255max LDA car2dir255max STA tempdir255max jsr .readdir LDA tempdir255max STA car2dir255max . ; .L0137 ; rem *** if paddle 2 button pressed accelerate, otherwise decelerate .L0138 ; if joy1right then car2velocity = car2velocity + 1 : if car2velocity > 45 then car2velocity = 45 lda #8 bit SWCHA BNE .skipL0138 .condpart26 INC car2velocity LDA #45 CMP car2velocity BCS .skip26then .condpart27 LDA #45 STA car2velocity .skip26then .skipL0138 .L0139 ; if !joy1right then car2velocity = car2velocity - 1 : if car2velocity < 1 then car2velocity = 1 lda #8 bit SWCHA BEQ .skipL0139 .condpart28 DEC car2velocity LDA car2velocity CMP #1 BCS .skip28then .condpart29 LDA #1 STA car2velocity .skip28then .skipL0139 . ; .L0140 ; rem *** car2 sound .L0141 ; AUDV0 = 15 : AUDC0 = 7 : AUDF0 = ( 31 - ( car2velocity / 8 ) ) LDA #15 STA AUDV0 LDA #7 STA AUDC0 ; complex statement detected LDA #31 PHA LDA car2velocity lsr lsr lsr TAY PLA TSX STY $00,x SEC SBC $100,x STA AUDF0 . ; .L0142 ; rem *** lower car2 velocity and make beeping sound if car collides with wall .L0143 ; if collision(playfield,player0) then if car2velocity > 2 then car2velocity = 1 : AUDC0 = 4 BIT CXP0FB BPL .skipL0143 .condpart30 LDA #2 CMP car2velocity BCS .skip30then .condpart31 LDA #1 STA car2velocity LDA #4 STA AUDC0 .skip30then .skipL0143 . ; .L0144 ; rem *** set x and y coordinate deltas for car2 .L0145 ; tempvel = car2velocity : gosub setdeltas LDA car2velocity STA tempvel jsr .setdeltas . ; .L0146 ; rem *** car2 direction is 1-16 so convert 0-255 direction to 1-16 .L0147 ; tempdir16max = ( car2dir255max / 16 ) + 1 ; complex statement detected LDA car2dir255max lsr lsr lsr lsr CLC ADC #1 STA tempdir16max . ; .L0148 ; rem *** change car2 position using deltas and car direction .L0149 ; tempx = car2x : tempy = car2y : gosub changepos : car2x = tempx : car2y = tempy LDA car2x STA tempx LDA car2y STA tempy jsr .changepos LDA tempx STA car2x LDA tempy STA car2y . ; .L0150 ; rem *** car2 cannot go off of screen .L0151 ; if car2x > 136 then car2x = 136 : car2velocity = 1 LDA #136 CMP car2x BCS .skipL0151 .condpart32 LDA #136 STA car2x LDA #1 STA car2velocity .skipL0151 .L0152 ; if car2x < 17 then car2x = 17 : car2velocity = 1 LDA car2x CMP #17 BCS .skipL0152 .condpart33 LDA #17 STA car2x LDA #1 STA car2velocity .skipL0152 .L0153 ; if car2y > 91 then car2y = 91 : car2velocity = 1 LDA #91 CMP car2y BCS .skipL0153 .condpart34 LDA #91 STA car2y LDA #1 STA car2velocity .skipL0153 .L0154 ; if car2y < 7 then car2y = 7 : car2velocity = 1 LDA car2y CMP #7 BCS .skipL0154 .condpart35 LDA #7 STA car2y LDA #1 STA car2velocity .skipL0154 . ; .L0155 ; rem *** car2 lap counter .L0156 ; if car2x = 75 then player2score = addbcd ( player2score , 1 ) : rem Adds 1 to player2score LDA car2x CMP #75 BNE .skipL0156 .condpart36 LDY #1 LDA player2score jsr addbcd STA player2score .skipL0156 . ; .L0157 ; rem *** car2 win check .L0158 ; if player2score > $09 then goto gameover LDA #$09 CMP player2score BCS .skipL0158 .condpart37 jmp .gameover .skipL0158 . ; .L0159 ; rem *** read paddle 3 .L0160 ; currentpaddle = 3 LDA #3 STA currentpaddle . ; .L0161 ; rem *** set player0 sprite with car2x/car2y/car2dir255max and player1 sprite with car3x/car3y/car3dir255max .L0162 ; gosub spritegroupb jsr .spritegroupb . ; .L0163 ; rem *** drawscreen and get paddle variable .L0164 ; drawscreen jsr drawscreen . ; .L0165 ; rem *** set car3 direction (0-255) .L0166 ; tempdir255max = car3dir255max : gosub readdir : car3dir255max = tempdir255max LDA car3dir255max STA tempdir255max jsr .readdir LDA tempdir255max STA car3dir255max . ; .L0167 ; rem *** if paddle 3 button pressed accelerate, otherwise decelerate .L0168 ; if joy1left then car3velocity = car3velocity + 1 : if car3velocity > 45 then car3velocity = 45 lda #4 bit SWCHA BNE .skipL0168 .condpart38 INC car3velocity LDA #45 CMP car3velocity BCS .skip38then .condpart39 LDA #45 STA car3velocity .skip38then .skipL0168 .L0169 ; if !joy1left then car3velocity = car3velocity - 1 : if car3velocity < 1 then car3velocity = 1 lda #4 bit SWCHA BEQ .skipL0169 .condpart40 DEC car3velocity LDA car3velocity CMP #1 BCS .skip40then .condpart41 LDA #1 STA car3velocity .skip40then .skipL0169 . ; .L0170 ; rem *** car3 sound .L0171 ; AUDV1 = 15 : AUDC1 = 7 : AUDF1 = ( 31 - ( car3velocity / 8 ) ) LDA #15 STA AUDV1 LDA #7 STA AUDC1 ; complex statement detected LDA #31 PHA LDA car3velocity lsr lsr lsr TAY PLA TSX STY $00,x SEC SBC $100,x STA AUDF1 . ; .L0172 ; rem *** lower car3 velocity and make beeping sound if car collides with wall .L0173 ; if collision(playfield,player1) then if car3velocity > 2 then car3velocity = 1 : AUDC1 = 4 BIT CXP1FB BPL .skipL0173 .condpart42 LDA #2 CMP car3velocity BCS .skip42then .condpart43 LDA #1 STA car3velocity LDA #4 STA AUDC1 .skip42then .skipL0173 . ; .L0174 ; rem *** set x and y coordinate deltas for car3 .L0175 ; tempvel = car3velocity : gosub setdeltas LDA car3velocity STA tempvel jsr .setdeltas . ; .L0176 ; rem *** car3 direction is 1-16 so convert 0-255 direction to 1-16 .L0177 ; tempdir16max = ( car3dir255max / 16 ) + 1 ; complex statement detected LDA car3dir255max lsr lsr lsr lsr CLC ADC #1 STA tempdir16max . ; .L0178 ; rem *** change car3 position using deltas and car direction .L0179 ; tempx = car3x : tempy = car3y : gosub changepos : car3x = tempx : car3y = tempy LDA car3x STA tempx LDA car3y STA tempy jsr .changepos LDA tempx STA car3x LDA tempy STA car3y . ; .L0180 ; rem *** car3 cannot go off of screen .L0181 ; if car3x > 136 then car3x = 136 : car3velocity = 1 LDA #136 CMP car3x BCS .skipL0181 .condpart44 LDA #136 STA car3x LDA #1 STA car3velocity .skipL0181 .L0182 ; if car3x < 17 then car3x = 17 : car3velocity = 1 LDA car3x CMP #17 BCS .skipL0182 .condpart45 LDA #17 STA car3x LDA #1 STA car3velocity .skipL0182 .L0183 ; if car3y > 91 then car3y = 91 : car3velocity = 1 LDA #91 CMP car3y BCS .skipL0183 .condpart46 LDA #91 STA car3y LDA #1 STA car3velocity .skipL0183 .L0184 ; if car3y < 7 then car3y = 7 : car3velocity = 1 LDA car3y CMP #7 BCS .skipL0184 .condpart47 LDA #7 STA car3y LDA #1 STA car3velocity .skipL0184 . ; .L0185 ; rem *** car3 lap counter .L0186 ; if car3x = 75 then player3score = addbcd ( player3score , 1 ) : rem Adds 1 to player3score LDA car3x CMP #75 BNE .skipL0186 .condpart48 LDY #1 LDA player3score jsr addbcd STA player3score .skipL0186 . ; .L0187 ; rem *** car3 win check .L0188 ; if player3score > $09 then goto gameover LDA #$09 CMP player3score BCS .skipL0188 .condpart49 jmp .gameover .skipL0188 . ; .L0189 ; goto mainloop jmp .mainloop . ; .setdeltas ; setdeltas .L0190 ; if tempvel >= 0 then temp100percentdelta = 0 : temp92percentdelta = 0 : temp71percentdelta = 0 : temp38percentdelta = 0 LDA tempvel CMP #0 BCC .skipL0190 .condpart50 LDA #0 STA temp100percentdelta STA temp92percentdelta STA temp71percentdelta STA temp38percentdelta .skipL0190 .L0191 ; if tempvel > 1 then temp100percentdelta = 1 : temp92percentdelta = 1 : temp71percentdelta = 1 : temp38percentdelta = 1 LDA #1 CMP tempvel BCS .skipL0191 .condpart51 LDA #1 STA temp100percentdelta STA temp92percentdelta STA temp71percentdelta STA temp38percentdelta .skipL0191 .L0192 ; if tempvel > 20 then temp100percentdelta = 2 : temp92percentdelta = 2 : temp71percentdelta = 1 : temp38percentdelta = 1 LDA #20 CMP tempvel BCS .skipL0192 .condpart52 LDA #2 STA temp100percentdelta STA temp92percentdelta LDA #1 STA temp71percentdelta STA temp38percentdelta .skipL0192 .L0193 ; if tempvel > 40 then temp100percentdelta = 3 : temp92percentdelta = 3 : temp71percentdelta = 2 : temp38percentdelta = 1 LDA #40 CMP tempvel BCS .skipL0193 .condpart53 LDA #3 STA temp100percentdelta STA temp92percentdelta LDA #2 STA temp71percentdelta LDA #1 STA temp38percentdelta .skipL0193 .L0194 ; rem if tempvel > 50 then temp100percentdelta = 5 : temp92percentdelta = 5 : temp71percentdelta = 4 : temp38percentdelta = 2 .L0195 ; rem if tempvel > 60 then temp100percentdelta = 6 : temp92percentdelta = 6 : temp71percentdelta = 4 : temp38percentdelta = 2 .L0196 ; return RTS . ; .changepos ; changepos .L0197 ; if tempdir16max = 1 then tempy = tempy - temp100percentdelta LDA tempdir16max CMP #1 BNE .skipL0197 .condpart54 LDA tempy SEC SBC temp100percentdelta STA tempy .skipL0197 .L0198 ; if tempdir16max = 2 then tempx = tempx + temp38percentdelta : tempy = tempy - temp92percentdelta LDA tempdir16max CMP #2 BNE .skipL0198 .condpart55 LDA tempx CLC ADC temp38percentdelta STA tempx LDA tempy SEC SBC temp92percentdelta STA tempy .skipL0198 .L0199 ; if tempdir16max = 3 then tempx = tempx + temp71percentdelta : tempy = tempy - temp71percentdelta LDA tempdir16max CMP #3 BNE .skipL0199 .condpart56 LDA tempx CLC ADC temp71percentdelta STA tempx LDA tempy SEC SBC temp71percentdelta STA tempy .skipL0199 .L0200 ; if tempdir16max = 4 then tempx = tempx + temp92percentdelta : tempy = tempy - temp38percentdelta LDA tempdir16max CMP #4 BNE .skipL0200 .condpart57 LDA tempx CLC ADC temp92percentdelta STA tempx LDA tempy SEC SBC temp38percentdelta STA tempy .skipL0200 .L0201 ; if tempdir16max = 5 then tempx = tempx + temp100percentdelta LDA tempdir16max CMP #5 BNE .skipL0201 .condpart58 LDA tempx CLC ADC temp100percentdelta STA tempx .skipL0201 .L0202 ; if tempdir16max = 6 then tempx = tempx + temp92percentdelta : tempy = tempy + temp38percentdelta LDA tempdir16max CMP #6 BNE .skipL0202 .condpart59 LDA tempx CLC ADC temp92percentdelta STA tempx LDA tempy CLC ADC temp38percentdelta STA tempy .skipL0202 .L0203 ; if tempdir16max = 7 then tempx = tempx + temp71percentdelta : tempy = tempy + temp71percentdelta LDA tempdir16max CMP #7 BNE .skipL0203 .condpart60 LDA tempx CLC ADC temp71percentdelta STA tempx LDA tempy CLC ADC temp71percentdelta STA tempy .skipL0203 .L0204 ; if tempdir16max = 8 then tempx = tempx + temp38percentdelta : tempy = tempy + temp92percentdelta LDA tempdir16max CMP #8 BNE .skipL0204 .condpart61 LDA tempx CLC ADC temp38percentdelta STA tempx LDA tempy CLC ADC temp92percentdelta STA tempy .skipL0204 .L0205 ; if tempdir16max = 9 then tempy = tempy + temp100percentdelta LDA tempdir16max CMP #9 BNE .skipL0205 .condpart62 LDA tempy CLC ADC temp100percentdelta STA tempy .skipL0205 .L0206 ; if tempdir16max = 10 then tempx = tempx - temp38percentdelta : tempy = tempy + temp92percentdelta LDA tempdir16max CMP #10 BNE .skipL0206 .condpart63 LDA tempx SEC SBC temp38percentdelta STA tempx LDA tempy CLC ADC temp92percentdelta STA tempy .skipL0206 .L0207 ; if tempdir16max = 11 then tempx = tempx - temp71percentdelta : tempy = tempy + temp71percentdelta LDA tempdir16max CMP #11 BNE .skipL0207 .condpart64 LDA tempx SEC SBC temp71percentdelta STA tempx LDA tempy CLC ADC temp71percentdelta STA tempy .skipL0207 .L0208 ; if tempdir16max = 12 then tempx = tempx - temp92percentdelta : tempy = tempy + temp38percentdelta LDA tempdir16max CMP #12 BNE .skipL0208 .condpart65 LDA tempx SEC SBC temp92percentdelta STA tempx LDA tempy CLC ADC temp38percentdelta STA tempy .skipL0208 .L0209 ; if tempdir16max = 13 then tempx = tempx - temp100percentdelta LDA tempdir16max CMP #13 BNE .skipL0209 .condpart66 LDA tempx SEC SBC temp100percentdelta STA tempx .skipL0209 .L0210 ; if tempdir16max = 14 then tempx = tempx - temp92percentdelta : tempy = tempy - temp38percentdelta LDA tempdir16max CMP #14 BNE .skipL0210 .condpart67 LDA tempx SEC SBC temp92percentdelta STA tempx LDA tempy SEC SBC temp38percentdelta STA tempy .skipL0210 .L0211 ; if tempdir16max = 15 then tempx = tempx - temp71percentdelta : tempy = tempy - temp71percentdelta LDA tempdir16max CMP #15 BNE .skipL0211 .condpart68 LDA tempx SEC SBC temp71percentdelta STA tempx LDA tempy SEC SBC temp71percentdelta STA tempy .skipL0211 .L0212 ; if tempdir16max = 16 then tempx = tempx - temp38percentdelta : tempy = tempy - temp92percentdelta LDA tempdir16max CMP #16 BNE .skipL0212 .condpart69 LDA tempx SEC SBC temp38percentdelta STA tempx LDA tempy SEC SBC temp92percentdelta STA tempy .skipL0212 .L0213 ; return RTS . ; .gameover ; gameover .L0214 ; AUDV0 = 0 : AUDV1 = 0 LDA #0 STA AUDV0 STA AUDV1 .L0215 ; if switchreset then goto startgame lda #1 bit SWCHB BNE .skipL0215 .condpart70 jmp .startgame .skipL0215 .L0216 ; gosub spritegroupa jsr .spritegroupa .L0217 ; drawscreen jsr drawscreen .L0218 ; gosub spritegroupb jsr .spritegroupb .L0219 ; drawscreen jsr drawscreen .L0220 ; if switchreset then goto startgame lda #1 bit SWCHB BNE .skipL0220 .condpart71 jmp .startgame .skipL0220 .L0221 ; goto gameover jmp .gameover . ; .readdir ; readdir .L0222 ; rem paddle center is 38 min 0 max 77 .L0223 ; if paddle > 40 then tempdir255maxdelta = ( paddle - 38 ) / 5 : gosub incrdir : return LDA #40 CMP paddle BCS .skipL0223 .condpart72 ; complex statement detected LDA paddle SEC SBC #38 LDY #5 jsr div8 STA tempdir255maxdelta jsr .incrdir RTS .skipL0223 .L0224 ; if paddle < 36 then tempdir255maxdelta = ( 38 - paddle ) / 5 : gosub decrdir LDA paddle CMP #36 BCS .skipL0224 .condpart73 ; complex statement detected LDA #38 SEC SBC paddle LDY #5 jsr div8 STA tempdir255maxdelta jsr .decrdir .skipL0224 .L0225 ; return RTS . ; .incrdir ; incrdir .L0226 ; tempdir255max = tempdir255max + tempdir255maxdelta LDA tempdir255max CLC ADC tempdir255maxdelta STA tempdir255max .L0227 ; return RTS . ; .decrdir ; decrdir .L0228 ; tempdir255max = tempdir255max - tempdir255maxdelta LDA tempdir255max SEC SBC tempdir255maxdelta STA tempdir255max .L0229 ; return RTS . ; .spritegroupa ; spritegroupa . ; .L0230 ; rem *** oliveish .L0231 ; COLUP0 = 232 LDA #232 STA COLUP0 .L0232 ; player0x = car0x LDA car0x STA player0x .L0233 ; player0y = car0y LDA car0y STA player0y .L0234 ; tempp0spritedir = ( car0dir255max / 16 ) + 1 : gosub p0draw ; complex statement detected LDA car0dir255max lsr lsr lsr lsr CLC ADC #1 STA tempp0spritedir jsr .p0draw . ; .L0235 ; rem *** black .L0236 ; COLUP1 = 0 LDA #0 STA COLUP1 .L0237 ; player1x = car1x LDA car1x STA player1x .L0238 ; player1y = car1y LDA car1y STA player1y .L0239 ; tempp1spritedir = ( car1dir255max / 16 ) + 1 : gosub p1draw ; complex statement detected LDA car1dir255max lsr lsr lsr lsr CLC ADC #1 STA tempp1spritedir jsr .p1draw . ; .L0240 ; rem *** flagpole is same color as player1 .L0241 ; NUSIZ1 = $00 LDA #$00 STA NUSIZ1 .L0242 ; missile1height = 6 LDA #6 STA missile1height .L0243 ; missile1x = missile1x - 1 DEC missile1x .L0244 ; missile1y = missile1y + 4 LDA missile1y CLC ADC #4 STA missile1y .L0245 ; return RTS . ; .spritegroupb ; spritegroupb . ; .L0246 ; rem *** red .L0247 ; COLUP0 = 64 LDA #64 STA COLUP0 .L0248 ; player0x = car2x LDA car2x STA player0x .L0249 ; player0y = car2y LDA car2y STA player0y .L0250 ; tempp0spritedir = ( car2dir255max / 16 ) + 1 : gosub p0draw ; complex statement detected LDA car2dir255max lsr lsr lsr lsr CLC ADC #1 STA tempp0spritedir jsr .p0draw . ; .L0251 ; rem *** white .L0252 ; COLUP1 = 14 LDA #14 STA COLUP1 .L0253 ; player1x = car3x LDA car3x STA player1x .L0254 ; player1y = car3y LDA car3y STA player1y .L0255 ; tempp1spritedir = ( car3dir255max / 16 ) + 1 : gosub p1draw ; complex statement detected LDA car3dir255max lsr lsr lsr lsr CLC ADC #1 STA tempp1spritedir jsr .p1draw . ; .L0256 ; rem *** flag is same color as player1 .L0257 ; NUSIZ1 = $20 LDA #$20 STA NUSIZ1 .L0258 ; missile1height = 2 LDA #2 STA missile1height .L0259 ; missile1y = missile1y - 4 LDA missile1y SEC SBC #4 STA missile1y .L0260 ; missile1x = missile1x + 1 INC missile1x .L0261 ; return RTS . ; .p0draw ; p0draw .L0262 ; if tempp0spritedir < 9 then REFP0 = 0 else tempp0spritedir = 17 - tempp0spritedir : REFP0 = 8 LDA tempp0spritedir CMP #9 BCS .skipL0262 .condpart74 LDA #0 STA REFP0 jmp .skipelse1 .skipL0262 LDA #17 SEC SBC tempp0spritedir STA tempp0spritedir LDA #8 STA REFP0 .skipelse1 .L0263 ; if tempp0spritedir = 1 gosub p0r1 : return LDA tempp0spritedir CMP #1 if ((* - .p0r1) < 127) && ((* - .p0r1) > -128) BEQ .p0r1 else bne .1skipp0r1 jmp .p0r1 .1skipp0r1 endif .L0264 ; if tempp0spritedir = 2 gosub p0r2 : return LDA tempp0spritedir CMP #2 if ((* - .p0r2) < 127) && ((* - .p0r2) > -128) BEQ .p0r2 else bne .2skipp0r2 jmp .p0r2 .2skipp0r2 endif .L0265 ; if tempp0spritedir = 3 gosub p0r3 : return LDA tempp0spritedir CMP #3 if ((* - .p0r3) < 127) && ((* - .p0r3) > -128) BEQ .p0r3 else bne .3skipp0r3 jmp .p0r3 .3skipp0r3 endif .L0266 ; if tempp0spritedir = 4 gosub p0r4 : return LDA tempp0spritedir CMP #4 if ((* - .p0r4) < 127) && ((* - .p0r4) > -128) BEQ .p0r4 else bne .4skipp0r4 jmp .p0r4 .4skipp0r4 endif .L0267 ; if tempp0spritedir = 5 gosub p0r5 : return LDA tempp0spritedir CMP #5 if ((* - .p0r5) < 127) && ((* - .p0r5) > -128) BEQ .p0r5 else bne .5skipp0r5 jmp .p0r5 .5skipp0r5 endif .L0268 ; if tempp0spritedir = 6 gosub p0r6 : return LDA tempp0spritedir CMP #6 if ((* - .p0r6) < 127) && ((* - .p0r6) > -128) BEQ .p0r6 else bne .6skipp0r6 jmp .p0r6 .6skipp0r6 endif .L0269 ; if tempp0spritedir = 7 gosub p0r7 : return LDA tempp0spritedir CMP #7 if ((* - .p0r7) < 127) && ((* - .p0r7) > -128) BEQ .p0r7 else bne .7skipp0r7 jmp .p0r7 .7skipp0r7 endif .L0270 ; if tempp0spritedir = 8 gosub p0r8 : return LDA tempp0spritedir CMP #8 if ((* - .p0r8) < 127) && ((* - .p0r8) > -128) BEQ .p0r8 else bne .8skipp0r8 jmp .p0r8 .8skipp0r8 endif .L0271 ; return RTS . ; .p1draw ; p1draw .L0272 ; if tempp1spritedir < 9 then REFP1 = 0 else tempp1spritedir = 17 - tempp1spritedir : REFP1 = 8 LDA tempp1spritedir CMP #9 BCS .skipL0272 .condpart75 LDA #0 STA REFP1 jmp .skipelse2 .skipL0272 LDA #17 SEC SBC tempp1spritedir STA tempp1spritedir LDA #8 STA REFP1 .skipelse2 .L0273 ; if tempp1spritedir = 1 gosub p1r1 : return LDA tempp1spritedir CMP #1 if ((* - .p1r1) < 127) && ((* - .p1r1) > -128) BEQ .p1r1 else bne .9skipp1r1 jmp .p1r1 .9skipp1r1 endif .L0274 ; if tempp1spritedir = 2 gosub p1r2 : return LDA tempp1spritedir CMP #2 if ((* - .p1r2) < 127) && ((* - .p1r2) > -128) BEQ .p1r2 else bne .10skipp1r2 jmp .p1r2 .10skipp1r2 endif .L0275 ; if tempp1spritedir = 3 gosub p1r3 : return LDA tempp1spritedir CMP #3 if ((* - .p1r3) < 127) && ((* - .p1r3) > -128) BEQ .p1r3 else bne .11skipp1r3 jmp .p1r3 .11skipp1r3 endif .L0276 ; if tempp1spritedir = 4 gosub p1r4 : return LDA tempp1spritedir CMP #4 if ((* - .p1r4) < 127) && ((* - .p1r4) > -128) BEQ .p1r4 else bne .12skipp1r4 jmp .p1r4 .12skipp1r4 endif .L0277 ; if tempp1spritedir = 5 gosub p1r5 : return LDA tempp1spritedir CMP #5 if ((* - .p1r5) < 127) && ((* - .p1r5) > -128) BEQ .p1r5 else bne .13skipp1r5 jmp .p1r5 .13skipp1r5 endif .L0278 ; if tempp1spritedir = 6 gosub p1r6 : return LDA tempp1spritedir CMP #6 if ((* - .p1r6) < 127) && ((* - .p1r6) > -128) BEQ .p1r6 else bne .14skipp1r6 jmp .p1r6 .14skipp1r6 endif .L0279 ; if tempp1spritedir = 7 gosub p1r7 : return LDA tempp1spritedir CMP #7 if ((* - .p1r7) < 127) && ((* - .p1r7) > -128) BEQ .p1r7 else bne .15skipp1r7 jmp .p1r7 .15skipp1r7 endif .L0280 ; if tempp1spritedir = 8 gosub p1r8 : return LDA tempp1spritedir CMP #8 if ((* - .p1r8) < 127) && ((* - .p1r8) > -128) BEQ .p1r8 else bne .16skipp1r8 jmp .p1r8 .16skipp1r8 endif .L0281 ; return RTS . ; .p0r1 ; p0r1 .L0282 ; player0: LDA #playerL0282_0 STA player0pointerhi LDA #8 STA player0height .L0283 ; return RTS . ; .p0r2 ; p0r2 .L0284 ; player0: LDA #playerL0284_0 STA player0pointerhi LDA #8 STA player0height .L0285 ; return RTS . ; .p0r3 ; p0r3 .L0286 ; player0: LDA #playerL0286_0 STA player0pointerhi LDA #8 STA player0height .L0287 ; return RTS . ; .p0r4 ; p0r4 .L0288 ; player0: LDA #playerL0288_0 STA player0pointerhi LDA #8 STA player0height .L0289 ; return RTS . ; .p0r5 ; p0r5 .L0290 ; player0: LDA #playerL0290_0 STA player0pointerhi LDA #8 STA player0height .L0291 ; return RTS . ; .p0r6 ; p0r6 .L0292 ; player0: LDA #playerL0292_0 STA player0pointerhi LDA #8 STA player0height .L0293 ; return RTS . ; .p0r7 ; p0r7 .L0294 ; player0: LDA #playerL0294_0 STA player0pointerhi LDA #8 STA player0height .L0295 ; return RTS . ; .p0r8 ; p0r8 .L0296 ; player0: LDA #playerL0296_0 STA player0pointerhi LDA #8 STA player0height .L0297 ; return RTS . ; .p1r1 ; p1r1 .L0298 ; player1: LDA #playerL0298_1 STA player1pointerhi LDA #8 STA player1height .L0299 ; return RTS . ; .p1r2 ; p1r2 .L0300 ; player1: LDA #playerL0300_1 STA player1pointerhi LDA #8 STA player1height .L0301 ; return RTS . ; .p1r3 ; p1r3 .L0302 ; player1: LDA #playerL0302_1 STA player1pointerhi LDA #8 STA player1height .L0303 ; return RTS . ; .p1r4 ; p1r4 .L0304 ; player1: LDA #playerL0304_1 STA player1pointerhi LDA #8 STA player1height .L0305 ; return RTS . ; .p1r5 ; p1r5 .L0306 ; player1: LDA #playerL0306_1 STA player1pointerhi LDA #8 STA player1height .L0307 ; return RTS . ; .p1r6 ; p1r6 .L0308 ; player1: LDA #playerL0308_1 STA player1pointerhi LDA #8 STA player1height .L0309 ; return RTS . ; .p1r7 ; p1r7 .L0310 ; player1: LDA #playerL0310_1 STA player1pointerhi LDA #8 STA player1height .L0311 ; return RTS . ; .p1r8 ; p1r8 .L0312 ; player1: LDA #playerL0312_1 STA player1pointerhi LDA #8 STA player1height .L0313 ; return RTS . ; . ; .trackindy ; trackindy .L0314 ; COLUPF = 128 : COLUBK = 6 LDA #128 STA COLUPF LDA #6 STA COLUBK . ; .L0315 ; missile1x = 80 : missile1y = 55 LDA #80 STA missile1x LDA #55 STA missile1y . ; .L0316 ; rem Player initial positions (behind starting line) .L0317 ; car0x = 80 : car0y = 85 : car0dir255max = 1 LDA #80 STA car0x LDA #85 STA car0y LDA #1 STA car0dir255max .L0318 ; car1x = 90 : car1y = 80 : car1dir255max = 1 LDA #90 STA car1x LDA #80 STA car1y LDA #1 STA car1dir255max .L0319 ; car2x = 100 : car2y = 75 : car2dir255max = 1 LDA #100 STA car2x LDA #75 STA car2y LDA #1 STA car2dir255max .L0320 ; car3x = 110 : car3y = 70 : car3dir255max = 1 LDA #110 STA car3x LDA #70 STA car3y LDA #1 STA car3dir255max . ; .L0321 ; playfield: ifconst pfres ldx #4*pfres-1 else ldx #47 endif jmp pflabel0 PF_data0 .byte %11111111, %11111111, %11111111, %11111111 .byte %10000000, %00000000, %00000000, %10000000 .byte %10000000, %00000000, %00000000, %10000000 .byte %10000000, %00000000, %00000000, %10000000 .byte %10000001, %11100000, %11100000, %10000001 .byte %10000001, %00000001, %00000001, %10000001 .byte %10000001, %11111111, %11111111, %10000001 .byte %10000001, %11111111, %11111111, %10000001 .byte %10000000, %00000000, %00000000, %10000000 .byte %10000000, %00000000, %00000000, %10000000 .byte %10000000, %00000000, %00000000, %10000000 .byte %11111111, %11111111, %11111111, %11111111 pflabel0 lda PF_data0,x sta playfield,x dex bpl pflabel0 . ; .L0322 ; pfscroll upup : pfscroll upup LDA #6 jsr pfscroll LDA #6 jsr pfscroll .L0323 ; return RTS . ; . ; .ultindy500titlea ; ultindy500titlea . ; .L0324 ; COLUP0 = 12 LDA #12 STA COLUP0 .L0325 ; COLUP1 = 12 LDA #12 STA COLUP1 . ; .L0326 ; player0x = 79 LDA #79 STA player0x .L0327 ; player0y = titlecolor LDA titlecolor STA player0y .L0328 ; player0: LDA #playerL0328_0 STA player0pointerhi LDA #8 STA player0height . ; .L0329 ; player1x = 87 LDA #87 STA player1x .L0330 ; player1y = titlecolor LDA titlecolor STA player1y .L0331 ; player1: LDA #playerL0331_1 STA player1pointerhi LDA #8 STA player1height . ; .L0332 ; drawscreen jsr drawscreen .L0333 ; return RTS . ; .ultindy500titleb ; ultindy500titleb . ; .L0334 ; COLUP0 = 12 LDA #12 STA COLUP0 .L0335 ; COLUP1 = 12 LDA #12 STA COLUP1 . ; .L0336 ; player0x = 79 LDA #79 STA player0x .L0337 ; player0y = 90 - titlecolor LDA #90 SEC SBC titlecolor STA player0y .L0338 ; player0: LDA #playerL0338_0 STA player0pointerhi LDA #8 STA player0height . ; .L0339 ; player1x = 87 LDA #87 STA player1x .L0340 ; player1y = 90 - titlecolor LDA #90 SEC SBC titlecolor STA player1y .L0341 ; player1: LDA #playerL0341_1 STA player1pointerhi LDA #8 STA player1height . ; .L0342 ; drawscreen jsr drawscreen . ; .L0343 ; return RTS . ; .L0344 ; rem should be last lines in game .L0345 ; inline playerscores.asm include playerscores.asm .L0346 ; inline bcd_math.asm include bcd_math.asm if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0282_0 .byte 0 .byte %00111100 .byte %00111100 .byte %00111100 .byte %00011000 .byte %00011000 .byte %00111100 .byte %00111100 .byte %00011000 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0284_0 .byte 0 .byte %01111000 .byte %01111100 .byte %01111100 .byte %00111000 .byte %00111000 .byte %00111110 .byte %00111110 .byte %00011100 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0286_0 .byte 0 .byte %01100000 .byte %11110000 .byte %11111000 .byte %01111000 .byte %00111110 .byte %00001111 .byte %00001111 .byte %00000110 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0288_0 .byte 0 .byte %11000000 .byte %11110000 .byte %11111000 .byte %11111000 .byte %00111111 .byte %00001111 .byte %00000111 .byte %00000000 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0290_0 .byte 0 .byte %00000000 .byte %00000000 .byte %11100110 .byte %11111111 .byte %11111111 .byte %11100110 .byte %00000000 .byte %00000000 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0292_0 .byte 0 .byte %00000000 .byte %00000111 .byte %00001111 .byte %00111111 .byte %11111000 .byte %11111000 .byte %11110000 .byte %11000000 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0294_0 .byte 0 .byte %00000110 .byte %00001111 .byte %00001111 .byte %00111110 .byte %01111000 .byte %11111000 .byte %11110000 .byte %01100000 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0296_0 .byte 0 .byte %00011100 .byte %00111110 .byte %00111110 .byte %00111000 .byte %00111000 .byte %01111100 .byte %01111100 .byte %01111000 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0298_1 .byte 0 .byte %00111100 .byte %00111100 .byte %00111100 .byte %00011000 .byte %00011000 .byte %00111100 .byte %00111100 .byte %00011000 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0300_1 .byte 0 .byte %01111000 .byte %01111100 .byte %01111100 .byte %00111000 .byte %00111000 .byte %00111110 .byte %00111110 .byte %00011100 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0302_1 .byte 0 .byte %01100000 .byte %11110000 .byte %11111000 .byte %01111000 .byte %00111110 .byte %00001111 .byte %00001111 .byte %00000110 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0304_1 .byte 0 .byte %11000000 .byte %11110000 .byte %11111000 .byte %11111000 .byte %00111111 .byte %00001111 .byte %00000111 .byte %00000000 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0306_1 .byte 0 .byte %00000000 .byte %00000000 .byte %11100110 .byte %11111111 .byte %11111111 .byte %11100110 .byte %00000000 .byte %00000000 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0308_1 .byte 0 .byte %00000000 .byte %00000111 .byte %00001111 .byte %00111111 .byte %11111000 .byte %11111000 .byte %11110000 .byte %11000000 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0310_1 .byte 0 .byte %00000110 .byte %00001111 .byte %00001111 .byte %00111110 .byte %01111000 .byte %11111000 .byte %11110000 .byte %01100000 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0312_1 .byte 0 .byte %00011100 .byte %00111110 .byte %00111110 .byte %00111000 .byte %00111000 .byte %01111100 .byte %01111100 .byte %01111000 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0328_0 .byte 0 .byte %10010101 .byte %10010111 .byte %11110101 .byte %10010111 .byte %11101110 .byte %10101000 .byte %10101000 .byte %10101000 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0331_1 .byte 0 .byte %00100111 .byte %00100100 .byte %00100111 .byte %01110111 .byte %01001110 .byte %01000100 .byte %01000100 .byte %11101110 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0338_0 .byte 0 .byte %10100010 .byte %10100110 .byte %10100110 .byte %10101010 .byte %10101010 .byte %10110010 .byte %10110010 .byte %10100010 if (<*) > (<(*+9)) repeat ($100-<*) .byte 0 repend endif playerL0341_1 .byte 0 .byte %11000100 .byte %10100100 .byte %10100100 .byte %10100100 .byte %10100100 .byte %10101010 .byte %10101010 .byte %11001010 echo " ",[(scoretable - *)]d , "bytes of ROM space left") ; feel free to modify the score graphics - just keep each digit 8 high ; and keep the conditional compilation stuff intact ifconst ROM2k ORG $F7AC else ifconst bankswitch if bankswitch == 8 ORG $2F94-bscode_length RORG $FF94-bscode_length endif if bankswitch == 16 ORG $4F94-bscode_length RORG $FF94-bscode_length endif if bankswitch == 32 ORG $8F94-bscode_length RORG $FF94-bscode_length endif else ORG $FF9C endif endif scoretable .byte %00111100 .byte %01100110 .byte %01100110 .byte %01100110 .byte %01100110 .byte %01100110 .byte %01100110 .byte %00111100 .byte %01111110 .byte %00011000 .byte %00011000 .byte %00011000 .byte %00011000 .byte %00111000 .byte %00011000 .byte %00001000 .byte %01111110 .byte %01100000 .byte %01100000 .byte %00111100 .byte %00000110 .byte %00000110 .byte %01000110 .byte %00111100 .byte %00111100 .byte %01000110 .byte %00000110 .byte %00000110 .byte %00011100 .byte %00000110 .byte %01000110 .byte %00111100 .byte %00001100 .byte %00001100 .byte %01111110 .byte %01001100 .byte %01001100 .byte %00101100 .byte %00011100 .byte %00001100 .byte %00111100 .byte %01000110 .byte %00000110 .byte %00000110 .byte %00111100 .byte %01100000 .byte %01100000 .byte %01111110 .byte %00111100 .byte %01100110 .byte %01100110 .byte %01100110 .byte %01111100 .byte %01100000 .byte %01100010 .byte %00111100 .byte %00110000 .byte %00110000 .byte %00110000 .byte %00011000 .byte %00001100 .byte %00000110 .byte %01000010 .byte %00111110 .byte %00111100 .byte %01100110 .byte %01100110 .byte %01100110 .byte %00111100 .byte %01100110 .byte %01100110 .byte %00111100 .byte %00111100 .byte %01000110 .byte %00000110 .byte %00111110 .byte %01100110 .byte %01100110 .byte %01100110 .byte %00111100 ifconst ROM2k ORG $F7FC else ifconst bankswitch if bankswitch == 8 ORG $2FF4-bscode_length RORG $FFF4-bscode_length endif if bankswitch == 16 ORG $4FF4-bscode_length RORG $FFF4-bscode_length endif if bankswitch == 32 ORG $8FF4-bscode_length RORG $FFF4-bscode_length endif else ORG $FFFC endif endif ifconst bankswitch if bankswitch == 8 ORG $2FFC RORG $FFFC endif if bankswitch == 16 ORG $4FFC RORG $FFFC endif if bankswitch == 32 ORG $8FFC RORG $FFFC endif else ifconst ROM2k ORG $F7FC else ORG $FFFC endif endif .word start .word start