]> cloudbase.mooo.com Git - z180-stamp-cpm3.git/blobdiff - cbios/msgbuf.180
New memory map: bank 1 and common are now contiguous
[z180-stamp-cpm3.git] / cbios / msgbuf.180
index 27c82d4b5278839ea14fd418446497aebf066e43..7b70d5427bd77975b6db30477d6ebd0f263d3a0b 100644 (file)
@@ -7,7 +7,7 @@
 ;      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
@@ -18,9 +18,6 @@
        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
@@ -35,7 +32,9 @@ msginit:
        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
@@ -47,11 +46,13 @@ msginit:
 \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