X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/fecee2418b6aea15008ed6d3a856d202d59a5cdb..64cc220767e870fad388fb9021cf96ff2958275b:/z180/init.180 diff --git a/z180/init.180 b/z180/init.180 index 0bd37c1..73a77bb 100644 --- a/z180/init.180 +++ b/z180/init.180 @@ -5,10 +5,10 @@ extrn $stack extrn charini,?const,?conin extrn ?cono,?conos - extrn romend + global iobyte global isv_sw include config.inc @@ -28,7 +28,8 @@ romstart equ $ org romstart+0 jp start -iobyte: db 0 +iobyte: db 2 + ; restart vectors rsti defl 1 @@ -75,14 +76,12 @@ start: hwini0: if CPU_Z180 - db 3 ;count db rcr,CREFSH ;configure DRAM refresh db dcntl,INIWAITS ;wait states db cbar,SYS$CBAR - else - db 0 endif + db 0 if CPU_Z180 dmclrt: ;clear ram per dma @@ -95,6 +94,7 @@ nullbyte: db 00h ;dst dw 0-romend ;count (64k) dmct_e: + db 0 endif @@ -165,7 +165,7 @@ kstart: if 0 ld hl,dmclrt ;load DMA registers - call io.ini.m + call ioiniml ld a,0cbh ;01ef dst +1, src fixed, burst out0 (dmode),a ;01f1 @@ -434,7 +434,7 @@ prt0_init: inc hl ld (hl),high iprt0 ld hl,prt0itab - call io.ini.m + call ioiniml ret prt0itab: @@ -444,6 +444,7 @@ prt0itab: dw PRT_TC10MS db M_TIE0+M_TDE0 ;enable timer 0 interrupt and down count. prt0it_e: + db 0 endif @@ -451,24 +452,55 @@ prt0it_e: ;---------------------------------------------------------------------- ; + if CPU_Z180 io.ini: + if 0 push bc - if CPU_Z180 - ld b,0 ;high byte port adress +ioi_nxt: ld a,(hl) ;count inc hl or a jr z,ioi_e -ioi_1: + ld c,(hl) ;port address inc hl +ioi_r: outi inc b ;outi decrements b dec a - jr nz,ioi_1 + jr nz,ioi_r + jr ioi_nxt ioi_e: + pop bc + ret + + else ;(if 1/0) + + push bc + jr ioi_nxt +ioi_l: + ld c,(hl) ;port address + inc hl + inc c +ioi_r: + dec c ;otim increments c + otim + jr z,ioi_r +ioi_nxt: + ld b,(hl) ;count + inc hl + inc b ;stop if count == 0 + djnz ioi_l + pop bc + ret + + endif ;(1/0) + else + +io.ini: + push bc jr ioi_nxt ioi_l: ld c,(hl) ;port address @@ -483,16 +515,28 @@ ioi_nxt: pop bc ret +;---------------------------------------------------------------------- + if CPU_Z180 -io.ini.m: + + global ioiniml + +ioiniml: push bc + xor a +ioml_lp: ld b,(hl) inc hl + cp b + jr z,ioml_e + ld c,(hl) inc hl otimr + jr ioml_lp +ioml_e: pop bc - ret + ret z endif io.ini.l: