Rev 3626 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3626 | Rev 3908 | ||
---|---|---|---|
Line 6... | Line 6... | ||
6 | ;; FAT12.INC ;; |
6 | ;; FAT12.INC ;; |
7 | ;; (C) 2005 Mario79, License: GPL ;; |
7 | ;; (C) 2005 Mario79, License: GPL ;; |
8 | ;; ;; |
8 | ;; ;; |
9 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
9 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 10... | Line 10... | ||
10 | 10 | ||
Line 11... | Line 11... | ||
11 | $Revision: 3626 $ |
11 | $Revision: 3908 $ |
12 | 12 | ||
13 | 13 | ||
Line 219... | Line 219... | ||
219 | ret |
219 | ret |
Line 220... | Line 220... | ||
220 | 220 | ||
221 | frnoread2_1: |
221 | frnoread2_1: |
222 | cmp [esp+16], dword 0; eof without read ? |
222 | cmp [esp+16], dword 0; eof without read ? |
223 | je frnoread_1 |
- | |
- | 223 | je frnoread_1 |
|
224 | mov [fdc_irq_func], fdc_null |
224 | |
225 | pop edi esi edx ecx |
225 | pop edi esi edx ecx |
226 | add esp, 4 |
226 | add esp, 4 |
227 | pop ebx; ebx <- eax : size of file |
227 | pop ebx; ebx <- eax : size of file |
228 | add esp, 36 |
228 | add esp, 36 |
Line 352... | Line 352... | ||
352 | check_label: |
352 | check_label: |
353 | pushad |
353 | pushad |
354 | mov [FDD_Track], 0; Цилиндр |
354 | mov [FDD_Track], 0; Цилиндр |
355 | mov [FDD_Head], 0; Сторона |
355 | mov [FDD_Head], 0; Сторона |
356 | mov [FDD_Sector], 1; Сектор |
356 | mov [FDD_Sector], 1; Сектор |
357 | call SetUserInterrupts |
- | |
358 | call FDDMotorON |
357 | call FDDMotorON |
359 | call RecalibrateFDD |
358 | call RecalibrateFDD |
360 | cmp [FDC_Status], 0 |
359 | cmp [FDC_Status], 0 |
361 | jne fdc_status_error |
360 | jne fdc_status_error |
362 | call SeekTrack |
361 | call SeekTrack |
Line 407... | Line 406... | ||
407 | jne unnecessary_root_save |
406 | jne unnecessary_root_save |
408 | inc [FDD_Sector] |
407 | inc [FDD_Sector] |
409 | cmp [FDD_Sector], 16 |
408 | cmp [FDD_Sector], 16 |
410 | jne save_flp_root_1 |
409 | jne save_flp_root_1 |
411 | unnecessary_root_save: |
410 | unnecessary_root_save: |
412 | mov [fdc_irq_func], fdc_null |
- | |
413 | popa |
411 | popa |
414 | ret |
412 | ret |
Line 415... | Line 413... | ||
415 | 413 | ||
416 | save_flp_fat: |
414 | save_flp_fat: |
Line 443... | Line 441... | ||
443 | call WriteSectWithRetr |
441 | call WriteSectWithRetr |
444 | cmp [FDC_Status], 0 |
442 | cmp [FDC_Status], 0 |
445 | jne unnecessary_flp_fat_save |
443 | jne unnecessary_flp_fat_save |
446 | mov [root_read], 0 |
444 | mov [root_read], 0 |
447 | unnecessary_flp_fat_save: |
445 | unnecessary_flp_fat_save: |
448 | mov [fdc_irq_func], fdc_null |
- | |
449 | popa |
446 | popa |
450 | ret |
447 | ret |
Line 451... | Line 448... | ||
451 | 448 | ||
Line 1701... | Line 1698... | ||
1701 | @@: |
1698 | @@: |
Line 1702... | Line 1699... | ||
1702 | 1699 | ||
1703 | ; now ebx=start pos, ecx=end pos, both lie inside file |
1700 | ; now ebx=start pos, ecx=end pos, both lie inside file |
1704 | sub ecx, ebx |
1701 | sub ecx, ebx |
1705 | jz .ret |
- | |
- | 1702 | jz .ret |
|
1706 | call SetUserInterrupts |
1703 | |
1707 | .write_loop: |
1704 | .write_loop: |
1708 | ; skip unmodified sectors |
1705 | ; skip unmodified sectors |
1709 | cmp dword [esp], 0x200 |
1706 | cmp dword [esp], 0x200 |
1710 | jb .modify |
1707 | jb .modify |
Line 1792... | Line 1789... | ||
1792 | sub dword [esp], 0x200 |
1789 | sub dword [esp], 0x200 |
1793 | jae .write_loop |
1790 | jae .write_loop |
1794 | and dword [esp], 0 |
1791 | and dword [esp], 0 |
1795 | jmp .write_loop |
1792 | jmp .write_loop |
1796 | .done: |
1793 | .done: |
1797 | mov [fdc_irq_func], fdc_null |
- | |
1798 | jmp .ret |
1794 | jmp .ret |
Line 1799... | Line 1795... | ||
1799 | 1795 | ||
1800 | floppy_extend_file.zero_size: |
1796 | floppy_extend_file.zero_size: |
1801 | xor eax, eax |
1797 | xor eax, eax |
Line 1946... | Line 1942... | ||
1946 | cmp [FDC_Status], 0 |
1942 | cmp [FDC_Status], 0 |
1947 | jz @f |
1943 | jz @f |
1948 | mov al, 11 |
1944 | mov al, 11 |
1949 | @@: |
1945 | @@: |
1950 | .doret: |
1946 | .doret: |
1951 | mov [fdc_irq_func], fdc_null |
- | |
1952 | ret |
1947 | ret |
1953 | .expand: |
1948 | .expand: |
1954 | push ecx |
1949 | push ecx |
1955 | push dword [edi+28] ; save old size |
1950 | push dword [edi+28] ; save old size |
1956 | mov ecx, eax |
1951 | mov ecx, eax |
Line 1979... | Line 1974... | ||
1979 | cmp [FDC_Status], 0 |
1974 | cmp [FDC_Status], 0 |
1980 | jnz .device_err |
1975 | jnz .device_err |
1981 | call save_flp_fat |
1976 | call save_flp_fat |
1982 | cmp [FDC_Status], 0 |
1977 | cmp [FDC_Status], 0 |
1983 | jnz .device_err |
1978 | jnz .device_err |
1984 | call SetUserInterrupts |
- | |
1985 | ; now zero new data |
1979 | ; now zero new data |
1986 | ; edi = current cluster, [esp+12]=new size, [esp+4]=old size, [esp]=return code |
1980 | ; edi = current cluster, [esp+12]=new size, [esp+4]=old size, [esp]=return code |
1987 | .zero_loop: |
1981 | .zero_loop: |
1988 | sub dword [esp+4], 0x200 |
1982 | sub dword [esp+4], 0x200 |
1989 | jae .next_cluster |
1983 | jae .next_cluster |
Line 2072... | Line 2066... | ||
2072 | ; zero last sector, ignore errors |
2066 | ; zero last sector, ignore errors |
2073 | pop eax |
2067 | pop eax |
2074 | add eax, 31 |
2068 | add eax, 31 |
2075 | and edi, 0x1FF |
2069 | and edi, 0x1FF |
2076 | jz .truncate_done |
2070 | jz .truncate_done |
2077 | call SetUserInterrupts |
- | |
- | 2071 | ||
2078 | pusha |
2072 | pusha |
2079 | call read_chs_sector |
2073 | call read_chs_sector |
2080 | popa |
2074 | popa |
2081 | add edi, FDD_BUFF |
2075 | add edi, FDD_BUFF |
2082 | mov ecx, FDD_BUFF+0x200 |
2076 | mov ecx, FDD_BUFF+0x200 |