diff --git a/crash.a b/crash.a index d913565..ec0e9ec 100644 --- a/crash.a +++ b/crash.a @@ -1,69 +1,69 @@ !zone { - lda CRASH - bne .nocrash - lda CXP0FB - ora CXP1FB - and #$80 - beq .nocrash - lda #8 - sta AUDC1 - lda #0 - sta AUDV0 - sta AUDC0 - lda #$80 - sta CRASH - lda #$3f - sta EXPLOSION - lda #0 - sta SPEEDY0_LO - sta SPEEDY0_HI - sta SPEEDY1_LO - sta SPEEDY1_HI - sta SPEEDX0_LO - sta SPEEDX0_HI - sta SPEEDX1_LO - sta SPEEDX1_HI + lda CRASH + bne .nocrash + lda CXP0FB + ora CXP1FB + and #$80 + beq .nocrash + lda #8 + sta AUDC1 + lda #0 + sta AUDV0 + sta AUDC0 + lda #$80 + sta CRASH + lda #$3f + sta EXPLOSION + lda #0 + sta SPEEDY0_LO + sta SPEEDY0_HI + sta SPEEDY1_LO + sta SPEEDY1_HI + sta SPEEDX0_LO + sta SPEEDX0_HI + sta SPEEDX1_LO + sta SPEEDX1_HI - lda CXP0FB - and #$80 - beq .nocrashp0 - dec P0LIVES + lda CXP0FB + and #$80 + beq .nocrashp0 + dec P0LIVES .nowinnerp0 - lda #120 - sta Y0_HI - lda P0LIVES - bne .nocrashp0 - lda #1 - sta RESET + lda #120 + sta Y0_HI + lda P0LIVES + bne .nocrashp0 + lda #1 + sta RESET .nocrashp0 - lda CXP1FB - and #$80 - beq .nocrashp1 - dec P1LIVES + lda CXP1FB + and #$80 + beq .nocrashp1 + dec P1LIVES .nowinnerp1 - lda #120 - sta Y1_HI - lda P1LIVES - bne .nocrashp1 - lda #1 - sta RESET + lda #120 + sta Y1_HI + lda P1LIVES + bne .nocrashp1 + lda #1 + sta RESET .nocrashp1 - lda P0LIVES - ora P1LIVES - bne .notboth - lda #$50 - sta WINNER_COLOR - jmp .nocrash + lda P0LIVES + ora P1LIVES + bne .notboth + lda #$50 + sta WINNER_COLOR + jmp .nocrash .notboth - lda P0LIVES - bne .checknext - lda #P1COL-10 - sta WINNER_COLOR - jmp .nocrash + lda P0LIVES + bne .checknext + lda #P1COL-10 + sta WINNER_COLOR + jmp .nocrash .checknext - lda P1LIVES - bne .nocrash - lda #P0COL-10 - sta WINNER_COLOR + lda P1LIVES + bne .nocrash + lda #P0COL-10 + sta WINNER_COLOR .nocrash } diff --git a/enginesounds.a b/enginesounds.a index 8814a28..9cd4ded 100644 --- a/enginesounds.a +++ b/enginesounds.a @@ -1,26 +1,26 @@ !zone { - tax - and #%11001100 - beq .noblow - lda SNDFRAME - and #1 - bne .noblow - lda #8 - sta AUDC0 - lda #1 - sta AUDF0 - lda #2 - sta AUDV0 - jmp .nothrust + tax + and #%11001100 + beq .noblow + lda SNDFRAME + and #1 + bne .noblow + lda #8 + sta AUDC0 + lda #1 + sta AUDF0 + lda #2 + sta AUDV0 + jmp .nothrust .noblow - txa - and #$11 - beq .nothrust - lda #8 - sta AUDC0 - lda #20 - sta AUDF0 - lda #4 - sta AUDV0 + txa + and #$11 + beq .nothrust + lda #8 + sta AUDC0 + lda #20 + sta AUDF0 + lda #4 + sta AUDV0 .nothrust } diff --git a/input.a b/input.a index d6b7a5c..8a32014 100644 --- a/input.a +++ b/input.a @@ -3,139 +3,139 @@ RSPEED = 0-9 VSPEED = 0-20 GRAVITY = 10 - lda CXPPMM - and #$80 - beq input_nocol + lda CXPPMM + and #$80 + beq input_nocol - ldy JUST_COLLIDED - bne input_nocol + ldy JUST_COLLIDED + bne input_nocol - ; Collision energy transfer - lda SPEEDX0_LO - ldy SPEEDX1_LO - sta SPEEDX1_LO - sty SPEEDX0_LO - lda SPEEDY0_LO - ldy SPEEDY1_LO - sta SPEEDY1_LO - sty SPEEDY0_LO - - lda SPEEDX0_HI - ldy SPEEDX1_HI - sta SPEEDX1_HI - sty SPEEDX0_HI - lda SPEEDY0_HI - ldy SPEEDY1_HI - sta SPEEDY1_HI - sty SPEEDY0_HI - lda #$f - sta COLLISION_SOUND + ; Collision energy transfer + lda SPEEDX0_LO + ldy SPEEDX1_LO + sta SPEEDX1_LO + sty SPEEDX0_LO + lda SPEEDY0_LO + ldy SPEEDY1_LO + sta SPEEDY1_LO + sty SPEEDY0_LO + + lda SPEEDX0_HI + ldy SPEEDX1_HI + sta SPEEDX1_HI + sty SPEEDX0_HI + lda SPEEDY0_HI + ldy SPEEDY1_HI + sta SPEEDY1_HI + sty SPEEDY0_HI + lda #$f + sta COLLISION_SOUND - lda #4 - sta JUST_COLLIDED + lda #4 + sta JUST_COLLIDED - jmp input_nocheck + jmp input_nocheck input_nocol !zone { ; player 0 - txa - and #$10 ; Up button - beq .noup - clc - lda SPEEDY0_LO - adc #VSPEED - sta SPEEDY0_HI + txa + and #$10 ; Up button + beq .noup + clc + lda SPEEDY0_LO + adc #VSPEED + sta SPEEDY0_HI .noup - txa - and #$80 ; Right button - beq .nor - clc - lda SPEEDX0_LO - adc #RSPEED - sta SPEEDX0_HI - jmp .nohor + txa + and #$80 ; Right button + beq .nor + clc + lda SPEEDX0_LO + adc #RSPEED + sta SPEEDX0_HI + jmp .nohor .nor - txa - and #$40 ; Left button - beq .nohor - clc - lda SPEEDX0_LO - adc #LSPEED - sta SPEEDX0_HI + txa + and #$40 ; Left button + beq .nohor + clc + lda SPEEDX0_LO + adc #LSPEED + sta SPEEDX0_HI .nohor } !zone { ; player 1 - txa - and #1 ; Up button - beq .noup - clc - lda SPEEDY1_LO - adc #VSPEED - sta SPEEDY1_HI + txa + and #1 ; Up button + beq .noup + clc + lda SPEEDY1_LO + adc #VSPEED + sta SPEEDY1_HI .noup - txa - and #8 ; Right button - beq .nor - clc - lda SPEEDX1_LO - adc #RSPEED - sta SPEEDX1_HI - jmp .nohor + txa + and #8 ; Right button + beq .nor + clc + lda SPEEDX1_LO + adc #RSPEED + sta SPEEDX1_HI + jmp .nohor .nor - txa - and #4 ; Left button - beq .nohor - clc - lda SPEEDX1_LO - adc #LSPEED - sta SPEEDX1_HI + txa + and #4 ; Left button + beq .nohor + clc + lda SPEEDX1_LO + adc #LSPEED + sta SPEEDX1_HI .nohor } input_nocheck - sta CXCLR + sta CXCLR -; Gravity p0 - clc - lda SPEEDY0_LO - adc #GRAVITY - sta SPEEDY0_HI + ; Gravity p0 + clc + lda SPEEDY0_LO + adc #GRAVITY + sta SPEEDY0_HI -; Gravity p1 - clc - lda SPEEDY1_LO - adc #GRAVITY - sta SPEEDY1_HI + ; Gravity p1 + clc + lda SPEEDY1_LO + adc #GRAVITY + sta SPEEDY1_HI diff --git a/jsumo.a b/jsumo.a index ec16ed2..d234550 100644 --- a/jsumo.a +++ b/jsumo.a @@ -66,10 +66,10 @@ MUSIC_TICK = $ab +Init - lda #$50 - sta WINNER_COLOR - lda #1 - sta MUSIC_TICK + lda #$50 + sta WINNER_COLOR + lda #1 + sta MUSIC_TICK !src "title.a" jsr game_init @@ -78,359 +78,360 @@ screenloop +VSync +VBlankBegin game_start - lda #$5a - sta COLUPF - - ldx #0 - stx GRP0 - stx GRP1 - - lda #$10 - sta PFSTORE - lda level_pf1 - sta PFSTORE+1 - lda level_pf2 - sta PFSTORE+2 - - lda #$ff - sta PF0 - sta PF1 - sta PF2 - jmp game1 + lda #$5a + sta COLUPF + + ldx #0 + stx GRP0 + stx GRP1 + + lda #$10 + sta PFSTORE + lda level_pf1 + sta PFSTORE+1 + lda level_pf2 + sta PFSTORE+2 + + lda #$ff + sta PF0 + sta PF1 + sta PF2 + jmp game1 game1_done - ldx #0 + ldx #0 +VBlankEnd prescreen - sta WSYNC - lda P0STORE - sta GRP0 - lda P1STORE - sta GRP1 - sta WSYNC - inx - - ; Set player Y postitions - ldy P0YCOUNT - lda player,y - sta P0STORE - dec P0YCOUNT - ldy P1YCOUNT - lda player,y - sta P1STORE - dec P1YCOUNT - - cpx #$3 - bne prescreen - lda PFSTORE - sta WSYNC - sta PF0 - jmp screen2 + sta WSYNC + lda P0STORE + sta GRP0 + lda P1STORE + sta GRP1 + sta WSYNC + inx + + ; Set player Y postitions + ldy P0YCOUNT + lda player,y + sta P0STORE + dec P0YCOUNT + ldy P1YCOUNT + lda player,y + sta P1STORE + dec P1YCOUNT + + cpx #$3 + bne prescreen + lda PFSTORE + sta WSYNC + sta PF0 + jmp screen2 screen - sta WSYNC + sta WSYNC screen2 - lda P0STORE - sta GRP0 - lda P1STORE - sta GRP1 - lda PFSTORE+1 - sta PF1 - lda PFSTORE+2 - sta PF2 - - ; Reload player stores - - inx - txa - lsr - lsr - tay - - lda #0 - sta WSYNC - sta VBLANK - - ; Load playfield data - lda level_pf0,y - sta PFSTORE - lda level_pf1,y - sta PFSTORE+1 - lda level_pf2,y - sta PFSTORE+2 - - ; Set player Y postitions - ldy P0YCOUNT - lda player,y - sta P0STORE - dec P0YCOUNT - ldy P1YCOUNT - lda player,y - sta P1STORE - dec P1YCOUNT - - cpx #PICTURE_LINES/2-9 - bne screen + lda P0STORE + sta GRP0 + lda P1STORE + sta GRP1 + lda PFSTORE+1 + sta PF1 + lda PFSTORE+2 + sta PF2 + + ; Reload player stores + + inx + txa + lsr + lsr + tay + + lda #0 + sta WSYNC + sta VBLANK + + ; Load playfield data + lda level_pf0,y + sta PFSTORE + lda level_pf1,y + sta PFSTORE+1 + lda level_pf2,y + sta PFSTORE+2 + + ; Set player Y postitions + ldy P0YCOUNT + lda player,y + sta P0STORE + dec P0YCOUNT + ldy P1YCOUNT + lda player,y + sta P1STORE + dec P1YCOUNT + + cpx #PICTURE_LINES/2-9 + bne screen postscreen - sta WSYNC - lda P0STORE - sta GRP0 - lda P1STORE - sta GRP1 - lda #$ff - sta PF0 - sta PF1 - sta PF2 - sta WSYNC - inx - - ; Set player Y postitions - ldy P0YCOUNT - lda player,y - sta P0STORE - dec P0YCOUNT - ldy P1YCOUNT - lda player,y - sta P1STORE - dec P1YCOUNT - - cpx #PICTURE_LINES/2-6 - bne postscreen - - - - sta WSYNC - lda #2 - sta VBLANK - lda #0 - sta GRP0 - sta GRP1 - sta PF0 - sta PF1 - sta PF2 - sta WSYNC - inx - sta WSYNC - sta WSYNC - lda #0 - sta COLUBK - sta VBLANK - inx + sta WSYNC + lda P0STORE + sta GRP0 + lda P1STORE + sta GRP1 + lda #$ff + sta PF0 + sta PF1 + sta PF2 + sta WSYNC + inx + + ; Set player Y postitions + ldy P0YCOUNT + lda player,y + sta P0STORE + dec P0YCOUNT + ldy P1YCOUNT + lda player,y + sta P1STORE + dec P1YCOUNT + + cpx #PICTURE_LINES/2-6 + bne postscreen + + + + sta WSYNC + lda #2 + sta VBLANK + lda #0 + sta GRP0 + sta GRP1 + sta PF0 + sta PF1 + sta PF2 + sta WSYNC + inx + sta WSYNC + sta WSYNC + lda #0 + sta COLUBK + sta VBLANK + inx ; Display lives scoreview - sta WSYNC - lda #P0COL - sta COLUPF - ldy P0LIVES ; 2 - lda livesconv,y ; 3 - sta PF1 ; 3 - +nopn 6 - ldy P1LIVES ; 2 - lda livesconv,y ; 3 - sta PF1 ; 3 - lda #P1COL - sta COLUPF - sta WSYNC - lda #P0COL - sta COLUPF - ldy P0LIVES ; 2 - lda livesconv,y ; 3 - sta PF1 ; 3 - +nopn 6 - ldy P1LIVES ; 2 - lda livesconv,y ; 3 - sta PF1 ; 3 - lda #P1COL - sta COLUPF - - inx - cpx #PICTURE_LINES/2 - bne scoreview + sta WSYNC + lda #P0COL + sta COLUPF + ldy P0LIVES ; 2 + lda livesconv,y ; 3 + sta PF1 ; 3 + +nopn 6 + ldy P1LIVES ; 2 + lda livesconv,y ; 3 + sta PF1 ; 3 + lda #P1COL + sta COLUPF + sta WSYNC + lda #P0COL + sta COLUPF + ldy P0LIVES ; 2 + lda livesconv,y ; 3 + sta PF1 ; 3 + +nopn 6 + ldy P1LIVES ; 2 + lda livesconv,y ; 3 + sta PF1 ; 3 + lda #P1COL + sta COLUPF + + inx + cpx #PICTURE_LINES/2 + bne scoreview +OverscanBegin - jmp game2 + jmp game2 game2_done +OverscanEnd - jmp screenloop + jmp screenloop reposp - sta WSYNC - +nopn 17 - sta RESP0 - sta WSYNC - +nopn 27 - sta RESP1 - lda #$50 - sta HMP1 - sta WSYNC - sta HMOVE - rts + sta WSYNC + +nopn 17 + sta RESP0 + sta WSYNC + +nopn 27 + sta RESP1 + lda #$50 + sta HMP1 + sta WSYNC + sta HMOVE + rts ; GAME CODE ; game1 !src "movement.a" - lda Y0_HI - sta P0YCOUNT - lda Y1_HI - sta P1YCOUNT - lda BGCOLOR - sta COLUBK - jmp game1_done + lda Y0_HI + sta P0YCOUNT + lda Y1_HI + sta P1YCOUNT + lda BGCOLOR + sta COLUBK + jmp game1_done game2 - lda SWCHB - and #1 - bne dontreset - lda #0 - sta AUDC0 - sta AUDC1 - sta AUDV0 - sta AUDV1 - lda #$50 - sta WINNER_COLOR - jmp game_end + lda SWCHB + and #1 + bne dontreset + lda #0 + sta AUDC0 + sta AUDC1 + sta AUDV0 + sta AUDV1 + lda #$50 + sta WINNER_COLOR + jmp game_end dontreset !src "crash.a" - ldx CRASH - beq nocrash - stx CXCLR - lda EXPLOSION - beq no_explosion - tay - lda EXPLOSION - and #7 - sta AUDF1 - tya - lsr - lsr - sta BGCOLOR - sta AUDV1 - dey - sty EXPLOSION + ldx CRASH + beq nocrash + stx CXCLR + lda EXPLOSION + beq no_explosion + tay + lda EXPLOSION + and #7 + sta AUDF1 + tya + lsr + lsr + sta BGCOLOR + sta AUDV1 + dey + sty EXPLOSION no_explosion - dex - bne norestart - - lda RESET - beq noreset - lda #0 - sta RESET - jmp game_end + dex + bne norestart + + lda RESET + beq noreset + lda #0 + sta RESET + jmp game_end noreset - jsr game_init + jsr game_init norestart - stx CRASH - jmp game2_done + stx CRASH + jmp game2_done nocrash - lda COUNTDOWN - beq no_countdown - tax - - ldy #12 - sty AUDC1 - ldy #31 - sty AUDF1 - - and #$1f - lsr - lsr - sta AUDV1 - - dex - dex - stx COUNTDOWN - bne nofinal - lda #20 - sta FINAL_COUNTDOWN - lda #0-2 - ldy #$48 - sta SPEEDY0_HI - sta SPEEDY1_HI - sty SPEEDY0_LO - sty SPEEDY1_LO + lda COUNTDOWN + beq no_countdown + tax + + ldy #12 + sty AUDC1 + ldy #31 + sty AUDF1 + + and #$1f + lsr + lsr + sta AUDV1 + + dex + dex + stx COUNTDOWN + bne nofinal + lda #20 + sta FINAL_COUNTDOWN + lda #0-2 + ldy #$48 + sta SPEEDY0_HI + sta SPEEDY1_HI + sty SPEEDY0_LO + sty SPEEDY1_LO nofinal - jmp game2_done + jmp game2_done no_countdown - ; Clear audio - lda #0 - sta AUDV0 - sta AUDC0 + ; Clear audio + lda #0 + sta AUDV0 + sta AUDC0 - ; Store joystick in x - lda SWCHA - eor #$ff + ; Store joystick in x + lda SWCHA + eor #$ff !src "enginesounds.a" !src "input.a" !src "sounds.a" - ldy JUST_COLLIDED - beq nojc - dey - sty JUST_COLLIDED + ldy JUST_COLLIDED + beq nojc + dey + sty JUST_COLLIDED nojc - inc SNDFRAME - jmp game2_done + inc SNDFRAME + jmp game2_done game_init - lda #0 - sta P0LASTX - sta P1LASTX - sta SPEEDX0_HI - sta SPEEDX0_LO - sta SPEEDX1_HI - sta SPEEDX1_LO - sta SPEEDY0_HI - sta SPEEDY0_LO - sta SPEEDY1_HI - sta SPEEDY1_LO - sta X0_LO - sta X0_HI - sta Y0_LO - sta Y0_HI - sta Y0_LO - sta Y1_LO - sta COLLISION_SOUND - sta CRASH - sta EXPLOSION - sta BGCOLOR - sta MUSIC_COUNTER - sta AUDC0 - sta AUDF0 - sta AUDV0 - sta SWACNT - sta SWBCNT - lda #1 - sta MUSIC_TICK - lda #96 - sta Y0_HI - sta Y1_HI - lda #5 - sta CTRLPF - lda #P0COL - sta COLUP0 - lda #P1COL - sta COLUP1 - jsr reposp - lda #$60 - sta COUNTDOWN - rts + lda #0 + sta P0LASTX + sta P1LASTX + sta SPEEDX0_HI + sta SPEEDX0_LO + sta SPEEDX1_HI + sta SPEEDX1_LO + sta SPEEDY0_HI + sta SPEEDY0_LO + sta SPEEDY1_HI + sta SPEEDY1_LO + sta X0_LO + sta X0_HI + sta Y0_LO + sta Y0_HI + sta Y0_LO + sta Y1_LO + sta COLLISION_SOUND + sta CRASH + sta EXPLOSION + sta BGCOLOR + sta MUSIC_COUNTER + sta AUDC0 + sta AUDF0 + sta AUDV0 + sta SWACNT + sta SWBCNT + lda #1 + sta MUSIC_TICK + lda #96 + sta Y0_HI + sta Y1_HI + lda #5 + sta CTRLPF + lda #P0COL + sta COLUP0 + lda #P1COL + sta COLUP1 + jsr reposp + lda #$60 + sta COUNTDOWN + rts livesconv - !byte 0 - !byte %00000010 - !byte %00001010 - !byte %00101010 - !byte %10101010 +!byte 0 +!byte %00000010 +!byte %00001010 +!byte %00101010 +!byte %10101010 !src "level.a" !src "player.a" !src "title_left.a" !src "title_right.a" + lander_pf2 !byte 0,0,0,0,192,224,240,48,240,240,32,112 +End 2 diff --git a/movement.a b/movement.a index d912bb9..c39bb83 100644 --- a/movement.a +++ b/movement.a @@ -1,54 +1,54 @@ - clc - lda Y0_LO - adc SPEEDY0_LO - sta Y0_LO - lda Y0_HI - adc SPEEDY0_HI - sta Y0_HI + clc + lda Y0_LO + adc SPEEDY0_LO + sta Y0_LO + lda Y0_HI + adc SPEEDY0_HI + sta Y0_HI - clc - lda X0_LO - adc SPEEDX0_LO - sta X0_LO - lda X0_HI - sta P0LASTX - adc SPEEDX0_HI - sta X0_HI + clc + lda X0_LO + adc SPEEDX0_LO + sta X0_LO + lda X0_HI + sta P0LASTX + adc SPEEDX0_HI + sta X0_HI - sec - sbc P0LASTX - asl - asl - asl - asl - clc - sta HMP0 + sec + sbc P0LASTX + asl + asl + asl + asl + clc + sta HMP0 - clc - lda Y1_LO - adc SPEEDY1_LO - sta Y1_LO - lda Y1_HI - adc SPEEDY1_HI - sta Y1_HI + clc + lda Y1_LO + adc SPEEDY1_LO + sta Y1_LO + lda Y1_HI + adc SPEEDY1_HI + sta Y1_HI - clc - lda X1_LO - adc SPEEDX1_LO - sta X1_LO - lda X1_HI - sta P1LASTX - adc SPEEDX1_HI - sta X1_HI + clc + lda X1_LO + adc SPEEDX1_LO + sta X1_LO + lda X1_HI + sta P1LASTX + adc SPEEDX1_HI + sta X1_HI - sec - sbc P1LASTX - asl - asl - asl - asl - clc - sta HMP1 + sec + sbc P1LASTX + asl + asl + asl + asl + clc + sta HMP1 - sta WSYNC - sta HMOVE + sta WSYNC + sta HMOVE diff --git a/sounds.a b/sounds.a index b310d27..c6d5ca7 100644 --- a/sounds.a +++ b/sounds.a @@ -1,30 +1,30 @@ !zone { ; Collision sound - lda COLLISION_SOUND - beq .nocol - ldy #8 - sty AUDF1 - ldy #15 - sty AUDC1 - sta AUDV1 - dec COLLISION_SOUND - jmp .sound + lda COLLISION_SOUND + beq .nocol + ldy #8 + sty AUDF1 + ldy #15 + sty AUDC1 + sta AUDV1 + dec COLLISION_SOUND + jmp .sound .nocol -; Final countdown - lda FINAL_COUNTDOWN - beq .nosound - tax - lsr - sta AUDV1 - lda #23 - sta AUDF1 - lda #12 - sta AUDC1 - dex - stx FINAL_COUNTDOWN - jmp .sound + ; Final countdown + lda FINAL_COUNTDOWN + beq .nosound + tax + lsr + sta AUDV1 + lda #23 + sta AUDF1 + lda #12 + sta AUDC1 + dex + stx FINAL_COUNTDOWN + jmp .sound .nosound - lda #0 - sta AUDC1 - sta AUDV1 + lda #0 + sta AUDC1 + sta AUDV1 .sound } diff --git a/title.a b/title.a index aedf86c..654f146 100644 --- a/title.a +++ b/title.a @@ -1,147 +1,147 @@ -title_loop + title !zone { +VSync +VBlankBegin - lda #4 - sta P0LIVES - sta P1LIVES - ldx #0 - ldy #0 + lda #4 + sta P0LIVES + sta P1LIVES + ldx #0 + ldy #0 - lda INPT4 - and INPT5 - and #$80 - bne .noplay - jsr game_init - jmp game_start + lda INPT4 + and INPT5 + and #$80 + bne .noplay + jsr game_init + jmp game_start .noplay - sty PF0 - sty PF1 - sty PF2 - lda #5 - sta CTRLPF + sty PF0 + sty PF1 + sty PF2 + lda #5 + sta CTRLPF +VBlankEnd .lander - sta WSYNC - lda lander_pf2,y - sta PF2 - inx - txa - lsr - lsr - lsr - tay - cpx #96 - bne .lander - ldx #0 + sta WSYNC + lda lander_pf2,y + sta PF2 + inx + txa + lsr + lsr + lsr + tay + cpx #96 + bne .lander + ldx #0 .break - sta WSYNC - lda #0 - sta CTRLPF - sta PF0 - sta PF1 - sta PF2 - inx - cpx #24 - bne .break - ldx #0 - ldy #0 + sta WSYNC + lda #0 + sta CTRLPF + sta PF0 + sta PF1 + sta PF2 + inx + cpx #24 + bne .break + ldx #0 + ldy #0 .title - sta WSYNC - txa - and #$f - ora #$50 - sta COLUPF - lda #0 - sta PF0 - lda title_left_pf1,y - sta PF1 - lda title_left_pf2,y - sta PF2 - nop - nop - lda title_right_pf0,y - sta PF0 - lda title_right_pf1,y - sta PF1 - lda title_right_pf2,y - sta PF2 - inx - txa - lsr - lsr - lsr - tay - cpx #80 - bne .title + sta WSYNC + txa + and #$f + ora #$50 + sta COLUPF + lda #0 + sta PF0 + lda title_left_pf1,y + sta PF1 + lda title_left_pf2,y + sta PF2 + nop + nop + lda title_right_pf0,y + sta PF0 + lda title_right_pf1,y + sta PF1 + lda title_right_pf2,y + sta PF2 + inx + txa + lsr + lsr + lsr + tay + cpx #80 + bne .title .final - sta WSYNC - lda #0 - sta PF0 - sta PF1 - sta PF2 - inx - cpx #PICTURE_LINES-96-24 - bne .final + sta WSYNC + lda #0 + sta PF0 + sta PF1 + sta PF2 + inx + cpx #PICTURE_LINES-96-24 + bne .final } + +OverscanBegin game_end - inc COLOR - lda COLOR - and #$f - ora WINNER_COLOR - sta COLUPF - jsr tick_music + inc COLOR + lda COLOR + and #$f + ora WINNER_COLOR + sta COLUPF + jsr tick_music +OverscanEnd -jmp title_loop +jmp title tick_music - dec MUSIC_TICK - bne noplay - jsr play_music - lda #MUSIC_SPEED - sta MUSIC_TICK + dec MUSIC_TICK + bne noplay + jsr play_music + lda #MUSIC_SPEED + sta MUSIC_TICK noplay - lda MUSIC_COUNTER - cmp #6 - beq novol - lda MUSIC_TICK - lsr - sta AUDV0 + lda MUSIC_COUNTER + cmp #6 + beq novol + lda MUSIC_TICK + lsr + sta AUDV0 novol - rts - + rts + play_music - ldy MUSIC_COUNTER - cpy #5 - beq music_off - cpy #6 - beq music_off - lda music_freq,y - sta AUDF0 - lda #1 - sta AUDC0 - lda #$f - sta AUDV0 - iny - sty MUSIC_COUNTER - rts + ldy MUSIC_COUNTER + cpy #5 + beq music_off + cpy #6 + beq music_off + lda music_freq,y + sta AUDF0 + lda #1 + sta AUDC0 + lda #$f + sta AUDV0 + iny + sty MUSIC_COUNTER + rts music_off - lda #0 - sta AUDF0 - sta AUDC0 - sta AUDV0 - cpy #6 - beq noenv - inc MUSIC_COUNTER + lda #0 + sta AUDF0 + sta AUDC0 + sta AUDV0 + cpy #6 + beq noenv + inc MUSIC_COUNTER noenv - rts + rts music_freq !byte 26,23,19,17,23 -