All pastes #1309837 Raw Edit

Anonymous

public text v1 · immutable
#1309837 ·published 2009-01-16 05:23 UTC
rendered paste body
PART 1:

; ---------------------------------------------------------------------------
; Sprite mappings - SCORE, TIME, RINGS
; ---------------------------------------------------------------------------
Map_obj21:
		incbin	_maps/sfhud.bin




PART 2:

Hud_ChkTime:
		tst.b	($FFFFFE1E).w	; does the time	need updating?
		beq.w	Hud_ChkLives	; if not, branch
		tst.w	($FFFFF63A).w	; is the game paused?
		bne.w	Hud_ChkLives	; if yes, branch
		lea	($FFFFFE22).w,a1
		cmpi.l	#$93B3B,(a1)+	; is the time 9.59?
		beq.w	TimeOver	; if yes, branch
		addq.b	#1,-(a1)
		jsr	centiseconds
		cmpi.b	#60,(a1)
		bcs.w	Hud_ChkLives
		move.b	#0,(a1)
		addq.b	#1,-(a1)
		cmpi.b	#60,(a1)
		bcs.w	loc_1C734
		move.b	#0,(a1)
		addq.b	#1,-(a1)
		cmpi.b	#9,(a1)
		bcs.w	loc_1C734
		move.b	#9,(a1)
centiseconds:
		move.l	a1,-(sp)
		moveq	#0,d0
		moveq	#0,d1
		move.b	($FFFFFE25).w,d1
		move.b	d1,d0
		divu.w	#3,d0
		mulu.w	#2,d0
		add.b	d0,d1
		sub.w	#1,d1
		bpl	notminus
		move.w	#0,d1
notminus:
		cmp.w	#100,d1
		blo.w	nothundred
		move.w	#99,d1
nothundred:
		cmp.b	#3,($FFFFFE25).w
		bne	notwrongcenti
		move.w	#5,d1
notwrongcenti:
		move.l	#$72E00003,d0
		jsr	Hud_Secs
		move.l	(sp)+,a1
		rts

loc_1C734:
		move.l	#$5E400003,d0
		moveq	#0,d1
		move.b	($FFFFFE23).w,d1 ; load	minutes
		bsr.w	Hud_Mins
		move.l	#$5EC00003,d0
		moveq	#0,d1
		move.b	($FFFFFE24).w,d1 ; load	seconds
		bsr.w	Hud_Secs

Hud_ChkLives:
		tst.b	($FFFFFE1C).w	; does the lives counter need updating?
		beq.s	Hud_ChkBonus	; if not, branch
		clr.b	($FFFFFE1C).w
		bsr.w	Hud_Lives

Hud_ChkBonus:
		tst.b	($FFFFF7D6).w	; do time/ring bonus counters need updating?
		beq.s	Hud_End		; if not, branch
		clr.b	($FFFFF7D6).w
		move.l	#$6E000002,($C00004).l
		moveq	#0,d1
		move.w	($FFFFF7D2).w,d1 ; load	time bonus
		bsr.w	Hud_TimeRingBonus
		moveq	#0,d1
		move.w	($FFFFF7D4).w,d1 ; load	ring bonus
		bsr.w	Hud_TimeRingBonus

Hud_End:
		rts
		
		
		
PART 3:

Ensure the sfhud.bin (or change the name to whatever) in included in the correct location.