#define CONFIG_LEVEL_2
#define CONFIG_NET
#define CONFIG_NET_NATIVE
+
+/* redefine tty queue primitives to use our banking ones */
+#define CONFIG_INDIRECT_QUEUES
+typedef unsigned char *queueptr_t;
+#define GETQ(p) getq(p)
+#define PUTQ(p, v) putq((p), (v))
uint8_t vtattr_cap;
-uint8_t tbuf1[TTYSIZ]; /* console 0 */
-uint8_t tbuf2[TTYSIZ]; /* console 1 */
-uint8_t tbuf3[TTYSIZ]; /* drivewire VSER 0 */
-uint8_t tbuf4[TTYSIZ]; /* drivewire VSER 1 */
-uint8_t tbuf5[TTYSIZ]; /* drivewire VSER 2 */
-uint8_t tbuf6[TTYSIZ]; /* drivewire VSER 3 */
-uint8_t tbuf7[TTYSIZ]; /* drivewire VWIN 0 */
-uint8_t tbuf8[TTYSIZ]; /* drivewire VWIN 1 */
-uint8_t tbuf9[TTYSIZ]; /* drivewire VWIN 2 */
-uint8_t tbufa[TTYSIZ]; /* drivewire VWIN 3 */
-
-
-struct s_queue ttyinq[NUM_DEV_TTY + 1] = {
+#define tbuf1 (uint8_t *)(0x2000+TTYSIZ*0)
+#define tbuf2 (uint8_t *)(0x2000+TTYSIZ*1)
+#define tbuf3 (uint8_t *)(0x2000+TTYSIZ*2)
+#define tbuf4 (uint8_t *)(0x2000+TTYSIZ*3)
+#define tbuf5 (uint8_t *)(0x2000+TTYSIZ*4)
+#define tbuf6 (uint8_t *)(0x2000+TTYSIZ*5)
+#define tbuf7 (uint8_t *)(0x2000+TTYSIZ*6)
+#define tbuf8 (uint8_t *)(0x2000+TTYSIZ*7)
+#define tbuf9 (uint8_t *)(0x2000+TTYSIZ*8)
+#define tbufa (uint8_t *)(0x2000+TTYSIZ*9)
+
+
+struct s_queue ttyinq[NUM_DEV_TTY + 1] = {
/* ttyinq[0] is never used */
{NULL, NULL, NULL, 0, 0, 0},
/* GIME Consoles */
/* We have 64 8k pages for a CoCo3 so insert every other one
* into the kernel allocator map.
*/
- for (i = 10; i < max ; i+=2)
+ for (i = 12; i < max ; i+=2)
pagemap_add(i);
/* add common page last so init gets it */
pagemap_add(6);
.globl _video_read
.globl _video_write
.globl _video_cmd
+ .globl _putq
+ .globl _getq
include "kernel.def"
include "../kernel09.def"
dec 1,y ; bump row counter
bne a@ ; loop
puls u,y,pc ; restore regs, return
+
+
+;;;
+;;; Low Level Queueing Routine
+;;;
+
+
+;;; Put a character into tty queue
+;;; void putq( uint8_t *ptr, uint8_t c )
+;;; takes: B = character, X = ptr to buffer (in queue-space)
+;;; modifies: A
+_putq
+ pshs cc ; save interrupt state
+ orcc #0x50 ; stop interrupt till we restore map
+ lda #10 ; mmu page 10 for queue structs
+ sta 0xffa9 ;
+ stb ,x ; store the character
+ lda #1 ; restore kernel map
+ sta 0xffa9 ;
+ puls cc,pc ; restore interrupts, return
+
+;;; Gets a character from tty queue
+;;; uint8_t getq( uint8_t *ptr )
+;;; takes: X = ptr to buffer (in queue-space)
+;;; returns: B = retrieved character
+;;; modifies: nothing
+_getq
+ pshs cc ; save interrupt state
+ orcc #0x50 ; stop interrupt till we restore map
+ lda #10 ; mmu page 10 for queue structs
+ sta 0xffa9 ;
+ ldb ,x
+ lda #1 ; restore kernel map
+ sta 0xffa9 ;
+ puls cc,pc ; restore interrupts, return
\ No newline at end of file