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$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
iglobal
|
|
|
|
|
;function pointers.
|
|
|
|
|
fdc_irq_func dd fdc_null
|
|
|
|
|
endg
|
|
|
|
|
|
|
|
|
|
uglobal
|
|
|
|
|
dmasize db 0x0
|
|
|
|
|
dmamode db 0x0
|
|
|
|
|
endg
|
|
|
|
|
|
|
|
|
|
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
|
2010-10-01 13:21:55 +04:00
|
|
|
|
rep stosb
|
2012-03-08 12:33:38 +04:00
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
fdc_irq:
|
|
|
|
|
call [fdc_irq_func]
|
|
|
|
|
fdc_null:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
save_image:
|
|
|
|
|
call reserve_flp
|
|
|
|
|
call restorefatchain
|
|
|
|
|
pusha
|
|
|
|
|
call check_label
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [FDC_Status], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jne unnecessary_save_image
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDD_Track], 0; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov [FDD_Head], 0; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov [FDD_Sector], 1; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov esi, RAMDISK
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call SeekTrack
|
|
|
|
|
save_image_1:
|
|
|
|
|
push esi
|
|
|
|
|
call take_data_from_application_1
|
|
|
|
|
pop esi
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add esi, 512
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call WriteSectWithRetr
|
|
|
|
|
; call WriteSector
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [FDC_Status], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jne unnecessary_save_image
|
|
|
|
|
inc [FDD_Sector]
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [FDD_Sector], 19
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jne save_image_1
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDD_Sector], 1
|
2010-10-01 13:21:55 +04:00
|
|
|
|
inc [FDD_Head]
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [FDD_Head], 2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jne save_image_1
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDD_Head], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
inc [FDD_Track]
|
|
|
|
|
call SeekTrack
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [FDD_Track], 80
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jne save_image_1
|
|
|
|
|
unnecessary_save_image:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [fdc_irq_func], fdc_null
|
2010-10-01 13:21:55 +04:00
|
|
|
|
popa
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [flp_status], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
ret
|
|
|
|
|
|