These primitives are used in TGI graphics in cc65

Switch to hires

#include "../orix/src/include/telemon.h"
#include "../orix/src/include/macro.h"
; set the header
  BRK_TELEMON(XHIRES)

Display a pixel in hires

Display a pixel in x:120 y:100

#include "../orix/src/include/telemon.h"
#include "../orix/src/include/macro.h"
; set the header
        lda #120
        sta HRS1
        lda #100
        sta HRS2
 
        lda #$80
        sta HRSFB
 
        BRK_TELEMON(XCURSE)

Draw a line

Draw a line from X1,Y1 to X2,Y2

#include "../orix/src/include/telemon.h"
#include "../orix/src/include/macro.h"
; set the header
        lda   X1
        sta   HRS1
        lda   Y1
        sta   HRS2
 
        lda   X2
        sta   HRS3
        lda   Y2
        sta   HRS4
 
        lda   #$ff
        sta   HRSPAT
 
        BRK_TELEMON(XDRAWA)

Draw a string

#include "../orix/src/include/telemon.h"
#include "../orix/src/include/macro.h"
 
        ; ptr3 contains the string pointer
 
        ; count the length of the string
        ldy   #$00
loop:        
        lda   (ptr3),y
        beq   out
        iny
        bne   loop
out:
        ; XSCHAR routine from telemon needs to have the length of the string in X register
        ; copy Y register to X register. It could be optimized in 65C02 with TYX
        tya 
        tax
 
        lda   ptr3     ; XSCHAR needs in A and Y the adress of the string        
        ldy   ptr3+1    
        BRK_TELEMON XSCHAR