]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - z180/config.inc
switch fifos conin,conout
[z180-stamp.git] / z180 / config.inc
index ed98656c936f9214df8b2fd109f3b7579167647b..2a8a842d0c4067f00f38425fab6c66601b3b9490 100644 (file)
@@ -2,6 +2,11 @@
 FALSE  equ     0\r
 TRUE   equ     NOT FALSE\r
 \r
+\r
+DEBUG  equ     true\r
+\r
+banked equ     true\r
+\r
 ;-----------------------------------------------------\r
 ; CPU and BANKING types\r
 \r
@@ -19,6 +24,20 @@ AVRCLK               equ     18432           ;[KHz]
 FOSC           equ     AVRCLK/2        ;Oscillator frequency [KHz]\r
 PHI            equ     FOSC*2          ;CPU frequency (clock doubler enabled)\r
 \r
+;----------------------------------------------------------------------\r
+; Baudrate Generator for x16 clock mode:\r
+; TC = (f PHI / (32 * baudrate)) - 2\r
+;\r
+;     PHI [MHz]: 9.216 18.432\r
+;     baudrate     TC     TC\r
+;     ----------------------\r
+;      115200      -      3\r
+;      57600       3      8\r
+;      38400       -     13\r
+;      19200      13     28\r
+;       9600      28     58\r
+\r
+\r
 ;-----------------------------------------------------\r
 ; Programmable Reload Timer (PRT)\r
 \r
@@ -32,10 +51,10 @@ PRT_TC10MS  equ     PHI / (PRT_PRE/10)
 ;-----------------------------------------------------\r
 ; MMU\r
 \r
-COMMON_SIZE    equ     4*1024          ;Common Area size in bytes\r
+COMMON_SIZE    equ     16*1024         ;Common Area size in bytes\r
                                        ;must be multiple of 4K\r
 \r
-if (COMMON_SIZE mod 1000h) \r
+if (COMMON_SIZE mod 1000h)\r
        .printx COMMON_SIZE not multiple of 4K!\r
        end     ;stop assembly\r
 endif\r
@@ -45,8 +64,8 @@ CA    equ     10h - CSK               ;common area start
 BA     equ     0                       ;banked area start\r
 \r
 SYS$CBR                equ     0\r
-SYS$CBAR       equ     CA<<4 + CA      ;CBAR in system mode\r
-USR$CBAR       equ     CA<<4 + BA      ;CBAR in user mode (CP/M)\r
+SYS$CBAR       equ     CA*16 + CA      ;CBAR in system mode\r
+USR$CBAR       equ     CA*16 + BA      ;CBAR in user mode (CP/M)\r
 \r
 \r
 BANKS          equ     18              ;max nr. of banks\r
@@ -55,6 +74,7 @@ BANKS         equ     18              ;max nr. of banks
 \r
 CREFSH         equ     0               ;Refresh rate register (disable refresh)\r
 CWAITIO                equ     3 shl IWI0      ;Max I/O Wait States, 0 Memory Wait States\r
+PHI_X2         equ     0               ;set to M_X2CM to enable the clock doubler\r
 \r
     endif              ;CPU_Z180\r
     if CPU_Z80\r
@@ -103,17 +123,25 @@ CWAITROM  equ     2 shl MWI0
     endif\r
 \r
 \r
-DRSTNUM        equ     30h             ;DDTZ Restart vector (breakpoints)\r
+DDTZRSTVEC     equ     030h            ;DDTZ Restart vector (breakpoints)\r
 \r
+INIDONE                equ     03Fh            ;CP/M skip hw init, if this address\r
+INIDONEVAL     equ     080h            ;    is set to this value.\r
 \r
-mrx.fifo_len   equ     256\r
-mtx.fifo_len   equ     256\r
+mtx.fifo_len   equ     32              ;Message transfer fifos\r
+mtx.fifo_id    equ     0               ;    This *must* have #0\r
+mrx.fifo_len   equ     32\r
+mrx.fifo_id    equ     1\r
 \r
-ci.fifo_len    equ     128\r
-co.fifo_len    equ     256\r
+ci.fifo_len    equ     32              ;AVRCON Character I/O via AVR\r
+ci.fifo_id     equ     2\r
+co.fifo_len    equ     32\r
+co.fifo_id     equ     3\r
 \r
-s1.rx_len      equ     256             ;Serial 1 (ASCI1) buffers\r
-s1.tx_len      equ     256             ;\r
+s1.rx_len      equ     128             ;Serial 1 (ASCI1) buffers\r
+s1.rx_id       equ     4               ;\r
+s1.tx_len      equ     128             ;\r
+s1.tx_id       equ     5               ;\r
 \r
 AVRINT5                equ     4Fh\r
 AVRINT6                equ     5Fh\r
@@ -123,7 +151,7 @@ AVRINT6             equ     5Fh
 ; Definition of (logical) top 2 memory pages\r
 \r
 sysram_start   equ     0FE00h\r
-stacksize      equ     80\r
+bs$stack$size  equ     80\r
 \r
 isvsw_loc      equ     0FEE0h\r
 \r
@@ -134,24 +162,26 @@ iv2tab            equ     ivtab + 2*9
 \r
 ;-----------------------------------------------------\r
 \r
-\r
+o.id           equ     -4\r
 o.mask         equ     -3\r
 o.in_idx       equ     -2\r
 o.out_idx      equ     -1\r
 \r
        .lall\r
 \r
-mkbuf  macro   name,size\r
-  if ((size & (size-1)) ne 0) or (size gt 256)\r
+mkbuf  macro   id,name,size\r
+  if ((size AND (size-1)) NE 0) OR (size GT 256)\r
     .printx Error: buffer ^size must be power of 2 and in range 0..256!\r
     name&.mask equ ;wrong size error\r
   else\r
+    db id\r
     ds 3\r
     name:: ds size\r
     name&.mask equ low (size-1)\r
     if size ne 0\r
       name&.end equ $-1\r
       name&.len equ size\r
+      name&.id equ id\r
     endif\r
   endif\r
 endm\r
@@ -169,3 +199,9 @@ inidate     macro
        ds      ??ps.len\r
        endm\r
 \r
+;-----------------------------------------------------\r
+\r
+b0call macro   address\r
+       call    _b0call\r
+       dw      address\r
+       endm\r