]> cloudbase.mooo.com Git - avrcpm.git/blobdiff - avr/dsk_fsys.asm
* avr/config.inc
[avrcpm.git] / avr / dsk_fsys.asm
index 46389d2e68273d21066bd09c16b298eb7d461b2d..e39783e251f4281f941a34d190685799931b9206 100644 (file)
@@ -184,7 +184,7 @@ dsk_getpartentry:
        mul     zh,zl
        ldiw    z,hostparttbl
        add     zl,_tmp0
-       add     zh,_tmp1
+       adc     zh,_tmp1
        ret
 
 ; ====================================================================
@@ -364,6 +364,9 @@ tmpdpb:     .byte   16
 
        .cseg
 
+str_CPM_Disk:
+       .db     10,"<CPM_Disk>",0
+
 ;  DPBs for varios fixed formats
 ;  dpb data starts at 2. byte
 
@@ -607,14 +610,10 @@ dsk_tst_avrcpmhd:
 ; ====================================================================
 
 
-pstrn_YAZE:
-       .db     10,"<CPM_Disk>",0
-
-       
 dsk_tst_yaze:
 
        ldiw    y,hostbuf
-       ldiw    z,pstrn_YAZE*2
+       ldiw    z,str_CPM_Disk*2
        lpm     temp2,z+                ; get length
        rcall   strncmp_p
        brne    dsk_tyze_not
@@ -678,8 +677,8 @@ dsk_tmyz80_not:
 ; Registers  : temp            drive #
 ;              
 ; --------------------------------------------------------------------
-; Description: Test, if first 6 tracks are filled with 0xE5,
-;              and Size = 8192 KB.
+; Description: Test, if Size = 8192 KB and 
+;              first 6 tracks are filled with 0xE5.
 ;              Actually, only the first phys. sector is tested, since 
 ;              the other 47 sectors are not in memory at this time.
 ; ====================================================================
@@ -694,10 +693,15 @@ dsk_tst_simhd:
        cpc     temp2,temp
        brne    dsk_tsimhd_not          ;wrong size
        
+       ldiw    y,hostbuf+128-10
+       ldiw    z,str_CPM_Disk*2
+       lpm     temp2,z+                ; get length
+       rcall   strncmp_p
+       breq    dsk_tsimhd_found
+       
        ldiw    z,hostbuf
        ldi     temp2,high(512)
        clr     _tmp0                   ;low(512)
-       
 dsk_tsimhd_loop:
        ld      temp,z+
        cpi     temp,0xE5
@@ -707,6 +711,7 @@ dsk_tsimhd_loop:
        dec     temp2
        brne    dsk_tsimhd_loop
 
+dsk_tsimhd_found:
        ori     temp,0xff
        ret