Rev 485 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 485 | Rev 539 | ||
---|---|---|---|
1 | ; @RCHER macros and messages |
1 | ; @RCHER macros and messages |
2 | ; Written in pure assembler by Ivushkin Andrey aka Willow |
2 | ; Written in pure assembler by Ivushkin Andrey aka Willow |
3 | 3 | ||
4 | macro stop |
4 | macro stop |
5 | { |
5 | { |
6 | if SYS eq win & NO_STOPS eq 0 |
6 | if SYS eq win & NO_STOPS eq 0 |
7 | int3 |
7 | int3 |
8 | end if |
8 | end if |
9 | } |
9 | } |
10 | 10 | ||
11 | macro wait |
11 | macro wait |
12 | { |
12 | { |
13 | if ~ SYS eq win |
13 | if ~ SYS eq win |
14 | local .nodrw,.ex |
14 | local .nodrw,.ex |
15 | pusha |
15 | pusha |
16 | mcall 10 |
16 | mcall 10 |
17 | cmp eax,1 |
17 | cmp eax,1 |
18 | jne .nodrw |
18 | jne .nodrw |
19 | call draw_window |
19 | call draw_window |
20 | .nodrw: |
20 | .nodrw: |
21 | mcall 17 |
21 | mcall 17 |
22 | .ex: |
22 | .ex: |
23 | popa |
23 | popa |
24 | end if |
24 | end if |
25 | } |
25 | } |
26 | 26 | ||
27 | macro rbits dest,cnt |
27 | macro rbits dest,cnt |
28 | { |
28 | { |
29 | if ~ cnt eq |
29 | if ~ cnt eq |
30 | mov ecx,cnt |
30 | mov ecx,cnt |
31 | end if |
31 | end if |
32 | if dest eq 0 |
32 | if dest eq 0 |
33 | xor eax,eax |
33 | xor eax,eax |
34 | else |
34 | else |
35 | mov eax,dest |
35 | mov eax,dest |
36 | end if |
36 | end if |
37 | call read_bits |
37 | call read_bits |
38 | } |
38 | } |
39 | 39 | ||
40 | 40 | ||
41 | macro rep_err cond_ok, result, msg |
41 | macro rep_err cond_ok, result, msg |
42 | { |
42 | { |
43 | local .m |
43 | local .m |
44 | j#cond_ok .m |
44 | j#cond_ok .m |
45 | if ~ msg eq |
45 | if ~ msg eq |
46 | Msg msg |
46 | Msg msg |
47 | end if |
47 | end if |
48 | mov edx,result |
48 | mov edx,result |
49 | jmp .err |
49 | jmp .err |
50 | .m: |
50 | .m: |
51 | } |
51 | } |
52 | 52 | ||
53 | macro memcpy_esi dest, count,_add |
53 | macro memcpy_esi dest, count,_add |
54 | { |
54 | { |
55 | push esi |
55 | push esi |
56 | if ~ _add eq |
56 | if ~ _add eq |
57 | add esi,_add |
57 | add esi,_add |
58 | end if |
58 | end if |
59 | mov edi,dest |
59 | mov edi,dest |
60 | mov ecx,count |
60 | mov ecx,count |
61 | rep movsb |
61 | rep movsb |
62 | pop esi |
62 | pop esi |
63 | } |
63 | } |
64 | 64 | ||
65 | DebugPrint: |
65 | DebugPrint: |
66 | ; in: edx-asciiz string ptr |
66 | ; in: edx-asciiz string ptr |
67 | pusha |
67 | pusha |
68 | if SYS eq win |
68 | if SYS eq win |
69 | mov ecx,255 |
69 | mov ecx,255 |
70 | xor eax,eax |
70 | xor eax,eax |
71 | mov edi,edx |
71 | mov edi,edx |
72 | repne scasb |
72 | repne scasb |
73 | sub edi,edx |
73 | sub edi,edx |
74 | dec edi |
74 | dec edi |
75 | invoke WriteConsole,[cons],edx,edi,cparam1,NULL |
75 | invoke WriteConsole,[cons],edx,edi,cparam1,NULL |
76 | else |
76 | else |
77 | call debug_outstr |
77 | call debug_outstr |
78 | end if |
78 | end if |
79 | popa |
79 | popa |
80 | ret |
80 | ret |
81 | 81 | ||
82 | macro DebugPrintDec |
82 | macro DebugPrintDec |
83 | { |
83 | { |
84 | if SYS eq win |
84 | if SYS eq win |
85 | call int2str |
85 | call int2str |
86 | mov edx,os_work |
86 | mov edx,os_work |
87 | call DebugPrint |
87 | call DebugPrint |
88 | else |
88 | else |
89 | call debug_outdec |
89 | call debug_outdec |
90 | end if |
90 | end if |
91 | } |
91 | } |
92 | 92 | ||
93 | macro Newline |
93 | macro Newline |
94 | { |
94 | { |
95 | if SYS eq win |
95 | if SYS eq win |
96 | pusha |
96 | pusha |
97 | invoke WriteConsole,[cons],cr_lf,2,cparam1,NULL |
97 | invoke WriteConsole,[cons],cr_lf,2,cparam1,NULL |
98 | popa |
98 | popa |
99 | else |
99 | else |
100 | newline |
100 | newline |
101 | end if |
101 | end if |
102 | } |
102 | } |
103 | 103 | ||
104 | Msgcall: |
104 | Msgcall: |
105 | ; edx - msg number |
105 | ; edx - msg number |
106 | pusha |
106 | pusha |
107 | movzx edx,word[strs+edx*2] |
107 | movzx edx,word[strs+edx*2] |
108 | add edx,msgs |
108 | add edx,msgs |
109 | call DebugPrint |
109 | call DebugPrint |
110 | popa |
110 | popa |
111 | ret |
111 | ret |
112 | 112 | ||
113 | macro Msg num |
113 | macro Msg num |
114 | { |
114 | { |
115 | if ~ num eq edx |
115 | if ~ num eq edx |
116 | mov edx,num |
116 | mov edx,num |
117 | end if |
117 | end if |
118 | call Msgcall |
118 | call Msgcall |
119 | } |
119 | } |
120 | 120 | ||
121 | MSG_COUNT=0 |
121 | MSG_COUNT=0 |
122 | macro str_table [str] |
122 | macro str_table [str] |
123 | { |
123 | { |
124 | forward |
124 | forward |
125 | local label |
125 | local label |
126 | dw label-msgs |
126 | dw label-msgs |
127 | common |
127 | common |
128 | msgs: |
128 | msgs: |
129 | forward |
129 | forward |
130 | label db str,0 |
130 | label db str,0 |
131 | MSG_COUNT=MSG_COUNT+1 |
131 | MSG_COUNT=MSG_COUNT+1 |
132 | } |
132 | } |
133 | 133 | ||
134 | 134 | ||
135 | 135 | ||
136 | strs: |
136 | strs: |
137 | if language eq ru |
137 | if language eq ru |
138 | str_table \ |
138 | str_table \ |
139 | <'*** @RCHER - Deflate Unpacker ***',13,10>,\ ;0 |
139 | <'*** @RCHER - Deflate Unpacker ***',13,10>,\ ;0 |
140 | <'*** Copyright Wiland Inc., 2005 ***',13,10>,\ ;1 |
140 | <'*** Copyright Wiland Inc., 2005 ***',13,10>,\ ;1 |
141 | ' ©«®¢ ¢ à娢¥: ',\ ;2 |
141 | ' ©«®¢ ¢ à娢¥: ',\ ;2 |
142 | <'End of Directory ¤®á⨣ãâ',13,10>,\ ;3 |
142 | <'End of Directory ¤®á⨣ãâ',13,10>,\ ;3 |
143 | '¥â ä ©« á â ª¨¬ ®¬¥à®¬',\ ;4 |
143 | '¥â ä ©« á â ª¨¬ ®¬¥à®¬',\ ;4 |
144 | <'FindByNumber ',13,10>,\ ;5 |
144 | <'FindByNumber ',13,10>,\ ;5 |
145 | <'¥¢¥àë© ID ¡«®ª ää¬ ',13,10>,\ ;6 |
145 | <'¥¢¥àë© ID ¡«®ª ää¬ ',13,10>,\ ;6 |
146 | <'訡ª ¢ ª®¤ å ää¬ !',13,10>,\ ;7 |
146 | <'訡ª ¢ ª®¤ å ää¬ !',13,10>,\ ;7 |
147 | <13,10,' áç¥â â ¡«¨æë CRC32',13,10>,\ ;8 |
147 | <13,10,' áç¥â â ¡«¨æë CRC32',13,10>,\ ;8 |
148 | '.',\ ;9 |
148 | '.',\ ;9 |
149 | 'Adler32',\ ;10 |
149 | 'Adler32',\ ;10 |
150 | 'CRC32',\ ;11 |
150 | 'CRC32',\ ;11 |
151 | <' ¢¥à襮.',13,10>,\ ;12 |
151 | <' ¢¥à襮.',13,10>,\ ;12 |
152 | <' ©« ¨¬¥¥â ã«¥¢ãî ¤«¨ã, à ᯠª®¢ª ®â¬¥¥ .',13,10>,\ ;13 |
152 | <' ©« ¨¬¥¥â ã«¥¢ãî ¤«¨ã, à ᯠª®¢ª ®â¬¥¥ .',13,10>,\ ;13 |
153 | <'âà ï ¤«¨ ä ©« -¨áâ®ç¨ª . 訡ª ¢ ¨¬¥¨? ⬥ .',13,10>,\ ;14 |
153 | <'âà ï ¤«¨ ä ©« -¨áâ®ç¨ª . 訡ª ¢ ¨¬¥¨? ⬥ .',13,10>,\ ;14 |
154 | <'¥ GZIP à娢',13,10>,\ ;15 |
154 | <'¥ GZIP à娢',13,10>,\ ;15 |
155 | <'«¨èª®¬ ¡®«ì让 à §¬¥à ¢ë室®£® ä ©« ',13,10>,\ ;16 |
155 | <'«¨èª®¬ ¡®«ì让 à §¬¥à ¢ë室®£® ä ©« ',13,10>,\ ;16 |
156 | <"訡ª ¯à¨ à ᯠª®¢ª¥.",13,10>,\ ; 17 |
156 | <"訡ª ¯à¨ à ᯠª®¢ª¥.",13,10>,\ ; 17 |
157 | <'¥ à¨á㮪 PNG',13,10>,\ ; 18 |
157 | <'¥ à¨á㮪 PNG',13,10>,\ ; 18 |
158 | <13,10,'*¤'>,\ ;19 |
158 | <13,10,'*¤'>,\ ;19 |
159 | <13,10,'*á'>,\ ;20 |
159 | <13,10,'*á'>,\ ;20 |
160 | '¥®¦¨¤ ë© ª®¥æ ¡«®ª®¢ IDAT',\ ;21 |
160 | '¥®¦¨¤ ë© ª®¥æ ¡«®ª®¢ IDAT',\ ;21 |
161 | '¥ä¨«ìâà æ¨ï:',\ ;22 |
161 | '¥ä¨«ìâà æ¨ï:',\ ;22 |
162 | '¨«ìâàë: None ',\ ;23 |
162 | '¨«ìâàë: None ',\ ;23 |
163 | ' Sub ',\ ;24 |
163 | ' Sub ',\ ;24 |
164 | ' Up ',\ ;25 |
164 | ' Up ',\ ;25 |
165 | ' Avg ',\ ;26 |
165 | ' Avg ',\ ;26 |
166 | ' Paeth ',\ ;27 |
166 | ' Paeth ',\ ;27 |
167 | ' 訡®ª: ',\ ;28 |
167 | ' 訡®ª: ',\ ;28 |
168 | <'¥à¥ááâà®çë© PNG',13,10>,\ ;29 |
168 | <'¥à¥ááâà®çë© PNG',13,10>,\ ;29 |
169 | <'«®ª ¡¥§ ᦠâ¨ï',13,10>,\ ;30 |
169 | <'«®ª ¡¥§ ᦠâ¨ï',13,10>,\ ;30 |
170 | <'¨¯ 梥⠥ ¯®¤¤¥à¦¨¢ ¥âáï',13,10>,\ ;31 |
170 | <'¨¯ 梥⠥ ¯®¤¤¥à¦¨¢ ¥âáï',13,10>,\ ;31 |
171 | <'¢¥¤¨â¥ ¯ à®«ì ¤«ï § è¨ä஢ ®£® ä ©« :',13,10>,\ ;32 |
171 | <'¢¥¤¨â¥ ¯ à®«ì ¤«ï § è¨ä஢ ®£® ä ©« :',13,10>,\ ;32 |
172 | <'®¨áª ä ©« ...',13,10>,\ ;33 |
172 | <'®¨áª ä ©« ...',13,10>,\ ;33 |
173 | '¥ ¬®¤ã«ì SFX',\ ;34 |
173 | '¥ ¬®¤ã«ì SFX',\ ;34 |
174 | ' ¥¢¥à ! ',\ ;35 |
174 | ' ¥¢¥à ! ',\ ;35 |
175 | ' OK: ',\ ;36 |
175 | ' OK: ',\ ;36 |
176 | <' ¯¨áì OUT.TXT',13,10>,\ ;37 |
176 | <' ¯¨áì OUT.TXT',13,10>,\ ;37 |
177 | ' ',\ ;38 |
177 | ' ',\ ;38 |
178 | <'®¤£®â®¢ª ¨§®¡à ¦¥¨ï...',13,10>,\ ;39 |
178 | <'®¤£®â®¢ª ¨§®¡à ¦¥¨ï...',13,10>,\ ;39 |
179 | <'ª ¦¨â¥ "R" ¤«ï ®¡à ¡®âª¨ áëàëå ¤ ëå. ⬥ .',13,10>,\ ;40 |
179 | <'ª ¦¨â¥ "R" ¤«ï ®¡à ¡®âª¨ áëàëå ¤ ëå. ⬥ .',13,10>,\ ;40 |
180 | <'¥ å¢ â ¥â ¯ ¬ïâ¨! ⬥ .',13,10>,\ ; 41 |
180 | <'¥ å¢ â ¥â ¯ ¬ïâ¨! ⬥ .',13,10>,\ ; 41 |
181 | ' ',\ ; |
181 | ' ',\ ; |
182 | ' ',\ ; |
182 | ' ',\ ; |
183 | ' ',\ ; |
183 | ' ',\ ; |
184 | ' ',\ ; |
184 | ' ',\ ; |
185 | ' ',\ ; |
185 | ' ',\ ; |
186 | ' ',\ ; |
186 | ' ',\ ; |
187 | ' ',\ ; |
187 | ' ',\ ; |
188 | ' ',\ ; |
188 | ' ',\ ; |
189 | ' <- ¥¨§¢¥áâë© ¬¥â®¤ ᦠâ¨ï',\ ;50 |
189 | ' <- ¥¨§¢¥áâë© ¬¥â®¤ ᦠâ¨ï',\ ;50 |
190 | ' <- § è¨ä஢ ',\ ;51 |
190 | ' <- § è¨ä஢ ',\ ;51 |
191 | <'¥ ZIP à娢',13,10> ; 52 |
191 | <'¥ ZIP à娢',13,10> ; 52 |
192 | else |
192 | else |
193 | str_table \ |
193 | str_table \ |
194 | <'*** @RCHER - Deflate Unpacker ***',13,10>,\ ;0 |
194 | <'*** @RCHER - Deflate Unpacker ***',13,10>,\ ;0 |
195 | <'*** Copyright Wiland Inc., 2005 ***',13,10>,\ ;1 |
195 | <'*** Copyright Wiland Inc., 2005 ***',13,10>,\ ;1 |
196 | 'Files in archive: ',\ ;2 |
196 | 'Files in archive: ',\ ;2 |
197 | <'End of Directory reached',13,10>,\ ;3 |
197 | <'End of Directory reached',13,10>,\ ;3 |
198 | 'No file has this number',\ ;4 |
198 | 'No file has this number',\ ;4 |
199 | <'FindByNumber succeded',13,10>,\ ;5 |
199 | <'FindByNumber succeded',13,10>,\ ;5 |
200 | <'Invalid Huffman block ID',13,10>,\ ;6 |
200 | <'Invalid Huffman block ID',13,10>,\ ;6 |
201 | <'Error while getting Huffman codes!',13,10>,\ ;7 |
201 | <'Error while getting Huffman codes!',13,10>,\ ;7 |
202 | <13,10,'Rebuilding CRC32 table',13,10>,\ ;8 |
202 | <13,10,'Rebuilding CRC32 table',13,10>,\ ;8 |
203 | '.',\ ;9 |
203 | '.',\ ;9 |
204 | 'Adler32',\ ;10 |
204 | 'Adler32',\ ;10 |
205 | 'CRC32',\ ;11 |
205 | 'CRC32',\ ;11 |
206 | <'Job finished.',13,10>,\ ;12 |
206 | <'Job finished.',13,10>,\ ;12 |
207 | <'File of zero length, unpacking aborted.',13,10>,\ ;13 |
207 | <'File of zero length, unpacking aborted.',13,10>,\ ;13 |
208 | <'Source file has strange length, may be missing? Abort.',13,10>,\ ;14 |
208 | <'Source file has strange length, may be missing? Abort.',13,10>,\ ;14 |
209 | <'Not a GZIP archive',13,10>,\ ;15 |
209 | <'Not a GZIP archive',13,10>,\ ;15 |
210 | <'Destination file is too large for now',13,10>,\ ;16 |
210 | <'Destination file is too large for now',13,10>,\ ;16 |
211 | <"Can't unpack content.",13,10>,\ ; 17 |
211 | <"Can't unpack content.",13,10>,\ ; 17 |
212 | <'Not a PNG image',13,10>,\ ; 18 |
212 | <'Not a PNG image',13,10>,\ ; 18 |
213 | <13,10,'*d'>,\ ;19 |
213 | <13,10,'*d'>,\ ;19 |
214 | <13,10,'*s'>,\ ;20 |
214 | <13,10,'*s'>,\ ;20 |
215 | 'Unexpected end of IDAT chunks',\ ;21 |
215 | 'Unexpected end of IDAT chunks',\ ;21 |
216 | 'Unfiltering:',\ ;22 |
216 | 'Unfiltering:',\ ;22 |
217 | 'Filters: None ',\ ;23 |
217 | 'Filters: None ',\ ;23 |
218 | ' Sub ',\ ;24 |
218 | ' Sub ',\ ;24 |
219 | ' Up ',\ ;25 |
219 | ' Up ',\ ;25 |