From: Brett Gordon Date: Tue, 17 May 2016 20:17:16 +0000 (-0400) Subject: coco3: make sdc driver handle rawmode=1. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=0892afb1e648ae7fbb43e972befc842af188e1e7;p=FUZIX.git coco3: make sdc driver handle rawmode=1. --- diff --git a/Kernel/platform-coco3/sdc.s b/Kernel/platform-coco3/sdc.s index 0193e004..e7bb7ef1 100644 --- a/Kernel/platform-coco3/sdc.s +++ b/Kernel/platform-coco3/sdc.s @@ -37,6 +37,9 @@ _devsdc_write pshs y,u ldy #PREG2 ; set Y to point at data reg a ldd #64*256+4 ; A = chunk count (64), B = bytes per chunk (4) + tst _blk_op+2 ; test user/kernel xfer + beq wrChnk ; if zero then stay in kernel space + jsr map_process_always ; else flip in user space wrChnk ldu ,x ; get 2 data bytes from source stu ,y ; send data to controller ldu 2,x ; two more bytes.. @@ -44,6 +47,7 @@ wrChnk ldu ,x ; get 2 data bytes from source abx ; increment X by chunk size (4) deca ; decrement loop counter bne wrChnk ; loop until all chunks written + jsr map_kernel ; reset to kernel space puls y,u,pc ; return ;;; Reads 256 bytes from SDC @@ -51,6 +55,9 @@ _devsdc_read pshs y,u ldy #PREG2 ; set Y to point to data reg a ldd #32*256+8 ; A = chunk count (32), B = bytes per chunk (8) + tst _blk_op+2 ; test usr/kernel xfer + beq rdChnk ; if zero then stay in kernel space + jsr map_process_always ; else flip to user space rdChnk ldu ,y ; read 1st pair of bytes for the chunk stu ,x ; store to buffer ldu ,y ; bytes 3 and 4 of.. @@ -62,11 +69,5 @@ rdChnk ldu ,y ; read 1st pair of bytes for the chunk abx ; increment X by chunk size (8) deca ; decrement loop counter bne rdChnk ; loop if more chunks to read + jsr map_kernel ; reset to kernel space puls y,u,pc ; return - - - - - - -