Rev 205 | Rev 503 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 205 | Rev 485 | ||
---|---|---|---|
Line 22... | Line 22... | ||
22 | dd 0x10000 ; memory for app |
22 | dd 0x10000 ; memory for app |
23 | dd 0x10000 ; esp |
23 | dd 0x10000 ; esp |
24 | dd param_area , 0x0 ; I_Param , I_Icon |
24 | dd param_area , 0x0 ; I_Param , I_Icon |
Line 25... | Line 25... | ||
25 | 25 | ||
26 | include 'lang.inc' |
26 | include 'lang.inc' |
27 | include 'macros.inc' ; very useful stuff for MeOS |
27 | include '..\..\..\macros.inc' ; very useful stuff for MeOS |
Line 28... | Line 28... | ||
28 | include 'ascl.inc' |
28 | include 'ascl.inc' |
Line 29... | Line 29... | ||
29 | 29 | ||
Line 80... | Line 80... | ||
80 | mov eax,4 |
80 | mov eax,4 |
81 | mov ebx,20*65536+70 |
81 | mov ebx,20*65536+70 |
82 | mov ecx,0x10ff0000 |
82 | mov ecx,0x10ff0000 |
83 | lea edx,[errors+ebp] |
83 | lea edx,[errors+ebp] |
84 | mov esi,43 ;[errors+edi*8+4] |
84 | mov esi,43 ;[errors+edi*8+4] |
85 | int 0x40 |
85 | mcall |
86 | jmp dexit |
86 | jmp dexit |
Line 87... | Line 87... | ||
87 | 87 | ||
88 | ;closep: |
88 | ;closep: |
89 | ; or eax,-1 ; close program |
89 | ; or eax,-1 ; close program |
Line 90... | Line 90... | ||
90 | ; int 0x40 |
90 | ; mcall |
91 | 91 | ||
92 | 92 | ||
Line 122... | Line 122... | ||
122 | mov ebx,[source_attr+32] |
122 | mov ebx,[source_attr+32] |
123 | push ebx ; save file size |
123 | push ebx ; save file size |
124 | lea ecx,[ebx+0x10000] ; size of memory needed = 0x10000+filesize |
124 | lea ecx,[ebx+0x10000] ; size of memory needed = 0x10000+filesize |
125 | mov eax,64 ; func 64 |
125 | mov eax,64 ; func 64 |
126 | mov ebx,1 ; resize application memory |
126 | mov ebx,1 ; resize application memory |
127 | int 0x40 |
127 | mcall |
128 | pop ebx ; restore filesize |
128 | pop ebx ; restore filesize |
Line 129... | Line 129... | ||
129 | 129 | ||
130 | ; check if alloc function failed |
130 | ; check if alloc function failed |
131 | test eax,eax ; non-zero value means error |
131 | test eax,eax ; non-zero value means error |
Line 137... | Line 137... | ||
137 | ; save number of blocks to source_info |
137 | ; save number of blocks to source_info |
138 | mov [source_info.bytes], ebx |
138 | mov [source_info.bytes], ebx |
139 | ; read the source file |
139 | ; read the source file |
140 | mov eax,70 |
140 | mov eax,70 |
141 | mov ebx,source_info |
141 | mov ebx,source_info |
142 | int 0x40 |
142 | mcall |
Line 143... | Line 143... | ||
143 | 143 | ||
144 | ; ebx = number of read bytes = file size |
144 | ; ebx = number of read bytes = file size |
145 | ; save loaded file |
145 | ; save loaded file |
146 | mov [dest_info.bytes],ebx ; file size in bytes |
146 | mov [dest_info.bytes],ebx ; file size in bytes |
147 | mov eax,70 |
147 | mov eax,70 |
148 | mov ebx,dest_info |
148 | mov ebx,dest_info |
Line 149... | Line 149... | ||
149 | int 0x40 |
149 | mcall |
150 | 150 | ||
151 | ; check if 58 function failed |
151 | ; check if 58 function failed |
152 | test eax,eax |
152 | test eax,eax |
Line 160... | Line 160... | ||
160 | 160 | ||
161 | ; return to the initial amount of memory |
161 | ; return to the initial amount of memory |
162 | mov eax,64 |
162 | mov eax,64 |
163 | mov ebx,1 |
163 | mov ebx,1 |
164 | mov ecx,0x10000 |
164 | mov ecx,0x10000 |
Line 165... | Line 165... | ||
165 | int 0x40 |
165 | mcall |
166 | 166 | ||
Line 175... | Line 175... | ||
175 | 175 | ||
Line 176... | Line 176... | ||
176 | draw_window: |
176 | draw_window: |
177 | 177 | ||
178 | mov eax,12 ; function 12:tell os about windowdraw |
178 | mov eax,12 ; function 12:tell os about windowdraw |
Line 179... | Line 179... | ||
179 | mov ebx,1 ; 1, start of draw |
179 | mov ebx,1 ; 1, start of draw |
180 | int 0x40 |
180 | mcall |
181 | 181 | ||
182 | ; DRAW WINDOW |
182 | ; DRAW WINDOW |
183 | xor eax,eax ; function 0 : define and draw window |
183 | xor eax,eax ; function 0 : define and draw window |
184 | mov ebx,160*65536+415 ; [x start] *65536 + [x size] |
184 | mov ebx,160*65536+415 ; [x start] *65536 + [x size] |
Line 185... | Line 185... | ||
185 | mov ecx,160*65536+90 ; [y start] *65536 + [y size] |
185 | mov ecx,160*65536+90 ; [y start] *65536 + [y size] |
186 | mov edx,0x03DDDDDD ; color of work area RRGGBB |
186 | mov edx,0x03DDDDDD ; color of work area RRGGBB |
187 | int 0x40 |
187 | mcall |
188 | 188 | ||
189 | ; WINDOW LABEL |
189 | ; WINDOW LABEL |
190 | mov eax,4 ; function 4 : write text to window |
190 | mov eax,4 ; function 4 : write text to window |
191 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] |
191 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] |
Line 192... | Line 192... | ||
192 | mov ecx,0x10ffffff ; color of text RRGGBB |
192 | mov ecx,0x10ffffff ; color of text RRGGBB |
193 | mov edx,labelt ; pointer to text beginning |
193 | mov edx,labelt ; pointer to text beginning |
194 | mov esi,labellen-labelt ; text length |
194 | mov esi,labellen-labelt ; text length |
195 | int 0x40 |
195 | mcall |
196 | 196 | ||
197 | mov eax,8 |
197 | mov eax,8 |
198 | mov ebx,105*65536+290 |
198 | mov ebx,105*65536+290 |
199 | mov ecx,33*65536+12 |
199 | mov ecx,33*65536+12 |
200 | mov edx,4 |
200 | mov edx,4 |
201 | mov esi,0xEBEBEB |
201 | mov esi,0xEBEBEB |
202 | int 0x40 |
202 | mcall |
Line 203... | Line 203... | ||
203 | mov ebx,105*65536+290 |
203 | mov ebx,105*65536+290 |
204 | mov ecx,49*65536+12 |
204 | mov ecx,49*65536+12 |
205 | mov edx,5 |
205 | mov edx,5 |
206 | mov esi,0xEBEBEB |
206 | mov esi,0xEBEBEB |
Line 220... | Line 220... | ||
220 | xor ecx,ecx |
220 | xor ecx,ecx |
221 | mov edx,text |
221 | mov edx,text |
222 | mov esi,62 |
222 | mov esi,62 |
223 | newline: |
223 | newline: |
224 | mov eax,4 |
224 | mov eax,4 |
225 | int 0x40 |
225 | mcall |
226 | add ebx,16 |
226 | add ebx,16 |
227 | add edx,62 |
227 | add edx,62 |
228 | cmp [edx],byte 'x' |
228 | cmp [edx],byte 'x' |
229 | jnz newline |
229 | jnz newline |
Line 230... | Line 230... | ||
230 | 230 | ||
231 | mov eax,12 ; function 12:tell os about windowdraw |
231 | mov eax,12 ; function 12:tell os about windowdraw |
232 | mov ebx,2 ; 2, end of draw |
232 | mov ebx,2 ; 2, end of draw |
Line 233... | Line 233... | ||
233 | int 0x40 |
233 | mcall |
Line 234... | Line 234... | ||
234 | 234 |