A2osX/A2osX.S.txt

715 lines
13 KiB
Plaintext
Raw Normal View History

2015-03-14 21:48:35 +00:00
NEW
2019-04-30 16:08:47 +00:00
AUTO 3,1
2015-03-14 21:48:35 +00:00
.LIST OFF
.OP 65C02
.OR $2000
2018-07-23 15:28:42 +00:00
.TF A2OSX.SYSTEM,TSYS
2015-03-14 21:48:35 +00:00
*--------------------------------------
2020-09-25 06:02:05 +00:00
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/io.i
2023-11-04 14:42:28 +00:00
.INB inc/rom.ii.i
2020-09-25 06:02:05 +00:00
.INB inc/mli.i
.INB inc/mli.e.i
.INB inc/zp.i
.INB inc/gfx.i
2015-03-14 21:48:35 +00:00
*--------------------------------------
TmpPtr1 .EQ $0 main & aux ZP
TmpPtr2 .EQ $2 main & aux ZP
*--------------------------------------
2022-03-13 12:52:24 +00:00
A2osX.PMLOAD .EQ $2000
2019-04-11 05:56:05 +00:00
A2osX.LOGOLOAD .EQ $4000
2022-03-13 12:52:24 +00:00
A2osX.PMMAXLEN .EQ $6000
2019-01-04 13:17:31 +00:00
A2osX.OpenBuff1 .EQ $8000 1024 Buffer for MLIOPEN01
A2osX.OpenBuff2 .EQ $8400 1024 Buffer for MLIOPEN02
A2osX.ReadBuff .EQ $8800 512 Buffer for MLIREAD01
Boot.Prefix .EQ $8A00 MLI.MAXPATH
2022-03-13 12:52:24 +00:00
Logo.Filename .EQ $8A80 MLI.MAXPATH
Sys.Prefix .EQ $8B00 MLI.MAXPATH
PM.Filename .EQ $8B80 MLI.MAXPATH
2020-03-05 16:55:02 +00:00
MLIONLINE01BUF .EQ $8C00 256
2015-03-14 21:48:35 +00:00
*--------------------------------------
2016-06-07 06:10:18 +00:00
* Kernel Stage 0
*--------------------------------------
2019-04-10 15:51:47 +00:00
SYSTEM.START .EQ *
2016-06-07 06:10:18 +00:00
.PH $1000
A2osX.Init0 >LDYAI $2000
2015-03-15 22:00:40 +00:00
>STYA TmpPtr1
2016-06-07 06:10:18 +00:00
>LDYAI $1000
2015-03-15 22:00:40 +00:00
>STYA TmpPtr2
2022-03-13 12:52:24 +00:00
ldx /SYSTEM.END-$1F00
2015-03-15 22:00:40 +00:00
ldy #0
.1 lda (TmpPtr1),y
sta (TmpPtr2),y
iny
bne .1
2022-03-13 12:52:24 +00:00
2015-03-15 22:00:40 +00:00
inc TmpPtr1+1
inc TmpPtr2+1
dex
bne .1
2015-06-03 18:30:57 +00:00
2015-03-15 22:00:40 +00:00
jmp A2osX.Init1
*--------------------------------------
2016-06-07 06:10:18 +00:00
A2osX.Init1 ldx #$FF init 6502 stack to highest
txs
2023-11-04 14:42:28 +00:00
bit IO.RROMBNK1
jsr ROM.HOME
2018-07-12 15:20:39 +00:00
>LDYAI MSG.INIT0
jsr PrintFYA
2015-03-14 21:48:35 +00:00
2018-07-12 15:20:39 +00:00
>LDYAI MSG.SYSMEM
jsr PrintFYA
2015-03-14 21:48:35 +00:00
2023-11-04 14:42:28 +00:00
lda GP.MACHID
2017-10-27 14:56:46 +00:00
and #MACHID.M
cmp #MACHID.M.128
2019-05-01 13:35:41 +00:00
beq A2osX.Init1.128
2018-07-12 15:20:39 +00:00
>LDYAI MSG.SYSMEM.KO
jsr PrintFYA
2015-03-14 21:48:35 +00:00
bra *
2019-04-10 15:51:47 +00:00
*--------------------------------------
2019-05-01 13:35:41 +00:00
A2osX.Init1.128 jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.GETPREFIX
2019-05-01 13:35:41 +00:00
.DA MLIGETPREFIX01
bcs *
2019-04-30 16:08:47 +00:00
2019-05-01 13:35:41 +00:00
ldx Boot.Prefix
2019-12-09 15:53:14 +00:00
2019-05-01 13:35:41 +00:00
.1 lda Boot.Prefix,x
2022-03-13 12:52:24 +00:00
sta Logo.Filename,x
sta Sys.Prefix,x
sta PM.Filename,x
2019-05-01 13:35:41 +00:00
sta A2osX.QC.B.BOOT,x
sta A2osX.QC.B.ROOT,x
dex
bpl .1
jsr A2osX.Screen80
2018-07-12 15:20:39 +00:00
>LDYAI MSG.INIT0
jsr PrintFYA
2019-05-01 13:35:41 +00:00
lda #Boot.Prefix
pha
lda /Boot.Prefix
pha
>LDYAI MSG.BOOTPREFIX
jsr PrintFYA
2018-07-12 15:20:39 +00:00
>LDYAI MSG.SYSMEM
jsr PrintFYA
2018-07-12 15:20:39 +00:00
>LDYAI MSG.SYSMEM.OK
jsr PrintFYA
>LDYAI MSG.CPU
jsr PrintFYA
2016-06-07 06:10:18 +00:00
sed Test 6502 BCD bug
lda #$99
clc
adc #$01
cld
bpl .2 if minus, BUG!, we have 6502
2021-03-17 19:49:39 +00:00
2018-07-12 15:20:39 +00:00
>LDYAI MSG.CPU.KO
jsr PrintFYA
2015-03-14 21:48:35 +00:00
bra *
2016-03-13 21:55:47 +00:00
2018-07-12 15:20:39 +00:00
.2 >LDYAI MSG.CPU.OK
jsr PrintFYA
2019-05-01 13:35:41 +00:00
2023-11-04 14:42:28 +00:00
stz GP.FLEVEL Back To FILE LEVEL 0
jsr MLI Make sure all files are closed
2023-11-04 14:42:28 +00:00
.DA #MLI.CLOSE
.DA MLICLOSE01
bcs *
*--------------------------------------
2018-07-12 15:20:39 +00:00
A2osX.RamDrv >LDYAI MSG.RAMDRV
jsr PrintFYA
2015-06-03 18:30:57 +00:00
2015-03-14 21:48:35 +00:00
jsr DisableRamDRV
bcc .2
2015-06-03 18:30:57 +00:00
2015-03-14 21:48:35 +00:00
tax
2015-06-03 18:30:57 +00:00
bne .1
2021-03-17 19:49:39 +00:00
2018-07-12 15:20:39 +00:00
>LDYAI MSG.RAMDRV.KO0
2021-03-17 19:49:39 +00:00
bra .8
2018-07-12 15:20:39 +00:00
.1 >LDYAI MSG.RAMDRV.KO1
2021-03-17 19:49:39 +00:00
bra .8
2018-07-12 15:20:39 +00:00
.2 >LDYAI MSG.RAMDRV.OK
2021-03-17 19:49:39 +00:00
.8 jsr PrintFYA
2015-03-14 21:48:35 +00:00
*--------------------------------------
2023-11-04 14:42:28 +00:00
A2osX.SetupQC lda IO.RRAMWRAMBNK2
lda IO.RRAMWRAMBNK2
2023-11-12 13:20:15 +00:00
lda GP.KVER
cmp #$8D
bne .1
sta IO.SETALTZP
.1 ldx #0
.2 lda A2osX.QC.B.Start,x Still at $2xxx !!! not moved to $1xxx
sta $D100,x
lda A2osX.QC.B.Start+$100,x
sta $D200,x
2016-06-07 06:10:18 +00:00
lda A2osX.QC.B.Start+$200,x
sta $D300,x
inx
2023-11-12 13:20:15 +00:00
bne .2
lda GP.KVER
cmp #$8D
bne .3
sta IO.CLRALTZP
bra A2osX.MLIQuit
2023-11-12 13:20:15 +00:00
.3 lda IO.RROMBNK1
*--------------------------------------
2022-03-13 12:52:24 +00:00
A2osX.EnumPM >LDYAI MSG.PMENUM do this After SetupQC, a PM could override QC
jsr PrintFYA
jsr EnumPM
*--------------------------------------
2018-07-12 15:20:39 +00:00
A2osX.MLIQuit >LDYAI MSG.INIT0OK
jsr PrintFYA
>DEBUGOA
2020-09-25 06:02:05 +00:00
stz $280 Quit to A2osX
2015-03-14 21:48:35 +00:00
jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.QUIT
2015-03-14 21:48:35 +00:00
.DA MLIQUIT01
bra *
*--------------------------------------
2019-05-01 13:35:41 +00:00
A2osX.Screen80 lda #$8C Reset 80 col screen ($0C:HOME)
2019-04-10 15:51:47 +00:00
jsr $C300
2019-04-30 16:08:47 +00:00
2019-04-10 15:51:47 +00:00
ldx Boot.Prefix
ldy #0
2020-06-29 05:49:24 +00:00
2019-04-10 15:51:47 +00:00
.2 inx
iny
lda A2osX.LOGO,y
2022-03-13 12:52:24 +00:00
sta Logo.Filename,x
2019-04-10 15:51:47 +00:00
cpy A2osX.LOGO
2019-10-03 06:25:27 +00:00
bne .2
2020-06-29 05:49:24 +00:00
2022-03-13 12:52:24 +00:00
stx Logo.Filename
2019-04-10 15:51:47 +00:00
jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.OPEN
2019-04-10 15:51:47 +00:00
.DA MLIOPEN00
bcs .99
lda MLIOPEN00+5
sta MLIREAD00+1
sta MLICLOSE00+1
jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.READ
2019-04-11 07:52:53 +00:00
.DA MLIREAD00
2019-04-10 15:51:47 +00:00
bcs .98
2020-06-29 05:49:24 +00:00
2019-04-10 15:51:47 +00:00
jsr .98
bra A2osX.ScreenDLGR
2019-12-09 15:53:14 +00:00
2019-04-10 15:51:47 +00:00
.98 jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.CLOSE
2019-04-10 15:51:47 +00:00
.DA MLICLOSE00
2019-10-03 06:25:27 +00:00
.99 rts
2019-04-10 15:51:47 +00:00
*--------------------------------------
A2osX.ScreenDLGR
lda #20
2023-11-04 14:42:28 +00:00
sta ZP.WNDTOP
sta ZP.CV
jsr ROM.TABV
2023-11-04 14:42:28 +00:00
* sta IO.SETALTCHAR
2023-11-04 14:42:28 +00:00
sta IO.CLRHIRES
sta IO.SETMIXED
* sta IO.SET80DISP
* sta IO.SET80STORE
* sta IO.CLRPAGE2
2020-06-27 18:30:09 +00:00
2023-11-04 14:42:28 +00:00
bit IO.RDIOUDIS
sta IO.SETIOUDIS
sta IO.SETDHIRES
2020-06-29 05:49:24 +00:00
bmi .10
2019-04-11 07:52:53 +00:00
2023-11-04 14:42:28 +00:00
sta IO.CLRIOUDIS
.10 sta IO.CLRTEXT
2020-06-27 18:30:09 +00:00
2019-04-10 15:51:47 +00:00
lda #A2osX.LOGOLOAD+S.BM
sta TmpPtr1
lda /A2osX.LOGOLOAD+S.BM
sta TmpPtr1+1
2020-06-26 19:34:12 +00:00
2019-04-10 15:51:47 +00:00
ldx #0
2020-06-26 19:34:12 +00:00
2020-07-03 20:55:40 +00:00
.1 phx
lda SCR.BASEL,x
2019-04-10 15:51:47 +00:00
sta TmpPtr2
lda SCR.BASEH,x
sta TmpPtr2+1
ldy #0
2020-06-26 19:34:12 +00:00
2019-04-10 15:51:47 +00:00
.2 lda (TmpPtr1),y
pha
2020-07-03 20:55:40 +00:00
2019-04-10 15:51:47 +00:00
and #$f
2020-07-03 20:55:40 +00:00
tax
lda PALETTE.AUX,x
2023-11-04 14:42:28 +00:00
sta IO.SETPAGE2
2019-04-10 15:51:47 +00:00
sta (TmpPtr2),y
2020-07-03 20:55:40 +00:00
2019-04-10 15:51:47 +00:00
pla
lsr
lsr
lsr
lsr
2020-07-03 20:55:40 +00:00
tax
lda PALETTE.MAIN,x
2023-11-04 14:42:28 +00:00
sta IO.CLRPAGE2
2019-04-10 15:51:47 +00:00
sta (TmpPtr2),y
iny
cpy #40
bne .2
2020-06-26 19:34:12 +00:00
2019-04-10 15:51:47 +00:00
lda TmpPtr1
clc
2019-04-11 05:56:05 +00:00
adc #40
2019-04-10 15:51:47 +00:00
sta TmpPtr1
bcc .3
2020-06-26 19:34:12 +00:00
2019-04-10 15:51:47 +00:00
inc TmpPtr1+1
2020-06-26 19:34:12 +00:00
2019-04-10 15:51:47 +00:00
.3 ldy #0
.4 lda (TmpPtr1),y
pha
and #$f
2020-07-03 20:55:40 +00:00
tax
lda PALETTE.AUX,x
2019-04-10 15:51:47 +00:00
asl
asl
asl
asl
2023-11-04 14:42:28 +00:00
sta IO.SETPAGE2
2019-04-10 15:51:47 +00:00
ora (TmpPtr2),y
sta (TmpPtr2),y
2020-07-03 20:55:40 +00:00
2019-04-10 15:51:47 +00:00
pla
2020-07-03 20:55:40 +00:00
lsr
lsr
lsr
lsr
tax
lda PALETTE.MAIN,x
asl
asl
asl
asl
2023-11-04 14:42:28 +00:00
sta IO.CLRPAGE2
2019-04-10 15:51:47 +00:00
ora (TmpPtr2),y
sta (TmpPtr2),y
iny
cpy #40
2019-04-11 05:56:05 +00:00
bne .4
2020-06-26 19:34:12 +00:00
2019-04-10 15:51:47 +00:00
lda TmpPtr1
clc
2019-04-11 05:56:05 +00:00
adc #40
2019-04-10 15:51:47 +00:00
sta TmpPtr1
bcc .7
2020-06-26 19:34:12 +00:00
2019-04-10 15:51:47 +00:00
inc TmpPtr1+1
2020-06-26 19:34:12 +00:00
2020-07-03 20:55:40 +00:00
.7 plx
inx
2019-04-10 15:51:47 +00:00
cpx #20
bne .1
2019-04-11 07:52:53 +00:00
2019-04-10 15:51:47 +00:00
rts
*--------------------------------------
2015-03-14 21:48:35 +00:00
DisableRamDRV php
sei
2023-11-04 14:42:28 +00:00
lda GP.DEVPTRS3D2
cmp GP.DEVPTRS S0D1=NOVEV
2015-03-14 21:48:35 +00:00
bne .1
2020-11-19 15:34:02 +00:00
2023-11-04 14:42:28 +00:00
lda GP.DEVPTRS3D2+1
cmp GP.DEVPTRS+1 S0D1=NODEV
2015-03-14 21:48:35 +00:00
beq .9 S3D2=NODEV, nothing to do
2020-11-19 15:34:02 +00:00
2023-11-04 14:42:28 +00:00
.1 ldx GP.DEVCNT
2015-06-03 18:30:57 +00:00
2023-11-04 14:42:28 +00:00
.2 lda GP.DEVLST,x LOOKING FOR $BF, $BB, $B7, $B3
2015-03-14 21:48:35 +00:00
and #$F3
cmp #$B3
beq .3
2020-11-19 15:34:02 +00:00
2015-03-14 21:48:35 +00:00
dex
bpl .2
2020-11-19 15:34:02 +00:00
2015-03-14 21:48:35 +00:00
plp
2020-11-19 15:34:02 +00:00
2015-03-14 21:48:35 +00:00
lda #1 No device found, exit with error
sec
rts
2020-11-19 15:34:02 +00:00
2023-11-04 14:42:28 +00:00
.3 cpx GP.DEVCNT
2015-06-03 18:30:57 +00:00
beq .5
2023-11-04 14:42:28 +00:00
.4 lda GP.DEVLST+1,x
sta GP.DEVLST,x
2015-03-14 21:48:35 +00:00
inx
2023-11-04 14:42:28 +00:00
cpx GP.DEVCNT
2015-03-14 21:48:35 +00:00
bne .4
2020-09-16 14:54:42 +00:00
2023-11-04 14:42:28 +00:00
.5 ldx GP.DEVCNT
stz GP.DEVLST,x
dec GP.DEVCNT
lda GP.DEVPTRS
sta GP.DEVPTRS3D2
lda GP.DEVPTRS+1
sta GP.DEVPTRS3D2+1
2020-11-19 15:34:02 +00:00
2015-03-14 21:48:35 +00:00
plp
2015-06-03 18:30:57 +00:00
jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.ONLINE
2015-06-03 18:30:57 +00:00
.DA MLIONLINE01
2015-03-14 21:48:35 +00:00
clc Success!!
rts
2020-11-19 15:34:02 +00:00
2015-03-14 21:48:35 +00:00
.9 plp
2020-11-19 15:34:02 +00:00
2015-03-14 21:48:35 +00:00
lda #0 Not detected
sec
rts
*--------------------------------------
2022-03-13 12:52:24 +00:00
EnumPM.EPB .EQ $0D
EnumPM.EL .EQ $27
2015-03-14 21:48:35 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
EnumPM ldx #0
2016-06-07 06:10:18 +00:00
ldy Boot.Prefix
2018-11-30 16:00:36 +00:00
2016-06-07 06:10:18 +00:00
.1 inx
lda SYS,x
2022-03-13 12:52:24 +00:00
sta Sys.Prefix+1,y
sta PM.Filename+1,y
2016-06-07 06:10:18 +00:00
iny
cpx SYS
2015-03-14 21:48:35 +00:00
bne .1
2019-12-09 15:53:14 +00:00
2022-03-13 12:52:24 +00:00
sty Sys.Prefix
sty PM.Filename
lda #Sys.Prefix
2019-12-10 16:06:51 +00:00
pha
2022-03-13 12:52:24 +00:00
lda /Sys.Prefix
2019-12-10 16:06:51 +00:00
pha
2022-03-13 12:52:24 +00:00
>LDYAI MSG.PMSYSDIR
2019-12-10 16:06:51 +00:00
jsr PrintFYA
2019-12-11 07:38:45 +00:00
2022-03-13 12:52:24 +00:00
jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.SETPREFIX
2022-03-13 12:52:24 +00:00
.DA MLISETPREFIX02
bcs .19
2016-06-07 06:10:18 +00:00
jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.OPEN
2016-06-07 06:10:18 +00:00
.DA MLIOPEN01
2019-12-10 16:06:51 +00:00
bcc .10
2022-03-13 12:52:24 +00:00
.19 pha
>LDYAI MSG.PMSYSDIR.KO
2019-12-10 16:06:51 +00:00
jsr PrintFYA
sec
rts
2018-11-30 16:00:36 +00:00
2019-12-10 16:06:51 +00:00
.10 lda MLIOPEN01+5
2016-06-07 06:10:18 +00:00
sta MLIREAD01+1
sta MLICLOSE01+1
2019-12-09 15:53:14 +00:00
2016-06-07 06:10:18 +00:00
.2 jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.READ
2016-06-07 06:10:18 +00:00
.DA MLIREAD01
bcs .98
2019-12-09 15:53:14 +00:00
2022-03-13 12:52:24 +00:00
lda #EnumPM.EPB
sta EnumPM.EC
2019-12-09 15:53:14 +00:00
2016-06-07 06:10:18 +00:00
>LDYAI A2osX.ReadBuff+4
2022-03-13 12:52:24 +00:00
>STYA EnumPM.BPTR
2019-12-09 15:53:14 +00:00
2022-03-13 12:52:24 +00:00
.3 >LDYA EnumPM.BPTR
2016-06-07 06:10:18 +00:00
>STYA TmpPtr1
2019-12-09 15:53:14 +00:00
2016-06-07 06:10:18 +00:00
lda (TmpPtr1)
and #$F0 Empty ?
beq .5 yes, skip
2019-12-09 15:53:14 +00:00
2016-06-07 06:10:18 +00:00
and #$C0 anything out of type 1,2 or 3 ?
bne .5 yes, skip
2019-12-09 15:53:14 +00:00
2016-06-07 06:10:18 +00:00
lda (TmpPtr1)
and #$0F
2022-03-13 12:52:24 +00:00
cmp PM. at least enough chars for PM.*?
2016-06-07 06:10:18 +00:00
bcc .5 no, skip
2018-11-30 16:00:36 +00:00
2016-06-07 06:10:18 +00:00
ldy #$10 file type
lda (TmpPtr1),y
cmp #$06 'BIN'?
bne .5 skip
2019-12-09 15:53:14 +00:00
2022-03-13 12:52:24 +00:00
ldy PM.
2019-12-09 15:53:14 +00:00
2022-03-13 12:52:24 +00:00
.4 lda (TmpPtr1),y PM.* ?
cmp PM.,y
2016-06-07 06:10:18 +00:00
bne .5
2019-12-09 15:53:14 +00:00
2016-06-07 06:10:18 +00:00
dey
bne .4
2019-12-09 15:53:14 +00:00
2022-03-13 12:52:24 +00:00
jsr LoadPM
2019-12-09 15:53:14 +00:00
2022-03-13 12:52:24 +00:00
.5 lda EnumPM.BPTR
2016-06-07 06:10:18 +00:00
clc
2022-03-13 12:52:24 +00:00
adc #EnumPM.EL
sta EnumPM.BPTR
2016-06-07 06:10:18 +00:00
bcc .6
2019-12-09 15:53:14 +00:00
2022-03-13 12:52:24 +00:00
inc EnumPM.BPTR+1
2016-06-07 06:10:18 +00:00
2022-03-13 12:52:24 +00:00
.6 dec EnumPM.EC
2016-06-07 06:10:18 +00:00
bne .3
2019-12-09 15:53:14 +00:00
2015-03-15 22:00:40 +00:00
bra .2
2019-12-09 15:53:14 +00:00
.98 cmp #MLI.E.EOF
2016-06-07 06:10:18 +00:00
beq .8
2019-12-09 15:53:14 +00:00
2016-06-07 06:10:18 +00:00
pha
jsr .8
pla
2018-11-30 16:00:36 +00:00
2019-12-10 16:06:51 +00:00
sec
2016-06-07 06:10:18 +00:00
rts
2018-11-30 16:00:36 +00:00
.8 jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.CLOSE
2018-11-30 16:00:36 +00:00
.DA MLICLOSE01
2022-03-13 12:52:24 +00:00
bcs .99
jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.SETPREFIX
2022-03-13 12:52:24 +00:00
.DA MLISETPREFIX01
.99 rts
2016-06-07 06:10:18 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
EnumPM.EC .BS 1
EnumPM.BPTR .BS 2
2016-06-07 06:10:18 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
LoadPM ldy #$1c
2019-12-11 07:38:45 +00:00
lda (TmpPtr1),y
2022-03-13 12:52:24 +00:00
sta LoadPM.VERSION
2019-12-11 07:38:45 +00:00
iny
lda (TmpPtr1),y
2022-03-13 12:52:24 +00:00
sta LoadPM.MVERSION
2019-12-11 07:38:45 +00:00
2022-03-13 12:52:24 +00:00
ldx Sys.Prefix
2016-06-07 06:10:18 +00:00
lda (TmpPtr1)
2015-03-15 22:00:40 +00:00
and #$0F
2016-06-07 06:10:18 +00:00
tay
2015-03-15 22:00:40 +00:00
clc
2022-03-13 12:52:24 +00:00
adc sys.Prefix
sta PM.Filename
2016-06-07 06:10:18 +00:00
tax
2019-12-09 15:53:14 +00:00
2022-03-13 12:52:24 +00:00
.2 bit LoadPM.MVERSION
2019-12-11 07:38:45 +00:00
bpl .6
cpy #8
bcs .3
2022-03-13 12:52:24 +00:00
lda LoadPM.Bits,y
bit LoadPM.MVERSION
2019-12-11 07:38:45 +00:00
beq .6
bra .4
2022-03-13 12:52:24 +00:00
.3 lda LoadPM.Bits-8,y
bit LoadPM.VERSION
2019-12-11 07:38:45 +00:00
beq .6
.4 lda (TmpPtr1),y
eor #$20
.HS 2C BIT ABS
.6 lda (TmpPtr1),y
2022-03-13 12:52:24 +00:00
sta PM.Filename,x
2016-06-07 06:10:18 +00:00
dex
dey
bne .2
2019-12-09 15:53:14 +00:00
2022-03-13 12:52:24 +00:00
lda #PM.Filename
pha
2022-03-13 12:52:24 +00:00
lda /PM.Filename
pha
2020-07-26 19:16:13 +00:00
2022-03-13 12:52:24 +00:00
>LDYAI MSG.PMLOAD
2018-07-12 15:20:39 +00:00
jsr PrintFYA
2016-06-07 06:10:18 +00:00
jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.OPEN
2016-06-07 06:10:18 +00:00
.DA MLIOPEN02
bcs .99
lda MLIOPEN02+5
sta MLIREAD02+1
sta MLICLOSE02+1
2019-12-09 15:53:14 +00:00
2016-06-07 06:10:18 +00:00
jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.READ
2016-06-07 06:10:18 +00:00
.DA MLIREAD02
bcs .98
2019-12-09 15:53:14 +00:00
2016-06-07 06:10:18 +00:00
jsr .9
2022-03-13 12:52:24 +00:00
jmp A2osX.PMLOAD
2019-12-09 15:53:14 +00:00
2016-06-07 06:10:18 +00:00
.98 pha
jsr .9
pla
2019-12-09 15:53:14 +00:00
2015-03-15 22:00:40 +00:00
sec
rts
2019-12-09 15:53:14 +00:00
2016-06-07 06:10:18 +00:00
.9 jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.CLOSE
2016-06-07 06:10:18 +00:00
.DA MLICLOSE02
.99 rts
2019-12-11 07:38:45 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
LoadPM.VERSION .BS 1
LoadPM.MVERSION .BS 1
LoadPM.Bits .HS 8040201008040201
2015-03-15 22:00:40 +00:00
*--------------------------------------
2020-09-25 06:02:05 +00:00
.INB usr/src/shared/x.printf.s
2015-03-14 21:48:35 +00:00
*--------------------------------------
MSG.INIT0 .CZ "A2osX[Stage0]:Init\r"
MSG.SYSMEM .CZ "Checking System Memory..."
MSG.SYSMEM.OK .CZ "128k Detected.\r"
MSG.SYSMEM.KO .CZ "A2osX Requires At Least 128k Memory.\r"
2016-06-07 06:10:18 +00:00
MSG.CPU .CZ "Checking CPU..."
MSG.CPU.OK .CZ "65C02 CPU (or higher) Detected.\r"
MSG.CPU.KO .CZ "A2osX Requires At Least A 65C02 CPU.\r"
2016-06-07 06:10:18 +00:00
MSG.RAMDRV .CZ "Checking ProDOS RamDrive..."
MSG.RAMDRV.OK .CZ "Successfully Disabled.\r"
MSG.RAMDRV.KO0 .CZ "Not Detected.\r"
MSG.RAMDRV.KO1 .CZ "Uninstall Failed.\r"
2016-06-07 06:10:18 +00:00
MSG.BOOTPREFIX .CZ "Boot Prefix:%S\r"
2016-06-07 06:10:18 +00:00
MSG.PMENUM .CZ "Looking For ProDOS Modules...\r"
MSG.PMSYSDIR .CZ "SYS dir is %S\r"
MSG.PMSYSDIR.KO .CZ "***Error : $%h\r"
MSG.PMLOAD .CZ "***Loading PM : %S\r"
MSG.INIT0OK .CZ "A2osX[Stage0]:Complete.\r"
2015-03-14 21:48:35 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
MLIGETPREFIX01
MLISETPREFIX01 .DA #1
2015-03-14 21:48:35 +00:00
.DA Boot.Prefix
2020-09-16 14:54:42 +00:00
*--------------------------------------
2022-03-13 12:52:24 +00:00
MLISETPREFIX02 .DA #1
.DA Sys.Prefix
*--------------------------------------
2015-06-03 18:30:57 +00:00
MLIONLINE01 .DA #2
2020-09-16 14:54:42 +00:00
* .DA #0
.DA #$B0 S3D2
2015-06-03 18:30:57 +00:00
.DA MLIONLINE01BUF
2019-04-10 15:51:47 +00:00
*--------------------------------------
MLIOPEN00 .DA #3 For DIR listing
2022-03-13 12:52:24 +00:00
.DA Logo.Filename
2019-04-10 15:51:47 +00:00
.DA A2osX.OpenBuff1
.BS 1
MLIREAD00 .DA #4
.BS 1
.DA A2osX.LOGOLOAD
.DA 2048
.BS 2
MLICLOSE00 .DA #1
.BS 1
*--------------------------------------
2015-03-15 22:00:40 +00:00
MLIOPEN01 .DA #3 For DIR listing
2022-03-13 12:52:24 +00:00
.DA Sys.Prefix
2015-03-15 22:00:40 +00:00
.DA A2osX.OpenBuff1
.BS 1
MLIREAD01 .DA #4
.BS 1
.DA A2osX.ReadBuff Load address Dir Blocks
.DA $200 Maxlen of Dir Blocks (512)
.BS 2
MLICLOSE01 .DA #1
.BS 1
2019-04-10 15:51:47 +00:00
*--------------------------------------
2015-03-15 22:00:40 +00:00
MLIOPEN02 .DA #3
2022-03-13 12:52:24 +00:00
.DA PM.Filename
2015-03-15 22:00:40 +00:00
.DA A2osX.OpenBuff2
.BS 1
MLIREAD02 .DA #4
.BS 1
2022-03-13 12:52:24 +00:00
.DA A2osX.PMLOAD Load address for PMs
.DA A2osX.PMMAXLEN Maxlen of PM
2015-03-15 22:00:40 +00:00
.BS 2
MLICLOSE02 .DA #1
.BS 1
2019-04-10 15:51:47 +00:00
*--------------------------------------
2015-03-14 21:48:35 +00:00
MLIQUIT01 .DA #4
.DA #0
.DA 0
.DA #0
.DA 0
*--------------------------------------
A2osX.LOGO .PS "A2osX.logo"
SYS .PS "sys/"
PM. .PS "PM."
2019-04-10 15:51:47 +00:00
*--------------------------------------
SCR.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
SCR.BASEH .HS 04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07
*--------------------------------------
2020-07-04 19:00:47 +00:00
PALETTE.MAIN .HS 00.02.04.06.08.0A.0C.0E
.HS 01.03.05.07.09.0B.0D.0F
PALETTE.AUX .HS 00.01.02.03.04.05.06.07
.HS 08.09.0A.0B.0C.0D.0E.0F
*--------------------------------------
2015-03-15 22:00:40 +00:00
.EP
2022-03-13 12:52:24 +00:00
.LIST ON
SYSTEM.END .EQ *
.LIST OFF
*--------------------------------------
2016-06-07 06:10:18 +00:00
A2osX.QC.B.Start
2019-04-30 16:08:47 +00:00
A2osX.QC.B.BOOT .EQ *+4
2021-03-17 19:49:39 +00:00
A2osX.QC.B.ROOT .EQ *+4+64
2023-11-12 13:20:15 +00:00
2020-09-25 06:02:05 +00:00
.INB usr/src/a2osx.s.qc
*--------------------------------------
2015-03-14 21:48:35 +00:00
MAN
2022-03-13 12:52:24 +00:00
SAVE usr/src/a2osx.s
2015-03-14 21:48:35 +00:00
ASM