;Screen Control Assembly Language Routines for Oric-1

; Display Colors
BLACK   EQU 0     Black
RED     EQU 1     Red
GREEN   EQU 2     Green
YELLOW  EQU 3     Yellow
BLUE    EQU 4     Blue
MAGENT  EQU 5     Magenta
CYAN    EQU 6     Cyan
WHITE   EQU 7     White

;ASCII Screen Control Characters
CHRBEL  EQU $07   Beep (Bell)
CHRBLK  EQU $FF   Block
CHRCAP  EQU $14   Caps Lock ()
CHRCKR  EQU $7E   Checkerboard
CHRCLR  EQU $0C   Clear (Form Feed)
CHRDEL  EQU $7F   Delete (Delete)
CHRDWN  EQU $0A   Cursor Down (Line Feed)
CHRFLS  EQU 140   Flash On
CHRHOM  EQU $00   Home (None) 
CHRINS  EQU $00   Insert
CHRLFT  EQU $08   Cursor Left (Backspace)
CHRRGT  EQU $09   Cursor Right (Tab)
CHRRTN  EQU $0D   Return (Carriage Return)
CHRRVF  EQU $00   Reverse Off
CHRRVN  EQU $00   Reverse On
CHRUP   EQU $0B   Cursor Up (Vertical Tab)

;ASCII Box Drawing Characters
BOXBLC  EQU 43    Bottom Left Corner (+)
BOXBRC  EQU 43    Bottom Right Corner (+)
BOXBCT  EQU 45    Bottom to Cetter Tee  (-)
BOXCTR  EQU 123   Center Cross (+)
BOXHLN  EQU 45    Horizontal Line (-)
BOXLCT  EQU 124   Left To Center T (|)
BOXRCT  EQU 124   Right To Center T (|)
BOXTLC  EQU 43    Top Left Corner (+)
BOXTRC  EQU 43    Top Right Corner (+)
BOXTCT  EQU 45   Top to Center T (-)
BOXVLN  EQU 124   Vertical Line (|)

;ASCII Color Code Table
CLRCDS  DC  128, 129, 130, 131, 132, 133, 134, 136

;Set Background Color
;Args: A = Oric Color Code
;Uses: TEMP0 - Temporary Storage
;Affects: A,C,N,Z
SCRBKG: AND $07     ;Strip High Bits
        ORA $90     ;Convert to Control Character
        JMP PRCHR   ;Print Character and Return

;Set Text Color
;Args: A = Vic color code
;Affects: A,X,C,N,Z
SCRTXT: AND $07     ;Strip High Bits
        ORA $80     ;Convert to Control Character
        JMP PRCHR   ;Print Character and Return

;Clear Screen
;Affects A,C,N,Z
SCRCLR: LDA #CHRCLR  ;Load Clear Screen Character
        JMP PRCHR   ;Print it and Return

;Move Cursor Down
;Affects A,C,N,Z
SCRDWN: LDA #CHRDWN ;Load Cursor Down Character
        JMP PRCHR   ;Print it and Return

;Move Cursor To Home Position
;Affects A,C,N,Z
SCRHOM: LDA #0      ;Column 0
        TAY         ;Row 0
        BEQ SRCMOV  ;Move Cursor

;Move Cursor Left
;Affects A,C,N,Z
SCRLFT: LDA #CHRLFT ;Load Cursor Left Character
        JMP PRCHR   ;Print it and Return

;Move Cursor Right
;Affects A,C,N,Z
SCRRGT: LDA #CHRRGT ;Load Cursor Left Character
        JMP PRCHR   ;Print it and Return

;Move Cursor Up
;Affects A,C,N,Z
SCRUP:  LDA #CHRUP  ;Load Cursor Left Character
        JMP PRCHR   ;Print it and Return

;Move Cursor to Specified Coordinates
;Args: A = screen column (0 = top)   
;      Y = screen line (0 = left)
SCRMOV: RTS         ;Not Yet Implemented

;Get Cursor Position
;Returns: A = current cursor column
;         Y = current cursor row
SCRPOS: RTS         ;Not Yet Implemented

;Get Screen Size
;Returns: A = width of screen in columns
;         Y = height of screen in rows
SCRSIZ: RTS         ;Not Yet Implemented
