A2osX/SYS/KERNEL.S.SCR.txt

365 lines
6.9 KiB
Plaintext
Raw Normal View History

2015-03-14 21:48:35 +00:00
PR#3
2015-06-03 18:30:57 +00:00
PREFIX /A2OSX.SRC
2015-03-14 21:48:35 +00:00
NEW
INC 1
AUTO 6
.LIST OFF
.OP 65C02
*--------------------------------------
* !!!!!!!! DO NOT USE VCPU16 !!!!!!!!
* !!!!!! DO NOT USE ZPQuickPTRs !!!!!
*--------------------------------------
SYSSCR.BASL .EQ ZPSysScr COUT
SYSSCR.BASLTMP .EQ ZPSysScr+2 Scrolling
SYSSCR.STRPTR .EQ ZPSysScr+4 PPSTR
*--------------------------------------
SYSSCR.BASL0 .EQ $800
*--------------------------------------
* S.SysScrInit
*--------------------------------------
S.SysScrInit stz SYSSCR.CPULOADI
stz SYSSCR.CH
stz SYSSCR.CV
ldx #0
ldy #0
.1 lda SYSSCR.TITLE,y
beq .2
jsr S.SysScrSetCharAtYX
iny
bne .1
.2 lda #$20
jsr S.SysScrSetCharAtYX
iny
cpy #80
bne .2
jsr S.SysScrHOME
lda A2osX.SCREENS
ora #A2osX.SCREENS.S
sta A2osX.SCREENS
lda #A2osX.SCREENS.S
jsr S.ScreenSelectA
clc
rts
*--------------------------------------
* S.ScreenSelectA
* IN :
* A = Screen to display
*--------------------------------------
S.ScreenSelectA and A2osX.SCREENS Screen is available ?
beq .9 ...not setup up
cmp #A2osX.SCREENS.S
bne .1
sta SETTEXT
sta SET80DISP
sta CLR80STORE
sta SETPAGE2
sta SETALTCHAR
lda #A2osX.SCREENS.S
bra .8
.1 cmp #A2osX.SCREENS.C
bne .2
sta SETTEXT
sta SET80DISP
2015-06-03 18:30:57 +00:00
sta CLR80STORE
sta CLRPAGE2
sta SETALTCHAR
lda #A2osX.SCREENS.C
bra .8
.2 cmp #A2osX.SCREENS.G
bne .9
sta CLRTEXT
sta CLRMIXED
sta SETHIRES
2015-06-03 18:30:57 +00:00
sta CLR80STORE
sta CLRPAGE2
sta SETIOUDIS
sta SETDHIRES
2015-06-03 18:30:57 +00:00
* sta CLR80DISP
* sta SETDHIRES
* sta CLRDHIRES
* sta SET80DISP
* sta SETDHIRES
* sta CLRDHIRES
* sta SETDHIRES
lda #A2osX.SCREENS.G
2015-06-03 18:30:57 +00:00
.8 sta A2osX.ASCREEN
.9 rts
*--------------------------------------
2015-03-14 21:48:35 +00:00
S.SysScrCPULoad ldx SYSSCR.CPULOADI
lda SYSSCR.CPULOADC,x
sta SYSSCR.BASL0+38
dec SYSSCR.CPULOADI
bpl .1
lda #3
sta SYSSCR.CPULOADI
.1 rts
*--------------------------------------
* S.SysScrPRCode
* In:
* CC : Prints [OK]
* CS : [$$] at column 36-39
*--------------------------------------
S.SysScrPRCode php save P to keep carry
bcs .1
lda #0 ensure we have ERR=0 if cc
.1 pha
ldy #76 HTAB to 76
sty SYSSCR.CH
lda #"["
jsr S.SysScrCOUTA
pla
pha
bne .2
lda #"O"
jsr S.SysScrCOUTA
lda #"K"
jsr S.SysScrCOUTA
bra .3
.2 jsr S.SysScrPRBYTEA
.3 lda #"]"
jsr S.SysScrCOUTA
pla
plp
rts
*--------------------------------------
2015-06-03 18:30:57 +00:00
S.DumpEvent lda (pEvent)
jsr S.SysScrPRBYTEA
ldy #S.EVT.hDEV
lda (pEvent),y
jsr S.SysScrPRBYTEA
ldy #S.EVT.DATALO
lda (pEvent),y
jsr S.SysScrPRBYTEA
ldy #S.EVT.DATAHI
lda (pEvent),y
jsr S.SysScrPRBYTEA
lda #'.'
jsr S.SysScrCOUTA
ldy #S.EVT.DATAW1
lda (pEvent),y
jsr S.SysScrPRBYTEA
iny
lda (pEvent),y
jsr S.SysScrPRBYTEA
lda #'.'
jsr S.SysScrCOUTA
ldy #S.EVT.DATAW2
lda (pEvent),y
jsr S.SysScrPRBYTEA
iny
lda (pEvent),y
jmp S.SysScrPRBYTEA
*--------------------------------------
2015-03-14 21:48:35 +00:00
S.SysScrPPSTRA jsr S.GetMemPtrA
2015-06-03 18:30:57 +00:00
S.SysScrPPSTRYA >STYA SYSSCR.STRPTR
2015-03-14 21:48:35 +00:00
lda (SYSSCR.STRPTR)
beq .9
ldy #0
.1 iny
lda (SYSSCR.STRPTR),y
cmp #'\'
bne .7
tya
cmp (SYSSCR.STRPTR)
beq .9
iny
lda (SYSSCR.STRPTR),y
cmp #'n'
bne .7
lda #13
.7 jsr S.SysScrCOUTA
.8 tya
cmp (SYSSCR.STRPTR)
bne .1
.9 >LDYA SYSSCR.STRPTR
rts
*--------------------------------------
S.SysScrPRBYTEA pha
lsr
lsr
lsr
lsr
ora #$B0
cmp #$BA
bcc .1
adc #6
.1 jsr S.SysScrCOUTA
pla
and #$0F
ora #$B0
cmp #$BA
bcc S.SysScrCOUTA
adc #6
*--------------------------------------
S.SysScrCOUTA phx
phy
cmp #13
bne .1
jsr S.SysScrCROUT
ply
plx
rts
.1 ldy SYSSCR.CH
ldx SYSSCR.CV
ora #$80
jsr S.SysScrSetCharAtYX
jsr S.SysScrFSOUT
ply
plx
rts
*--------------------------------------
S.SysScrFSOUT lda SYSSCR.CH
cmp #79
beq S.SysScrCROUT1
inc SYSSCR.CH
rts
*--------------------------------------
S.SysScrCROUT jsr S.SysScrCLREOL
S.SysScrCROUT1 stz SYSSCR.CH
ldx SYSSCR.CV
cpx #23
beq S.SysScrScroll
inc SYSSCR.CV
rts
*--------------------------------------
S.SysScrCLREOL ldx SYSSCR.CV
lda #$A0
ldy SYSSCR.CH
.1 cpy #79
beq .2
jsr S.SysScrSetCharAtYX
iny
bne .1
.2 rts
*--------------------------------------
S.SysScrScroll ldx #1
.1 lda SYSSCR.BASEL,x
sta SYSSCR.BASL
lda SYSSCR.BASEH,x
sta SYSSCR.BASL+1
inx
lda SYSSCR.BASEL,x
sta SYSSCR.BASLTMP
lda SYSSCR.BASEH,x
sta SYSSCR.BASLTMP+1
ldy #39
sta SETWRITEAUX
sta SETREADAUX
.2 lda (SYSSCR.BASLTMP),y
sta (SYSSCR.BASL),y
dey
bpl .2
ldy #39
sta CLRWRITEAUX
sta CLRREADAUX
.3 lda (SYSSCR.BASLTMP),y
sta (SYSSCR.BASL),y
dey
bpl .3
cpx #23
bne .1
ldy #39
lda #$A0
.4 sta SETWRITEAUX
sta (SYSSCR.BASLTMP),y
sta CLRWRITEAUX
sta (SYSSCR.BASLTMP),y
dey
bpl .4
rts
*--------------------------------------
S.SysScrClrLineAtX
lda SYSSCR.BASEL,x
sta SYSSCR.BASL
lda SYSSCR.BASEH,x
sta SYSSCR.BASL+1
lda #$A0
ldy #39
sta SETWRITEAUX
.1 sta (SYSSCR.BASL),y
dey
bpl .1
ldy #39
sta CLRWRITEAUX
.2 sta (SYSSCR.BASL),y
dey
bpl .2
rts
*--------------------------------------
S.SysScrHOME ldx #23
.1 jsr S.SysScrClrLineAtX
dex
bne .1
stz SYSSCR.CH
lda #1
sta SYSSCR.CV
rts
*--------------------------------------
S.SysScrSetCharAtYX
cmp #$40
bcc .1
cmp #$5F
bcs .1
and #$3F
.1 phy
pha
lda SYSSCR.BASEL,x
sta SYSSCR.BASL
lda SYSSCR.BASEH,x
sta SYSSCR.BASL+1
tya
lsr
tay
bcs .2
sta SETWRITEAUX
.2 pla
sta (SYSSCR.BASL),y
sta CLRWRITEAUX
ply
rts
*--------------------------------------
SYSSCR.CH .BS 1
SYSSCR.CV .BS 1
SYSSCR.CPULOADI .BS 1
2015-06-03 18:30:57 +00:00
SYSSCR.CPULOADC .AS -"|/-\"
2015-03-14 21:48:35 +00:00
*--------------------------------------
SYSSCR.TITLE >CSTRING "A2osX System Screen"
SYSSCR.BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0.50.D0.50.D0
SYSSCR.BASEH .HS 08.08.09.09.0A.0A.0B.0B.08.08.09.09.0A.0A.0B.0B.08.08.09.09.0A.0A.0B.0B
*--------------------------------------
MAN
SAVE SYS/KERNEL.S.SCR
LOAD SYS/KERNEL.S
ASM