Rev 617 | Rev 827 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 617 | Rev 629 | ||
---|---|---|---|
1 | ;----------------------------------------------------------------------------- |
1 | ;----------------------------------------------------------------------------- |
2 | ; project name: TINYPAD |
2 | ; project name: TINYPAD |
3 | ; compiler: flat assembler 1.67.18 |
3 | ; compiler: flat assembler 1.67.21 |
4 | ; memory to compile: 3.0/9.0 MBytes (without/with size optimizations) |
4 | ; memory to compile: 3.0/9.0 MBytes (without/with size optimizations) |
5 | ; version: 4.0.4 |
5 | ; version: 4.0.5 |
6 | ; last update: 2007-02-08 (Feb 08, 2007) |
6 | ; last update: 2007-09-18 (Sep 18, 2007) |
7 | ; minimal kernel: revision #270 (svn://kolibrios.org/kernel/trunk) |
7 | ; minimal kernel: revision #270 (svn://kolibrios.org/kernel/trunk) |
8 | ;----------------------------------------------------------------------------- |
8 | ;----------------------------------------------------------------------------- |
9 | ; originally by: Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi |
9 | ; originally by: Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi |
10 | ; maintained by: Mike Semenyako >> mike.dld@gmail.com |
10 | ; maintained by: Mike Semenyako >> mike.dld@gmail.com |
11 | ; Ivan Poddubny >> ivan-yar@bk.ru |
11 | ; Ivan Poddubny >> ivan-yar@bk.ru |
12 | ;----------------------------------------------------------------------------- |
12 | ;----------------------------------------------------------------------------- |
13 | ; TODO (4.1.0): |
13 | ; TODO (4.1.0): |
14 | ; - add vertical selection, undo, goto position, overwrite mode, smart tabulation |
14 | ; - add vertical selection, undo, goto position, overwrite mode, smart tabulation |
15 | ; - improve window drawing with small dimensions |
15 | ; - improve window drawing with small dimensions |
16 | ; - save/load settings to/from ini file, not executable |
16 | ; - save/load settings to/from ini file, not executable |
17 | ; - path autocompletion for open/save dialogs |
17 | ; - path autocompletion for open/save dialogs |
18 | ; - other bug-fixes and speed/size optimizations |
18 | ; - other bug-fixes and speed/size optimizations |
19 | ;----------------------------------------------------------------------------- |
19 | ;----------------------------------------------------------------------------- |
20 | ; See history.txt for complete changelog |
20 | ; See history.txt for complete changelog |
21 | ;----------------------------------------------------------------------------- |
21 | ;----------------------------------------------------------------------------- |
22 | 22 | ||
23 | include 'lang.inc' |
23 | include 'lang.inc' |
24 | 24 | ||
25 | include '../../../macros.inc' ; useful stuff |
25 | include '../../../macros.inc' ; useful stuff |
26 | include '../../../struct.inc' |
26 | include '../../../struct.inc' |
27 | include '../../../proc32.inc' |
27 | include '../../../proc32.inc' |
28 | 28 | ||
29 | include 'external/libio.inc' |
29 | include 'external/libio.inc' |
30 | 30 | ||
31 | include 'tinypad.inc' |
31 | include 'tinypad.inc' |
32 | 32 | ||
33 | ;purge mov,add,sub ; SPEED |
33 | ;purge mov,add,sub ; SPEED |
34 | 34 | ||
35 | header '01',1,@CODE,TINYPAD_END,STATIC_MEM_END,MAIN_STACK,@PARAMS,self_path |
35 | header '01',1,@CODE,TINYPAD_END,STATIC_MEM_END,MAIN_STACK,@PARAMS,self_path |
36 | 36 | ||
37 | APP_VERSION equ '4.0.4' |
37 | APP_VERSION equ '4.0.5' |
38 | 38 | ||
39 | TRUE = 1 |
39 | TRUE = 1 |
40 | FALSE = 0 |
40 | FALSE = 0 |
41 | 41 | ||
42 | ;include 'debug.inc' |
42 | ;include 'debug.inc' |
43 | ;define __DEBUG__ 1 |
43 | ;define __DEBUG__ 1 |
44 | ;define __DEBUG_LEVEL__ 1 |
44 | ;define __DEBUG_LEVEL__ 1 |
45 | ;include 'debug-fdo.inc' |
45 | ;include 'debug-fdo.inc' |
46 | 46 | ||
47 | ASEPC = '-' ; separator character (char) |
47 | ASEPC = '-' ; separator character (char) |
48 | ATOPH = 19 ; menu bar height (pixels) |
48 | ATOPH = 19 ; menu bar height (pixels) |
49 | SCRLW = 16 ; scrollbar widht/height (pixels) |
49 | SCRLW = 16 ; scrollbar widht/height (pixels) |
50 | ATABW = 8 ; tab key indent width (chars) |
50 | ATABW = 8 ; tab key indent width (chars) |
51 | LINEH = 10 ; line height (pixels) |
51 | LINEH = 10 ; line height (pixels) |
52 | PATHL = 256 ; maximum path length (chars) !!! don't change !!! |
52 | PATHL = 256 ; maximum path length (chars) !!! don't change !!! |
53 | AMINS = 8 ; minimal scroll thumb size (pixels) |
53 | AMINS = 8 ; minimal scroll thumb size (pixels) |
54 | LCHGW = 3 ; changed/saved marker width (pixels) |
54 | LCHGW = 3 ; changed/saved marker width (pixels) |
55 | 55 | ||
56 | STATH = 16 ; status bar height (pixels) |
56 | STATH = 16 ; status bar height (pixels) |
57 | TBARH = 18 ; tab bar height (pixels) |
57 | TBARH = 18 ; tab bar height (pixels) |
58 | 58 | ||
59 | ;----------------------------------------------------------------------------- |
59 | ;----------------------------------------------------------------------------- |
60 | section @OPTIONS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
60 | section @OPTIONS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
61 | ;----------------------------------------------------------------------------- |
61 | ;----------------------------------------------------------------------------- |
62 | 62 | ||
63 | label color_tbl dword |
63 | label color_tbl dword |
64 | .text: RGB( 0, 0, 0) |
64 | .text: RGB( 0, 0, 0) |
65 | .back: RGB(255,255,255) |
65 | .back: RGB(255,255,255) |
66 | .text.sel: RGB(255,255,255) |
66 | .text.sel: RGB(255,255,255) |
67 | .back.sel: RGB( 10, 36,106) |
67 | .back.sel: RGB( 10, 36,106) |
68 | .symbol: RGB( 48, 48,240) |
68 | .symbol: RGB( 48, 48,240) |
69 | .number: RGB( 0,144, 0) |
69 | .number: RGB( 0,144, 0) |
70 | .string: RGB(176, 0, 0) |
70 | .string: RGB(176, 0, 0) |
71 | .comment: RGB(128,128,128) |
71 | .comment: RGB(128,128,128) |
72 | .line.moded: RGB(255,238, 98) |
72 | .line.moded: RGB(255,238, 98) |
73 | .line.saved: RGB(108,226,108) |
73 | .line.saved: RGB(108,226,108) |
74 | 74 | ||
75 | ins_mode db 1 |
75 | ins_mode db 1 |
76 | tab_pos db 2 |
76 | tab_pos db 2 |
77 | 77 | ||
78 | options db OPTS_AUTOINDENT+OPTS_OPTIMSAVE+OPTS_SMARTTAB |
78 | options db OPTS_AUTOINDENT+OPTS_OPTIMSAVE+OPTS_SMARTTAB |
79 | 79 | ||
80 | mainwnd_pos: |
80 | mainwnd_pos: |
81 | .x dd 250 |
81 | .x dd 250 |
82 | .y dd 75 |
82 | .y dd 75 |
83 | .w dd 6*80+6+SCRLW+5 ;- 220 |
83 | .w dd 6*80+6+SCRLW+5 ;- 220 |
84 | .h dd 402 ;- 220 |
84 | .h dd 402 ;- 220 |
85 | 85 | ||
86 | ;----------------------------------------------------------------------------- |
86 | ;----------------------------------------------------------------------------- |
87 | section @CODE ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
87 | section @CODE ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
88 | ;----------------------------------------------------------------------------- |
88 | ;----------------------------------------------------------------------------- |
89 | 89 | ||
90 | ; fninit |
90 | ; fninit |
91 | 91 | ||
92 | ; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_left,50 |
92 | ; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_left,50 |
93 | ; mov [mainwnd_pos.x],eax |
93 | ; mov [mainwnd_pos.x],eax |
94 | ; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_top,50 |
94 | ; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_top,50 |
95 | ; mov [mainwnd_pos.y],eax |
95 | ; mov [mainwnd_pos.y],eax |
96 | ; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_right,350 |
96 | ; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_right,350 |
97 | ; sub eax,[mainwnd_pos.x] |
97 | ; sub eax,[mainwnd_pos.x] |
98 | ; mov [mainwnd_pos.w],eax |
98 | ; mov [mainwnd_pos.w],eax |
99 | ; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_bottom,450 |
99 | ; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_bottom,450 |
100 | ; sub eax,[mainwnd_pos.y] |
100 | ; sub eax,[mainwnd_pos.y] |
101 | ; mov [mainwnd_pos.h],eax |
101 | ; mov [mainwnd_pos.h],eax |
102 | 102 | ||
103 | cld |
103 | cld |
104 | mov edi,@UDATA |
104 | mov edi,@UDATA |
105 | mov ecx,@PARAMS-@UDATA |
105 | mov ecx,@PARAMS-@UDATA |
106 | mov al,0 |
106 | mov al,0 |
107 | rep stosb |
107 | rep stosb |
108 | 108 | ||
109 | mov al,[tab_pos] |
109 | mov al,[tab_pos] |
110 | mov [tab_bar.Style],al |
110 | mov [tab_bar.Style],al |
111 | 111 | ||
112 | mcall 68,11 |
112 | mcall 68,11 |
113 | or eax,eax |
113 | or eax,eax |
114 | jz key.alt_x.close |
114 | jz key.alt_x.close |
115 | 115 | ||
116 | stdcall dll.Load,@IMPORT |
116 | stdcall dll.Load,@IMPORT |
117 | or eax,eax |
117 | or eax,eax |
118 | jnz key.alt_x.close |
118 | jnz key.alt_x.close |
119 | 119 | ||
120 | stdcall mem.Alloc,65536 |
120 | stdcall mem.Alloc,65536 |
121 | mov [temp_buf],eax |
121 | mov [temp_buf],eax |
122 | 122 | ||
123 | inc [do_not_draw] |
123 | inc [do_not_draw] |
124 | 124 | ||
125 | mov dword[app_start],7 |
125 | mov dword[app_start],7 |
126 | 126 | ||
127 | mov esi,s_example |
127 | mov esi,s_example |
128 | mov edi,tb_opensave.text |
128 | mov edi,tb_opensave.text |
129 | mov ecx,s_example.size |
129 | mov ecx,s_example.size |
130 | mov [tb_opensave.length],cl |
130 | mov [tb_opensave.length],cl |
131 | rep movsb |
131 | rep movsb |
132 | 132 | ||
133 | mov esi,s_still |
133 | mov esi,s_still |
134 | mov edi,s_search |
134 | mov edi,s_search |
135 | mov ecx,s_still.size |
135 | mov ecx,s_still.size |
136 | mov [s_search.size],ecx |
136 | mov [s_search.size],ecx |
137 | rep movsb |
137 | rep movsb |
138 | 138 | ||
139 | cmp byte[@PARAMS],0 |
139 | cmp byte[@PARAMS],0 |
140 | jz no_params |
140 | jz no_params |
141 | 141 | ||
142 | ;// Willow's code to support DOCPAK [ |
142 | ;// Willow's code to support DOCPAK [ |
143 | 143 | ||
144 | cmp byte[@PARAMS],'*' |
144 | cmp byte[@PARAMS],'*' |
145 | jne .noipc |
145 | jne .noipc |
146 | 146 | ||
147 | ;// diamond [ (convert size from decimal representation to dword) |
147 | ;// diamond [ (convert size from decimal representation to dword) |
148 | ;-- mov edx,dword[@PARAMS+1] |
148 | ;-- mov edx,dword[@PARAMS+1] |
149 | mov esi,@PARAMS+1 |
149 | mov esi,@PARAMS+1 |
150 | xor edx,edx |
150 | xor edx,edx |
151 | xor eax,eax |
151 | xor eax,eax |
152 | @@: lodsb |
152 | @@: lodsb |
153 | test al,al |
153 | test al,al |
154 | jz @f |
154 | jz @f |
155 | lea edx,[edx*4+edx] |
155 | lea edx,[edx*4+edx] |
156 | lea edx,[edx*2+eax-'0'] |
156 | lea edx,[edx*2+eax-'0'] |
157 | jmp @b |
157 | jmp @b |
158 | @@: |
158 | @@: |
159 | ;// diamond ] |
159 | ;// diamond ] |
160 | 160 | ||
161 | add edx,20 |
161 | add edx,20 |
162 | 162 | ||
163 | stdcall mem.Alloc,edx |
163 | stdcall mem.Alloc,edx |
164 | mov ebp,eax |
164 | mov ebp,eax |
165 | push eax |
165 | push eax |
166 | 166 | ||
167 | mov dword[ebp+0],0 |
167 | mov dword[ebp+0],0 |
168 | mov dword[ebp+4],8 |
168 | mov dword[ebp+4],8 |
169 | mcall 60,1,ebp |
169 | mcall 60,1,ebp |
170 | mcall 40,1000000b |
170 | mcall 40,1000000b |
171 | 171 | ||
172 | mcall 23,200 |
172 | mcall 23,200 |
173 | 173 | ||
174 | cmp eax,7 |
174 | cmp eax,7 |
175 | jne key.alt_x.close |
175 | jne key.alt_x.close |
176 | mov byte[ebp],1 |
176 | mov byte[ebp],1 |
177 | 177 | ||
178 | mov ecx,[ebp+12] |
178 | mov ecx,[ebp+12] |
179 | lea esi,[ebp+16] |
179 | lea esi,[ebp+16] |
180 | call create_tab |
180 | call create_tab |
181 | call load_from_memory |
181 | call load_from_memory |
182 | 182 | ||
183 | pop ebp |
183 | pop ebp |
184 | stdcall mem.Free,ebp |
184 | stdcall mem.Free,ebp |
185 | 185 | ||
186 | jmp @f |
186 | jmp @f |
187 | .noipc: |
187 | .noipc: |
188 | 188 | ||
189 | ;// Willow's code to support DOCPAK ] |
189 | ;// Willow's code to support DOCPAK ] |
190 | 190 | ||
191 | mov esi,@PARAMS |
191 | mov esi,@PARAMS |
192 | mov edi,tb_opensave.text |
192 | mov edi,tb_opensave.text |
193 | mov ecx,PATHL |
193 | mov ecx,PATHL |
194 | rep movsb |
194 | rep movsb |
195 | mov edi,tb_opensave.text |
195 | mov edi,tb_opensave.text |
196 | mov ecx,PATHL |
196 | mov ecx,PATHL |
197 | xor al,al |
197 | xor al,al |
198 | repne scasb |
198 | repne scasb |
199 | jne key.alt_x.close |
199 | jne key.alt_x.close |
200 | lea eax,[edi-tb_opensave.text-1] |
200 | lea eax,[edi-tb_opensave.text-1] |
201 | mov [tb_opensave.length],al |
201 | mov [tb_opensave.length],al |
202 | call load_file |
202 | call load_file |
203 | jnc @f |
203 | jnc @f |
204 | 204 | ||
205 | no_params: |
205 | no_params: |
206 | call create_tab |
206 | call create_tab |
207 | 207 | ||
208 | @@: |
208 | @@: |
209 | mov [s_status],0 |
209 | mov [s_status],0 |
210 | dec [do_not_draw] |
210 | dec [do_not_draw] |
211 | mcall 66,1,1 |
211 | mcall 66,1,1 |
212 | mcall 40,00100111b |
212 | mcall 40,00100111b |
213 | red: |
213 | red: |
214 | call drawwindow |
214 | call drawwindow |
215 | 215 | ||
216 | ;----------------------------------------------------------------------------- |
216 | ;----------------------------------------------------------------------------- |
217 | 217 | ||
218 | still: |
218 | still: |
219 | call draw_statusbar ; write current position & number of strings |
219 | call draw_statusbar ; write current position & number of strings |
220 | 220 | ||
221 | .skip_write: |
221 | .skip_write: |
222 | mcall 10 ; wait here until event |
222 | mcall 10 ; wait here until event |
223 | cmp [main_closed],0 |
223 | cmp [main_closed],0 |
224 | jne key.alt_x |
224 | jne key.alt_x |
225 | dec eax ; redraw ? |
225 | dec eax ; redraw ? |
226 | jz red |
226 | jz red |
227 | dec eax ; key ? |
227 | dec eax ; key ? |
228 | jz key |
228 | jz key |
229 | dec eax ; button ? |
229 | dec eax ; button ? |
230 | jz button |
230 | jz button |
231 | sub eax,3 ; mouse ? |
231 | sub eax,3 ; mouse ? |
232 | jz mouse |
232 | jz mouse |
233 | 233 | ||
234 | jmp still.skip_write |
234 | jmp still.skip_write |
235 | 235 | ||
236 | ;----------------------------------------------------------------------------- |
236 | ;----------------------------------------------------------------------------- |
237 | proc get_event ctx ;////////////////////////////////////////////////////////// |
237 | proc get_event ctx ;////////////////////////////////////////////////////////// |
238 | ;----------------------------------------------------------------------------- |
238 | ;----------------------------------------------------------------------------- |
239 | mcall 10 |
239 | mcall 10 |
240 | dec eax ; redraw ? |
240 | dec eax ; redraw ? |
241 | jz .redraw |
241 | jz .redraw |
242 | dec eax ; key ? |
242 | dec eax ; key ? |
243 | jz .key |
243 | jz .key |
244 | dec eax ; button ? |
244 | dec eax ; button ? |
245 | jz .button |
245 | jz .button |
246 | sub eax,2 ; background ? |
246 | sub eax,2 ; background ? |
247 | jz .background |
247 | jz .background |
248 | dec eax ; mouse ? |
248 | dec eax ; mouse ? |
249 | jz .mouse |
249 | jz .mouse |
250 | dec eax ; ipc ? |
250 | dec eax ; ipc ? |
251 | jz .ipc |
251 | jz .ipc |
252 | dec eax ; network ? |
252 | dec eax ; network ? |
253 | jz .network |
253 | jz .network |
254 | dec eax ; debug ? |
254 | dec eax ; debug ? |
255 | jz .debug |
255 | jz .debug |
256 | sub eax,7 ; irq ? |
256 | sub eax,7 ; irq ? |
257 | js .nothing |
257 | js .nothing |
258 | cmp eax,15 |
258 | cmp eax,15 |
259 | jg .nothing |
259 | jg .nothing |
260 | jmp .irq |
260 | jmp .irq |
261 | 261 | ||
262 | .nothing: |
262 | .nothing: |
263 | mov eax,EV_IDLE |
263 | mov eax,EV_IDLE |
264 | ret |
264 | ret |
265 | 265 | ||
266 | .redraw: |
266 | .redraw: |
267 | mov eax,EV_REDRAW |
267 | mov eax,EV_REDRAW |
268 | ret |
268 | ret |
269 | 269 | ||
270 | .key: |
270 | .key: |
271 | mov eax,EV_KEY |
271 | mov eax,EV_KEY |
272 | ret |
272 | ret |
273 | 273 | ||
274 | .button: |
274 | .button: |
275 | mov eax,EV_BUTTON |
275 | mov eax,EV_BUTTON |
276 | ret |
276 | ret |
277 | 277 | ||
278 | .background: |
278 | .background: |
279 | mov eax,EV_BACKGROUND |
279 | mov eax,EV_BACKGROUND |
280 | ret |
280 | ret |
281 | 281 | ||
282 | .mouse: |
282 | .mouse: |
283 | mov eax,EV_MOUSE |
283 | mov eax,EV_MOUSE |
284 | ret |
284 | ret |
285 | 285 | ||
286 | .ipc: |
286 | .ipc: |
287 | mov eax,EV_IPC |
287 | mov eax,EV_IPC |
288 | ret |
288 | ret |
289 | 289 | ||
290 | .network: |
290 | .network: |
291 | mov eax,EV_NETWORK |
291 | mov eax,EV_NETWORK |
292 | ret |
292 | ret |
293 | 293 | ||
294 | .debug: |
294 | .debug: |
295 | mov eax,EV_DEBUG |
295 | mov eax,EV_DEBUG |
296 | ret |
296 | ret |
297 | endp |
297 | endp |
298 | 298 | ||
299 | ;----------------------------------------------------------------------------- |
299 | ;----------------------------------------------------------------------------- |
300 | proc start_fasm ;///////////////////////////////////////////////////////////// |
300 | proc start_fasm ;///////////////////////////////////////////////////////////// |
301 | ;----------------------------------------------------------------------------- |
301 | ;----------------------------------------------------------------------------- |
302 | ; BL = run after compile |
302 | ; BL = run after compile |
303 | ;----------------------------------------------------------------------------- |
303 | ;----------------------------------------------------------------------------- |
304 | ; FASM infile,outfile,/path/to/files[,run] |
304 | ; FASM infile,outfile,/path/to/files[,run] |
305 | ;----------------------------------------------------------------------------- |
305 | ;----------------------------------------------------------------------------- |
306 | cmp [cur_editor.AsmMode],0 |
306 | cmp [cur_editor.AsmMode],0 |
307 | jne @f |
307 | jne @f |
308 | ret |
308 | ret |
309 | @@: |
309 | @@: |
310 | mov eax,[tab_bar.Default.Ptr] |
310 | mov eax,[tab_bar.Default.Ptr] |
311 | or eax,eax |
311 | or eax,eax |
312 | jnz @f |
312 | jnz @f |
313 | mov eax,[tab_bar.Current.Ptr] |
313 | mov eax,[tab_bar.Current.Ptr] |
314 | @@: cmp byte[eax+TABITEM.Editor.FilePath],'/' |
314 | @@: cmp byte[eax+TABITEM.Editor.FilePath],'/' |
315 | je @f |
315 | je @f |
316 | ret |
316 | ret |
317 | @@: |
317 | @@: |
318 | mov edi,fasm_parameters |
318 | mov edi,fasm_parameters |
319 | push eax |
319 | push eax |
320 | 320 | ||
321 | cld |
321 | cld |
322 | 322 | ||
323 | lea esi,[eax+TABITEM.Editor.FilePath] |
323 | lea esi,[eax+TABITEM.Editor.FilePath] |
324 | add esi,[eax+TABITEM.Editor.FileName] |
324 | add esi,[eax+TABITEM.Editor.FileName] |
325 | push esi esi |
325 | push esi esi |
326 | @@: lodsb |
326 | @@: lodsb |
327 | cmp al,0 |
327 | cmp al,0 |
328 | je @f |
328 | je @f |
329 | stosb |
329 | stosb |
330 | cmp al,'.' |
330 | cmp al,'.' |
331 | jne @b |
331 | jne @b |
332 | mov ecx,esi |
332 | mov ecx,esi |
333 | jmp @b |
333 | jmp @b |
334 | @@: |
334 | @@: |
335 | mov al,',' |
335 | mov al,',' |
336 | stosb |
336 | stosb |
337 | 337 | ||
338 | pop esi |
338 | pop esi |
339 | sub ecx,esi |
339 | sub ecx,esi |
340 | dec ecx |
340 | dec ecx |
341 | jz @f |
341 | jz @f |
342 | rep movsb |
342 | rep movsb |
343 | @@: |
343 | @@: |
344 | mov al,',' |
344 | mov al,',' |
345 | stosb |
345 | stosb |
346 | 346 | ||
347 | pop ecx esi |
347 | pop ecx esi |
348 | add esi,TABITEM.Editor.FilePath |
348 | add esi,TABITEM.Editor.FilePath |
349 | sub ecx,esi |
349 | sub ecx,esi |
350 | rep movsb |
350 | rep movsb |
351 | 351 | ||
352 | cmp bl,0 ; run outfile ? |
352 | cmp bl,0 ; run outfile ? |
353 | je @f |
353 | je @f |
354 | mov dword[edi],',run' |
354 | mov dword[edi],',run' |
355 | add edi,4 |
355 | add edi,4 |
356 | @@: |
356 | @@: |
357 | mov al,0 |
357 | mov al,0 |
358 | stosb |
358 | stosb |
359 | 359 | ||
360 | mov [app_start.filename],app_fasm |
360 | mov [app_start.filename],app_fasm |
361 | mov [app_start.params],fasm_parameters |
361 | mov [app_start.params],fasm_parameters |
362 | start_ret: |
362 | start_ret: |
363 | mcall 70,app_start |
363 | mcall 70,app_start |
364 | ret |
364 | ret |
365 | endp |
365 | endp |
366 | 366 | ||
367 | ;----------------------------------------------------------------------------- |
367 | ;----------------------------------------------------------------------------- |
368 | proc open_debug_board ;/////////////////////////////////////////////////////// |
368 | proc open_debug_board ;/////////////////////////////////////////////////////// |
369 | ;----------------------------------------------------------------------------- |
369 | ;----------------------------------------------------------------------------- |
370 | mov [app_start.filename],app_board |
370 | mov [app_start.filename],app_board |
371 | mov [app_start.params],0 |
371 | mov [app_start.params],0 |
372 | jmp start_ret |
372 | jmp start_ret |
373 | endp |
373 | endp |
374 | 374 | ||
375 | ;----------------------------------------------------------------------------- |
375 | ;----------------------------------------------------------------------------- |
376 | proc open_sysfuncs_txt ;////////////////////////////////////////////////////// |
376 | proc open_sysfuncs_txt ;////////////////////////////////////////////////////// |
377 | ;----------------------------------------------------------------------------- |
377 | ;----------------------------------------------------------------------------- |
378 | mov [app_start.filename],app_docpak |
378 | mov [app_start.filename],app_docpak |
379 | mov [app_start.params],sysfuncs_param |
379 | mov [app_start.params],sysfuncs_param |
380 | call start_ret |
380 | call start_ret |
381 | cmp eax,0xfffffff0 |
381 | cmp eax,0xfffffff0 |
382 | jb @f |
382 | jb @f |
383 | mov [app_start.filename],app_tinypad |
383 | mov [app_start.filename],app_tinypad |
384 | mov [app_start.params],sysfuncs_filename |
384 | mov [app_start.params],sysfuncs_filename |
385 | call start_ret |
385 | call start_ret |
386 | @@: ret |
386 | @@: ret |
387 | endp |
387 | endp |
388 | 388 | ||
389 | set_opt: |
389 | set_opt: |
390 | 390 | ||
391 | .dialog: |
391 | .dialog: |
392 | mov [bot_mode],1 |
392 | mov [bot_mode],1 |
393 | mov [bot_dlg_height],128 |
393 | mov [bot_dlg_height],128 |
394 | mov [bot_dlg_handler],optsdlg_handler |
394 | mov [bot_dlg_handler],optsdlg_handler |
395 | mov [focused_tb],tb_color |
395 | mov [focused_tb],tb_color |
396 | mov al,[tb_color.length] |
396 | mov al,[tb_color.length] |
397 | mov [tb_color.pos.x],al |
397 | mov [tb_color.pos.x],al |
398 | mov [tb_color.sel.x],0 |
398 | mov [tb_color.sel.x],0 |
399 | mov [tb_casesen],1 |
399 | mov [tb_casesen],1 |
400 | mov [cur_part],0 |
400 | mov [cur_part],0 |
401 | m2m [cur_color],dword[color_tbl.text] |
401 | m2m [cur_color],dword[color_tbl.text] |
402 | mov esi,color_tbl |
402 | mov esi,color_tbl |
403 | mov edi,cur_colors |
403 | mov edi,cur_colors |
404 | mov ecx,10 |
404 | mov ecx,10 |
405 | cld |
405 | cld |
406 | rep movsd |
406 | rep movsd |
407 | call drawwindow |
407 | call drawwindow |
408 | ret |
408 | ret |
409 | 409 | ||
410 | .line_numbers: |
410 | .line_numbers: |
411 | mov al,OPTS_LINENUMS |
411 | mov al,OPTS_LINENUMS |
412 | jmp .main |
412 | jmp .main |
413 | .optimal_fill: |
413 | .optimal_fill: |
414 | mov al,OPTS_OPTIMSAVE |
414 | mov al,OPTS_OPTIMSAVE |
415 | jmp .main |
415 | jmp .main |
416 | .auto_indents: |
416 | .auto_indents: |
417 | mov al,OPTS_AUTOINDENT |
417 | mov al,OPTS_AUTOINDENT |
418 | jmp .main |
418 | jmp .main |
419 | .auto_braces: |
419 | .auto_braces: |
420 | mov al,OPTS_AUTOBRACES |
420 | mov al,OPTS_AUTOBRACES |
421 | jmp .main |
421 | jmp .main |
422 | .secure_sel: |
422 | .secure_sel: |
423 | mov al,OPTS_SECURESEL |
423 | mov al,OPTS_SECURESEL |
424 | 424 | ||
425 | .main: |
425 | .main: |
426 | xor [options],al |
426 | xor [options],al |
427 | ret |
427 | ret |
428 | 428 | ||
429 | ;----------------------------------------------------------------------------- |
429 | ;----------------------------------------------------------------------------- |
430 | 430 | ||
431 | include 'data/tp-defines.inc' |
431 | include 'data/tp-defines.inc' |
432 | 432 | ||
433 | include 'tp-draw.asm' |
433 | include 'tp-draw.asm' |
434 | include 'tp-key.asm' |
434 | include 'tp-key.asm' |
435 | include 'tp-button.asm' |
435 | include 'tp-button.asm' |
436 | include 'tp-mouse.asm' |
436 | include 'tp-mouse.asm' |
437 | include 'tp-files.asm' |
437 | include 'tp-files.asm' |
438 | include 'tp-common.asm' |
438 | include 'tp-common.asm' |
439 | include 'tp-dialog.asm' |
439 | include 'tp-dialog.asm' |
440 | include 'tp-popup.asm' |
440 | include 'tp-popup.asm' |
441 | include 'tp-tbox.asm' |
441 | include 'tp-tbox.asm' |
442 | include 'tp-tabctl.asm' |
442 | include 'tp-tabctl.asm' |
443 | include 'tp-editor.asm' |
443 | include 'tp-editor.asm' |
444 | include 'tp-recode.asm' |
444 | include 'tp-recode.asm' |
445 | 445 | ||
446 | include 'external/dll.inc' |
446 | include 'external/dll.inc' |
447 | 447 | ||
448 | ;----------------------------------------------------------------------------- |
448 | ;----------------------------------------------------------------------------- |
449 | section @DATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
449 | section @DATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
450 | ;----------------------------------------------------------------------------- |
450 | ;----------------------------------------------------------------------------- |
451 | 451 | ||
452 | include 'data/tp-idata.inc' |
452 | include 'data/tp-idata.inc' |
453 | 453 | ||
454 | ;----------------------------------------------------------------------------- |
454 | ;----------------------------------------------------------------------------- |
455 | section @IMPORT ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
455 | section @IMPORT ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
456 | ;----------------------------------------------------------------------------- |
456 | ;----------------------------------------------------------------------------- |
457 | ;align 16 |
457 | ;align 16 |
458 | ;@IMPORT: |
458 | ;@IMPORT: |
459 | 459 | ||
460 | library \ |
460 | library \ |
461 | libini,'libini.obj',\ |
461 | libini,'libini.obj',\ |
462 | libio,'libio.obj',\ |
462 | libio,'libio.obj',\ |
463 | libgfx,'libgfx.obj' |
463 | libgfx,'libgfx.obj' |
464 | 464 | ||
465 | import libini, \ |
465 | import libini, \ |
466 | ini.get_str,'ini.get_str',\ |
466 | ini.get_str,'ini.get_str',\ |
467 | ini.set_str,'ini.set_str',\ |
467 | ini.set_str,'ini.set_str',\ |
468 | ini.get_int,'ini.get_int',\ |
468 | ini.get_int,'ini.get_int',\ |
469 | ini.set_int,'ini.set_int' |
469 | ini.set_int,'ini.set_int' |
470 | 470 | ||
471 | import libio, \ |
471 | import libio, \ |
472 | file.find_first,'file.find_first',\ |
472 | file.find_first,'file.find_first',\ |
473 | file.find_next ,'file.find_next',\ |
473 | file.find_next ,'file.find_next',\ |
474 | file.find_close,'file.find_close',\ |
474 | file.find_close,'file.find_close',\ |
475 | file.size ,'file.size',\ |
475 | file.size ,'file.size',\ |
476 | file.open ,'file.open',\ |
476 | file.open ,'file.open',\ |
477 | file.read ,'file.read',\ |
477 | file.read ,'file.read',\ |
478 | file.write ,'file.write',\ |
478 | file.write ,'file.write',\ |
479 | file.seek ,'file.seek',\ |
479 | file.seek ,'file.seek',\ |
480 | file.tell ,'file.tell',\ |
480 | file.tell ,'file.tell',\ |
481 | file.eof? ,'file.eof?',\ |
481 | file.eof? ,'file.eof?',\ |
482 | file.truncate ,'file.truncate',\ |
482 | file.truncate ,'file.truncate',\ |
483 | file.close ,'file.close' |
483 | file.close ,'file.close' |
484 | 484 | ||
485 | import libgfx, \ |
485 | import libgfx, \ |
486 | gfx.open ,'gfx.open',\ |
486 | gfx.open ,'gfx.open',\ |
487 | gfx.close ,'gfx.close',\ |
487 | gfx.close ,'gfx.close',\ |
488 | gfx.pen.color ,'gfx.pen.color',\ |
488 | gfx.pen.color ,'gfx.pen.color',\ |
489 | gfx.brush.color ,'gfx.brush.color',\ |
489 | gfx.brush.color ,'gfx.brush.color',\ |
490 | gfx.pixel ,'gfx.pixel',\ |
490 | gfx.pixel ,'gfx.pixel',\ |
491 | gfx.move.to ,'gfx.move.to',\ |
491 | gfx.move.to ,'gfx.move.to',\ |
492 | gfx.line.to ,'gfx.line.to',\ |
492 | gfx.line.to ,'gfx.line.to',\ |
493 | gfx.line ,'gfx.line',\ |
493 | gfx.line ,'gfx.line',\ |
494 | gfx.polyline ,'gfx.polyline',\ |
494 | gfx.polyline ,'gfx.polyline',\ |
495 | gfx.polyline.to ,'gfx.polyline.to',\ |
495 | gfx.polyline.to ,'gfx.polyline.to',\ |
496 | gfx.fillrect ,'gfx.fillrect',\ |
496 | gfx.fillrect ,'gfx.fillrect',\ |
497 | gfx.fillrect.ex ,'gfx.fillrect.ex',\ |
497 | gfx.fillrect.ex ,'gfx.fillrect.ex',\ |
498 | gfx.framerect ,'gfx.framerect',\ |
498 | gfx.framerect ,'gfx.framerect',\ |
499 | gfx.framerect.ex,'gfx.framerect.ex',\ |
499 | gfx.framerect.ex,'gfx.framerect.ex',\ |
500 | gfx.rectangle ,'gfx.rectangle',\ |
500 | gfx.rectangle ,'gfx.rectangle',\ |
501 | gfx.rectangle.ex,'gfx.rectangle.ex' |
501 | gfx.rectangle.ex,'gfx.rectangle.ex' |
502 | 502 | ||
503 | TINYPAD_END: ; end of file |
503 | TINYPAD_END: ; end of file |
504 | 504 | ||
505 | ;----------------------------------------------------------------------------- |
505 | ;----------------------------------------------------------------------------- |
506 | section @UDATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
506 | section @UDATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
507 | ;----------------------------------------------------------------------------- |
507 | ;----------------------------------------------------------------------------- |
508 | 508 | ||
509 | include 'data/tp-udata.inc' |
509 | include 'data/tp-udata.inc' |
510 | 510 | ||
511 | ;----------------------------------------------------------------------------- |
511 | ;----------------------------------------------------------------------------- |
512 | section @PARAMS ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
512 | section @PARAMS ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
513 | ;----------------------------------------------------------------------------- |
513 | ;----------------------------------------------------------------------------- |
514 | 514 | ||
515 | fasm_parameters: |
515 | fasm_parameters: |
516 | 516 | ||
517 | p_info process_information |
517 | p_info process_information |
518 | p_info2 process_information |
518 | p_info2 process_information |
519 | sc system_colors |
519 | sc system_colors |
520 | 520 | ||
521 | rb 1024*4 |
521 | rb 1024*4 |
522 | MAIN_STACK: |
522 | MAIN_STACK: |
523 | rb 1024*4 |
523 | rb 1024*4 |
524 | POPUP_STACK: |
524 | POPUP_STACK: |
525 | 525 | ||
526 | STATIC_MEM_END: |
526 | STATIC_MEM_END: |
527 | 527 | ||
528 | diff10 'Main memory size',0,$ |
528 | diff10 'Main memory size',0,$ |