Update hud error

So with a bunch of help from Cargo, I have a nearly flawless "Easter Egg" Script,
however the Hud only updates after moving to the next screen.

Before:

CDqp04V.png



When i add Hud update code i get this:
EQNUBP9.png





Here is the script.

Code:
LDA Object_vulnerability,x
    AND #%00100000 ; Action Step Flag #5 turned on?
    BEQ usr_skipCounterAdd    ; if FALSE then skip counting
	
	LDA Object_vulnerability, x
	AND #%01000000
	BNE usr_skipCounterAdd
    
    ; Increment cat counter by 1
    CLC ; Clear carry flag
    LDA #$01 ; Load decimal value 1 into the accumulator
    ADC myMoney ; Add accumulator with the value contained in myMoney
    STA myMoney ; Store the result of the arithmetic in myMoney 
	
	
    
	LDA Object_vulnerability, x
	ORA #%01000000
	STA Object_vulnerability, x 
  
	LDA_DrawHudBytes
	ora #HUD_myMoney
	STA DrawHudBytes
	
usr_skipCounterAdd:

Thanks in advance for any help.
 

chronosv2

New member
It looks like you're missing part of the HUD update code -- there's a byte you write to for the HUD draw counter. I don't see that here.
Code:
		LDA #$02 ;; amount of score places?
		STA hudElementTilesToLoad
		LDA DrawHudBytes
		ORA #HUD_myMoney
		STA DrawHudBytes
 
chronosv2 said:
It looks like you're missing part of the HUD update code -- there's a byte you write to for the HUD draw counter. I don't see that here.
Code:
		LDA #$02 ;; amount of score places?
		STA hudElementTilesToLoad
		LDA DrawHudBytes
		ORA #HUD_myMoney
		STA DrawHudBytes

Thanks a bunch, I really appreciate it!
 
chronosv2 said:
It looks like you're missing part of the HUD update code -- there's a byte you write to for the HUD draw counter. I don't see that here.

The code you gave reduced the amount of glitching, but didn't fix it.

Thanks anyway though.
 

dale_coop

Moderator
Staff member
Another thing... you should replace your :
Code:
    CLC ; Clear carry flag
    LDA #$01 ; Load decimal value 1 into the accumulator
    ADC myMoney ; Add accumulator with the value contained in myMoney
    STA myMoney ; Store the result of the arithmetic in myMoney
with:

Code:
	AddValue #$02, myMoney, #$01, #$00
 
Top Bottom