2016-10-07 15:28:17 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
2017-02-07 07:27:27 +00:00
|
|
|
|
LOMEM $900
|
2016-10-07 15:28:17 +00:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2017-01-27 16:26:09 +00:00
|
|
|
|
DevMgr.LoMem .EQ *
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
DevMgr.NUL.Code cld
|
|
|
|
|
jmp (.1,x)
|
2017-01-25 21:46:40 +00:00
|
|
|
|
.1 .DA DevMgr.NUL.Status
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.DA DevMgr.BADCALL READBLOCK
|
|
|
|
|
.DA DevMgr.BADCALL WRITEBLOCK
|
|
|
|
|
.DA DevMgr.BADCALL FORMAT
|
|
|
|
|
.DA DevMgr.BADCALL CONTROL
|
|
|
|
|
.DA DevMgr.BADCALL INIT
|
|
|
|
|
.DA DevMgr.BADCALL OPEN
|
|
|
|
|
.DA DevMgr.BADCALL CLOSE
|
|
|
|
|
.DA DevMgr.BADCALL READ
|
|
|
|
|
.DA .8 WRITE
|
2016-10-07 15:28:17 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-25 21:46:40 +00:00
|
|
|
|
DevMgr.NUL.Status
|
|
|
|
|
>LDYAI DevMgr.NUL.Stat
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgr.NUL.Stat .DA #S.DEV.S.WRITE+S.DEV.S.READ
|
|
|
|
|
.DA #0,#0,#0
|
2017-01-27 16:26:09 +00:00
|
|
|
|
>PSTR "NULL DEVICE "
|
|
|
|
|
.DA #S.DEVSTAT.TYPE.CHAR
|
2017-01-25 21:46:40 +00:00
|
|
|
|
.DA #0
|
|
|
|
|
.DA $0900
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
DevMgr.SYS.Code cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.1 .DA DevMgr.SYS.Status
|
|
|
|
|
.DA DevMgr.BADCALL READBLOCK
|
|
|
|
|
.DA DevMgr.BADCALL WRITEBLOCK
|
|
|
|
|
.DA DevMgr.BADCALL FORMAT
|
|
|
|
|
.DA DevMgr.SYS.Control
|
|
|
|
|
.DA DevMgr.BADCALL INIT
|
|
|
|
|
.DA DevMgr.SYS.Open
|
|
|
|
|
.DA DevMgr.BADCALL CLOSE
|
|
|
|
|
.DA DevMgr.SYS.Read
|
|
|
|
|
.DA DevMgr.SYS.Write
|
2016-10-07 15:28:17 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
DevMgr.BADCALL lda #MLI.ERR.BADCALL
|
2016-10-07 15:28:17 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
DevMgr.SYS.Status
|
2017-01-25 21:46:40 +00:00
|
|
|
|
>LDYAI DevMgr.SYS.Stat
|
2017-01-12 17:43:45 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgr.SYS.Stat .DA #S.DEV.S.WRITE+S.DEV.S.READ
|
|
|
|
|
.DA #0,#0,#0
|
|
|
|
|
>PSTR "A2osX SYS Screen"
|
2017-01-27 16:26:09 +00:00
|
|
|
|
.DA #S.DEVSTAT.TYPE.CHAR
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.DA #0
|
2017-01-25 21:46:40 +00:00
|
|
|
|
.DA $0900
|
2017-01-12 17:43:45 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-08 16:42:32 +00:00
|
|
|
|
DevMgr.SYS.Open stz DevMgr.SYS.CH
|
2016-10-07 15:28:17 +00:00
|
|
|
|
stz DevMgr.SYS.CV
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
.1 lda DevMgr.SYS.TITLE,y
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
jsr DevMgr.SYS.SetCharAtYX
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.2 lda #$20
|
|
|
|
|
jsr DevMgr.SYS.SetCharAtYX
|
|
|
|
|
iny
|
|
|
|
|
cpy #80
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
jsr DevMgr.SYS.Home
|
|
|
|
|
|
|
|
|
|
lda #1
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta A2osX.SCRNDEVS+1 fall in Control
|
2016-11-13 21:03:31 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
DevMgr.SYS.Control
|
2016-11-13 21:03:31 +00:00
|
|
|
|
sta SETTEXT
|
|
|
|
|
sta SETALTCHAR
|
|
|
|
|
sta SET80DISP
|
|
|
|
|
sta CLR80STORE
|
|
|
|
|
sta SETPAGE2
|
2016-12-05 17:04:42 +00:00
|
|
|
|
lda #2
|
|
|
|
|
sta A2osX.ASCREEN
|
2016-10-07 15:28:17 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
DevMgr.SYS.Read lda A2osX.ASCREEN
|
2016-10-07 15:28:17 +00:00
|
|
|
|
cmp #2 is SYS active?
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
lda OPENAPPLE
|
|
|
|
|
bmi .9 Open apple key, not for us...
|
|
|
|
|
lda KBD
|
|
|
|
|
bpl .9
|
|
|
|
|
sta KBDSTROBE
|
|
|
|
|
|
|
|
|
|
and #$7F
|
2017-02-08 16:42:32 +00:00
|
|
|
|
|
2016-10-07 15:28:17 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #0 Error = no event
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
DevMgr.SYS.Write
|
|
|
|
|
phx
|
2016-10-07 15:28:17 +00:00
|
|
|
|
phy
|
|
|
|
|
cmp #' '
|
|
|
|
|
bcc .1
|
|
|
|
|
ldy DevMgr.SYS.CH
|
|
|
|
|
ldx DevMgr.SYS.CV
|
|
|
|
|
ora #$80
|
|
|
|
|
jsr DevMgr.SYS.SetCharAtYX
|
|
|
|
|
jsr DevMgr.SYS.FSOut
|
|
|
|
|
bra .8
|
|
|
|
|
|
|
|
|
|
.1 cmp #10
|
|
|
|
|
bne .2
|
|
|
|
|
jsr DevMgr.SYS.LF
|
|
|
|
|
bra .8
|
|
|
|
|
|
|
|
|
|
.2 cmp #13
|
|
|
|
|
bne .3
|
|
|
|
|
jsr DevMgr.SYS.CROut
|
|
|
|
|
bra .8
|
|
|
|
|
|
|
|
|
|
.3 ora #$20
|
|
|
|
|
jsr DevMgr.SYS.SetCharAtYX
|
|
|
|
|
jsr DevMgr.SYS.FSOut
|
|
|
|
|
|
|
|
|
|
.8 ply
|
|
|
|
|
plx
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgr.SYS.FSOut
|
|
|
|
|
lda DevMgr.SYS.CH
|
|
|
|
|
cmp #79
|
|
|
|
|
beq DevMgr.SYS.LF1
|
|
|
|
|
inc DevMgr.SYS.CH
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgr.SYS.CROut
|
|
|
|
|
jsr DevMgr.SYS.ClrEOL
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgr.SYS.LF1 stz DevMgr.SYS.CH
|
|
|
|
|
DevMgr.SYS.LF ldx DevMgr.SYS.CV
|
|
|
|
|
cpx #23
|
|
|
|
|
beq DevMgr.SYS.Scroll
|
|
|
|
|
inc DevMgr.SYS.CV
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgr.SYS.ClrEOL
|
|
|
|
|
ldx DevMgr.SYS.CV
|
|
|
|
|
lda #$A0
|
|
|
|
|
ldy DevMgr.SYS.CH
|
|
|
|
|
.1 cpy #79
|
|
|
|
|
beq .2
|
|
|
|
|
jsr DevMgr.SYS.SetCharAtYX
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
|
|
|
|
.2 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgr.SYS.Scroll
|
|
|
|
|
ldx #1
|
|
|
|
|
.1 lda DevMgr.SYS.BASEL,x
|
|
|
|
|
sta ZPDRV
|
|
|
|
|
lda DevMgr.SYS.BASEH,x
|
|
|
|
|
sta ZPDRV+1
|
|
|
|
|
inx
|
|
|
|
|
lda DevMgr.SYS.BASEL,x
|
|
|
|
|
sta ZPDRV+2
|
|
|
|
|
lda DevMgr.SYS.BASEH,x
|
|
|
|
|
sta ZPDRV+3
|
|
|
|
|
|
2017-02-07 07:27:27 +00:00
|
|
|
|
php
|
|
|
|
|
sei
|
2016-10-07 15:28:17 +00:00
|
|
|
|
sta SETWRITEAUX
|
|
|
|
|
sta SETREADAUX
|
2017-02-07 07:27:27 +00:00
|
|
|
|
|
|
|
|
|
ldy #39
|
2016-10-07 15:28:17 +00:00
|
|
|
|
.2 lda (ZPDRV+2),y
|
|
|
|
|
sta (ZPDRV),y
|
|
|
|
|
dey
|
|
|
|
|
bpl .2
|
|
|
|
|
|
|
|
|
|
sta CLRWRITEAUX
|
|
|
|
|
sta CLRREADAUX
|
2017-02-07 07:27:27 +00:00
|
|
|
|
plp
|
|
|
|
|
|
|
|
|
|
ldy #39
|
2016-10-07 15:28:17 +00:00
|
|
|
|
.3 lda (ZPDRV+2),y
|
|
|
|
|
sta (ZPDRV),y
|
|
|
|
|
dey
|
|
|
|
|
bpl .3
|
|
|
|
|
|
|
|
|
|
cpx #23
|
|
|
|
|
bne .1 Fall in ClrLineAtX for last line
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgr.SYS.ClrLineAtX
|
|
|
|
|
lda DevMgr.SYS.BASEL,x
|
|
|
|
|
sta ZPDRV
|
|
|
|
|
lda DevMgr.SYS.BASEH,x
|
|
|
|
|
sta ZPDRV+1
|
2017-02-07 07:27:27 +00:00
|
|
|
|
|
|
|
|
|
php
|
|
|
|
|
sei
|
2016-10-07 15:28:17 +00:00
|
|
|
|
|
|
|
|
|
lda #$A0
|
|
|
|
|
ldy #39
|
|
|
|
|
|
|
|
|
|
.1 sta SETWRITEAUX
|
|
|
|
|
sta (ZPDRV),y
|
|
|
|
|
sta CLRWRITEAUX
|
|
|
|
|
sta (ZPDRV),y
|
|
|
|
|
dey
|
|
|
|
|
bpl .1
|
|
|
|
|
|
2017-02-07 07:27:27 +00:00
|
|
|
|
plp
|
|
|
|
|
|
2016-10-07 15:28:17 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgr.SYS.Home ldx #23
|
|
|
|
|
|
|
|
|
|
.1 jsr DevMgr.SYS.ClrLineAtX
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
stz DevMgr.SYS.CH
|
|
|
|
|
lda #1
|
|
|
|
|
sta DevMgr.SYS.CV
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgr.SYS.SetCharAtYX
|
|
|
|
|
cmp #$40
|
|
|
|
|
bcc .1
|
|
|
|
|
cmp #$5F
|
|
|
|
|
bcs .1
|
|
|
|
|
and #$3F
|
|
|
|
|
|
2017-02-07 07:27:27 +00:00
|
|
|
|
.1 php
|
|
|
|
|
|
|
|
|
|
phy
|
2016-10-07 15:28:17 +00:00
|
|
|
|
pha
|
|
|
|
|
lda DevMgr.SYS.BASEL,x
|
|
|
|
|
sta ZPDRV
|
|
|
|
|
lda DevMgr.SYS.BASEH,x
|
|
|
|
|
sta ZPDRV+1
|
|
|
|
|
tya
|
|
|
|
|
lsr
|
|
|
|
|
tay
|
|
|
|
|
bcs .2
|
|
|
|
|
sta SETWRITEAUX
|
|
|
|
|
|
|
|
|
|
.2 pla
|
|
|
|
|
sta (ZPDRV),y
|
|
|
|
|
sta CLRWRITEAUX
|
|
|
|
|
ply
|
2017-02-07 07:27:27 +00:00
|
|
|
|
|
|
|
|
|
plp
|
|
|
|
|
|
2016-10-07 15:28:17 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgr.SYS.CH .BS 1
|
|
|
|
|
DevMgr.SYS.CV .BS 1
|
|
|
|
|
*--------------------------------------
|
2016-10-24 15:54:43 +00:00
|
|
|
|
DevMgr.SYS.TITLE >CSTR "A2osX System Screen"
|
2016-10-07 15:28:17 +00:00
|
|
|
|
DevMgr.SYS.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
|
|
|
|
|
DevMgr.SYS.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
|
|
|
|
|
*--------------------------------------
|
2017-01-27 16:26:09 +00:00
|
|
|
|
DevMgr.FreeMem .EQ *
|
2016-10-07 15:28:17 +00:00
|
|
|
|
MAN
|
|
|
|
|
SAVE SYS/KERNEL.S.D01
|
|
|
|
|
LOAD SYS/KERNEL.S
|
|
|
|
|
ASM
|