]> cloudbase.mooo.com Git - avrcpm.git/blobdiff - avrcpm/avr/dsk_mgr.asm
* More rcall --> lcall changes.
[avrcpm.git] / avrcpm / avr / dsk_mgr.asm
index 38901cd6fa7d7118da2c0cf4c0029ca8ce43a84e..4b108a301a07a8472f457a20def900d2f4b7a0d9 100644 (file)
 ;\r
 \r
 \r
-; ------------------------- Defines for the disk management Structures\r
+;-------------------------- Defines for the disk management Structures\r
 \r
 ;----------------------------------------------- Start of Data Segment\r
 \r
        .dseg\r
 \r
 \r
+; Partition table offsets:\r
+tmp_tbl:\r
+       .byte   PARTENTRY_SIZE*MAXDISKS\r
 \r
 ; ------------------------------- Start of Code Segment\r
        .cseg\r
 ; ====================================================================\r
 ; Parameters\r
 ; --------------------------------------------------------------------\r
-; Registers  : none\r
-; Variables  : [w] temp                Status of Operation\r
-;                                                      (0x80 - Operation Failure )\r
-;                                                      (others - Operation Suceded)\r
+; \r
+; Registers  : [w] temp            Number of disk images (raw and fat16) found.\r
+;                          + 0x80 if sd card changes. (not used, doesn't work)\r
+; SREG :          Z        according to temp\r
 ; --------------------------------------------------------------------\r
 ; Description:\r
 ; This Function scans an SD-Cards Boot-Sector for valid Partitions.\r
@@ -164,8 +167,16 @@ mgr_nextp2:
 \r
 mgr_pend:\r
 \r
+#if 0          /* ToDo: ramdisks are not in sd-card partitions */\r
 ; Initialize RAM-Disks\r
        rcall   rdsk_add_partition\r
+#endif\r
+\r
+/*\r
+   Don't use change info. It doesn't word reliably with partitions, \r
+   and it doesn't work at all with fat images:\r
+*/\r
+#define CHANGEINFO 0\r
 \r
 ;Store new partitions and check if the SD card has been changed.\r
 \r
@@ -185,22 +196,27 @@ mgr_pcpl:
 \r
        mov             temp,temp3\r
        sts             ndisks,temp\r
+#if CHANGEINFO\r
        brtc    mgr_pcpe\r
 \r
+;      SD card changed.\r
+#endif\r
        tst             temp\r
        breq    mgr_pcpe\r
 \r
-;      SD card not changed.\r
 \r
 #if FAT16_SUPPORT\r
        rcall fat_scan_partition\r
        rcall fat_reset_cache
 #endif\r
        lds             temp,ndisks\r
+#if CHANGEINFO\r
        sbr             temp,0x80\r
+#endif\r
 \r
 mgr_pcpe:\r
 \r
+       tst     temp\r
        ret\r
 \r
 \r