Primordial Ooze Posted March 28, 2009 Share Posted March 28, 2009 I have started writing my remake of pong tentitivly called 6502Pong. I managed to get the player paddles to show onscreen, but for some reason the ball is drawn, it seems to have holes in them. I double checked my assembly code and everything seems to be in order. Any help would be greatly appreciated. Sincerely, 6502Pong 6502Pong.zip Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted March 28, 2009 Share Posted March 28, 2009 I found the problem and fixed it for you ldx #0 ;get X ready to disable Ball object ;changed from lda to ldx ; sta ENABL ; removed this line ; if the visibleballline is non zero, lda visibleballline ; if the visibleballline is zero beq FinishBall ; don't draw the ball lda #2 ; otherwise set the accumulator to 2 sta ENABL ; and draw the ball dec visibleballline ; and decrement the visibleballline by 1 .byte $2c ;skip over next two bytes. Added this line FinishBall stx ENABL ;this 2 byte instruction is skipped if ;ball is still drawing. changed from sta to stx 6502Pong.zip Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted March 28, 2009 Share Posted March 28, 2009 It can be simplified further, since the FinishBall tag is only branched to when visibleballline is zero (and subsequently, not drawing the ball). There is a 6-cycle difference between the two cases tho...but that doesn't matter here. SkipActivateBall lda visibleballline ; if the visibleballline is zero beq FinishBall ; don't draw the ball lda #2 ; otherwise set the accumulator to 2 dec visibleballline ; and decrement the visibleballline by 1 FinishBall sta ENABL ; enable/disable the ball ; if the visibleballline is non zero, ; we're drawing it Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted March 28, 2009 Share Posted March 28, 2009 BTW is there a reason for using 8-bit sprite GFX for the players? You could make a shorter kernel by using the missiles instead (and resetting the stack pointer to the missiles and ball to enable/disable them). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.