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