2010-10-01 13:21:55 +04:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; ;;
|
2012-03-15 16:41:29 +04:00
|
|
|
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
2010-10-01 13:21:55 +04:00
|
|
|
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
$Revision$
|
|
|
|
|
|
|
|
|
|
|
|
uglobal
|
2013-05-28 23:09:31 +04:00
|
|
|
dmasize db 0x0
|
|
|
|
dmamode db 0x0
|
2010-10-01 13:21:55 +04:00
|
|
|
endg
|
|
|
|
|
2013-05-28 23:09:31 +04:00
|
|
|
fdc_init: ;start with clean tracks.
|
2012-03-08 12:33:38 +04:00
|
|
|
mov edi, OS_BASE+0xD201
|
|
|
|
mov al, 0
|
|
|
|
mov ecx, 160
|
2013-05-28 23:09:31 +04:00
|
|
|
rep stosb
|
2012-03-08 12:33:38 +04:00
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
save_image:
|
2013-05-28 23:09:31 +04:00
|
|
|
call reserve_flp
|
|
|
|
call restorefatchain
|
|
|
|
pusha
|
|
|
|
call check_label
|
2012-03-08 12:33:38 +04:00
|
|
|
cmp [FDC_Status], 0
|
2013-05-28 23:09:31 +04:00
|
|
|
jne unnecessary_save_image
|
|
|
|
mov [FDD_Track], 0; Цилиндр
|
|
|
|
mov [FDD_Head], 0; Сторона
|
|
|
|
mov [FDD_Sector], 1; Сектор
|
2012-03-08 12:33:38 +04:00
|
|
|
mov esi, RAMDISK
|
2013-05-28 23:09:31 +04:00
|
|
|
call SeekTrack
|
2010-10-01 13:21:55 +04:00
|
|
|
save_image_1:
|
2013-05-28 23:09:31 +04:00
|
|
|
push esi
|
|
|
|
call take_data_from_application_1
|
|
|
|
pop esi
|
2012-03-08 12:33:38 +04:00
|
|
|
add esi, 512
|
2013-05-28 23:09:31 +04:00
|
|
|
call WriteSectWithRetr
|
2010-10-01 13:21:55 +04:00
|
|
|
; call WriteSector
|
2012-03-08 12:33:38 +04:00
|
|
|
cmp [FDC_Status], 0
|
2013-05-28 23:09:31 +04:00
|
|
|
jne unnecessary_save_image
|
|
|
|
inc [FDD_Sector]
|
2012-03-08 12:33:38 +04:00
|
|
|
cmp [FDD_Sector], 19
|
2013-05-28 23:09:31 +04:00
|
|
|
jne save_image_1
|
2012-03-08 12:33:38 +04:00
|
|
|
mov [FDD_Sector], 1
|
2013-05-28 23:09:31 +04:00
|
|
|
inc [FDD_Head]
|
2012-03-08 12:33:38 +04:00
|
|
|
cmp [FDD_Head], 2
|
2013-05-28 23:09:31 +04:00
|
|
|
jne save_image_1
|
2012-03-08 12:33:38 +04:00
|
|
|
mov [FDD_Head], 0
|
2013-05-28 23:09:31 +04:00
|
|
|
inc [FDD_Track]
|
|
|
|
call SeekTrack
|
2012-03-08 12:33:38 +04:00
|
|
|
cmp [FDD_Track], 80
|
2013-05-28 23:09:31 +04:00
|
|
|
jne save_image_1
|
2010-10-01 13:21:55 +04:00
|
|
|
unnecessary_save_image:
|
2013-05-28 23:09:31 +04:00
|
|
|
popa
|
2012-03-08 12:33:38 +04:00
|
|
|
mov [flp_status], 0
|
2013-05-28 23:09:31 +04:00
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|