LDY #SCORE_HEIGHT .scoreloop STA WSYNC LDX #AMBAR+5 TYA SEC SBC #SCORE_HEIGHT-10 CMP #20 BCC .drawnumber LDX #WHITE .drawnumber STX COLUBK DEY BNE .scoreloop LDA #GREEN STA COLUBK ; Playfield Backfround color LDY #SCREEN_LINES-SCORE_HEIGHT .screenloop STA WSYNC ; Ball vertical position LDX #%00000010 ; Set ball enable bit TYA ; Move line number to A SEC ; Set carry before subtracting SBC BallVPos ; Subtract ball start line CMP #BALL_HEIGHT ; Test if line is in [0, BALL_HEIGHT-1] BCC .enableball ; yes -> enable ball LDX #%00000000 ; no -> clear ball enable bit .enableball STX ENABL ; Player 0 vertical position LDX #PLAYER_GFX TYA SEC SBC P0VPos CMP #PLAYER_HEIGHT BCC .enableP0 LDX #0 .enableP0 STX GRP0 ; Player 1 vertical position LDX #PLAYER_GFX TYA SEC SBC P1VPos CMP #PLAYER_HEIGHT BCC .enableP1 LDX #0 .enableP1 STX GRP1 DEY BNE .screenloop
Basicly its two loops, one for the score and the other one to draw the paddles and the ball, is this the correct way of doing it?














