Subversion Repositories Kolibri OS

Rev

Rev 259 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 259 Rev 267
Line 1... Line 1...
1
;-----------------------------------------------------------------------------
1
;-----------------------------------------------------------------------------
2
func save_file ;//////////////////////////////////////////////////////////////
2
func save_file ;//////////////////////////////////////////////////////////////
3
;-----------------------------------------------------------------------------
3
;-----------------------------------------------------------------------------
-
 
4
	ret	; DISALLOW FOR NOW
Line 4... Line 5...
4
 
5
 
5
	mov	esi,tb_opensave.text
6
	mov	esi,tb_opensave.text
6
	mov	edi,f_info.path
7
	mov	edi,f_info.path
7
	movzx	ecx,[tb_opensave.length]
8
	movzx	ecx,[tb_opensave.length]
8
	mov	[f_info.length],ecx
9
	mov	[f_info.length],ecx
9
	cld
10
	cld
10
	rep	movsb
11
	rep	movsb
Line 11... Line 12...
11
	mov	byte[edi],0
12
	mov	byte[edi],0
12
 
13
 
Line 13... Line 14...
13
	mov	esi,[cur_tab.Editor.Data] ;! AREA_EDIT     ; 0x70000 = 448 Kbytes (maximum)
14
	mov	esi,[cur_editor.Lines] ;! AREA_EDIT     ; 0x70000 = 448 Kbytes (maximum)
14
	mov	edi,0 ;!!! AREA_TEMP
15
	mov	edi,0 ;!!! AREA_TEMP
15
 
16
 
Line 26... Line 27...
26
	jz	.exit
27
	jz	.exit
27
;       call    file_not_found
28
;       call    file_not_found
28
	jmp	.exit.2
29
	jmp	.exit.2
Line 29... Line 30...
29
 
30
 
30
  .systree_save:
-
 
31
;!      mov     eax,[filelen]
-
 
32
;       mov     [f_info+8],edi ;! eax
-
 
33
;       mov     [f_info+0],1
-
 
34
;        mov     esi,s_fname
-
 
35
;        mov     edi,f_info.path
-
 
36
;        mov     ecx,PATHL
-
 
37
;        cld
-
 
38
;        rep     movsb
-
 
39
	;mcall   58,f_info
-
 
40
 
31
  .systree_save:
41
	mov	[f_info70+0],2
32
	mov	[f_info70+0],2
42
	mov	[f_info70+12],edi
33
	mov	[f_info70+12],edi
43
	mov	[f_info70+16],0 ;!!! AREA_TEMP
34
	mov	[f_info70+16],0 ;!!! AREA_TEMP
44
	mov	byte[f_info70+20],0
35
	mov	byte[f_info70+20],0
Line 49... Line 40...
49
 
40
 
50
	or	eax,eax
41
	or	eax,eax
Line 51... Line 42...
51
	jnz	.exit.2
42
	jnz	.exit.2
52
 
43
 
53
  .exit:
44
  .exit:
54
	mov	[cur_tab.Editor.Modified],0 ;! [modified],0
45
	mov	[cur_editor.Modified],0 ;! [modified],0
Line 55... Line 46...
55
	clc
46
	clc
56
	ret
47
	ret
Line 195... Line 186...
195
	mov	ecx,eax
186
	mov	ecx,eax
196
	call	create_tab
187
	call	create_tab
197
	push	ecx esi edi
188
	push	ecx esi edi
198
	mov	esi,tb_opensave.text
189
	mov	esi,tb_opensave.text
199
	lea	edi,[ebp+TABITEM.Editor.FilePath]
190
	lea	edi,[ebp+TABITEM.Editor.FilePath]
200
	;mov     ecx,[f_info.length]
-
 
201
	movzx	ecx,[tb_opensave.length]
191
	movzx	ecx,[tb_opensave.length]
202
	rep	movsb
192
	rep	movsb
203
	mov	byte[edi],0
193
	mov	byte[edi],0
