summaryrefslogtreecommitdiff
path: root/engine/pinball_game/ball_loss/ball_loss_seel_bonus.asm
blob: 551aaf42ca2865b431e56939566d4b9f05723530 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
HandleBallLossSeelBonus: ; 0xe08b
	xor a
	ld [wd64e], a
	ld a, [wFlippersDisabled]
	and a
	jr z, .flippersEnabled
	ld a, [wCompletedBonusStage]
	and a
	jr z, .asm_e0b8
.flippersEnabled
	ld a, [wd793]
	cp $14
	jr nc, .asm_e0b8
	cp $5
	jr c, .asm_e0aa
	sub $4
	jr .asm_e0ab

.asm_e0aa
	xor a
.asm_e0ab
	ld [wd793], a
	callba Func_262f4
.asm_e0b8
	ld a, [wCurrentStageBackup]
	ld hl, wCurrentStage
	cp [hl]
	ret z
	ld a, [wd794]
	cp $0
	jr nz, .asm_e0c8
	ret

.asm_e0c8
	lb de, $00, $02
	call PlaySoundEffect
	xor a
	ld [wTimerActive], a
	ld [wTimerActive], a ; duplicate instruction
	ld [wGoingToBonusStage], a
	ld a, $1
	ld [wReturningFromBonusStage], a
	ld a, $2
	ld [wd4c8], a
	xor a
	ld [wDisableHorizontalScrollForBallStart], a
	ld [wd794], a
	ld a, [wCompletedBonusStage]
	and a
	ret nz
	call FillBottomMessageBufferWithBlackTile
	call EnableBottomText
	ld hl, wScrollingText3
	ld de, EndSeelStageText
	call LoadScrollingText
	ret