Help to Remove Hurt Flicker [Resolved]

hairycarrot

New member
I see this part in the code. I tried removing it but I'm not sure it really stopped the flickering. What does the last part mean about the y value?
Code:
HandleDrawingSprites:
	;;; HANDLE HURT FLICKER
	;;;;; if you don't want your objects to flicker when hurt, delete this block
	;;; also look down for another block when drawing y value

I looked for a part with a reference to flicker and a y value, but I don't know what lines it was really talking about. Is it another whole code block or just a few specific lines?
 

hairycarrot

New member
Ok. I found it.

The first part was 18 lines.
Code:
HandleDrawingSprites:
;	;;; HANDLE HURT FLICKER
;	;;;;; if you don't want your objects to flicker when hurt, delete this block
;	;;; also look down for another block when drawing y value
;	LDA Object_status,x
;	AND #HURT_STATUS_MASK
;	BEQ ignoreHurtFlicker
;	LDA vBlankTimer
;	AND #%00000001
;	BEQ ignoreHurtFlicker
;	LDA #$01
;	STA DrawFlags ;; if DrawFlags is 1, do flicker.  If 0, do not.
;	JMP gotFlickerValue
;ignoreHurtFlicker:
;	LDA #$00
;	STA DrawFlags
;gotFlickerValue:
;	;;;;;;;;;;;;;;;;;;;;;;;;;;;
;	;;; END HANDLE HURT FLICKER ;commented 1-19

This is the results of testing these lines.
Code:
DrawSpritesForThisObjectLoop: ;cmmented 144-147 ; 150-155 caused badness
;	LDA DrawFlags ;; are we flickering?
;	BEQ noFlicker
;	LDA #$fe
;	JMP drawTileOffScreen_flicker
noFlicker:
	LDA temp2 ;; LDA the y value, not drawn off screen
drawTileOffScreen_flicker:
	STA SpriteRam,x ;; store it to the y value byte for this sprite
	INX ;; increase the index to draw to
	LDA (sprite_pointer),y  ;; load the table pointer to the tile number
	CLC
	ADC tileset_offset

If you want to see the result - it's here.
https://youtu.be/gUSwwCx2DRE
You can also see the next part I broke with player health. There is a solution on the boards I have to put in.
 
Top Bottom