-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelp.asm
More file actions
112 lines (88 loc) · 2.03 KB
/
Copy pathhelp.asm
File metadata and controls
112 lines (88 loc) · 2.03 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
DATASEG
HELPPAGE db "helpf.bmp", 0
helppsize dw 320, 200
CODESEG
; ==============================
; Description: Help page first-run drawer.
; Example:
; call DrawHelpPage
; ==============================
proc DrawHelpPage
call clearvideo
assetBig HELPPAGE, 0, 0
ret
endp DrawHelpPage
; ======================================================
; Description: Help page keypress handler.
; Input : (By order) [1] KeyPressedInLSB.
; Example:
; push KeyPressedInLSB
; call HelpKeyPress
; ======================================================
proc HelpKeyPress
push bp
mov bp, sp
pushh
; -------------------
; Stack State:
; | [bp + 4] |
; | KeyPressedInLSB |
; -------------------
mov ax, [bp+4]
cmp al, 'q'
je @@exit_sign
jmp @@end
@@exit_sign:
mov [current_page], 0
jmp @@end
@@end:
popp
pop bp
ret 2
endp HelpKeyPress
; =============================================================
; Description: Help page left click handler.
; Input : (By order) [1] xCoord, [2] yCoord.
; Example:
; push xCoord
; push yCoord
; call HelpLeftClick
; =============================================================
proc HelpLeftClick
push bp
mov bp, sp
pushh
; -----------------------
; Stack State:
; | [bp + 4] | [bp + 6] |
; | yCoord | xCoord |
; -----------------------
mov cx, [bp+6]
mov dx, [bp+4]
popp
pop bp
ret 4
endp HelpLeftClick
; =============================================================
; Description: Help page right click handler.
; Input : (By order) [1] xCoord, [2] yCoord.
; Example:
; push xCoord
; push yCoord
; call HelpRightClick
; =============================================================
proc HelpRightClick
push bp
mov bp, sp
pushh
; -----------------------
; Stack State:
; | [bp + 4] | [bp + 6] |
; | yCoord | xCoord |
; -----------------------
mov cx, [bp+6]
mov dx, [bp+4]
popp
pop bp
ret 4
endp HelpRightClick