Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
431 serge 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2540 hidnplayr 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
 
2540 hidnplayr 8
$Revision $
431 serge 9
 
593 mikedld 10
 
1 ha 11
iglobal
19 mario79 12
  ;function pointers.
2382 hidnplayr 13
  fdc_irq_func    dd fdc_null
1 ha 14
endg
15
 
16
uglobal
2382 hidnplayr 17
  dmasize         db 0x0
18
  dmamode         db 0x0
1 ha 19
endg
20
 
2382 hidnplayr 21
fdc_init:                               ;start with clean tracks.
22
        mov     edi, OS_BASE+0xD201
23
        mov     al, 0
24
        mov     ecx, 160
25
        rep stosb
26
        ret
1 ha 27
 
19 mario79 28
fdc_irq:
2382 hidnplayr 29
        call    [fdc_irq_func]
19 mario79 30
fdc_null:
2382 hidnplayr 31
        ret
1 ha 32
 
19 mario79 33
save_image:
2382 hidnplayr 34
        call    reserve_flp
35
        call    restorefatchain
36
        pusha
37
        call    check_label
38
        cmp     [FDC_Status], 0
39
        jne     unnecessary_save_image
40
        mov     [FDD_Track], 0; Цилиндр
41
        mov     [FDD_Head], 0; Сторона
42
        mov     [FDD_Sector], 1; Сектор
43
        mov     esi, RAMDISK
44
        call    SeekTrack
19 mario79 45
save_image_1:
2382 hidnplayr 46
        push    esi
47
        call    take_data_from_application_1
48
        pop     esi
49
        add     esi, 512
50
        call    WriteSectWithRetr
19 mario79 51
;    call   WriteSector
2382 hidnplayr 52
        cmp     [FDC_Status], 0
53
        jne     unnecessary_save_image
54
        inc     [FDD_Sector]
55
        cmp     [FDD_Sector], 19
56
        jne     save_image_1
57
        mov     [FDD_Sector], 1
58
        inc     [FDD_Head]
59
        cmp     [FDD_Head], 2
60
        jne     save_image_1
61
        mov     [FDD_Head], 0
62
        inc     [FDD_Track]
63
        call    SeekTrack
64
        cmp     [FDD_Track], 80
65
        jne     save_image_1
19 mario79 66
unnecessary_save_image:
2382 hidnplayr 67
        mov     [fdc_irq_func], fdc_null
68
        popa
69
        mov     [flp_status], 0
70
        ret
1 ha 71