st y+,_0
st y+,_0
st y+,_0
- st y+,_0
- st y+,_0
- st y+,_0
- st y+,_0
ret\r
\r
; ============================================================================\r
st y+,temp
ldd temp,z+PART_START+3
st y+,temp
-\r
-; Don't need the Size of the Partition for use with Imagefiles
-; ldd temp,z+PART_SIZE
-; st y+,temp
-; ldd temp,z+PART_SIZE+1
-; st y+,temp
-; ldd temp,z+PART_SIZE+2
-; st y+,temp
-; ldd temp,z+PART_SIZE+3
-; st y+,temp
-
; reload variables from stack
pop yh
fat_scan_for_more:\r
\r
-\r
-.if FAT16_DEBUG > 1\r
- printstring "At:Scann for more ",0\r
- printnewline\r
-.endif\r
-\r
lds zl ,fat_clust_ptr\r
lds zh ,fat_clust_ptr+1\r
lds temp2,fat_clust_ptr+2\r
fat_look_not_ok:
-
-.if FAT16_DEBUG > 1\r
- printstring "+",0\r
-.endif\r
- \r
+ \r
adiw z,32\r
inc temp2
fat_scan_next_sector:
-.if FAT16_DEBUG > 1\r
- printstring "At:Scan next Sector",0\r
- printnewline\r
-.endif\r
\r
lds temp3, fat_log_clust\r
lds temp4, fat_log_clust+1\r
\r
fat_scan_at_end:\r
\r
-.if FAT16_DEBUG > 1\r
- printstring "At:Scan at end",0\r
- printnewline\r
-.endif\r
-\r
lds temp,fat_last_dsk\r
inc temp\r
sts fat_last_dsk,temp\r
ldi temp,dskType_FAT
st y+,temp
-.if FAT16_DEBUG > 1\r
- printstring "ClusterID",0\r
-.endif\r
+\r
; Offset to Startcluster + 2
ldd temp,z+0x1A
st y+,temp
-.if FAT16_DEBUG > 1\r
- rcall printhex\r
-.endif
+
ldd temp,z+0x1B
st y+,temp
-.if FAT16_DEBUG > 1\r
- rcall printhex\r
-.endif
+
ldi temp,0
st y+,temp
st y+,temp\r
-.if FAT16_DEBUG > 1\r
- printnewline\r
-.endif
-
; Filesize in Bytes\r
; ldd temp,z+0x1C
; st y+,temp
rjmp fat_next_phsy_clust
; Found the physical cluster
-fat_found_phsy_clust:
+fat_found_phsy_clust:\r
+
.if FAT16_DBG_FAT > 0
printstring "Found phys. Cluster at:",0
mov temp,yl
lsr zl
- rjmp fat_search_clst_lp
+ rjmp fat_search_clst_lp\r
+
fat_found_clst:
; at this point xh and xl are carying the logical cluster number
; printstring "find subsector"
mov xl,yl
mov xh,yh
rcall fat_gethostsec
+\r
; Found the physical sector
.if FAT16_DBG_FAT > 0
printstring "Found phys. Sector at:",0