]> cloudbase.mooo.com Git - avrcpm.git/blobdiff - init.asm
* Test: change directory hierarchy.
[avrcpm.git] / init.asm
index 7b9d9fb6c71f119e5f624d48f84b347abccb8cb2..de576a8608cbb2710b4c23b66b6eb30aa1eccaf2 100644 (file)
--- a/init.asm
+++ b/init.asm
@@ -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
 
@@ -205,11 +202,13 @@ ramfillw:
 boot_again:
        printnewline
        printstring "Initing mmc...",0
-       rcall   dsk_partinit
+       printnewline
+       lcall   mgr_init_partitions
 
        cbr     temp,0x80
        brne    boot_ipl2
        printstring "No bootable CP/M disk found! Please change MMC/SD-Card."
+       printnewline
        ldi     temp2,18
 boot_iplwl:
        ldi     temp,255
@@ -220,19 +219,21 @@ boot_iplwl:
        
 
 boot_ipl2:
-       rcall   prnt_parttbl
+       lcall   mgr_prnt_parttbl
        printnewline
        printstring "Partinit done."
 
-; Read first sector of first CP/M partition
+       rcall   dsk_cboot               ;init (de)blocking buffer
 
-       lds     xl,hostparttbl
-       lds     xh,hostparttbl+1
-       lds     yl,hostparttbl+2
-       lds     yh,hostparttbl+3
+; 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
 
-       rcall   dsk_cboot               ;init (de)blocking buffer
+;      rcall   dsk_cboot               ;init (de)blocking buffer
 
 ;First sector of disk or first CP/M partition is in hostbuf.
 
@@ -241,12 +242,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
-       rjmp z80_init
+       ljmp z80_init