Jump to content
IGNORED

Ball Object has holes in it


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...