Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1792 | yogev_ezra | 1 | ;--------------------------------------------------------------------- |
2 | confirmation_action: |
||
3 | mov [work_confirmation],0 |
||
4 | mov [work_confirmation_yes],0 |
||
5 | jmp .red |
||
6 | .red_1: |
||
7 | call draw_window |
||
8 | .red: |
||
9 | call draw_confirmation_button |
||
10 | call draw_confirmation_menu |
||
11 | .still: |
||
12 | mcall 10 |
||
13 | cmp eax,1 |
||
14 | je .red_1 |
||
15 | cmp eax,2 |
||
16 | je key_menu_confirmation |
||
17 | cmp eax,3 |
||
18 | jne .still |
||
19 | mcall 17 |
||
20 | cmp ah,161 |
||
21 | je .no_del |
||
22 | cmp ah,160 |
||
23 | je .del |
||
24 | cmp ah,1 |
||
25 | jne .still |
||
26 | mcall -1 |
||
27 | .del: |
||
28 | mov [work_confirmation_yes],1 |
||
29 | .no_del: |
||
30 | call draw_window |
||
31 | .ret: |
||
32 | ret |
||
33 | ;--------------------------------------------------------------------- |
||
34 | draw_confirmation_button: |
||
35 | mov ecx,[window_high] |
||
36 | mov ebx,[window_width] |
||
37 | shr ecx,1 |
||
38 | shr ebx,1 |
||
39 | sub ebx,45 |
||
40 | shl ecx,16 |
||
41 | shl ebx,16 |
||
42 | mov cx,15 |
||
43 | mov bx,40 |
||
44 | mov esi,0xffffff |
||
45 | mov edx,0x40000000+160 |
||
46 | mov eax,8 |
||
47 | int 0x40 |
||
48 | add ebx,50 shl 16 |
||
49 | inc edx |
||
50 | int 0x40 |
||
51 | ret |
||
52 | ;--------------------------------------------------------------------- |
||
53 | draw_confirmation_menu: |
||
54 | mov ecx,[window_high] |
||
55 | mov ebx,[window_width] |
||
56 | shr ecx,1 |
||
57 | shr ebx,1 |
||
58 | sub ecx,22 |
||
59 | sub ebx,60 |
||
60 | shl ecx,16 |
||
61 | shl ebx,16 |
||
62 | mov cx,44 |
||
63 | mov bx,120 |
||
64 | mcall 13, , ,0x6060ff ;0xff |
||
65 | push ebx ecx |
||
66 | add ebx,15 shl 16 |
||
67 | add ecx,22 shl 16 |
||
68 | mov bx,40 |
||
69 | mov cx,15 |
||
70 | mov edx,0 |
||
71 | push ebx ecx |
||
72 | cmp [work_confirmation],0 |
||
73 | jne @f |
||
74 | add ebx,50 shl 16 |
||
75 | @@: |
||
76 | int 0x40 |
||
77 | add ecx,1 shl 16 |
||
78 | add ebx,1 shl 16 |
||
79 | mov bx,38 |
||
80 | mov cx,13 |
||
81 | mov edx,0x6060ff |
||
82 | int 0x40 |
||
83 | pop ecx ebx |
||
84 | mov edx,0xff0000 |
||
85 | cmp [work_confirmation],0 |
||
86 | je @f |
||
87 | add ebx,50 shl 16 |
||
88 | mov edx,0xaa00 |
||
89 | @@: |
||
90 | int 0x40 |
||
91 | pop ecx ebx |
||
92 | shr ecx,16 |
||
93 | mov bx,cx |
||
94 | add ebx,15 shl 16+5 |
||
95 | mcall 4, ,0x90ffffff,[confirmation_type] |
||
96 | add ebx,7 shl 16+20 |
||
97 | mov edx,type_yes |
||
98 | int 0x40 |
||
99 | add ebx,56 shl 16 |
||
100 | mov edx,type_no |
||
101 | int 0x40 |
||
102 | ret |
||
103 | ;--------------------------------------------------------------------- |
||
104 | key_menu_confirmation: |
||
105 | mcall 2 |
||
106 | cmp [extended_key],1 |
||
107 | je .extended_key |
||
108 | test al, al |
||
109 | jnz .end_1 |
||
110 | cmp ah, 0xE0 |
||
111 | jne @f |
||
112 | .end_1: |
||
113 | jmp confirmation_action.still |
||
114 | @@: |
||
115 | cmp ah,75 |
||
116 | je confirmation_key_75.1 |
||
117 | cmp ah,77 |
||
118 | je confirmation_key_75.1 |
||
119 | cmp ah,28 |
||
120 | je confirmation_key_28.1 |
||
121 | .end: |
||
122 | cmp ah,1 |
||
123 | jne confirmation_action.still |
||
124 | ret |
||
125 | ;--------------------------------------------------------------------- |
||
126 | .extended_key: |
||
127 | mov [extended_key],0 |
||
128 | confirmation_key_75: |
||
129 | cmp ah,75 ;arrow left |
||
130 | je .1 |
||
131 | cmp ah,77 ; arrow right |
||
132 | jne confirmation_key_28 |
||
133 | .1: |
||
134 | dec [work_confirmation] |
||
135 | and [work_confirmation],1 |
||
136 | jmp confirmation_action.red |
||
137 | confirmation_key_28: |
||
138 | cmp ah,28 ; Enter |
||
139 | jne confirmation_action.still |
||
140 | .1: |
||
141 | cmp [work_confirmation],0 |
||
142 | jne @f |
||
143 | mov [work_confirmation_yes],1 |
||
144 | @@: |
||
145 | ret |
||
146 | ;--------------------------------------------------------------------- |