From 6a4e9540b950d871ea8fa072b195490a231b251d Mon Sep 17 00:00:00 2001 From: Leo C Date: Thu, 23 Oct 2014 02:22:01 +0200 Subject: new fifos msg in, msg out, console in, console out --- z180/r3init.180 | 62 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 25 deletions(-) (limited to 'z180/r3init.180') diff --git a/z180/r3init.180 b/z180/r3init.180 index 1936c9b..2dd1bb8 100644 --- a/z180/r3init.180 +++ b/z180/r3init.180 @@ -313,7 +313,7 @@ buf.init: ret ;---------------------------------------------------------------------- - +if 0 extrn msginit,msg_tx_fifo,msg_rx_fifo extrn msg.sout @@ -325,19 +325,19 @@ bufferinit: ld (40h+0),hl ld (40h+2),a - ld (bufdat+1),hl - ld (bufdat+3),a - xor a - ld (bufdat+0),a - ld hl,inimsg - call msg.sout +; ld (bufdat+1),hl +; ld (bufdat+3),a +; ld a,1 +; ld (bufdat+0),a +; ld hl,inimsg +; call msg.sout ld de,msg_rx_fifo in0 a,cbr call log2phys ld (bufdat+1),hl ld (bufdat+3),a - ld a,1 + ld a,2 ld (bufdat+0),a ld hl,inimsg call msg.sout @@ -355,50 +355,63 @@ bufdat: db 0 inimsg_e: +endif ;---------------------------------------------------------------------- ; -if 0 - extrn msginit,msg.sout,msg_fifo - extrn tx.buf,rx.buf + extrn msginit,msg.sout + extrn mtx.fifo,mrx.fifo + extrn co.fifo,ci.fifo bufferinit: call msginit ld hl,buffers - ld bc,0300h ; b:count, c:buffer nr + ld b,buftablen bfi_1: + ld a,(hl) + inc hl + ld (bufdat+0),a ld e,(hl) inc hl ld d,(hl) inc hl push hl + + or a + jr nz,bfi_2 + in0 a,cbr + call log2phys + ld (40h+0),hl + ld (40h+2),a + out0 (AVRINT5),a + jr bfi_3 +bfi_2: in0 a,cbr call log2phys ld (bufdat+1),hl ld (bufdat+3),a - ld a,c - ld (bufdat+0),a ld hl,inimsg call msg.sout +bfi_3: pop hl - inc c djnz bfi_1 ret - rept 20 - db 0 - endm - buffers: - dw msg_fifo - dw tx.buf - dw rx.buf + db 0 + dw mtx.fifo + db 1 + dw mrx.fifo + db 2 + dw co.fifo + db 3 + dw ci.fifo +buftablen equ ($ - buffers)/3 inimsg: - db inimsg_e - $ -2 - db PMSG + db inimsg_e - $ -1 db 81h db inimsg_e - $ -1 db 0 @@ -408,7 +421,6 @@ bufdat: db 0 inimsg_e: -endif ; ;---------------------------------------------------------------------- -- cgit v1.2.3