;       BK monitor specific macros,...

; Generate a piece of text to display at the specified point of the BK screen
;       .bktext <col,row>,<text string>
; "text string2" can involve with usual chars some special symbols
;              '\n '    - means newline
;              '\_ '    - means switching underline mode
;              '\~ '    - means switching inverse video mode
;              '\^ '    - means clearing up to the end of screen
;              '\r '    - means switch on red color
;              '\g '    - means switch on green color
;              '\b '    - means switch on blue color
        .nlist
 .macro .bktext loc,string
        .iif nb <loc>   .byte   5,loc   ; Specify the string location
        ..spec=0
        .irpc   X,<string>
                .if     nz ..spec
                                        ; Handle special chars
                   .if     idn <X> <n>
                        .byte   12      ; Newline char
                   .iff
                   .if     idn <X> <_>
                        .byte   237     ; Underline mode
                   .iff
                   .if     idn <X> <~>
                        .byte   234     ; Inverse video mode
                   .iff
                   .if     idn <X> <^>
                        .byte   4       ; Clear to end-of-screen
                   .iff
                   .if     idn <X> <r>
                        .byte   221     ; Red color
                   .iff
                   .if     idn <X> <g>
                        .byte   222     ; Green color
                   .iff
                   .if     idn <X> <b>
                        .byte   223     ; Blue color
                   .endc
                   .endc
                   .endc
                   .endc
                   .endc
                   .endc
                   .endc
                   ..spec=0
                .iff                    ; Else X is an usual char
                   .if     idn <X> <\>
                        ..spec=1                ; Switch to the special char
                   .iff
                        .byte  ''X
                   .endc
                .endc
        .endr
 .endm
        .list

MessTablePtr    =       402             ; Message table ptr

; Write a message with the specified no.
;       .mess   no
;  'no' being a number or 'r0'
        .nlist
 .macro .mess   numb            ; Write a message
        trap    14
        .ntype  ..ntype, numb
        .if     eq ..ntype-0            ; r0 was specified
                .word   0
        .iff
                .word   numb
        .endc
 .endm
        .list
