From cdc4625b124f725fbc9462d5592d1d3be2aa613a Mon Sep 17 00:00:00 2001 From: Leo C Date: Mon, 11 May 2015 08:32:57 +0200 Subject: phys. address 0x00040 points to fifo_list --- z180/init.180 | 83 ++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 23 deletions(-) (limited to 'z180/init.180') diff --git a/z180/init.180 b/z180/init.180 index f43aaeb..c3db6a1 100644 --- a/z180/init.180 +++ b/z180/init.180 @@ -163,7 +163,7 @@ kstart: if CPU_Z180 if 0 - + ld hl,dmclrt ;load DMA registers call ioiniml ld a,0cbh ;01ef dst +1, src fixed, burst @@ -174,7 +174,7 @@ kstart: ??cl_1: out0 (dstat),a ;01f9 clear (up to) 64k djnz ??cl_1 ; end of RAM? - + endif endif @@ -185,10 +185,10 @@ kstart: ; -- wstart -- wstart: - call sysram_init ;027f + call sysram_init call ivtab_init if CPU_Z180 - call prt0_init +; call prt0_init endif call charini @@ -199,20 +199,23 @@ wstart: call selbnk endif - im 2 ;?030e - ei ;0282 + ld a,INIDONEVAL ;tell others (CP/M) that hardware and fifos + ld (INIDONE),a ; are allready initialized + + im 2 + ei - call ?const ;0284 - call ?const ;0287 - or a ;028a - call nz,?conin ;028d + call ?const + call ?const + or a + call nz,?conin if CPU_Z180 ld e,0 ;Sys$Bank else ; TODO: endif - jp ddtz ;0290 + jp ddtz if CPU_Z180 @@ -224,16 +227,51 @@ syscbr: db 1 ;---------------------------------------------------------------------- ; -;TODO: Make a ringbuffer module. - global buf.init buf.init: ld (ix+o.in_idx),0 ld (ix+o.out_idx),0 ld (ix+o.mask),a + + ld a,(ix+o.id) + cp 4 + ret nc + + push de + push hl + ld hl,fifo_list + push hl ;save fifo_list + ld e,a + ld d,0 + add hl,de + add hl,de + add hl,de + push ix + pop de +; TODO: address transation + ld (hl),e + inc hl + ld (hl),d + pop hl ;get fifo_list back + or a + jr nz,bufi_ex + + ld (040h),hl + ld (040h+2),a +bufi_ex: + pop hl + pop de + ret + +fifo_list: + rept 4 + dw 0 + db 0 + endm + ;---------------------------------------------------------------------- extrn msginit,msg.sout @@ -259,11 +297,11 @@ bfi_1: or a jr nz,bfi_2 - call hwl2phy - ld (40h+0),hl - ld (40h+2),a +; call hwl2phy +; ld (40h+0),hl +; ld (40h+2),a out (AVRINT5),a - jr bfi_3 + jr bfi_3 bfi_2: call hwl2phy ld (bufdat+1),hl @@ -426,12 +464,12 @@ ioi_r: dec a jr nz,ioi_r jr ioi_nxt -ioi_e: +ioi_e: pop bc ret - + else ;(if 1/0) - + push bc jr ioi_nxt ioi_l: @@ -449,7 +487,7 @@ ioi_nxt: djnz ioi_l pop bc ret - + endif ;(1/0) else @@ -484,7 +522,7 @@ ioml_lp: inc hl cp b jr z,ioml_e - + ld c,(hl) inc hl otimr @@ -909,4 +947,3 @@ mark_55AA equ 0 - 2 - 4 ;2 byte for trap stack end - -- cgit v1.2.3