Subversion Repositories Kolibri OS

Rev

Rev 1161 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1161 Rev 1206
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
4
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
4
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
5
;; Distributed under terms of the GNU General Public License    ;;
5
;; Distributed under terms of the GNU General Public License    ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
7
 
8
$Revision: 766 $
8
$Revision: 1206 $
9
 
9
 
10
 
10
 
11
iglobal
11
iglobal
12
  ;function pointers.
12
  ;function pointers.
13
  fdc_irq_func	  dd fdc_null
13
  fdc_irq_func	  dd fdc_null
14
endg
14
endg
15
 
15
 
16
uglobal
16
uglobal
17
  dmasize	  db 0x0
17
  dmasize	  db 0x0
18
  dmamode	  db 0x0
18
  dmamode	  db 0x0
19
endg
19
endg
20
 
20
 
21
fdc_init:				;start with clean tracks.
21
fdc_init:				;start with clean tracks.
22
	mov edi,OS_BASE+0xD201
22
	mov edi,OS_BASE+0xD201
23
	mov al,0
23
	mov al,0
24
	mov ecx,160
24
	mov ecx,160
25
	rep stosb
25
	rep stosb
26
ret
26
ret
27
 
27
 
28
fdc_irq:
28
fdc_irq:
29
	call [fdc_irq_func]
29
	call [fdc_irq_func]
30
fdc_null:
30
fdc_null:
31
ret
31
ret
32
 
32
 
33
save_image:
33
save_image:
34
    call   reserve_flp
34
    call   reserve_flp
35
    call   restorefatchain
35
    call   restorefatchain
36
    pusha
36
    pusha
37
    call   check_label
37
    call   check_label
38
    cmp    [FDC_Status],0
38
    cmp    [FDC_Status],0
39
    jne    unnecessary_save_image
39
    jne    unnecessary_save_image
40
    mov    [FDD_Track],0      ; Öèëèíäð
40
    mov    [FDD_Track],0      ; Öèëèíäð
41
    mov    [FDD_Head],0      ; Ñòîðîíà
41
    mov    [FDD_Head],0      ; Ñòîðîíà
42
    mov    [FDD_Sector],1      ; Ñåêòîð
42
    mov    [FDD_Sector],1      ; Ñåêòîð
43
    mov    esi,RAMDISK
43
    mov    esi,RAMDISK
44
    call   SeekTrack
44
    call   SeekTrack
45
save_image_1:
45
save_image_1:
46
    push   esi
46
    push   esi
47
    call   take_data_from_application_1
47
    call   take_data_from_application_1
48
    pop    esi
48
    pop    esi
49
    add    esi,512
49
    add    esi,512
50
    call   WriteSectWithRetr
50
    call   WriteSectWithRetr
51
;    call   WriteSector
51
;    call   WriteSector
52
    cmp    [FDC_Status],0
52
    cmp    [FDC_Status],0
53
    jne    unnecessary_save_image
53
    jne    unnecessary_save_image
54
    inc    [FDD_Sector]
54
    inc    [FDD_Sector]
55
    cmp    [FDD_Sector],19
55
    cmp    [FDD_Sector],19
56
    jne    save_image_1
56
    jne    save_image_1
57
    mov    [FDD_Sector],1
57
    mov    [FDD_Sector],1
58
    inc    [FDD_Head]
58
    inc    [FDD_Head]
59
    cmp    [FDD_Head],2
59
    cmp    [FDD_Head],2
60
    jne    save_image_1
60
    jne    save_image_1
61
    mov    [FDD_Head],0
61
    mov    [FDD_Head],0
62
    inc    [FDD_Track]
62
    inc    [FDD_Track]
63
    call   SeekTrack
63
    call   SeekTrack
64
    cmp    [FDD_Track],80
64
    cmp    [FDD_Track],80
65
    jne    save_image_1
65
    jne    save_image_1
66
unnecessary_save_image:
66
unnecessary_save_image:
67
    mov    [fdc_irq_func],fdc_null
67
    mov    [fdc_irq_func],fdc_null
68
    popa
68
    popa
69
    mov    [flp_status],0
69
    mov    [flp_status],0
70
    ret
70
    ret