2007-03-22 01:58:33 +03:00
|
|
|
|
$Revision$
|
2005-10-06 21:56:22 +04:00
|
|
|
|
iglobal
|
|
|
|
|
;function pointers.
|
|
|
|
|
fdc_irq_func dd fdc_null
|
|
|
|
|
endg
|
|
|
|
|
|
|
|
|
|
uglobal
|
2005-11-06 23:01:18 +03:00
|
|
|
|
dmasize db 0x0
|
|
|
|
|
dmamode db 0x0
|
2005-10-06 21:56:22 +04:00
|
|
|
|
endg
|
|
|
|
|
|
|
|
|
|
fdc_init: ;start with clean tracks.
|
2007-03-06 00:37:28 +03:00
|
|
|
|
mov edi,OS_BASE+0xD201
|
2005-10-06 21:56:22 +04:00
|
|
|
|
mov al,0
|
|
|
|
|
mov ecx,160
|
|
|
|
|
rep stosb
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
fdc_filesave: ;ebx: cluster to be saved.
|
|
|
|
|
pusha ;returns immediately. does not trigger a write.
|
|
|
|
|
mov eax,ebx
|
|
|
|
|
add eax,31
|
|
|
|
|
mov bl,18
|
|
|
|
|
div bl
|
|
|
|
|
mov ah,0
|
2007-03-06 00:37:28 +03:00
|
|
|
|
add eax,OS_BASE+0xD201
|
2005-10-06 21:56:22 +04:00
|
|
|
|
mov [eax],byte 1 ;This track is now dirty.
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
fdc_irq:
|
|
|
|
|
call [fdc_irq_func]
|
|
|
|
|
fdc_null:
|
2005-11-06 23:01:18 +03:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
save_image:
|
|
|
|
|
call reserve_flp
|
|
|
|
|
call restorefatchain
|
|
|
|
|
pusha
|
|
|
|
|
call check_label
|
|
|
|
|
cmp [FDC_Status],0
|
|
|
|
|
jne unnecessary_save_image
|
|
|
|
|
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov [FDD_Head],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2007-03-01 23:32:19 +03:00
|
|
|
|
mov [FDD_Sector],1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov esi,RAMDISK
|
2005-11-06 23:01:18 +03:00
|
|
|
|
call SeekTrack
|
|
|
|
|
save_image_1:
|
|
|
|
|
push esi
|
|
|
|
|
call take_data_from_application_1
|
|
|
|
|
pop esi
|
|
|
|
|
add esi,512
|
|
|
|
|
call WriteSectWithRetr
|
|
|
|
|
; call WriteSector
|
|
|
|
|
cmp [FDC_Status],0
|
|
|
|
|
jne unnecessary_save_image
|
|
|
|
|
inc [FDD_Sector]
|
|
|
|
|
cmp [FDD_Sector],19
|
|
|
|
|
jne save_image_1
|
|
|
|
|
mov [FDD_Sector],1
|
2007-03-01 23:32:19 +03:00
|
|
|
|
inc [FDD_Head]
|
2005-11-06 23:01:18 +03:00
|
|
|
|
cmp [FDD_Head],2
|
|
|
|
|
jne save_image_1
|
|
|
|
|
mov [FDD_Head],0
|
|
|
|
|
inc [FDD_Track]
|
|
|
|
|
call SeekTrack
|
|
|
|
|
cmp [FDD_Track],80
|
|
|
|
|
jne save_image_1
|
|
|
|
|
unnecessary_save_image:
|
|
|
|
|
mov [fdc_irq_func],fdc_null
|
|
|
|
|
popa
|
|
|
|
|
mov [flp_status],0
|
|
|
|
|
ret
|
|
|
|
|
|