From a7693db3d3c922fc800a59d04d720ba3edc046cd Mon Sep 17 00:00:00 2001 From: Frank Zoll Date: Tue, 5 Oct 2010 11:57:21 +0000 Subject: [PATCH] git-svn-id: svn://cu.loc/avr-cpm/trunk/avrcpm/avr@117 57430480-672e-4586-8877-bcf8adbbf3b7 --- dsk_fat16.asm | 59 ++++++++------------------------------------------- 1 file changed, 9 insertions(+), 50 deletions(-) diff --git a/dsk_fat16.asm b/dsk_fat16.asm index 4d2683d..cc25afd 100644 --- a/dsk_fat16.asm +++ b/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 -- 2.39.2