]> cloudbase.mooo.com Git - avrcpm.git/blobdiff - avrcpm/avr/dsk_mgr.asm
git-svn-id: svn://cu.loc/avr-cpm/trunk@114 57430480-672e-4586-8877-bcf8adbbf3b7
[avrcpm.git] / avrcpm / avr / dsk_mgr.asm
index 16977f57cf1f3c95ac0b6742ac1086aacb78284b..38901cd6fa7d7118da2c0cf4c0029ca8ce43a84e 100644 (file)
@@ -65,7 +65,7 @@ mgr_picl:
        brne    mgr_picl\r
 \r
 ; Start mmc Card interaction\r
-       rcall   mmcInit\r
+       lcall   mmcInit\r
        andi    temp,MMCST_NOINIT & MMCST_NODISK\r
        brne    mgr_pierr\r
        \r
@@ -194,6 +194,7 @@ mgr_pcpl:
 \r
 #if FAT16_SUPPORT\r
        rcall fat_scan_partition\r
+       rcall fat_reset_cache
 #endif\r
        lds             temp,ndisks\r
        sbr             temp,0x80\r
@@ -217,19 +218,29 @@ mgr_pcpe:
 \r
 mgr_prnt_parttbl:\r
        ldiw    z,hostparttbl\r
-pprl:\r
-; Partitiontype examining\r
+       lds             yl,ndisks\r
+       ldi             xh,'A'\r
 \r
-       ldd     xl,z+0\r
-; Empty slot?\r
-       cpi             xl,dskType_None\r
-       breq    mgr_goto_next_part\r
+pprl:
+       ldd             temp ,z+1               ;Get partition start
+       ldd             temp2,z+2
+       ldd             temp3,z+3
+       ldd             temp4,z+4
 \r
        printnewline\r
 \r
+       cp              temp,_0                 ;If zero ...
+       cpc             temp2,_0
+       cpc             temp3,_0
+       cpc             temp4,_0
+       breq    mgr_prnop               ;... no partition table at 0
+\r
+; Partitiontype examining\r
+       ldd     xl,z+0\r
 ; CP/M ?\r
        cpi             xl,dskType_CPM\r
        brne    mgr_prtb_nocpm\r
+       rcall   mgr_prnt_diskname\r
        rcall   mgr_prnt_table_cpm\r
        rjmp    mgr_prnt_size\r
 \r
@@ -237,12 +248,14 @@ pprl:
 mgr_prtb_nocpm:\r
        cpi             xl,dskType_FAT\r
        brne    mgr_prtb_nofat\r
+       rcall   mgr_prnt_diskname\r
        rcall   mgr_prnt_table_fat\r
        rjmp    mgr_prnt_size\r
 ; RAMDISK ?\r
 mgr_prtb_nofat:\r
        cpi             xl,dskType_RAM\r
        brne    mgr_prnt_err\r
+       rcall   mgr_prnt_diskname\r
        rcall   mgr_prnt_table_ram\r
        rjmp    mgr_prnt_size\r
 ; Entry Error\r
@@ -251,14 +264,11 @@ mgr_prnt_err:
        rjmp    mgr_prnt_size\r
 \r
 mgr_prnop:\r
+       rcall   mgr_prnt_diskname\r
        rcall   mgr_prnt_image\r
 \r
 mgr_prnt_size:\r
-       ldd             temp ,z+1               ;Get partition start\r
-       ldd             temp2,z+2\r
-       ldd             temp3,z+3\r
-       ldd             temp4,z+4\r
-       lcall   print_ultoa\r
+       call    print_ultoa
        printstring ", size: "\r
 \r
        ldd             temp ,z+5                       ;Get partition size\r
@@ -270,15 +280,15 @@ mgr_prnt_size:
        ror             temp3\r
        ror             temp2\r
        ror             temp\r
-       lcall   print_ultoa\r
+       call    print_ultoa
        printstring "KB."\r
 \r
 mgr_goto_next_part:    \r
        adiw    z,PARTENTRY_SIZE\r
-       ldi             temp,high(hostparttbltop)\r
-       cpi             zl,  low (hostparttbltop)\r
-       cpc             zh,temp\r
-       brlo    pprl\r
+       inc             xh
+       dec             yl\r
+       tst             yl\r
+       brne    pprl
 \r
 mgr_pppre:\r
        ret\r
@@ -298,6 +308,15 @@ mgr_prnt_fatsize:
        \r
        rjmp            mgr_goto_next_part\r
 \r
+mgr_prnt_diskname:\r
+       push    temp\r
+       mov temp,xh
+       call uartputc\r
+       ldi temp,':'
+       call uartputc\r
+       pop             temp\r
+       ret\r
+\r
 mgr_prnt_table_cpm:\r
        printstring "CP/M partition at: "\r
        ret\r