Game Over Fixes - RetroKoH/S1Fixed GitHub Wiki

(Guide Credits in each section)
Source: ReadySonic
Commit: 3c1cdd3
Commit: 3c3905a
This covers three fixes related to the Game Over feature, two of which are handled in ReadySonic, along with a minor graphical bugfix that I provided.

Timing Issues

(By: MarkeyJester)
When Sonic dies, the game waits before showing the "Time Over" or "Game Over" message. How long it waits depends on Sonic's position; it waits until he's fallen past the bottom boundary of the Zone. This isn't ideal, because it means it'll show up almost instantly if he dies near the bottom of the Zone, but takes much more time if he dies near the top. It also doesn't check properly; it treats the value as if it were unsigned, meaning the message will appear if Sonic goes off the top of the Zone, too, which is wrong. We simply need to change the variable that's being checked, along with the comparative instruction being used. In _incObj\Sonic (part 2).asm, at GameOver:, change these lines:

GameOver:
!	move.w	(v_screenposy).w,d0	; variable changed from v_limitbtm2
	addi.w	#$100,d0
	cmp.w	obY(a0),d0
!	bge.w	locret_13900		; instruction changed from bcc.w

This will fix the timing issues.

Game Over When Drowning Bugfix

(By: Mercury)
If Sonic gets a Game Over after drowning, the flag that prevents the background from scrolling is set. Since it doesn't reset on the Title Screen, that means the scrolling background will be frozen. Fixing this is extremely simple. In sonic.asm, at Tit_LoadText:, add this line:

Tit_LoadText:
	move.w	(a5)+,(a6)
	dbf	d1,Tit_LoadText		; load level select font
+	move.b	#0,(f_nobgscroll).w

Game Over Sprite Flicker

(By: RetroKoH)
This one is extremely minor, but for a brief moment as the GAME/TIME and OVER sprites meet in the middle of the screen, the sprites flicker. This is because for one brief instance, their code does not call DisplaySprite, allowing them to appear on screen. To fix this, open _incObj\39 Game Over.asm and find Over_SetWait:. Simply replace the rts with a branch to DisplaySprite, like so:

; ===========================================================================

Over_SetWait:
		move.w	#720,obTimeFrame(a0)	; set time delay to 12 seconds
		addq.b	#2,obRoutine(a0)
!		bra.w	DisplaySprite	
; ===========================================================================