; VINTAGE COMPUTING CHRISTMAS
; CHALLENGE 2023 (VC3 2023)
; DR. LUTZ BELLMANN

; ------------------------------------

CINT     = $FF81
CHROUT   = $FFD2
SCR      = $E56C
YPOS     = $D6
XPOS     = $D3

         *= $1000
         JSR CINT
         LDX #0
L0       LDA XOORDV,X
         STA XPOS
         LDA YOORDV,X
         STA YPOS
         STX $FF
         JSR LV
         LDX $FF
         INX
         CPX #VXLEN
         BNE L0
         LDX #0
L1       LDA XOORDB,X
         STA XPOS
         LDA YOORDB,X
         STA YPOS
         STX $FF
         JSR LB
         LDX $FF
         INX
         CPX #BXLEN
         BNE L1
         RTS

LV       JSR PRT
         INC YPOS
         LDA #19
         CMP XPOS
         BEQ LEXV
         CMP YPOS
         BNE LV
LEXV     RTS

LB       JSR PRT
         INC YPOS
         DEC XPOS
         DEC XPOS
         LDA #$FF
         CMP XPOS
         BEQ LEXB
         LDA #19
         CMP YPOS
         BNE LB
LEXB     RTS

PRT      JSR SCR
         LDA #"*"
         JSR CHROUT
         RTS

XOORDV   .BYTE 0,0,0
XOORDB   .BYTE 3,9,15
VXLEN    = *-XOORDV
         .BYTE 18,18,18
BXLEN    = *-XOORDB
YOORDV   .BYTE 15,9,3
YOORDB   .BYTE 0,0,0
VYLEN    = *-YOORDV
         .BYTE 3,9,15