   .if .not .def _GRAPHIX_

_GRAPHIX_ = 1   

   .if .not .def _SYSTEM
      .include #system
   .endif
   .if .not .def _MACROS_
      .include #macros
   .endif
; -------------------------------------------------------------
; For the macro...
;              FILL  channel,x,y,color[,flags]
; will get us
;     channel in X
; -------------------------------------------------------------
   .macro fill
@tmp  .= p2 + p3 + p3   
      .if %0 = 5
         .if .not [%5 & $8000]
            ch_x  %5
         .endif
@tmp     .=  %5
      .endif
      @moke_x  %2,colcrs,@tmp,2
      @moke_x  %3,rowcrs,@tmp,4
      @moke_x  %4,fildat,@tmp,8
      poke_x   iccom,18
      jsr   ciov
   .endm

; -------------------------------------------------------------
; For the macro...
;              POSITION    x,y[,select]
; -------------------------------------------------------------
   .macro position
      .if %0 <> 3
         dpoke colcrs,%1
         poke  rowcrs,%2
      .else
         @moke %1,colcrs,%3,1
         @moke %2,rowcrs,%3,2
      .endif
   .endm

   .endif
