Rev 551 | Rev 1736 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
123 | diamond | 1 | ;--------------------------------------------------------------------- |
2 | ; |
||
3 | ; DOCPAK FOR MENUET v1.1 |
||
4 | ; Written in pure assembly by Ivushkin Andrey aka Willow |
||
5 | ; |
||
6 | ;--------------------------------------------------------------------- |
||
7 | |||
8 | FILE_COUNT=0 |
||
9 | DEF_FILE equ 'g' |
||
10 | |||
11 | macro embed_file fn |
||
12 | { |
||
13 | forward |
||
14 | local label,label2,label3 |
||
15 | dd label2-label |
||
16 | dd label-label3 |
||
17 | label3: |
||
18 | db fn |
||
19 | label: |
||
1735 | clevermous | 20 | file '%DOCDIR%' # fn |
123 | diamond | 21 | label2: |
22 | FILE_COUNT=FILE_COUNT+1 |
||
23 | } |
||
180 | heavyiron | 24 | appname equ 'Doc Pack' |
123 | diamond | 25 | use32 |
26 | org 0x0 |
||
27 | db 'MENUET01' ; 8 byte id |
||
28 | dd 0x01 ; header version |
||
29 | dd start ; start of code |
||
30 | dd I_END ; size of image |
||
31 | dd I_END+0x400 ; memory for app |
||
32 | dd I_END+0x400 ; esp |
||
33 | dd my_param , 0x0 ; I_Param , I_Icon |
||
485 | heavyiron | 34 | include '..\..\..\MACROS.INC' |
123 | diamond | 35 | |
36 | start: |
||
37 | cmp [my_param],0 |
||
38 | je red |
||
39 | cmp [my_param],'a' |
||
40 | jb .par_a |
||
41 | cmp [my_param],'z' |
||
42 | jbe .ok2 |
||
43 | .par_a: |
||
44 | mov [my_param],DEF_FILE |
||
45 | .ok2: |
||
46 | movzx ecx,[my_param] |
||
47 | mov [my_param],'*' |
||
48 | .open: |
||
49 | sub ecx,'a'-1 |
||
50 | mov edx,embedded |
||
51 | xor esi,esi |
||
52 | .list: |
||
53 | lea edx,[edx+esi+8] |
||
54 | mov esi,[edx-8] |
||
55 | add edx,[edx-4] |
||
56 | test esi,esi |
||
57 | jz .close |
||
58 | loop .list |
||
59 | push edx |
||
60 | ; convert number in esi to decimal representation |
||
61 | mov ecx, 10 |
||
62 | push -'0' |
||
63 | mov eax, esi |
||
64 | @@: |
||
65 | xor edx, edx |
||
66 | div ecx |
||
67 | push edx |
||
68 | test eax, eax |
||
69 | jnz @b |
||
70 | mov edi, fsize |
||
71 | @@: |
||
72 | pop eax |
||
73 | add al, '0' |
||
74 | stosb |
||
75 | jnz @b |
||
76 | mcall 70,fileinfo |
||
77 | mov ecx,eax |
||
78 | mcall 5,20 |
||
79 | pop edx |
||
80 | mcall 60,2 |
||
81 | cmp [my_param],'*' |
||
82 | jne still |
||
83 | .close: |
||
84 | mcall -1 |
||
85 | |||
86 | red: |
||
87 | mov [my_param],'a' |
||
180 | heavyiron | 88 | |
89 | mov eax,48 |
||
90 | mov ebx,3 |
||
91 | mov ecx,sc |
||
92 | mov edx,sizeof.system_colors |
||
485 | heavyiron | 93 | mcall |
180 | heavyiron | 94 | |
123 | diamond | 95 | mcall 12,1 |
180 | heavyiron | 96 | |
97 | xor eax,eax |
||
98 | mov ebx,220*65536+120 |
||
99 | mov ecx,30*65536+FILECOUNT*16+35 |
||
100 | mov edx,[sc.work] |
||
551 | spraid | 101 | or edx,0x34000000 |
485 | heavyiron | 102 | mov edi,title |
103 | mcall |
||
180 | heavyiron | 104 | |
123 | diamond | 105 | mov ecx,FILECOUNT |
180 | heavyiron | 106 | mov ebx,5 shl 16+100 |
107 | mov esi,[sc.work_button] |
||
108 | mov edi,5 shl 16+14 |
||
123 | diamond | 109 | mov edx,10 |
110 | mov eax,8 |
||
111 | .btnlp: |
||
112 | push ecx |
||
113 | mcall ,,edi |
||
114 | add edi,16 shl 16 |
||
115 | inc edx |
||
116 | pop ecx |
||
117 | loop .btnlp |
||
118 | mov ecx,FILECOUNT |
||
119 | mov edx,embedded |
||
120 | xor edi,edi |
||
180 | heavyiron | 121 | mov ebx,25 shl 16+8 |
123 | diamond | 122 | mov eax,4 |
123 | .list: |
||
124 | lea edx,[edx+edi+8] |
||
125 | mov edi,[edx-8] |
||
126 | pusha |
||
127 | sub ebx,15 shl 16 |
||
180 | heavyiron | 128 | mcall ,,0xff0000,my_param,1 |
123 | diamond | 129 | inc [my_param] |
130 | popa |
||
131 | push ecx |
||
180 | heavyiron | 132 | mcall ,,[sc.work_button_text],,[edx-4] |
123 | diamond | 133 | pop ecx |
134 | add edx,esi |
||
135 | add ebx,16 |
||
136 | loop .list |
||
137 | mcall 12,2 |
||
138 | |||
139 | still: |
||
140 | mcall 10 |
||
141 | cmp eax,1 |
||
142 | je red |
||
143 | cmp eax,2 |
||
144 | jne .nokey |
||
145 | mcall 2 |
||
146 | cmp ah,27 ;Esc |
||
147 | je start.close |
||
148 | cmp ah,'a' |
||
149 | jb still |
||
150 | cmp ah,'a'+FILECOUNT |
||
151 | jae still |
||
152 | jmp .cxax |
||
153 | .nokey: |
||
154 | mcall 17 |
||
155 | cmp ah,1 |
||
156 | je start.close |
||
157 | sub ah,10-'a' |
||
158 | .cxax: |
||
159 | movzx ecx,ah |
||
160 | jmp start.open |
||
161 | |||
485 | heavyiron | 162 | title db appname,0 |
123 | diamond | 163 | |
164 | fileinfo: |
||
165 | dd 7 |
||
166 | dd 0 |
||
167 | dd param |
||
180 | heavyiron | 168 | dd 0 ,0 |
539 | spraid | 169 | db '/sys/TINYPAD',0 |
123 | diamond | 170 | |
171 | param db '*' |
||
172 | fsize: |
||
173 | times 10 db '0' |
||
174 | db 0 |
||
175 | |||
176 | embedded: |
||
177 | |||
178 | ; Please use only filenames w/o path! |
||
179 | |||
180 | ; -- Start of embedding area ------ |
||
181 | embed_file 'README.TXT' ;a |
||
1735 | clevermous | 182 | if lang eq ru |
123 | diamond | 183 | embed_file 'GNU.TXT' ;b |
1735 | clevermous | 184 | else |
185 | embed_file 'COPYING.TXT' ;b |
||
186 | end if |
||
123 | diamond | 187 | embed_file 'HOT_KEYS.TXT' ;c |
188 | embed_file 'FASM.TXT' ;d |
||
189 | embed_file 'MTDBG.TXT' ;e |
||
1735 | clevermous | 190 | if lang eq ru |
123 | diamond | 191 | embed_file 'VRR_RUS.TXT' ;f |
192 | embed_file 'SYSFUNCR.TXT' ;g |
||
1735 | clevermous | 193 | embed_file 'STACK_RU.TXT' ;h |
194 | embed_file 'GROBFAR.TXT' ;i |
||
195 | else |
||
196 | embed_file 'VRR_ENG.TXT' ;f |
||
197 | embed_file 'SYSFUNCS.TXT' ;g |
||
198 | embed_file 'STACK.TXT' ;h |
||
199 | embed_file 'FARA.TXT' ;i |
||
200 | end if |
||
201 | embed_file 'KFAR_KEYS.TXT' ;j |
||
202 | embed_file 'INI.TXT' ;k |
||
123 | diamond | 203 | ; -- End of embedding area ------- |
204 | |||
205 | dd 0 |
||
206 | FILECOUNT = FILE_COUNT |
||
207 | |||
208 | if ~ FILECOUNT>0 |
||
209 | error 'No embedded files' |
||
210 | end if |
||
211 | |||
212 | my_param db 0 |
||
213 | rb 256 |
||
214 | I_END: |
||
180 | heavyiron | 215 | |
216 | sc system_colors |