[Coco] Printing from Coco3 Disk Basic to the Drivewire4 printer

Ron ron at kdomain.org
Sun Feb 14 17:43:57 EST 2016


Hi Robert,

I would be very interested in this feature.  Thanks for taking the time 
to work on it!

-Ron


On 02/12/2016 08:27 AM, Robert Gault wrote:
> While we have an easy method of using the DW4 "printer" from NitrOS-9, 
> there is no built-in method of accessing the DW4 printer from 
> Drivewire HDBDOS. I've managed to write some code that will integrate 
> this capability into HDBDOS at least as far as LLIST is concerned. It 
> may work for any PRINT #-2 command but I've not yet tested that.
> I thought the group would find this interesting and there has been 
> little if any interest lately in programming on the list. :)
>
> Robert
>
> * This example is intended to replace the bit-banger print routine on 
> a Coco3
> * so that text is sent to the DW4 printer.
> * Feb 12, 2016  Robert Gault
>
> lptpos    equ    $9C    printer position
> lptwid    equ    $9B    printer page width
>
>     org    $FA0C        Unused memory in SEB
> Main    pshs    d,x,y
>     ldb    #$FF        mark that data will have been sent to DW4
>     stb    <flag,pcr    set our flag
>     ldy    #2        sending two bytes
>     leax    <Param,pcr    temp storage
>     tfr    a,b        data to regB
>     cmpa    #$0d        carriage return?
>     bne    a@
>     clr    lptpos        clear position
>     dec    lptpos
>     lda    #$0a        line feed
>     sta    3,x        add to data
>     ldy    #4        sending 4 bytes
> a@    lda    #'P        print OP_Code
>     std    ,x        store code and data
>     sta     2,x        just in case of line feed
>     jsr    [$D941]        got to HDBDOS routine
>     inc    lptpos        update line position
>     ldb    lptpos        test it for
>     cmpb    lptwid        edge of page
>     bne    b@
>     clr    lptpos        clear position
> b@    puls    d,x,y,pc
>
> Flush    pshs    d,x,y        flush the DW4 print buffer
>     ldy    #1        one byte to send
>     lda    #'F
>     leax    <Param,pcr    temp storage
>     sta    ,x        set Flush code
>     clr    <flag,pcr    clear our flag
>     jsr    [$D941]        go to HDBDOS routine
>     puls    d,x,y,pc
>
> tstchg    pshs    cc,a        test for a change from printer to 
> anything else
>     tst    <flag,pcr
>     beq    a@
>     lda    #'F
>     jsr    Flush
> a@    puls    cc,a
>     jmp    $8C37        the code that was at $A30A
> flag    fcb    0
> Param    fcb    'P,0,'P,0    DW4 print, data, DW4 print, data
> zend    equ    *
>
>     org    $A30A        put character on the screen
>     jmp    tstchg
>
>     org    $A2BF
>     jmp    Main
>
>     end    $0000
>



More information about the Coco mailing list