Fix the HUD blinking
From Sonic Retro
(Original guide by Quickman)
There's a bug in the HUD in Sonic 1 - the timer is supposed to blink if there's less than a minute left to go, which it does if you have no rings, but as soon as you collect a ring it stops blinking. That's silly, so let's fix it.
Hivebrain's 2005 disassembly
(Addition by Vanya)
Go to "Obj21_Flash:" and replace this:
Obj21_Flash: ; XREF: Obj21_Main
tst.w ($FFFFFE20).w ; do you have any rings?
beq.s Obj21_Flash2 ; if not, branch
clr.b $1A(a0) ; make all counters yellow
jmp DisplaySprite
; ===========================================================================
Obj21_Flash2:
moveq #0,d0
btst #3,($FFFFFE05).w
bne.s Obj21_Display
addq.w #1,d0 ; make ring counter flash red
cmpi.b #9,($FFFFFE23).w ; have 9 minutes elapsed?
bne.s Obj21_Display ; if not, branch
addq.w #2,d0 ; make time counter flash red
Obj21_Display:
move.b d0,$1A(a0)
jmp DisplaySprite
with this:
Obj21_Flash: ; XREF: Obj21_Main
moveq #0,d0
btst #3,($FFFFFE05).w
bne.s Obj21_Display
tst.w ($FFFFFE20).w ; do you have any rings?
bne.s Obj21_Flash2 ; if not, branch
addq.w #1,d0 ; make ring counter flash red
; ===========================================================================
Obj21_Flash2:
cmpi.b #9,($FFFFFE23).w ; have 9 minutes elapsed?
bne.s Obj21_Display ; if not, branch
addq.w #2,d0 ; make time counter flash red
Obj21_Display:
move.b d0,$1A(a0)
jmp DisplaySprite
SVN/GitHub disassembly
Open _incObj/21 HUD.asm and replace this:
HUD_Flash: ; Routine 2
tst.w (v_rings).w ; do you have any rings?
beq.s @norings ; if not, branch
clr.b obFrame(a0) ; make all counters yellow
jmp DisplaySprite
; ===========================================================================
@norings:
moveq #0,d0
btst #3,(v_framebyte).w
bne.s @display
addq.w #1,d0 ; make ring counter flash red
cmpi.b #9,(v_timemin).w ; have 9 minutes elapsed?
bne.s @display ; if not, branch
addq.w #2,d0 ; make time counter flash red
@display:
move.b d0,obFrame(a0)
jmp DisplaySprite
with this:
HUD_Flash: ; Routine 2
moveq #0,d0
btst #3,(v_framebyte).w
bne.s @display
tst.w (v_rings).w ; do you have any rings?
bne.s @norings ; if so, branch
addq.w #1,d0 ; make ring counter flash red
; ===========================================================================
@norings:
cmpi.b #9,(v_timemin).w ; have 9 minutes elapsed?
bne.s @display ; if not, branch
addq.w #2,d0 ; make time counter flash red
@display:
move.b d0,obFrame(a0)
jmp DisplaySprite
|Fix the HUD Blinking]]