]> cloudbase.mooo.com Git - avrcpm.git/blobdiff - avrcpm/avr/init.asm
* Merged fat16-test back into trunk.
[avrcpm.git] / avrcpm / avr / init.asm
index 374bdd24bc785d9ff0014ca8c8bee838d4a8e670..4ffff96751146fe23503e3211ed2cf09f066c5e9 100644 (file)
@@ -1,5 +1,4 @@
 ;    Various functions: init, (RAM) disk, mmc, timer
-;    This file needs to get split up.
 ;
 ;    Copyright (C) 2010 Sprite_tm
 ;    Copyright (C) 2010 Leo C.
@@ -141,8 +140,7 @@ clr_l:
 ramtestw:
        mov temp,xh
        eor temp,xl
-       mem_write
-       adiw xl,1
+       rcall   dram_write_pp
        brcc ramtestw
        printstring "wait..."
 
@@ -194,8 +192,7 @@ ramtestrok:
        ldiw    x,0
 ramfillw:
        ldi temp,MEMFILL_VAL
-       mem_write
-       adiw xl,1
+       rcall   dram_write_pp
        brcc ramfillw
 .endif
 
@@ -206,7 +203,7 @@ boot_again:
        printnewline
        printstring "Initing mmc...",0
        printnewline
-       call    mgr_init_partitions
+       lcall   mgr_init_partitions
 
        cbr     temp,0x80
        brne    boot_ipl2
@@ -222,21 +219,31 @@ boot_iplwl:
        
 
 boot_ipl2:
-       call    mgr_prnt_parttbl
+       lcall   mgr_prnt_parttbl
        printnewline
        printstring "Partinit done."
 
-       rcall   dsk_cboot               ;init (de)blocking buffer\r
+       rcall   dsk_cboot               ;init (de)blocking buffer
 
-; Read first sector of first CP/M partition
+; Read first sector of first CP/M partition (ipl)
 
-       lds     xl,hostparttbl+1
-       lds     xh,hostparttbl+2
-       lds     yl,hostparttbl+3
-       lds     yh,hostparttbl+4
-       rcall   mmcReadSect
+;      lds     xl,hostparttbl+1
+;      lds     xh,hostparttbl+2
+;      lds     yl,hostparttbl+3
+;      lds     yh,hostparttbl+4
+;      rcall   mmcReadSect
 
-       rcall   dsk_cboot               ;init (de)blocking buffer
+;      Disk 0
+       sts     seekdsk,_0
+;      Track 0
+       sts     seektrk,_0
+       sts     seektrk+1,_0
+;      Sector 0
+       sts     seeksec,_0
+
+       rcall   dsk_read
+
+;      rcall   dsk_cboot               ;init (de)blocking buffer
 
 ;First sector of disk or first CP/M partition is in hostbuf.
 
@@ -245,12 +252,11 @@ boot_ipl2:
        ldiw x,IPLADDR
 iplwriteloop:
        ld temp,z+
-       mem_write
-       adiw xl,1
+       rcall   dram_write_pp
        cpi zl,low(hostbuf+128)
        brne iplwriteloop
        cpi zh,high(hostbuf+128)
        brne iplwriteloop
-       jmp z80_init
+       ljmp z80_init