Subversion Repositories Kolibri OS

Rev

Rev 2434 | Rev 3555 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
431 serge 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2465 Serge 3
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
431 serge 4
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
5
;; Distributed under terms of the GNU General Public License    ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
593 mikedld 8
$Revision: 2465 $
431 serge 9
 
593 mikedld 10
 
1 ha 11
iglobal
19 mario79 12
  ;function pointers.
766 Rus 13
  fdc_irq_func	  dd fdc_null
1 ha 14
endg
15
 
16
uglobal
766 Rus 17
  dmasize	  db 0x0
18
  dmamode	  db 0x0
1 ha 19
endg
20
 
766 Rus 21
fdc_init:				;start with clean tracks.
2434 Serge 22
        mov     edi, OS_BASE+0xD201
23
        mov     al, 0
24
        mov     ecx, 160
766 Rus 25
	rep stosb
2434 Serge 26
        ret
1 ha 27
 
19 mario79 28
fdc_irq:
766 Rus 29
	call [fdc_irq_func]
19 mario79 30
fdc_null:
2434 Serge 31
        ret
1 ha 32
 
19 mario79 33
save_image:
34
    call   reserve_flp
35
    call   restorefatchain
36
    pusha
37
    call   check_label
2434 Serge 38
        cmp     [FDC_Status], 0
19 mario79 39
    jne    unnecessary_save_image
2434 Serge 40
        mov     [FDD_Track], 0; Цилиндр
41
        mov     [FDD_Head], 0; Сторона
42
        mov     [FDD_Sector], 1; Сектор
43
        mov     esi, RAMDISK
19 mario79 44
    call   SeekTrack
45
save_image_1:
46
    push   esi
47
    call   take_data_from_application_1
48
    pop    esi
2434 Serge 49
        add     esi, 512
19 mario79 50
    call   WriteSectWithRetr
51
;    call   WriteSector
2434 Serge 52
        cmp     [FDC_Status], 0
19 mario79 53
    jne    unnecessary_save_image
54
    inc    [FDD_Sector]
2434 Serge 55
        cmp     [FDD_Sector], 19
19 mario79 56
    jne    save_image_1
2434 Serge 57
        mov     [FDD_Sector], 1
381 serge 58
    inc    [FDD_Head]
2434 Serge 59
        cmp     [FDD_Head], 2
19 mario79 60
    jne    save_image_1
2434 Serge 61
        mov     [FDD_Head], 0
19 mario79 62
    inc    [FDD_Track]
63
    call   SeekTrack
2434 Serge 64
        cmp     [FDD_Track], 80
19 mario79 65
    jne    save_image_1
66
unnecessary_save_image:
2434 Serge 67
        mov     [fdc_irq_func], fdc_null
19 mario79 68
    popa
2434 Serge 69
        mov     [flp_status], 0
19 mario79 70
    ret
1 ha 71