204
	lea	edi,[ebp+TABITEM.Editor.FilePath]
194
	lea	edi,[ebp+TABITEM.Editor.FilePath]
205
	movzx	ecx,[tb_opensave.length]
195
	movzx	ecx,[tb_opensave.length]
Line 223... Line 213...
223
; ECX = data length
213
; ECX = data length
224
; ESI = data pointer
214
; ESI = data pointer
225
; EBP = EDITOR*
215
; EBP = EDITOR*
226
;-----------------------------------------------------------------------------
216
;-----------------------------------------------------------------------------
227
	call	get_lines_in_file
217
	call	get_lines_in_file
-
 
218
	inc	eax
228
	mov	[ebp+EDITOR.Lines],eax
219
	mov	[ebp+EDITOR.Lines.Count],eax
229
	imul	ebx,eax,14
220
	imul	ebx,eax,14
230
	add	ebx,ecx
221
	add	ebx,ecx
231
	mov	eax,[ebp+EDITOR.Data]
222
	mov	eax,[ebp+EDITOR.Lines]
232
	call	mem.ReAlloc
223
	call	mem.ReAlloc
233
	mov	[ebp+EDITOR.Data],eax
224
	mov	[ebp+EDITOR.Lines],eax
Line 234... Line 225...
234
 
225
 
235
	mov	[ebp+EDITOR.Columns],0
226
	mov	[ebp+EDITOR.Columns.Count],0
236
	mov	edi,eax
227
	mov	edi,eax
Line 237... Line 228...
237
	mov	edx,ecx
228
	mov	edx,ecx
238
 
229
 
Line 264... Line 255...
264
	mov	[ebx],eax
255
	mov	[ebx],eax
265
	mov	dword[ebx+eax+4],0
256
	mov	dword[ebx+eax+4],0
266
	sub	eax,10
257
	sub	eax,10
267
	jnz	@f
258
	jnz	@f
268
	inc	eax
259
	inc	eax
269
    @@: cmp	eax,[ebp+EDITOR.Columns] ;! eax,[columns]
260
    @@: cmp	eax,[ebp+EDITOR.Columns.Count] ;! eax,[columns]
270
	jbe	@f
261
	jbe	@f
271
	mov	[ebp+EDITOR.Columns],eax ;! [columns],eax
262
	mov	[ebp+EDITOR.Columns.Count],eax ;! [columns],eax
272
    @@: mov	[ebp+EDITOR.Modified],0 ;! [modified],0
263
    @@: mov	[ebp+EDITOR.Modified],0 ;! [modified],0
273
	ret
264
	ret
Line 274... Line 265...
274
 
265
 
275
  .CR:	cmp	byte[esi],10
266
  .CR:	cmp	byte[esi],10
Line 280... Line 271...
280
	mov	al,' '
271
	mov	al,' '
281
	rep	stosb
272
	rep	stosb
282
	lea	eax,[edi-4]
273
	lea	eax,[edi-4]
283
	sub	eax,ebx
274
	sub	eax,ebx
284
	mov	[ebx],eax
275
	mov	[ebx],eax
285
	;inc     [cur_tab.Editor.Lines] ;! [lines]
276
;       inc     [cur_editor.Lines] ;! [lines]
286
	add	eax,-10
277
	add	eax,-10
287
	cmp	eax,[ebp+EDITOR.Columns] ;! eax,[columns]
278
	cmp	eax,[ebp+EDITOR.Columns.Count] ;! eax,[columns]
288
	jbe	.next_line
279
	jbe	.next_line
289
	mov	[ebp+EDITOR.Columns],eax ;! [columns],eax
280
	mov	[ebp+EDITOR.Columns.Count],eax ;! [columns],eax
290
	jmp	.next_line
281
	jmp	.next_line
Line 291... Line 282...
291
 
282
 
292
  .TB:	lea	eax,[edi-4]
283
  .TB:	lea	eax,[edi-4]
293
	sub	eax,ebx
284
	sub	eax,ebx