; global msg.sout\r
global msg.sm,msg.recv\r
\r
- extrn bufinit,hwl2phy\r
+ extrn bufinit,hwl2phy,phy2log\r
extrn fifolst\r
\r
include config.inc\r
mkbuf 0,mtx.fifo,mtx.fifo_len\r
mkbuf 1,mrx.fifo,mrx.fifo_len\r
\r
-;txfifo_addr equ fifolst + (0*2)\r
-;rxfifo_addr equ fifolst + (1*2)\r
-\r
itx equ 0*2\r
irx equ 1*2\r
\r
jr nz,msgi_1\r
\r
ld hl,(040h)\r
-;TODO: physical to logical address translation\r
+ ld a,(040h+2)\r
+ call phy2log\r
+\r
ld a,l\r
or h\r
jr z,msgi_1\r
\r
msgi_1:\r
ld a,(043h)\r
+\r
;TODO: value should be 0\r
+\r
ld ix,mtx.fifo\r
call bufinit\r
-\r
- ld hl,fifolst\r
+ push ix\r
+ pop hl\r
call hwl2phy\r
ld (040h),hl\r
ld (040h+2),a\r