Jump to content



0

Ball Object has holes in it


3 replies to this topic

#1 Primordial Ooze OFFLINE  

Primordial Ooze

    Dragonstomper

  • 504 posts
  • Quacker Blaster Lead Programmer
  • Location:United States of America

Posted Sat Mar 28, 2009 9:52 AM

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

Attached Files



#2 Wickeycolumbus OFFLINE  

Wickeycolumbus

    River Patroller

  • 4,063 posts
  • Location:Michigan

Posted Sat Mar 28, 2009 10:28 AM

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

Attached Files



#3 Nukey Shay ONLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Sat Mar 28, 2009 11:35 AM

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


#4 Nukey Shay ONLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Sat Mar 28, 2009 11:43 AM

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).




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users