X-Git-Url: http://cloudbase.mooo.com/gitweb/avrcpm.git/blobdiff_plain/5acead9620303eb771fd6a19d00f0cad7b842e89..32618ce120d49871ee23e7a3c1c9d061a024d10a:/avrcpm/avr/dsk_fat16.asm diff --git a/avrcpm/avr/dsk_fat16.asm b/avrcpm/avr/dsk_fat16.asm index 4d2683d..cc25afd 100644 --- a/avrcpm/avr/dsk_fat16.asm +++ b/avrcpm/avr/dsk_fat16.asm @@ -101,10 +101,6 @@ fat_init_partitiontable: st y+,_0 st y+,_0 st y+,_0 - st y+,_0 - st y+,_0 - st y+,_0 - st y+,_0 ret ; ============================================================================ @@ -172,17 +168,6 @@ fat_add_partition: st y+,temp ldd temp,z+PART_START+3 st y+,temp - -; 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 @@ -539,21 +524,11 @@ fat_look_for_loop: fat_scan_for_more: - -.if FAT16_DEBUG > 1 - printstring "At:Scann for more ",0 - printnewline -.endif - lds zl ,fat_clust_ptr lds zh ,fat_clust_ptr+1 lds temp2,fat_clust_ptr+2 fat_look_not_ok: - -.if FAT16_DEBUG > 1 - printstring "+",0 -.endif - + adiw z,32 inc temp2 @@ -563,10 +538,6 @@ fat_look_not_ok: fat_scan_next_sector: -.if FAT16_DEBUG > 1 - printstring "At:Scan next Sector",0 - printnewline -.endif lds temp3, fat_log_clust lds temp4, fat_log_clust+1 @@ -589,11 +560,6 @@ fat_scan_next_sector: fat_scan_at_end: -.if FAT16_DEBUG > 1 - printstring "At:Scan at end",0 - printnewline -.endif - lds temp,fat_last_dsk inc temp sts fat_last_dsk,temp @@ -637,28 +603,18 @@ fat_look_store: ldi temp,dskType_FAT st y+,temp -.if FAT16_DEBUG > 1 - printstring "ClusterID",0 -.endif + ; Offset to Startcluster + 2 ldd temp,z+0x1A st y+,temp -.if FAT16_DEBUG > 1 - rcall printhex -.endif + ldd temp,z+0x1B st y+,temp -.if FAT16_DEBUG > 1 - rcall printhex -.endif + ldi temp,0 st y+,temp st y+,temp -.if FAT16_DEBUG > 1 - printnewline -.endif - ; Filesize in Bytes ; ldd temp,z+0x1C ; st y+,temp @@ -871,7 +827,8 @@ fat_next_phsy_clust: rjmp fat_next_phsy_clust ; Found the physical cluster -fat_found_phsy_clust: +fat_found_phsy_clust: + .if FAT16_DBG_FAT > 0 printstring "Found phys. Cluster at:",0 mov temp,yl @@ -961,7 +918,8 @@ fat_search_clst_lp: lsr zl - rjmp fat_search_clst_lp + rjmp fat_search_clst_lp + fat_found_clst: ; at this point xh and xl are carying the logical cluster number ; printstring "find subsector" @@ -1019,6 +977,7 @@ fat_wrong_cache_clst: mov xl,yl mov xh,yh rcall fat_gethostsec + ; Found the physical sector .if FAT16_DBG_FAT > 0 printstring "Found phys. Sector at:",0