2018-09-17 00:30:25 +00:00
|
|
|
;Screen Control Assembly Lanuage Routines for Apple II
|
|
|
|
|
2019-11-20 06:06:34 +00:00
|
|
|
SUBROUTINE _SCREEN
|
|
|
|
|
|
|
|
SMTEXT EQU $00 ;Default Text Screen
|
|
|
|
SMWIDE EQU $FF ;Wide Text Screen (Undefined)
|
|
|
|
|
|
|
|
;Set Screen Mode
|
|
|
|
SETSCR: CMP SMTEXT ;If Default Text Screen
|
|
|
|
BEQ GETSCR ;Return Return 0
|
|
|
|
LDA #$FF ;Else Return ERROR
|
|
|
|
RTS
|
|
|
|
;Else Return 0
|
|
|
|
;Get Screen Mode
|
|
|
|
GETSCR: LDA #0 ;Return 0 (Default Text Mode)
|
|
|
|
RTS
|
|
|
|
|
2018-09-17 00:30:25 +00:00
|
|
|
;Clear the Screen
|
|
|
|
CLRSCR: EQU $FC58 ;Applesoft Routine HOME
|
|
|
|
|
|
|
|
;Move Cursor To Home Position
|
|
|
|
CRSRHM LDA #0 ;Set Column to 0
|
|
|
|
TAY ;Set Row to 0
|
|
|
|
;and Fall into SETPOS
|
|
|
|
|
|
|
|
;Move Cursor to Specified Coordinates
|
|
|
|
SETPOS: STA $24 ;Store Column in CH
|
|
|
|
TYA ;Transfer Row to Accumulator
|
|
|
|
JMP $FB5B ;Exectute Monitor Routine TABV
|
|
|
|
|
|
|
|
;Get Cursor Position
|
|
|
|
GETPOS: LDA $24 ;Load Column from CH
|
|
|
|
LDY $25 ;Load Row from CV
|
|
|
|
RTS
|
|
|
|
|
|
|
|
;Get Screen Size
|
|
|
|
GETSIZ: LDA $21 ;Load Width from WNDWDTH
|
|
|
|
LDY $23 ;Load Height from WNDBTM
|
|
|
|
RTS
|