-
Notifications
You must be signed in to change notification settings - Fork 0
/
pause.asm
87 lines (74 loc) · 1.69 KB
/
pause.asm
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
; PAUSE FUNCTION
;----------------------------------------------
pause.msg:
db white*&11,192,68
dm "PAUSED"
db eof
pause.msg2:
db pale_blue*&11,192,69
dm "PAUSED"
db eof
;----------------------------------------------
pause.start:
; Test for pause key pressed, run pause cycle if true
@test_pause:
@test_gs: ; Can't pause if game is over
ld a,(game_state)
cp gs.game_over
ret z
@test_esc: ; Test escape key
ld a,(keys.processed)
bit Escape,a
ret z
@pause:
call house.double_buffer.off
@blanking: ; Blank out playing grid
@loop:
call house.wait_frame_im2
call gs.blanker ; call blanking routine
jp c,@-loop
@reset_blanking_counter:
call gs.blanking.reset_counter
@print_msg: ; print pause message and hearts
call font.set_masked
ld hl,pause.msg2
call font.print_string.colHL
ld hl,pause.msg
call font.print_string.colHL
ld b,gfx.heart
ld hl,7774
call gfx.print_blockBHL
ld b,gfx.heart
ld hl,10102
call gfx.print_blockBHL
@sound_off: ; No sound for this part
di
ld d,28
xor a
call sfx.soundDABC
@wait_for_escape:
@wait:
call house.wait_frame
call keys.input
ld a,(keys.processed)
bit Escape,a
jp nz,@+end
bit RotateC,a
jp nz,@+end
bit RotateAC,a
jp nz,@+end
jr @-wait
@end:
@reset_screen:
call gfx.print_full_map1
ld hl,&3cbc
ld de,&54f4
xor a
call gfx.print_byte_rectHLDEA
call house.double_buffer.on
@sound_on:
ld d,28
ld a,1
call sfx.soundDABC
ei
jp main.loop