2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2019-04-30 16:08:47 +00:00
|
|
|
|
AUTO 3,1
|
2017-10-18 15:32:56 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-10 15:33:13 +00:00
|
|
|
|
Kernel.Init2 sei
|
2017-08-22 06:38:16 +00:00
|
|
|
|
ldx #$FF
|
|
|
|
|
txs
|
2023-11-12 13:20:15 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.SETALTZP
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2021-05-04 17:31:21 +00:00
|
|
|
|
stx SaveSM
|
|
|
|
|
stx SaveSX
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2023-11-12 13:20:15 +00:00
|
|
|
|
.DO K8M=1
|
|
|
|
|
sta IO.CLRALTZP
|
|
|
|
|
.FIN
|
|
|
|
|
|
2018-07-11 15:13:29 +00:00
|
|
|
|
ldx #Kernel.ZP.S-1
|
2019-10-21 14:25:37 +00:00
|
|
|
|
|
2019-10-28 06:32:12 +00:00
|
|
|
|
.1 lda Kernel.ZP,x
|
2018-07-11 15:13:29 +00:00
|
|
|
|
sta CHARGET,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
|
|
|
|
|
2023-11-12 13:20:15 +00:00
|
|
|
|
.DO K8M=0
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.CLRALTZP
|
2023-11-12 13:20:15 +00:00
|
|
|
|
.FIN
|
|
|
|
|
|
2018-07-12 15:20:39 +00:00
|
|
|
|
>LDYAI MSG.Init2
|
|
|
|
|
jsr PrintFYA
|
2019-10-21 14:25:37 +00:00
|
|
|
|
|
2023-11-12 13:20:15 +00:00
|
|
|
|
.DO K8M=0
|
|
|
|
|
sta IO.SETALTZP
|
|
|
|
|
.FIN
|
|
|
|
|
|
|
|
|
|
>LDYA PAKME.GP
|
|
|
|
|
>STYA ZPInBufPtr
|
|
|
|
|
>LDYAI $0140
|
|
|
|
|
jsr A2osX.Unpak
|
|
|
|
|
|
|
|
|
|
.DO K8M=0
|
|
|
|
|
sta IO.CLRALTZP
|
|
|
|
|
.FIN
|
|
|
|
|
|
2019-10-30 16:29:46 +00:00
|
|
|
|
>LDYA PAKME.MAIN
|
2019-10-28 06:32:12 +00:00
|
|
|
|
>STYA ZPInBufPtr
|
2023-11-12 13:20:15 +00:00
|
|
|
|
>LDYAI MAIN.ORG
|
2020-04-13 17:04:02 +00:00
|
|
|
|
jsr A2osX.Unpak
|
2017-11-22 16:27:50 +00:00
|
|
|
|
|
2023-11-12 13:20:15 +00:00
|
|
|
|
.DO K8M=0
|
2019-10-30 16:29:46 +00:00
|
|
|
|
>LDYA PAKME.AUX
|
2019-10-28 06:32:12 +00:00
|
|
|
|
>STYA ZPInBufPtr
|
2020-04-13 17:04:02 +00:00
|
|
|
|
>LDYAI $9F00
|
|
|
|
|
jsr A2osX.Unpak
|
|
|
|
|
|
|
|
|
|
>LDYAI $9F00
|
|
|
|
|
>STYA ZPPtr1
|
2020-01-11 17:13:27 +00:00
|
|
|
|
>LDYAI Mem.XHiMem
|
2020-04-13 17:04:02 +00:00
|
|
|
|
>STYA ZPPtr2
|
2020-01-10 15:58:47 +00:00
|
|
|
|
|
2021-05-04 17:31:21 +00:00
|
|
|
|
lda #AUX.S
|
2020-04-13 17:04:02 +00:00
|
|
|
|
eor #$ff
|
|
|
|
|
tax
|
2021-05-04 17:31:21 +00:00
|
|
|
|
lda /AUX.S
|
2020-04-13 17:04:02 +00:00
|
|
|
|
eor #$ff
|
|
|
|
|
pha
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-04-13 17:04:02 +00:00
|
|
|
|
ldy #0
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.SETWRITEAUX
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-04-13 17:04:02 +00:00
|
|
|
|
.2 inx
|
|
|
|
|
bne .3
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-04-13 17:04:02 +00:00
|
|
|
|
pla
|
|
|
|
|
inc
|
|
|
|
|
beq .4
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-04-13 17:04:02 +00:00
|
|
|
|
pha
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-04-13 17:04:02 +00:00
|
|
|
|
.3 lda (ZPPtr1),y
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
iny
|
|
|
|
|
bne .2
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-04-13 17:04:02 +00:00
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
inc ZPPtr2+1
|
|
|
|
|
bra .2
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
.4 sta IO.CLRWRITEAUX
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-11-20 20:22:55 +00:00
|
|
|
|
.FIN
|
2023-11-12 13:20:15 +00:00
|
|
|
|
|
2023-11-20 20:22:55 +00:00
|
|
|
|
.DO K8M=0
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.SETALTZP
|
2023-11-20 20:22:55 +00:00
|
|
|
|
|
2023-11-12 13:20:15 +00:00
|
|
|
|
.FIN
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
lda IO.RRAMWRAMBNK2
|
|
|
|
|
lda IO.RRAMWRAMBNK2
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2019-10-30 16:29:46 +00:00
|
|
|
|
>LDYA PAKME.D2
|
2019-10-28 06:32:12 +00:00
|
|
|
|
>STYA ZPInBufPtr
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>LDYAI $D000
|
2020-04-13 17:04:02 +00:00
|
|
|
|
jsr A2osX.Unpak
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
lda IO.RRAMWRAMBNK1
|
|
|
|
|
lda IO.RRAMWRAMBNK1
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2019-10-30 16:29:46 +00:00
|
|
|
|
>LDYA PAKME.D1
|
2019-10-28 06:32:12 +00:00
|
|
|
|
>STYA ZPInBufPtr
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>LDYAI $D000
|
2020-04-13 17:04:02 +00:00
|
|
|
|
jsr A2osX.Unpak
|
2019-10-28 06:32:12 +00:00
|
|
|
|
|
2019-10-30 16:29:46 +00:00
|
|
|
|
>LDYA PAKME.E0
|
2019-10-28 06:32:12 +00:00
|
|
|
|
>STYA ZPInBufPtr
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>LDYAI $E000
|
2020-04-13 17:04:02 +00:00
|
|
|
|
jsr A2osX.Unpak
|
2019-10-28 06:32:12 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
lda IO.RROMBNK1
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2023-11-20 20:22:55 +00:00
|
|
|
|
.DO K8M=0
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.CLRALTZP
|
2023-11-20 20:22:55 +00:00
|
|
|
|
|
|
|
|
|
.FIN
|
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
cli
|
2019-10-21 14:25:37 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
jsr KConfigLoad
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2023-11-12 13:20:15 +00:00
|
|
|
|
lda A2osX.FSID
|
|
|
|
|
beq .5
|
|
|
|
|
|
|
|
|
|
sta IO.SETALTZP
|
|
|
|
|
sta A2osX.FSID
|
|
|
|
|
sta IO.CLRALTZP
|
|
|
|
|
|
|
|
|
|
>LDYAI MSG.FX
|
|
|
|
|
jsr PrintFYA
|
|
|
|
|
|
2023-11-26 13:17:41 +00:00
|
|
|
|
.5 sta IO.SETALTZP
|
|
|
|
|
lda A2osX.HZ
|
|
|
|
|
sta IO.CLRALTZP
|
2018-07-12 15:20:39 +00:00
|
|
|
|
pha
|
|
|
|
|
>LDYAI MSG.HZ
|
|
|
|
|
jsr PrintFYA
|
2023-11-12 13:20:15 +00:00
|
|
|
|
|
2018-07-12 15:20:39 +00:00
|
|
|
|
>LDYAI MSG.Init2.OK
|
|
|
|
|
jsr PrintFYA
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
>DEBUGOA
|
|
|
|
|
*--------------------------------------
|
2023-11-04 14:42:28 +00:00
|
|
|
|
Kernel.Init3 sta IO.SETALTZP
|
|
|
|
|
lda IO.RRAMWRAMBNK1
|
|
|
|
|
lda IO.RRAMWRAMBNK1
|
2020-11-19 15:34:02 +00:00
|
|
|
|
|
2018-04-13 15:18:48 +00:00
|
|
|
|
lda #$ff Make sure we are in Kernel Mode during setup
|
|
|
|
|
sta IRQ.InKernel
|
2019-03-27 17:01:01 +00:00
|
|
|
|
stz IRQ.InLib
|
2018-04-13 15:18:48 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
lda /K.VER
|
|
|
|
|
sta A2osX.KVER
|
|
|
|
|
lda #K.VER
|
|
|
|
|
sta A2osX.KVER+1
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.SETALTCHAR
|
|
|
|
|
sta IO.SETMIXED
|
|
|
|
|
sta IO.CLRHIRES
|
|
|
|
|
sta IO.SET80DISP
|
|
|
|
|
sta IO.SET80STORE
|
|
|
|
|
sta IO.CLRPAGE2
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
lda IO.RDIOUDIS
|
|
|
|
|
sta IO.SETIOUDIS
|
|
|
|
|
sta IO.SETDHIRES
|
2020-06-27 18:30:09 +00:00
|
|
|
|
bmi .10
|
2021-07-13 16:52:04 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.CLRIOUDIS
|
2018-12-14 07:32:20 +00:00
|
|
|
|
|
2020-06-27 18:30:09 +00:00
|
|
|
|
.10 jsr MemMgrInit
|
2018-12-10 16:45:37 +00:00
|
|
|
|
|
2019-01-13 13:10:14 +00:00
|
|
|
|
>LDYAI S.PS Select Process 0 (Kernel)
|
|
|
|
|
jsr K.GetMem0
|
2018-12-18 14:37:07 +00:00
|
|
|
|
>STYA pPs
|
2023-10-18 05:41:12 +00:00
|
|
|
|
stx PSs.hPS
|
2018-12-18 14:37:07 +00:00
|
|
|
|
|
2019-08-02 20:55:43 +00:00
|
|
|
|
jsr Mem.SetOwner
|
2019-01-24 13:53:29 +00:00
|
|
|
|
lda #1
|
|
|
|
|
sta CORE.PSCount
|
2018-12-18 14:37:07 +00:00
|
|
|
|
>LDYAI K.STACKTOP
|
|
|
|
|
>STYA pStack
|
2020-02-23 20:01:48 +00:00
|
|
|
|
sta pBase+1
|
2018-12-18 14:37:07 +00:00
|
|
|
|
|
2023-10-18 05:41:12 +00:00
|
|
|
|
jsr SysCDEVInit
|
2018-12-13 16:39:24 +00:00
|
|
|
|
bcs *
|
2021-03-11 21:40:55 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
* sta IO.CLRMIXED
|
2021-03-11 21:40:55 +00:00
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHWI DEV.CONSOLE
|
2019-01-13 13:10:14 +00:00
|
|
|
|
>PUSHBI O.RDWR
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHBI S.FI.T.TXT
|
2020-02-16 20:45:16 +00:00
|
|
|
|
>PUSHWZ Aux type
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 fopen
|
2018-12-03 13:56:52 +00:00
|
|
|
|
bcs *
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2019-01-13 13:10:14 +00:00
|
|
|
|
ldy #S.PS.hStdIn
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2019-01-13 13:10:14 +00:00
|
|
|
|
iny #S.PS.hStdOut
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2019-01-13 13:10:14 +00:00
|
|
|
|
iny #S.PS.hStdErr
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2019-01-06 09:58:49 +00:00
|
|
|
|
*--------------------------------------
|
2023-10-18 05:41:12 +00:00
|
|
|
|
Kernel.Init3C >LDYAI MSG.Init3
|
|
|
|
|
>SYSCALL2 PutS
|
|
|
|
|
|
2019-10-21 14:25:37 +00:00
|
|
|
|
jsr HW.Detect
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
jsr CPU.Init
|
2018-12-03 13:56:52 +00:00
|
|
|
|
|
2018-07-13 14:38:24 +00:00
|
|
|
|
jsr CPU.Init.Z80
|
2020-03-10 16:42:07 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
jsr DevMgrInit
|
2018-12-03 13:56:52 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
jsr IrqMgrInit
|
|
|
|
|
bcs *
|
2018-12-03 13:56:52 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
jsr EvtMgrInit
|
2018-12-03 13:56:52 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
jsr TskMgrInit
|
|
|
|
|
bcs *
|
2018-12-03 13:56:52 +00:00
|
|
|
|
|
2019-04-09 15:47:33 +00:00
|
|
|
|
jsr PwdMgrInit
|
|
|
|
|
|
2020-02-27 16:46:40 +00:00
|
|
|
|
>PUSHWI MSG.EXEC
|
|
|
|
|
>PUSHWI SBININITD
|
2018-08-22 15:23:27 +00:00
|
|
|
|
>PUSHBI 2
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-02-27 07:27:42 +00:00
|
|
|
|
>PUSHWI SBININITD
|
|
|
|
|
>PUSHBI 0 PS Flags
|
2023-11-12 13:20:15 +00:00
|
|
|
|
|
2020-08-07 19:49:24 +00:00
|
|
|
|
>SYSCALL2 ExecV
|
2018-12-03 06:59:30 +00:00
|
|
|
|
bcs Kernel.Init3.Err
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-10-18 05:41:12 +00:00
|
|
|
|
>LDYAI MSG.Init3.OK
|
|
|
|
|
>SYSCALL2 PutS
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>DEBUGOA
|
|
|
|
|
|
2017-08-29 15:19:09 +00:00
|
|
|
|
jmp CORE.Run
|
2018-12-03 06:59:30 +00:00
|
|
|
|
Kernel.Init3.Err
|
2020-02-14 07:21:56 +00:00
|
|
|
|
pha
|
|
|
|
|
>PUSHWI MSG.StartupErr
|
|
|
|
|
pla
|
2018-12-03 06:59:30 +00:00
|
|
|
|
>PUSHA
|
2020-08-19 19:39:43 +00:00
|
|
|
|
>PUSHBI 1
|
2020-02-14 16:32:52 +00:00
|
|
|
|
>SYSCALL2 printf
|
2020-07-28 15:16:14 +00:00
|
|
|
|
bra * No need to discard Expanded CMDLINE
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-12 15:20:39 +00:00
|
|
|
|
* INIT2 Subs
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
KConfigLoad >LDYAI MSG.KCREAD
|
|
|
|
|
jsr PrintFYA
|
2018-07-10 15:33:13 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
jsr GP.MLIENTRY Bypass ATALK
|
|
|
|
|
.DA #MLI.GFINFOEX
|
2021-05-04 17:31:21 +00:00
|
|
|
|
.DA pMLIGFIEX
|
2019-11-28 22:06:22 +00:00
|
|
|
|
bcc .1
|
2023-11-12 13:20:15 +00:00
|
|
|
|
|
2019-12-03 15:42:17 +00:00
|
|
|
|
eor #MLI.E.BADCALL
|
2019-12-09 15:53:14 +00:00
|
|
|
|
beq .2 regular ProDOS
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
ror A2osX.FSID Bad file, but ProDOS.FX detected
|
2019-11-28 22:06:22 +00:00
|
|
|
|
bra .9
|
2019-11-27 22:04:55 +00:00
|
|
|
|
|
2019-12-17 12:28:49 +00:00
|
|
|
|
.1 sec
|
2020-11-19 15:34:02 +00:00
|
|
|
|
ror A2osX.FSID File Present & ProDOS.FX detected
|
2019-12-09 15:53:14 +00:00
|
|
|
|
|
2019-11-28 22:06:22 +00:00
|
|
|
|
.2 jsr MLI
|
2023-11-04 14:42:28 +00:00
|
|
|
|
.DA #MLI.OPEN
|
2021-05-04 17:31:21 +00:00
|
|
|
|
.DA pMLIOPEN
|
2018-07-10 15:33:13 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2021-05-04 17:31:21 +00:00
|
|
|
|
lda pMLIOPEN+5
|
|
|
|
|
sta pMLIREAD+1
|
|
|
|
|
sta pMLICLOSE+1
|
2018-07-10 15:33:13 +00:00
|
|
|
|
jsr MLI
|
2023-11-04 14:42:28 +00:00
|
|
|
|
.DA #MLI.READ
|
2021-05-04 17:31:21 +00:00
|
|
|
|
.DA pMLIREAD
|
2018-07-10 15:33:13 +00:00
|
|
|
|
php
|
|
|
|
|
pha
|
|
|
|
|
jsr MLI
|
2023-11-04 14:42:28 +00:00
|
|
|
|
.DA #MLI.CLOSE
|
2021-05-04 17:31:21 +00:00
|
|
|
|
.DA pMLICLOSE
|
2018-07-10 15:33:13 +00:00
|
|
|
|
pla
|
|
|
|
|
plp
|
|
|
|
|
bcs .9
|
2023-11-26 13:17:41 +00:00
|
|
|
|
|
|
|
|
|
ldx #15
|
|
|
|
|
|
|
|
|
|
.3 lda A2osX.KCONFIG,x
|
|
|
|
|
sta IO.SETALTZP
|
|
|
|
|
sta A2osX.KCONFIG,x
|
|
|
|
|
sta IO.CLRALTZP
|
|
|
|
|
dex
|
|
|
|
|
bpl .3
|
2019-11-28 22:06:22 +00:00
|
|
|
|
|
2018-07-12 15:20:39 +00:00
|
|
|
|
>LDYAI MSG.KCREAD.OK
|
2019-11-28 22:06:22 +00:00
|
|
|
|
bra .8
|
|
|
|
|
|
2018-07-12 15:20:39 +00:00
|
|
|
|
.9 >LDYAI MSG.KCREAD.KO
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2019-12-09 15:53:14 +00:00
|
|
|
|
.8 jsr PrintFYA
|
2023-11-12 13:20:15 +00:00
|
|
|
|
|
|
|
|
|
rts
|
2018-07-10 15:33:13 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-12 15:20:39 +00:00
|
|
|
|
* INIT3 Subs
|
|
|
|
|
*--------------------------------------
|
2018-12-10 16:45:37 +00:00
|
|
|
|
MemMgrInit >LDYAI Mem.MHiMem
|
|
|
|
|
>STYA Mem.HiMem
|
|
|
|
|
>STYA Mem.Free
|
|
|
|
|
>LDYAI Mem.MLoMem
|
|
|
|
|
>STYA Mem.LoMem
|
|
|
|
|
stz Mem.LastSlot Reserve Slot #0
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.SETWRITEAUX
|
2018-12-17 14:24:39 +00:00
|
|
|
|
|
2018-12-10 16:45:37 +00:00
|
|
|
|
>LDYAI Mem.XLoMem
|
|
|
|
|
>STYA Mem.LoMem
|
2018-12-17 14:24:39 +00:00
|
|
|
|
|
2018-12-10 16:45:37 +00:00
|
|
|
|
stz Mem.LastSlot Reserve Slot #0
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.CLRWRITEAUX
|
2018-12-10 16:45:37 +00:00
|
|
|
|
|
2023-10-18 05:41:12 +00:00
|
|
|
|
ldx #K.FILE.MAX-1
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-10-18 05:41:12 +00:00
|
|
|
|
.1 stz FILEs.hFD,x
|
|
|
|
|
stz FILEs.hName,x
|
|
|
|
|
stz FILEs.oCnt,x
|
2018-12-10 16:45:37 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2018-12-10 16:45:37 +00:00
|
|
|
|
ldx #K.PS.MAX*4-1
|
2019-10-18 15:07:14 +00:00
|
|
|
|
|
2023-10-18 05:41:12 +00:00
|
|
|
|
.3 stz PSs.PID,x
|
2018-12-10 16:45:37 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .3
|
2023-10-18 05:41:12 +00:00
|
|
|
|
|
|
|
|
|
ldx #K.FD.MAX-1
|
|
|
|
|
|
|
|
|
|
.4 stz FDs.pLO,x
|
|
|
|
|
stz FDs.pHI,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .4
|
2019-10-18 15:07:14 +00:00
|
|
|
|
|
2018-12-10 16:45:37 +00:00
|
|
|
|
ldx #K.EVT.MAX*S.EVT-1
|
2019-10-18 15:07:14 +00:00
|
|
|
|
|
2023-07-12 17:07:55 +00:00
|
|
|
|
.5 stz K.S.EVT,x
|
2018-12-10 16:45:37 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .5
|
2019-10-18 15:07:14 +00:00
|
|
|
|
|
2019-04-15 05:40:13 +00:00
|
|
|
|
ldx #K.USR.MAX*2-1
|
2019-10-18 15:07:14 +00:00
|
|
|
|
|
2023-10-18 05:41:12 +00:00
|
|
|
|
.6 stz USRs.hSID,x
|
2019-04-15 05:40:13 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .6
|
2019-10-18 15:07:14 +00:00
|
|
|
|
|
2023-10-18 05:41:12 +00:00
|
|
|
|
ldx #K.PFT.MAX*4-1
|
2021-01-12 21:14:13 +00:00
|
|
|
|
|
2023-10-18 05:41:12 +00:00
|
|
|
|
.7 stz PFTs.pLO,x
|
2021-01-12 21:14:13 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .7
|
|
|
|
|
|
2018-12-10 16:45:37 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-10-18 05:41:12 +00:00
|
|
|
|
SysCDEVInit >PUSHWI FD.NULL
|
|
|
|
|
>PUSHWI FD.NULL.NAME
|
|
|
|
|
>SYSCALL2 MKDev
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDYAI Mem.XHiMem
|
2020-05-04 20:46:21 +00:00
|
|
|
|
>STYA FD.TTY+S.FD.DEV.DCBPTR
|
2018-12-17 14:24:39 +00:00
|
|
|
|
|
2023-10-18 05:41:12 +00:00
|
|
|
|
jsr SysCDEVInit.TTYPtrs
|
2018-12-10 16:45:37 +00:00
|
|
|
|
|
2020-02-16 20:45:16 +00:00
|
|
|
|
>PUSHWI FD.TTY
|
2018-12-13 16:39:24 +00:00
|
|
|
|
>PUSHWI FD.CONSOLE.NAME
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 MKDev
|
2018-12-13 16:39:24 +00:00
|
|
|
|
bcs .9
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2018-12-17 14:24:39 +00:00
|
|
|
|
ldx A2osX.TTYDEVS
|
2020-01-11 17:13:27 +00:00
|
|
|
|
|
2018-12-17 14:24:39 +00:00
|
|
|
|
.1 phx
|
2018-12-10 16:45:37 +00:00
|
|
|
|
inc FD.TTY+S.FD.DEV.DEVID
|
2018-12-11 16:41:25 +00:00
|
|
|
|
inc FD.TTY.NAME+3
|
2023-10-18 05:41:12 +00:00
|
|
|
|
jsr SysCDEVInit.TTYPtrs
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-02-16 20:45:16 +00:00
|
|
|
|
>PUSHWI FD.TTY
|
2018-12-11 16:41:25 +00:00
|
|
|
|
>PUSHWI FD.TTY.NAME
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 MKDev
|
2018-12-17 14:24:39 +00:00
|
|
|
|
plx
|
|
|
|
|
bcs .9
|
2020-01-11 17:13:27 +00:00
|
|
|
|
|
2018-12-17 14:24:39 +00:00
|
|
|
|
dex
|
2018-12-10 16:45:37 +00:00
|
|
|
|
bne .1
|
2020-01-11 17:13:27 +00:00
|
|
|
|
|
2020-04-13 17:04:02 +00:00
|
|
|
|
* clc
|
2018-12-13 16:39:24 +00:00
|
|
|
|
.9 rts
|
2018-07-12 15:20:39 +00:00
|
|
|
|
*--------------------------------------
|
2023-10-18 05:41:12 +00:00
|
|
|
|
SysCDEVInit.TTYPtrs
|
2020-05-04 20:46:21 +00:00
|
|
|
|
lda FD.TTY+S.FD.DEV.DCBPTR
|
|
|
|
|
sec
|
2021-05-04 17:31:21 +00:00
|
|
|
|
sbc #80*24+S.DCB.TTY
|
2018-12-13 16:39:24 +00:00
|
|
|
|
sta FD.TTY+S.FD.DEV.DCBPTR
|
2021-07-24 20:42:23 +00:00
|
|
|
|
sta ZPPtr1
|
2020-05-04 20:46:21 +00:00
|
|
|
|
tay
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-05-04 20:46:21 +00:00
|
|
|
|
lda FD.TTY+S.FD.DEV.DCBPTR+1
|
2021-05-04 17:31:21 +00:00
|
|
|
|
sbc /80*24+S.DCB.TTY
|
2018-12-13 16:39:24 +00:00
|
|
|
|
sta FD.TTY+S.FD.DEV.DCBPTR+1
|
2021-07-24 20:42:23 +00:00
|
|
|
|
sta ZPPtr1+1
|
2020-01-11 17:13:27 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.SETWRITEAUX
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-04-13 17:04:02 +00:00
|
|
|
|
>STYA Mem.HiMem
|
|
|
|
|
>STYA Mem.Free
|
2021-07-24 20:42:23 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.DCB.TTY-1
|
|
|
|
|
|
|
|
|
|
lda #0
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
2021-07-24 20:42:23 +00:00
|
|
|
|
.1 sta (ZPPtr1),y
|
|
|
|
|
dey
|
|
|
|
|
bne .1
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
2021-07-24 20:42:23 +00:00
|
|
|
|
lda FD.TTY+S.FD.DEV.DEVID
|
|
|
|
|
sta (ZPPtr1)
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.CLRWRITEAUX
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2018-12-13 16:39:24 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2019-10-21 14:25:37 +00:00
|
|
|
|
* http://www.1000bit.it/support/manuali/apple/technotes/misc/tn.misc.02.html
|
|
|
|
|
* https://mirrors.apple2.org.za/apple.cabi.net/FAQs.and.INFO/A2.TECH.NOTES.ETC/A2.CLASSIC.TNTS/a2misc007(1).htm
|
|
|
|
|
*--------------------------------------
|
2020-02-14 07:21:56 +00:00
|
|
|
|
HW.Detect >PUSHWI MSG.HW
|
|
|
|
|
>PUSHBI 0
|
2020-02-14 16:32:52 +00:00
|
|
|
|
>SYSCALL2 printf
|
2019-10-21 14:25:37 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
bit IO.RROMBNK1
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-11-12 13:20:15 +00:00
|
|
|
|
stz A2osX.HWT
|
2019-10-21 14:25:37 +00:00
|
|
|
|
stz A2osX.HWSubT
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2019-10-21 14:25:37 +00:00
|
|
|
|
sec
|
2023-11-04 14:42:28 +00:00
|
|
|
|
jsr $FE1F ROM.IDROUTINE IIgs ?
|
2019-10-21 14:25:37 +00:00
|
|
|
|
bcs .2
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-11-12 13:20:15 +00:00
|
|
|
|
lda #A2osX.HWT.IIgs
|
|
|
|
|
sta A2osX.HWT
|
2019-10-21 14:25:37 +00:00
|
|
|
|
|
|
|
|
|
cpy #2
|
2019-10-21 15:24:11 +00:00
|
|
|
|
bne .1
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2019-10-21 14:25:37 +00:00
|
|
|
|
iny
|
2019-10-21 15:24:11 +00:00
|
|
|
|
|
2019-10-21 14:25:37 +00:00
|
|
|
|
.1 sty A2osX.HWSubT
|
|
|
|
|
bra .8
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
.2 lda $FBC0 ROM.ZIDBYTE
|
2019-10-21 14:25:37 +00:00
|
|
|
|
beq .4 //c
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-11-12 13:20:15 +00:00
|
|
|
|
ldx #A2osX.HWT.IIe
|
|
|
|
|
stx A2osX.HWT
|
2019-10-21 14:25:37 +00:00
|
|
|
|
cmp #$EA
|
|
|
|
|
beq .8 //e OLD ROMs
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2019-10-21 14:25:37 +00:00
|
|
|
|
inc A2osX.HWSubT //e Enh ROMs
|
|
|
|
|
lda $FBDD
|
|
|
|
|
cmp #2
|
|
|
|
|
bne .8
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2019-10-21 14:25:37 +00:00
|
|
|
|
inc A2osX.HWSubT //e LC card
|
|
|
|
|
bra .8
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-11-12 13:20:15 +00:00
|
|
|
|
.4 lda #A2osX.HWT.IIc
|
|
|
|
|
sta A2osX.HWT
|
2019-10-21 14:25:37 +00:00
|
|
|
|
lda $FBBF
|
|
|
|
|
sta A2osX.HWSubT
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
.8 bit IO.RRAMWRAMBNK1
|
|
|
|
|
bit IO.RRAMWRAMBNK1
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHWI MSG.HW.TypeSubT
|
2023-11-12 13:20:15 +00:00
|
|
|
|
>PUSHB A2osX.HWT
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHB A2osX.HWSubT
|
2019-10-21 14:25:37 +00:00
|
|
|
|
>PUSHBI 2
|
2020-02-14 16:32:52 +00:00
|
|
|
|
>SYSCALL2 printf
|
2019-10-21 14:25:37 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-11-19 15:34:02 +00:00
|
|
|
|
CPU.Init >PUSHWI MSG.CPU
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHBI 0
|
2020-02-14 16:32:52 +00:00
|
|
|
|
>SYSCALL2 printf
|
2017-08-22 06:38:16 +00:00
|
|
|
|
jsr Detect6502 A = CPU type
|
|
|
|
|
sta A2osX.CPUTYPE
|
2018-07-13 14:38:24 +00:00
|
|
|
|
and #$F
|
|
|
|
|
asl
|
|
|
|
|
tax
|
|
|
|
|
ldy MSG.CPUTYPE,x
|
|
|
|
|
lda MSG.CPUTYPE+1,x
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 puts
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHWI MSG.CPU.SPEED
|
2020-07-28 15:16:14 +00:00
|
|
|
|
>PUSHB A2osX.HZ
|
|
|
|
|
>PUSHBI 1
|
2020-02-14 16:32:52 +00:00
|
|
|
|
>SYSCALL2 printf
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
stz A2osX.CPUSPEED+1
|
2019-10-21 14:25:37 +00:00
|
|
|
|
|
2022-03-13 12:52:24 +00:00
|
|
|
|
ldy #0
|
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
php
|
|
|
|
|
sei
|
2020-04-23 15:36:51 +00:00
|
|
|
|
|
2023-11-12 13:20:15 +00:00
|
|
|
|
lda A2osX.HWT
|
|
|
|
|
cmp #A2osX.HWT.IIc
|
2020-11-19 15:34:02 +00:00
|
|
|
|
beq CPU.Init2c
|
2023-01-18 07:19:41 +00:00
|
|
|
|
*--------------------------------------
|
2023-04-23 15:20:27 +00:00
|
|
|
|
* VBL = 20.000us 50hz, 16.666 60hz
|
2023-01-18 07:19:41 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ldx A2osX.HZ
|
2019-10-21 14:25:37 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
.1 bit IO.VBL //e : Wait VBL high....
|
2020-07-28 15:16:14 +00:00
|
|
|
|
bpl .1
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
.2 lda IO.VBL //e : wait VBL low
|
2017-08-22 06:38:16 +00:00
|
|
|
|
bmi .2
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-01-18 07:19:41 +00:00
|
|
|
|
.3 pha (3)
|
2023-01-17 06:31:23 +00:00
|
|
|
|
|
2023-01-18 07:19:41 +00:00
|
|
|
|
lda CPU.Hz2L-5,x (5) 50Hz = 36, 60Hz = 29
|
2021-03-11 21:40:55 +00:00
|
|
|
|
|
2023-01-18 07:19:41 +00:00
|
|
|
|
.4 dec (2)
|
|
|
|
|
bne .4 (3)
|
|
|
|
|
|
|
|
|
|
iny (2) 38*5+10 = 200us
|
|
|
|
|
cpy #100 (3)
|
|
|
|
|
bne .5 (3)
|
2021-03-11 21:40:55 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
inc A2osX.CPUSPEED+1
|
2023-01-17 06:31:23 +00:00
|
|
|
|
ldy #0
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-01-18 07:19:41 +00:00
|
|
|
|
.5 pla
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
eor IO.VBL
|
2023-01-17 06:31:23 +00:00
|
|
|
|
bpl .3
|
2023-04-23 15:20:27 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
lda IO.VBL
|
2023-01-17 06:31:23 +00:00
|
|
|
|
bmi .3
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
bra CPU.InitOK
|
|
|
|
|
*--------------------------------------
|
2023-11-04 14:42:28 +00:00
|
|
|
|
CPU.Init2c lda IO.RDIOUDIS
|
2022-03-13 12:52:24 +00:00
|
|
|
|
pha
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.CLRIOUDIS
|
2022-03-13 12:52:24 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
lda IO.IIC.RDVBLMSK
|
|
|
|
|
pha Save VBLIRQ enable
|
|
|
|
|
sta IO.IIC.ENVBL
|
2019-10-22 14:28:54 +00:00
|
|
|
|
|
2022-03-13 12:52:24 +00:00
|
|
|
|
lda IO.IIC.CLRVBLIRQ
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
.1 bit IO.VBL Wait VBL high....
|
2020-11-19 15:34:02 +00:00
|
|
|
|
bpl .1
|
2019-10-22 14:28:54 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
bit IO.IIC.CLRVBLIRQ clear //c IRQ
|
|
|
|
|
|
2023-01-17 06:31:23 +00:00
|
|
|
|
.3 ldx A2osX.HZ
|
2023-04-23 15:20:27 +00:00
|
|
|
|
|
2020-11-23 22:05:27 +00:00
|
|
|
|
.4 pha (3)
|
2020-11-19 15:34:02 +00:00
|
|
|
|
pla (4)
|
|
|
|
|
pha (3)
|
|
|
|
|
pla (4)
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-01-17 06:31:23 +00:00
|
|
|
|
dex
|
2020-11-23 22:05:27 +00:00
|
|
|
|
bne .4
|
2021-03-11 21:40:55 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
iny
|
|
|
|
|
cpy #100
|
|
|
|
|
bne .5
|
2021-03-11 21:40:55 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
inc A2osX.CPUSPEED+1
|
|
|
|
|
ldy #0
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
.5 bit IO.VBL Wait VBL high....
|
2020-11-19 15:34:02 +00:00
|
|
|
|
bpl .3
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
bit IO.IIC.CLRVBLIRQ clear //c IRQ
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
pla Disable VBLIRQ ?
|
2022-03-13 12:52:24 +00:00
|
|
|
|
bpl .8
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2019-10-21 19:40:50 +00:00
|
|
|
|
sta IO.IIC.DISVBL
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
2022-03-13 12:52:24 +00:00
|
|
|
|
.8 pla
|
|
|
|
|
bpl CPU.InitOk
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.SETIOUDIS
|
2020-07-28 04:49:45 +00:00
|
|
|
|
*--------------------------------------
|
2020-11-19 15:34:02 +00:00
|
|
|
|
CPU.InitOk plp
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
sty A2osX.CPUSPEED
|
2019-10-22 14:28:54 +00:00
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHWI MSG.CPU.SPEEDOK
|
|
|
|
|
lda A2osX.CPUSPEED+1
|
2020-11-19 15:34:02 +00:00
|
|
|
|
>PUSHA push CPU speed HI
|
|
|
|
|
lda A2osX.CPUSPEED
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHA push CPU speed LO
|
2018-08-22 15:23:27 +00:00
|
|
|
|
>PUSHBI 2
|
2020-02-14 16:32:52 +00:00
|
|
|
|
>SYSCALL2 printf
|
2018-07-13 14:38:24 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-01-18 07:19:41 +00:00
|
|
|
|
CPU.Hz2L .DA #36,#29
|
|
|
|
|
*--------------------------------------
|
2020-02-14 07:21:56 +00:00
|
|
|
|
CPU.Init.Z80 >PUSHWI MSG.Z80
|
|
|
|
|
>PUSHBI 0
|
2020-02-14 16:32:52 +00:00
|
|
|
|
>SYSCALL2 printf
|
2017-08-22 06:38:16 +00:00
|
|
|
|
jsr DetectZ80
|
|
|
|
|
bcs .9
|
2023-10-18 05:41:12 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
sta A2osX.Z80SLOT
|
|
|
|
|
tax
|
2017-10-19 15:27:38 +00:00
|
|
|
|
lda #A2osX.S.Z80
|
2023-11-26 13:17:41 +00:00
|
|
|
|
sta A2osX.S-1,x
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHWI MSG.Z80.OK
|
|
|
|
|
lda A2osX.Z80SLOT
|
|
|
|
|
>PUSHA
|
2018-08-22 15:23:27 +00:00
|
|
|
|
>PUSHBI 1
|
2020-02-14 16:32:52 +00:00
|
|
|
|
>SYSCALL2 printf
|
2017-08-22 06:38:16 +00:00
|
|
|
|
rts
|
2020-09-24 15:31:48 +00:00
|
|
|
|
|
2018-07-12 15:20:39 +00:00
|
|
|
|
.9 >LDYAI MSG.Z80.KO
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 puts
|
2017-08-22 06:38:16 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Out:
|
|
|
|
|
* A = $60, 6502
|
|
|
|
|
* A = $61, 65C02
|
|
|
|
|
* A = $62, 65R02
|
|
|
|
|
* A = $63, 65816
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Detect6502 ldy #0 Test 6502 BCD bug
|
|
|
|
|
sed
|
|
|
|
|
lda #$99
|
|
|
|
|
clc
|
|
|
|
|
adc #$01
|
|
|
|
|
cld
|
|
|
|
|
bmi .9 BUG!, we have 6502
|
|
|
|
|
|
|
|
|
|
ldy #3 test 65C816 TYX Instruction
|
|
|
|
|
ldx #0
|
|
|
|
|
.OP 65816
|
|
|
|
|
tyx TYX: if 65C816, x becomes non-zero
|
|
|
|
|
.OP 65C02
|
|
|
|
|
bne .9 worked! 65C816
|
|
|
|
|
|
|
|
|
|
dey y=2 -> R65C02
|
|
|
|
|
ldx $EA save zp $EA
|
|
|
|
|
stz $EA store 0 in $EA
|
|
|
|
|
* .OP 65R02
|
|
|
|
|
.HS F7EA For compatibility with A2osX.ASM
|
|
|
|
|
* smb 7,$EA if not Rockwell, assemble as nop nop
|
|
|
|
|
* .OP 65C02
|
|
|
|
|
asl $EA cs if Rockwell
|
|
|
|
|
stx $EA restore zp $EA
|
|
|
|
|
bcs .9
|
|
|
|
|
dey y=1 -> 65C02
|
|
|
|
|
.9 tya
|
|
|
|
|
ora #$60
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Out:
|
|
|
|
|
* A = Z80 Slot
|
|
|
|
|
*--------------------------------------
|
2023-07-12 17:07:55 +00:00
|
|
|
|
DetectZ80 ldx #Z80.300.L
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2023-07-12 17:07:55 +00:00
|
|
|
|
.1 lda Z80.300-1,x
|
|
|
|
|
sta $300-1,x 0F300H for Z80
|
2017-08-22 06:38:16 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .1
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2023-07-12 17:07:55 +00:00
|
|
|
|
ldx #Z80.1000.L
|
|
|
|
|
|
2023-07-14 10:24:49 +00:00
|
|
|
|
.2 lda $1000-1,x
|
|
|
|
|
sta Z80.SAVE-1,x
|
|
|
|
|
lda Z80.1000-1,x
|
2023-07-12 17:07:55 +00:00
|
|
|
|
sta $1000-1,x 00000H for Z80
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
stz ZPPtr1
|
|
|
|
|
lda #$C1
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
sta ZPPtr1+1
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2023-07-12 17:07:55 +00:00
|
|
|
|
.3 sta (ZPPtr1) to Z80.....
|
|
|
|
|
lda $100B .....back
|
2017-08-22 06:38:16 +00:00
|
|
|
|
bmi .8
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
lda ZPPtr1+1
|
|
|
|
|
cmp #$C8
|
|
|
|
|
beq .9 CS
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #$20
|
2023-07-12 17:07:55 +00:00
|
|
|
|
sta $302
|
|
|
|
|
bra .3
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.8 lda ZPPtr1+1
|
|
|
|
|
and #$0F
|
|
|
|
|
clc
|
2023-07-12 17:07:55 +00:00
|
|
|
|
|
2023-07-14 10:24:49 +00:00
|
|
|
|
.9 php
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
ldx #Z80.1000.L
|
2023-07-12 17:07:55 +00:00
|
|
|
|
|
2023-07-14 10:24:49 +00:00
|
|
|
|
.90 lda Z80.SAVE-1,x
|
|
|
|
|
sta $1000-1,x
|
|
|
|
|
dex
|
|
|
|
|
bne .90
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
plp
|
|
|
|
|
rts
|
2023-07-12 17:07:55 +00:00
|
|
|
|
*--------------------------------------
|
2019-07-23 06:13:03 +00:00
|
|
|
|
DevMgrInit >LDYAI MSG.DEV
|
2023-10-18 05:41:12 +00:00
|
|
|
|
>SYSCALL2 PutS
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2023-01-18 07:19:41 +00:00
|
|
|
|
jsr DevMgr.VXD
|
2021-02-20 10:18:02 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
lda GP.DEVCNT
|
2019-07-23 06:13:03 +00:00
|
|
|
|
sta .1+1
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2019-07-23 06:13:03 +00:00
|
|
|
|
.1 ldx #$ff SELF MODIFIED
|
2023-11-04 14:42:28 +00:00
|
|
|
|
lda GP.DEVLST,x
|
2019-07-23 06:13:03 +00:00
|
|
|
|
and #$F0
|
|
|
|
|
asl
|
|
|
|
|
php Save Drive 1/2 in C
|
|
|
|
|
ror DSSS0000
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
|
|
|
|
|
tax 000DSSS0
|
|
|
|
|
lsr 0000DSSS
|
|
|
|
|
and #$7
|
|
|
|
|
sta FD.BDEV+S.FD.DEV.BUSID
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2019-07-23 06:13:03 +00:00
|
|
|
|
ora #$30
|
|
|
|
|
sta FD.BDEV.NAME+1 SnDy
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
lda GP.DEVPTRS,x
|
2019-07-23 06:13:03 +00:00
|
|
|
|
sta FD.BDEV+S.FD.DEV.BUSPTR
|
2023-11-04 14:42:28 +00:00
|
|
|
|
lda GP.DEVPTRS+1,x
|
2019-07-23 06:13:03 +00:00
|
|
|
|
sta FD.BDEV+S.FD.DEV.BUSPTR+1
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2020-07-28 15:16:14 +00:00
|
|
|
|
sta ZPPtr1+1
|
2019-07-23 06:13:03 +00:00
|
|
|
|
stz ZPPtr1 Cn00
|
2020-12-15 13:23:22 +00:00
|
|
|
|
|
2019-07-23 06:13:03 +00:00
|
|
|
|
plp
|
|
|
|
|
lda #0
|
|
|
|
|
adc #1 Make DevID 1 or 2
|
|
|
|
|
sta FD.BDEV+S.FD.DEV.DEVID
|
|
|
|
|
ora #$30
|
|
|
|
|
sta FD.BDEV.NAME+3 SxDn
|
|
|
|
|
lda ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
cmp #$FF /RAM is always $FF00
|
|
|
|
|
bne .2
|
|
|
|
|
|
2023-04-23 15:20:27 +00:00
|
|
|
|
ldx #2
|
|
|
|
|
jsr DevMgr.AddBDev
|
2019-07-23 06:13:03 +00:00
|
|
|
|
bra .8 keep slot free
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2019-07-23 06:13:03 +00:00
|
|
|
|
.2 cmp #$D0 Disk II Driver is $D000
|
|
|
|
|
bne .3
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2023-04-23 15:20:27 +00:00
|
|
|
|
lda #280
|
|
|
|
|
sta FD.BDEV+S.FD.DEV.SIZE
|
|
|
|
|
lda /280
|
|
|
|
|
sta FD.BDEV+S.FD.DEV.SIZE+1
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
jsr DevMgr.AddBDev
|
|
|
|
|
lda #A2osX.S.D2
|
2019-07-23 06:13:03 +00:00
|
|
|
|
bra .7 Go mark slot as USED
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2023-04-22 18:58:37 +00:00
|
|
|
|
.3 bcs .53 > $D0, Some SP remapped DRV
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2019-07-23 06:13:03 +00:00
|
|
|
|
cmp #$C0
|
2020-07-28 15:16:14 +00:00
|
|
|
|
bcs .4 $C0 .. $CF, in slot ROM
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2023-04-23 15:20:27 +00:00
|
|
|
|
ldx #4
|
|
|
|
|
jsr DevMgr.AddBDev Outside ROM/LC space, User loaded BLK dev
|
2019-07-23 06:13:03 +00:00
|
|
|
|
bra .8 keep slot free
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2023-04-23 15:20:27 +00:00
|
|
|
|
.4 ldx #BDEV.SIG-BDEV.OFS-1
|
2019-07-23 06:13:03 +00:00
|
|
|
|
|
2023-04-23 15:20:27 +00:00
|
|
|
|
.5 ldy BDEV.OFS,x Check if there is a smartport firmware
|
2019-07-23 06:13:03 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2023-04-23 15:20:27 +00:00
|
|
|
|
cmp BDEV.SIG,x
|
2020-01-28 16:42:51 +00:00
|
|
|
|
bne .8 not a Disk Controller...
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2019-07-23 06:13:03 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .5
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2019-07-23 06:13:03 +00:00
|
|
|
|
ldy #7
|
|
|
|
|
lda (ZPPtr1),y
|
2020-01-28 16:42:51 +00:00
|
|
|
|
bne .6 $Cn07=00 : SmartPort
|
2019-07-23 06:13:03 +00:00
|
|
|
|
|
2023-04-23 15:20:27 +00:00
|
|
|
|
ldy #$ff
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
clc
|
|
|
|
|
adc #3 Compute smartport entry point
|
|
|
|
|
sta FD.BDEV+S.FD.DEV.BUSPTR
|
|
|
|
|
|
|
|
|
|
ldx #10
|
|
|
|
|
jsr DevMgr.AddBDev
|
2019-07-23 06:13:03 +00:00
|
|
|
|
lda #A2osX.S.SP
|
|
|
|
|
bra .7
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-04-23 15:20:27 +00:00
|
|
|
|
.53 ldx #12
|
|
|
|
|
jsr DevMgr.AddBDev Remapped SP devices....
|
|
|
|
|
bra .8 don't mark slot as busy
|
|
|
|
|
|
|
|
|
|
.6 ldy #$FC Size in Blk
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sta FD.BDEV+S.FD.DEV.SIZE
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sta FD.BDEV+S.FD.DEV.SIZE+1
|
|
|
|
|
|
|
|
|
|
lda FD.BDEV+S.FD.DEV.BUSID 00000SSS
|
|
|
|
|
eor FD.BDEV+S.FD.DEV.BUSPTR+1 Cn
|
|
|
|
|
cmp #$C0
|
|
|
|
|
beq .70
|
|
|
|
|
|
|
|
|
|
ldx #8
|
|
|
|
|
jsr DevMgr.AddBDev Remapped BLK devices....
|
2020-01-28 16:42:51 +00:00
|
|
|
|
bra .8 don't mark slot as busy
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-04-23 15:20:27 +00:00
|
|
|
|
.70 ldx #6
|
|
|
|
|
jsr DevMgr.AddBDev
|
2019-07-23 06:13:03 +00:00
|
|
|
|
lda #A2osX.S.BLK
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2019-07-23 06:13:03 +00:00
|
|
|
|
.7 ldx FD.BDEV+S.FD.DEV.BUSID
|
2023-11-26 13:17:41 +00:00
|
|
|
|
sta A2osX.S-1,x
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2019-07-23 06:13:03 +00:00
|
|
|
|
.8 dec .1+1
|
|
|
|
|
bmi .80
|
2019-10-17 13:30:09 +00:00
|
|
|
|
|
2019-07-23 06:13:03 +00:00
|
|
|
|
jmp .1
|
2023-04-22 18:58:37 +00:00
|
|
|
|
|
2019-07-23 06:13:03 +00:00
|
|
|
|
.80 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-04-23 15:20:27 +00:00
|
|
|
|
DevMgr.AddBDev stx FD.BDEV+S.FD.DEV.TYPE
|
2020-01-28 16:42:51 +00:00
|
|
|
|
|
2023-04-23 15:20:27 +00:00
|
|
|
|
lda DRV.BDEVs,x
|
|
|
|
|
sta FD.BDEV+S.FD.DEV.DRVPTR
|
|
|
|
|
lda DRV.BDEVs+1,x
|
|
|
|
|
sta FD.BDEV+S.FD.DEV.DRVPTR+1
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-04-23 15:20:27 +00:00
|
|
|
|
>PUSHWI MSG.BDEV
|
2019-07-23 06:13:03 +00:00
|
|
|
|
>PUSHWI FD.BDEV.NAME
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHW FD.BDEV+S.FD.DEV.BUSPTR
|
2023-04-23 15:20:27 +00:00
|
|
|
|
>PUSHW MSG.BDEVs,x
|
2020-01-28 16:42:51 +00:00
|
|
|
|
>PUSHBI 6
|
2020-02-14 16:32:52 +00:00
|
|
|
|
>SYSCALL2 printf
|
2020-01-28 16:42:51 +00:00
|
|
|
|
|
2020-02-16 20:45:16 +00:00
|
|
|
|
>PUSHWI FD.BDEV
|
2019-07-23 06:13:03 +00:00
|
|
|
|
>PUSHWI FD.BDEV.NAME
|
|
|
|
|
>SYSCALL2 MKDev
|
2020-09-24 15:31:48 +00:00
|
|
|
|
|
2019-07-23 06:13:03 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-01-18 07:19:41 +00:00
|
|
|
|
DevMgr.VXD >LDYAI VSD.PATCH
|
2021-02-20 10:18:02 +00:00
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
jsr .10
|
|
|
|
|
bcc .8
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
>LDYAI VED.PATCH
|
|
|
|
|
jsr .10
|
|
|
|
|
bcs .9
|
2021-03-11 21:40:55 +00:00
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
.8 ldy #4
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sec
|
|
|
|
|
sbc #1
|
|
|
|
|
sta .81+1
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sbc #0
|
|
|
|
|
sta .81+2
|
2021-03-11 21:40:55 +00:00
|
|
|
|
|
2021-02-20 10:18:02 +00:00
|
|
|
|
php
|
|
|
|
|
sei
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
bit IO.RRAMWRAMBNK2
|
|
|
|
|
bit IO.RRAMWRAMBNK2
|
|
|
|
|
sta IO.CLRALTZP
|
2022-09-17 11:35:52 +00:00
|
|
|
|
.81 ldx $FFFF SELF MODIFIED : Slot0n
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.SETALTZP
|
|
|
|
|
bit IO.RRAMWRAMBNK1
|
|
|
|
|
bit IO.RRAMWRAMBNK1
|
2021-02-20 10:18:02 +00:00
|
|
|
|
|
2023-04-23 15:20:27 +00:00
|
|
|
|
lda #A2osX.S.VXD
|
2023-11-26 13:17:41 +00:00
|
|
|
|
sta A2osX.S-1,x
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2021-02-20 10:18:02 +00:00
|
|
|
|
plp
|
2021-03-11 21:40:55 +00:00
|
|
|
|
|
|
|
|
|
.9 rts
|
2021-02-20 10:18:02 +00:00
|
|
|
|
*--------------------------------------
|
2022-09-17 11:35:52 +00:00
|
|
|
|
.10 >STYA ZPPtr1
|
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
ldy #9 10 bytes
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
|
|
|
|
.11 lda $BF41,y
|
|
|
|
|
cmp (ZPPtr1),y
|
|
|
|
|
bne .19
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
bpl .11
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
.19 sec
|
2023-01-11 18:34:34 +00:00
|
|
|
|
rts
|
2022-09-17 11:35:52 +00:00
|
|
|
|
*--------------------------------------
|
2023-11-04 14:42:28 +00:00
|
|
|
|
VSD.PATCH bit IO.RRAMWRAMBNK2
|
2021-03-11 21:40:55 +00:00
|
|
|
|
jsr $D002
|
2023-11-04 14:42:28 +00:00
|
|
|
|
bit IO.RRAMWRAMBNK1
|
2021-02-20 10:18:02 +00:00
|
|
|
|
rts
|
2022-09-17 11:35:52 +00:00
|
|
|
|
*--------------------------------------
|
2023-11-04 14:42:28 +00:00
|
|
|
|
VED.PATCH bit IO.RRAMWRAMBNK2
|
2022-09-17 11:35:52 +00:00
|
|
|
|
jsr $D401
|
2023-11-04 14:42:28 +00:00
|
|
|
|
bit IO.RRAMWRAMBNK1
|
2022-09-17 11:35:52 +00:00
|
|
|
|
rts
|
2021-02-20 10:18:02 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-22 06:38:16 +00:00
|
|
|
|
* Setup AuxLC $FFFE->Kernel IRQ Handler
|
|
|
|
|
* if irq not handled, jmp (S.IrqMgrOldFFFE)
|
|
|
|
|
*--------------------------------------
|
2017-08-31 15:35:15 +00:00
|
|
|
|
IrqMgrInit >LDYAI MSG.IRQ
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 puts
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
php
|
|
|
|
|
sei
|
|
|
|
|
>LDYA $FFFE
|
2020-09-24 15:31:48 +00:00
|
|
|
|
>STYA IRQ.JMP+1
|
|
|
|
|
>LDYAI IRQ.Handler
|
2018-04-10 15:03:29 +00:00
|
|
|
|
>STYA $FFFE
|
|
|
|
|
|
2020-09-24 15:31:48 +00:00
|
|
|
|
>LDYAI GP.IRQ
|
2018-04-10 15:03:29 +00:00
|
|
|
|
>STYA K.MLI.PARAMS+2
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
>MLICALL MLI.ALLOCIRQ
|
2019-10-22 07:52:34 +00:00
|
|
|
|
bcs .9
|
2023-01-06 22:07:00 +00:00
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
lda K.MLI.PARAMS+1
|
|
|
|
|
sta IRQ.INTNUM
|
2019-10-22 07:52:34 +00:00
|
|
|
|
*--------------------------------------
|
2023-11-12 13:20:15 +00:00
|
|
|
|
lda A2osX.HWT
|
|
|
|
|
cmp #A2osX.HWT.IIgs
|
2019-10-22 07:52:34 +00:00
|
|
|
|
bne .1
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
.OP 65816
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
clc
|
|
|
|
|
xce go to native mode
|
|
|
|
|
rep #$30 long M,X
|
|
|
|
|
|
|
|
|
|
pea $000C Vertical blanking interrupt handler
|
|
|
|
|
pea $0000
|
|
|
|
|
pea $0000
|
|
|
|
|
>TKCALL GetVector
|
2023-04-23 15:20:27 +00:00
|
|
|
|
* bcs *
|
2023-01-11 18:34:34 +00:00
|
|
|
|
pla
|
|
|
|
|
sta IRQ.GSVect+2
|
2023-04-23 15:20:27 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
pla
|
|
|
|
|
sta IRQ.GSVect
|
2023-04-23 15:20:27 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
pea $000C Vertical blanking interrupt handler
|
|
|
|
|
pea $0000
|
|
|
|
|
pea CORE.IRQGS
|
|
|
|
|
>TKCALL SetVector
|
2023-04-23 15:20:27 +00:00
|
|
|
|
* bcs *
|
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
pea $0002 Enable vertical blanking interrupts
|
|
|
|
|
>TKCALL IntSource
|
2023-04-23 15:20:27 +00:00
|
|
|
|
* bcs *
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
|
|
|
|
sep #$30 short M,X
|
|
|
|
|
sec
|
|
|
|
|
xce back to emulation mode
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
.OP 65C02
|
|
|
|
|
|
|
|
|
|
jsr IrqMgr.HZ2Tick
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>LDYAI CORE.IRQGS
|
|
|
|
|
jsr IrqMgr.SetV
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>LDYAI CORE.IRQGSOff
|
2021-04-10 17:17:40 +00:00
|
|
|
|
>STYA CORE.Quit+3
|
2020-09-24 15:31:48 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>LDYAI MSG.IRQGS
|
|
|
|
|
ldx #"G"
|
2023-01-06 22:07:00 +00:00
|
|
|
|
sec
|
2023-01-11 18:34:34 +00:00
|
|
|
|
bra IrqMgrInit.8
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-09-24 15:31:48 +00:00
|
|
|
|
.9 plp
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2023-01-06 22:07:00 +00:00
|
|
|
|
*--------------------------------------
|
2023-11-12 13:20:15 +00:00
|
|
|
|
.1 cmp #A2osX.HWT.IIc
|
2019-10-22 07:52:34 +00:00
|
|
|
|
beq .2
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
jsr IrqMgr.TClk
|
2021-02-26 20:13:48 +00:00
|
|
|
|
bcs .3
|
2019-10-21 14:37:10 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>LDYAI CORE.IRQTK
|
|
|
|
|
jsr IrqMgr.SetV
|
2020-11-25 16:29:06 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>LDYAI CORE.IRQTKOff
|
2021-04-10 17:17:40 +00:00
|
|
|
|
>STYA CORE.Quit+3
|
2021-03-11 21:40:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>LDYAI MSG.IRQTK
|
|
|
|
|
ldx #"C"
|
2023-01-06 22:07:00 +00:00
|
|
|
|
sec
|
2023-01-11 18:34:34 +00:00
|
|
|
|
bra IrqMgrInit.8
|
2018-04-05 20:32:22 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
.2 sta IO.CLRPAGE2
|
2021-02-26 20:13:48 +00:00
|
|
|
|
lda #$60
|
2021-07-28 16:50:59 +00:00
|
|
|
|
sta $5fa //c EXTINT COM1:Dont buffer but get IRQ
|
|
|
|
|
sta $5fb //c EXTINT COM2:Dont buffer but get IRQ
|
2021-03-11 21:40:55 +00:00
|
|
|
|
|
2021-07-28 16:50:59 +00:00
|
|
|
|
stz $5FA //c TYPHED no keyboard buffering
|
|
|
|
|
|
|
|
|
|
stz $4FF //c ROM FF: no ACIABUF
|
|
|
|
|
stz $4FC //c ROM 0X: no ACIABUF
|
2021-02-26 20:13:48 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
.3 jsr IrqMgr.Mouse
|
2021-02-26 20:13:48 +00:00
|
|
|
|
bcs .7
|
2019-10-21 14:37:10 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>LDYAI CORE.IRQM
|
|
|
|
|
jsr IrqMgr.SetV
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>LDYAI CORE.IRQMOff
|
2021-04-10 17:17:40 +00:00
|
|
|
|
>STYA CORE.Quit+3
|
2020-09-24 15:31:48 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>LDYAI MSG.IRQM
|
|
|
|
|
ldx #"V"
|
2023-01-06 22:07:00 +00:00
|
|
|
|
sec
|
2023-01-11 18:34:34 +00:00
|
|
|
|
bra IrqMgrInit.8
|
2019-10-21 14:37:10 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
.7 jsr IrqMgr.HZ2Tick
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
ldx #"P"
|
|
|
|
|
>LDYAI MSG.IRQP
|
2023-01-06 22:07:00 +00:00
|
|
|
|
clc
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
IrqMgrInit.8 ror A2osX.IRQMode
|
|
|
|
|
stx IRQ.Mode
|
2023-01-06 22:07:00 +00:00
|
|
|
|
>SYSCALL2 puts
|
2020-11-23 22:05:27 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
plp
|
2017-10-11 15:37:41 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2019-10-22 07:52:34 +00:00
|
|
|
|
*--------------------------------------
|
2023-01-11 18:34:34 +00:00
|
|
|
|
IrqMgr.SetV >STYA IRQ.JSR+1
|
2020-09-24 15:31:48 +00:00
|
|
|
|
>STYA GP.IRQ.JSR+1
|
2019-10-03 06:25:27 +00:00
|
|
|
|
rts
|
2018-04-05 20:32:22 +00:00
|
|
|
|
*--------------------------------------
|
2023-01-11 18:34:34 +00:00
|
|
|
|
IrqMgr.TClk stz ZPPtr1 Try finding a TClock Card...
|
2018-04-05 20:32:22 +00:00
|
|
|
|
lda #$C1
|
|
|
|
|
sta ZPPtr1+1
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-04-13 17:04:02 +00:00
|
|
|
|
.1 ldx #TClock.SIG-TClock.OFS-1
|
2018-04-05 20:32:22 +00:00
|
|
|
|
|
2020-04-13 17:04:02 +00:00
|
|
|
|
.2 ldy TClock.OFS,x
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
cmp TClock.SIG,x
|
2018-04-05 20:32:22 +00:00
|
|
|
|
bne .3
|
2020-04-13 17:04:02 +00:00
|
|
|
|
|
2020-11-23 22:05:27 +00:00
|
|
|
|
dex
|
2018-04-05 20:32:22 +00:00
|
|
|
|
bpl .2
|
2020-04-13 17:04:02 +00:00
|
|
|
|
|
2018-04-05 20:32:22 +00:00
|
|
|
|
bra .4
|
2020-04-13 17:04:02 +00:00
|
|
|
|
|
2018-04-05 20:32:22 +00:00
|
|
|
|
.3 inc ZPPtr1+1 no match, try next slot....
|
|
|
|
|
lda ZPPtr1+1
|
|
|
|
|
cmp #$C8
|
2020-07-28 15:16:14 +00:00
|
|
|
|
bne .1
|
2020-11-23 22:05:27 +00:00
|
|
|
|
|
2020-11-25 16:29:06 +00:00
|
|
|
|
* sec
|
2018-04-05 20:32:22 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.4 lda ZPPtr1+1 get $Cn
|
|
|
|
|
and #$f
|
|
|
|
|
tax get $0n
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
tay get $n0
|
2020-09-25 12:05:23 +00:00
|
|
|
|
sty IRQ.n0
|
2018-12-01 19:39:44 +00:00
|
|
|
|
lda #A2osX.S.CLK
|
2023-11-26 13:17:41 +00:00
|
|
|
|
sta A2osX.S-1,x
|
2020-09-24 15:31:48 +00:00
|
|
|
|
|
2018-12-01 19:39:44 +00:00
|
|
|
|
lda #$40+$20 Enable interrupt + 64Hz
|
2018-04-05 20:32:22 +00:00
|
|
|
|
sta $c080,y
|
2020-09-24 15:31:48 +00:00
|
|
|
|
|
|
|
|
|
lda #$40
|
2018-04-05 20:32:22 +00:00
|
|
|
|
sta $478,x
|
|
|
|
|
sta $7f8,x
|
|
|
|
|
|
|
|
|
|
lda #64
|
|
|
|
|
sta CORE.TickPerSec
|
|
|
|
|
sta CORE.TickSec
|
2020-11-25 16:29:06 +00:00
|
|
|
|
|
2018-04-05 20:32:22 +00:00
|
|
|
|
lda #11
|
2017-10-11 15:37:41 +00:00
|
|
|
|
sta CORE.TickPer10t
|
|
|
|
|
sta CORE.Tick10t
|
2020-11-19 15:34:02 +00:00
|
|
|
|
dec A2osX.IRQMode
|
2020-11-23 22:05:27 +00:00
|
|
|
|
|
2018-04-05 20:32:22 +00:00
|
|
|
|
clc
|
2017-10-11 15:37:41 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-01-11 18:34:34 +00:00
|
|
|
|
IrqMgr.Mouse stz ZPPtr1 Try finding a Mouse Card...
|
2017-08-22 06:38:16 +00:00
|
|
|
|
lda #$C1
|
|
|
|
|
sta ZPPtr1+1
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.1 ldx #Mouse.SIG-Mouse.OFS-1
|
|
|
|
|
|
|
|
|
|
.2 ldy Mouse.OFS,x
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
cmp Mouse.SIG,x
|
|
|
|
|
bne .3
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
bra .4
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.3 inc ZPPtr1+1 no match, try next slot....
|
|
|
|
|
lda ZPPtr1+1
|
|
|
|
|
cmp #$C8
|
2020-07-28 15:16:14 +00:00
|
|
|
|
bne .1
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
* sec
|
2017-08-22 06:38:16 +00:00
|
|
|
|
rts
|
2021-05-15 14:35:24 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.4 lda ZPPtr1+1
|
|
|
|
|
|
2018-04-05 20:32:22 +00:00
|
|
|
|
sta .11+2
|
2023-01-11 18:34:34 +00:00
|
|
|
|
sta CORE.IRQMOff.1+2
|
|
|
|
|
sta CORE.IRQM+2
|
|
|
|
|
sta CORE.IRQM.2+2
|
2017-08-22 06:38:16 +00:00
|
|
|
|
and #$0f
|
2020-09-25 12:05:23 +00:00
|
|
|
|
sta IRQ.0n
|
2017-08-22 06:38:16 +00:00
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
|
2020-09-25 12:05:23 +00:00
|
|
|
|
sta IRQ.n0
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
bit IO.RROMBNK2 Renable ROM to allow MOUSE II firmware works properly
|
2018-04-05 20:32:22 +00:00
|
|
|
|
ldy #INITMOUSE
|
|
|
|
|
jsr .10
|
2020-09-24 15:31:48 +00:00
|
|
|
|
|
2018-04-05 20:32:22 +00:00
|
|
|
|
ldy #SETMOUSE
|
2020-09-24 15:31:48 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2023-01-11 18:34:34 +00:00
|
|
|
|
sta CORE.IRQMOff.1+1
|
2018-04-05 20:32:22 +00:00
|
|
|
|
lda #MOUSEMODx.INTVBL+MOUSEMODx.ACTIVE
|
|
|
|
|
jsr .10
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
bit IO.RRAMWRAMBNK1 Back To LC Ram
|
|
|
|
|
bit IO.RRAMWRAMBNK1
|
2018-04-05 20:32:22 +00:00
|
|
|
|
ldy #SERVEMOUSE
|
|
|
|
|
lda (ZPPtr1),y
|
2023-01-11 18:34:34 +00:00
|
|
|
|
sta CORE.IRQM+1
|
2018-04-05 20:32:22 +00:00
|
|
|
|
|
|
|
|
|
ldy #READMOUSE
|
|
|
|
|
lda (ZPPtr1),y
|
2023-01-11 18:34:34 +00:00
|
|
|
|
sta CORE.IRQM.2+1
|
2018-04-05 20:32:22 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
jsr IrqMgr.HZ2Tick
|
2020-11-19 15:34:02 +00:00
|
|
|
|
dec A2osX.IRQMode
|
2020-09-24 15:31:48 +00:00
|
|
|
|
|
2019-10-03 06:25:27 +00:00
|
|
|
|
clc
|
2017-10-11 15:37:41 +00:00
|
|
|
|
rts
|
2020-09-24 15:31:48 +00:00
|
|
|
|
|
2018-04-05 20:32:22 +00:00
|
|
|
|
.10 pha
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sta .11+1
|
|
|
|
|
pla
|
|
|
|
|
ldx .11+2 Cn
|
2020-09-25 12:05:23 +00:00
|
|
|
|
ldy IRQ.n0
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
2018-04-05 20:32:22 +00:00
|
|
|
|
.11 jmp $ffff SELF MODIFIED
|
|
|
|
|
*--------------------------------------
|
2023-01-11 18:34:34 +00:00
|
|
|
|
IrqMgr.HZ2Tick lda A2osX.HZ
|
2017-10-11 15:37:41 +00:00
|
|
|
|
sta CORE.TickPer10t
|
|
|
|
|
sta CORE.Tick10t
|
2019-10-22 07:52:34 +00:00
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
clc
|
|
|
|
|
adc A2osX.HZ
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2019-10-22 07:52:34 +00:00
|
|
|
|
asl
|
|
|
|
|
|
|
|
|
|
sta CORE.TickPerSec
|
|
|
|
|
sta CORE.TickSec
|
2018-04-05 20:32:22 +00:00
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-08-31 15:35:15 +00:00
|
|
|
|
EvtMgrInit >LDYAI MSG.EVT
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 puts
|
2020-04-13 17:04:02 +00:00
|
|
|
|
|
2019-01-24 13:53:29 +00:00
|
|
|
|
stz CORE.EvtCount
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2023-07-12 17:07:55 +00:00
|
|
|
|
lda /K.S.EVT
|
2017-08-22 06:38:16 +00:00
|
|
|
|
sta pEvent+1
|
|
|
|
|
clc
|
2021-05-04 17:31:21 +00:00
|
|
|
|
rts
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-31 15:35:15 +00:00
|
|
|
|
TskMgrInit >LDYAI MSG.TSK
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 puts
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI K.ENV.SIZE get a buffer for ENV
|
2020-02-17 16:55:02 +00:00
|
|
|
|
>SYSCALL NewStkObj Buffer in AUX mem
|
2023-11-12 13:20:15 +00:00
|
|
|
|
|
2021-05-04 17:31:21 +00:00
|
|
|
|
bcs .99
|
2020-02-17 16:55:02 +00:00
|
|
|
|
|
2019-01-22 16:35:42 +00:00
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
txa
|
2020-01-14 07:40:01 +00:00
|
|
|
|
|
2020-02-03 16:31:18 +00:00
|
|
|
|
ldy #S.PS.hENV
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.SETWRITEAUX
|
2019-01-22 16:35:42 +00:00
|
|
|
|
lda #0
|
|
|
|
|
sta (ZPPtr1) make sure blank!!
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta IO.CLRWRITEAUX
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2021-07-24 20:42:23 +00:00
|
|
|
|
>PUSHWZ
|
|
|
|
|
>PUSHWZ
|
2020-03-13 16:10:36 +00:00
|
|
|
|
>SYSCALL OpenSession
|
|
|
|
|
bcs .99
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2023-10-18 05:41:12 +00:00
|
|
|
|
sta USRs.hSID
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-03-13 16:10:36 +00:00
|
|
|
|
ldy #S.PS.hStdIn
|
|
|
|
|
lda (pPS),y
|
2023-10-18 05:41:12 +00:00
|
|
|
|
sta USRs.hFile
|
2020-03-13 16:10:36 +00:00
|
|
|
|
|
|
|
|
|
lda #1
|
|
|
|
|
ldy #S.PS.hSession
|
|
|
|
|
sta (pPS),y
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2019-04-30 16:08:47 +00:00
|
|
|
|
>LDYAI $2E0 Get ROOT from QC
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 strdup
|
2021-05-04 17:31:21 +00:00
|
|
|
|
.99 bcs .9
|
2020-01-17 16:12:24 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
txa
|
2019-07-22 16:28:44 +00:00
|
|
|
|
ldy #S.PS.hCWD
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2020-01-17 16:12:24 +00:00
|
|
|
|
|
2020-01-17 07:31:00 +00:00
|
|
|
|
>PUSHWI I.ENV.BOOT
|
2019-04-30 16:08:47 +00:00
|
|
|
|
>PUSHWI $2C0 Get BOOT from QC
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 SetEnv
|
2021-05-04 17:31:21 +00:00
|
|
|
|
bcs .9
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2020-01-17 07:31:00 +00:00
|
|
|
|
>PUSHWI I.ENV.ROOT
|
2019-04-30 16:08:47 +00:00
|
|
|
|
>PUSHWI $2E0 Get ROOT from QC
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 SetEnv
|
2017-08-22 06:38:16 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2020-01-17 11:23:11 +00:00
|
|
|
|
>PUSHWI I.ENV.PATH
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 PutEnv
|
2017-08-22 06:38:16 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2020-01-17 11:23:11 +00:00
|
|
|
|
>PUSHWI I.ENV.LIB
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 PutEnv
|
2017-08-22 06:38:16 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2020-01-17 11:23:11 +00:00
|
|
|
|
>PUSHWI I.ENV.DRV
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 PutEnv
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2019-04-09 15:47:33 +00:00
|
|
|
|
PwdMgrInit >LDYAI MSG.PWD
|
2019-06-10 13:52:20 +00:00
|
|
|
|
>SYSCALL2 puts
|
2020-02-14 07:21:56 +00:00
|
|
|
|
|
2020-03-12 16:44:11 +00:00
|
|
|
|
>LDYAI PWD.ETCPASSWD
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr .1
|
|
|
|
|
bcs .9
|
2020-03-12 16:44:11 +00:00
|
|
|
|
|
|
|
|
|
stx PWD.hUsrDB
|
|
|
|
|
>STYA PWD.UsrDBSize
|
2020-07-28 15:16:14 +00:00
|
|
|
|
|
2020-03-12 16:44:11 +00:00
|
|
|
|
>LDYAI PWD.ETCGROUP
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr .1
|
|
|
|
|
bcs .9
|
2020-03-12 16:44:11 +00:00
|
|
|
|
|
|
|
|
|
stx PWD.hGrpDB
|
|
|
|
|
>STYA PWD.GrpDBSize
|
|
|
|
|
|
2020-07-28 15:16:14 +00:00
|
|
|
|
* clc
|
2020-03-12 16:44:11 +00:00
|
|
|
|
.9 rts
|
2022-10-07 19:21:37 +00:00
|
|
|
|
|
|
|
|
|
.1 >PUSHYA
|
|
|
|
|
>PUSHBI O.RDONLY
|
|
|
|
|
>PUSHBI S.FI.T.TXT
|
|
|
|
|
>PUSHWZ Auxtype=0000
|
|
|
|
|
>SYSCALL2 LoadStkObj
|
|
|
|
|
rts
|
2020-03-12 16:44:11 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-11 15:13:29 +00:00
|
|
|
|
* Modified CHARGET/CHARGOT for ROM CALL
|
|
|
|
|
* CHRGET .EQ $B1 - C8
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Kernel.ZP .PH $B1
|
|
|
|
|
CHARGET inc TXTPTR
|
|
|
|
|
bne CHARGOT
|
|
|
|
|
inc TXTPTR+1
|
|
|
|
|
CHARGOT lda $ffff
|
2019-07-28 20:39:30 +00:00
|
|
|
|
beq ZP.IsDigit.9
|
|
|
|
|
ZP.IsDigit cmp #'0'
|
|
|
|
|
bcc ZP.IsDigit.9
|
2018-07-11 15:13:29 +00:00
|
|
|
|
cmp #'9'+1
|
|
|
|
|
rts
|
2019-07-28 20:39:30 +00:00
|
|
|
|
ZP.IsDigit.9 sec
|
2019-10-03 06:25:27 +00:00
|
|
|
|
rts
|
2018-07-11 15:13:29 +00:00
|
|
|
|
.EP
|
2019-10-03 06:25:27 +00:00
|
|
|
|
Kernel.ZP.S .EQ *-Kernel.ZP
|
2018-07-11 15:13:29 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
Mouse.OFS .HS 05070B0CFB
|
|
|
|
|
Mouse.SIG .HS 38180120D6
|
2020-07-28 15:16:14 +00:00
|
|
|
|
*--------------------------------------
|
2020-11-23 22:05:27 +00:00
|
|
|
|
TClock.OFS .HS 00020406
|
2020-04-13 17:04:02 +00:00
|
|
|
|
TClock.SIG .HS 08285870
|
2018-07-11 15:13:29 +00:00
|
|
|
|
*--------------------------------------
|
2023-04-23 15:20:27 +00:00
|
|
|
|
BDEV.OFS .HS 010305
|
|
|
|
|
BDEV.SIG .HS 200003
|
2020-07-28 15:16:14 +00:00
|
|
|
|
*--------------------------------------
|
2022-09-17 11:35:52 +00:00
|
|
|
|
MSG.Init2 .CZ "A2osX[Stage2]:Init\rRelocating Kernel...\r"
|
|
|
|
|
MSG.KCREAD .CZ "Reading Kernel Config File..."
|
|
|
|
|
MSG.KCREAD.OK .CZ "OK\r"
|
|
|
|
|
MSG.KCREAD.KO .CZ "\rError While Reading Kernel Config File, Using Default.\r"
|
|
|
|
|
MSG.HZ .CZ "Kernel SYS Timer Set For %d0 hz Machine.\r"
|
2023-04-22 18:58:37 +00:00
|
|
|
|
MSG.FX .CZ "!!!Running under ProDOS.FX!!! Enabling lowercase mode.\r"
|
2022-09-17 11:35:52 +00:00
|
|
|
|
MSG.Init2.OK .CZ "A2osX[Stage2]:Complete."
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
2023-10-18 05:41:12 +00:00
|
|
|
|
MSG.Init3 .CZ "A2osX[Stage3]:Init *** Press Ctrl-R for entering ROOT Mode ***"
|
2018-08-22 15:23:27 +00:00
|
|
|
|
MSG.DEV .AZ "Device Manager..."
|
2023-04-23 15:20:27 +00:00
|
|
|
|
MSG.BDEV .CZ " Adding Device: /dev/%s, Addr:%H, Type: %s\r\n"
|
|
|
|
|
MSG.BDEVs .DA MSG.BDEV.D2
|
|
|
|
|
.DA MSG.BDEV.RAM
|
|
|
|
|
.DA MSG.BDEV.USR
|
|
|
|
|
.DA MSG.BDEV.BLK
|
|
|
|
|
.DA MSG.BDEV.RBLK
|
|
|
|
|
.DA MSG.BDEV.SP
|
|
|
|
|
.DA MSG.BDEV.RSP
|
|
|
|
|
MSG.BDEV.D2 .AZ "Disk ]["
|
|
|
|
|
MSG.BDEV.RAM .AZ "/RAM Disk"
|
|
|
|
|
MSG.BDEV.USR .AZ "User Block"
|
|
|
|
|
MSG.BDEV.BLK .AZ "Generic Block"
|
|
|
|
|
MSG.BDEV.RBLK .AZ "Generic Block (Remapped)"
|
|
|
|
|
MSG.BDEV.SP .AZ "SmartPort"
|
|
|
|
|
MSG.BDEV.RSP .AZ "SmartPort (Remapped)"
|
|
|
|
|
DRV.BDEVs .DA DRV.BLK D2
|
|
|
|
|
.DA DRV.BLK RAM
|
|
|
|
|
.DA DRV.BLK USR
|
|
|
|
|
.DA DRV.BLK
|
|
|
|
|
.DA DRV.BLK RBLK
|
2023-04-22 18:58:37 +00:00
|
|
|
|
.DA DRV.SP
|
2023-04-23 15:20:27 +00:00
|
|
|
|
.DA DRV.BLK RSP
|
2020-01-28 16:42:51 +00:00
|
|
|
|
*--------------------------------------
|
2018-08-22 15:23:27 +00:00
|
|
|
|
MSG.IRQ .AZ "Interrupt Manager..."
|
2023-01-11 18:34:34 +00:00
|
|
|
|
MSG.IRQGS .AZ " Apple IIgs VBL IRQ Activated."
|
|
|
|
|
MSG.IRQM .AZ " Mouse Card VBL IRQ Activated."
|
|
|
|
|
MSG.IRQTK .AZ " Clock Card IRQ Activated."
|
|
|
|
|
MSG.IRQP .AZ " Polling Mode."
|
2018-08-22 15:23:27 +00:00
|
|
|
|
MSG.EVT .AZ "Event Manager..."
|
|
|
|
|
MSG.TSK .AZ "Task Manager..."
|
2019-04-09 15:47:33 +00:00
|
|
|
|
MSG.PWD .AZ "Password Manager..."
|
2020-02-27 16:46:40 +00:00
|
|
|
|
MSG.EXEC .AZ "Executing %s..."
|
2022-09-17 11:35:52 +00:00
|
|
|
|
MSG.StartupErr .CZ "Failed : [$%h]\r\n"
|
2023-10-18 05:41:12 +00:00
|
|
|
|
MSG.Init3.OK .CZ "OK\r\nA2osX[Stage3]:Complete."
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
2019-10-21 14:25:37 +00:00
|
|
|
|
MSG.HW .AZ "Checking Hardware..."
|
2022-09-17 11:35:52 +00:00
|
|
|
|
MSG.HW.TypeSubT .CZ "Type=%h,SubT=%h\r\n"
|
2018-04-10 15:03:29 +00:00
|
|
|
|
MSG.CPU .AZ "Checking CPU..."
|
2018-07-13 14:38:24 +00:00
|
|
|
|
MSG.CPUTYPE .DA MSG.6502
|
|
|
|
|
.DA MSG.65C02
|
|
|
|
|
.DA MSG.65R02
|
|
|
|
|
.DA MSG.65816
|
2018-08-22 15:23:27 +00:00
|
|
|
|
MSG.6502 .AZ "6502."
|
|
|
|
|
MSG.65C02 .AZ "65C02."
|
|
|
|
|
MSG.65R02 .AZ "65R02."
|
|
|
|
|
MSG.65816 .AZ "65816."
|
2020-07-28 15:16:14 +00:00
|
|
|
|
MSG.CPU.SPEED .AZ "Checking CPU Speed (%d0Hz)..."
|
2022-09-17 11:35:52 +00:00
|
|
|
|
MSG.CPU.SPEEDOK .CZ "%d.%02d Mhz.\r\n"
|
2018-10-03 15:25:03 +00:00
|
|
|
|
MSG.Z80 .AZ "Checking Z80 CPU..."
|
2022-09-17 11:35:52 +00:00
|
|
|
|
MSG.Z80.OK .CZ "Detected In Slot %d.\r\n"
|
2018-08-22 15:23:27 +00:00
|
|
|
|
MSG.Z80.KO .AZ "Not Detected."
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
2019-11-26 06:46:02 +00:00
|
|
|
|
DEV.CONSOLE .AZ "/dev/console"
|
2019-04-30 16:08:47 +00:00
|
|
|
|
RAMx .AZ "/RAMx"
|
|
|
|
|
I.ENV.BOOT .AZ "BOOT"
|
2018-11-17 17:17:13 +00:00
|
|
|
|
I.ENV.ROOT .AZ "ROOT"
|
2019-12-05 15:09:38 +00:00
|
|
|
|
I.ENV.PATH .AZ "PATH=${BOOT}sbin/:${BOOT}bin/"
|
2019-12-03 15:42:17 +00:00
|
|
|
|
I.ENV.LIB .AZ "LIB=${BOOT}lib/"
|
2019-12-05 15:09:38 +00:00
|
|
|
|
I.ENV.DRV .AZ "DRV=${BOOT}drv/"
|
2023-11-20 20:22:55 +00:00
|
|
|
|
SBININITD .AZ "${ROOT}sbin/initd"
|
2020-08-07 19:49:24 +00:00
|
|
|
|
.DA #0 end of ARGV for ExecV
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
pMLIGFIEX .DA #2
|
|
|
|
|
.DA FNKConfig
|
2020-06-29 05:49:24 +00:00
|
|
|
|
.BS S.FIEX
|
2019-11-27 22:04:55 +00:00
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
pMLIOPEN .DA #3
|
|
|
|
|
.DA FNKConfig
|
2020-07-28 15:16:14 +00:00
|
|
|
|
.DA $B000
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.BS 1
|
2022-09-17 11:35:52 +00:00
|
|
|
|
FNKConfig .PS "A2osX.kconfig"
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
pMLIREAD .DA #4
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.BS 1
|
2018-10-08 05:55:28 +00:00
|
|
|
|
.DA A2osX.KCONFIG
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.DA 16
|
|
|
|
|
.BS 2
|
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
pMLICLOSE .DA #1
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.BS 1
|
|
|
|
|
*--------------------------------------
|
2018-07-11 15:13:29 +00:00
|
|
|
|
FD.NULL .DA #S.FD.T.CDEV
|
|
|
|
|
.DA #0 HANDLER
|
2023-10-18 05:41:12 +00:00
|
|
|
|
.DA #$F BUSID
|
|
|
|
|
.DA #$F DEVID
|
2018-07-12 15:20:39 +00:00
|
|
|
|
.DA 0 BUSPTR
|
2018-07-11 15:13:29 +00:00
|
|
|
|
.DA DRV.NULL
|
2018-12-13 16:39:24 +00:00
|
|
|
|
.DA 0 DCBPTR
|
2018-12-11 16:41:25 +00:00
|
|
|
|
.DA 0 BUFPTR
|
2023-04-23 15:20:27 +00:00
|
|
|
|
.BS 4
|
2021-07-24 20:42:23 +00:00
|
|
|
|
*--------------------------------------
|
2018-12-10 16:45:37 +00:00
|
|
|
|
FD.TTY .DA #S.FD.T.CDEV
|
|
|
|
|
.DA #0 HANDLER
|
2023-10-18 05:41:12 +00:00
|
|
|
|
.DA #$F BUSID
|
2021-07-24 20:42:23 +00:00
|
|
|
|
.DA #0 DEVID
|
2018-12-11 16:41:25 +00:00
|
|
|
|
.DA 0 BUSPTR
|
2018-12-13 16:39:24 +00:00
|
|
|
|
.DA DRV.TERM
|
|
|
|
|
.BS 2 DCBPTR
|
2018-12-17 14:24:39 +00:00
|
|
|
|
.BS 2 BUFPTR
|
2023-04-23 15:20:27 +00:00
|
|
|
|
.BS 4
|
2018-12-13 16:39:24 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-11 15:13:29 +00:00
|
|
|
|
FD.BDEV .DA #S.FD.T.BDEV
|
|
|
|
|
.DA #0 HANDLER
|
2023-10-18 05:41:12 +00:00
|
|
|
|
.DA #$F BUSID
|
2018-07-11 15:13:29 +00:00
|
|
|
|
.DA #0 DEVID
|
2018-07-12 15:20:39 +00:00
|
|
|
|
.BS 2 BUSPTR
|
2018-07-11 15:13:29 +00:00
|
|
|
|
.BS 2 DRVPTR
|
2018-12-13 16:39:24 +00:00
|
|
|
|
.DA 0 DCBPTR
|
2018-12-11 16:41:25 +00:00
|
|
|
|
.DA 0 BUFPTR
|
2023-04-23 15:20:27 +00:00
|
|
|
|
.DA 0 SIZE
|
|
|
|
|
.DA 0
|
2021-07-24 20:42:23 +00:00
|
|
|
|
*--------------------------------------
|
2023-10-18 05:41:12 +00:00
|
|
|
|
FD.NULL.NAME .AZ "null"
|
|
|
|
|
FD.CONSOLE.NAME .AZ "console"
|
|
|
|
|
FD.TTY.NAME .AZ "tty0"
|
2019-11-26 06:46:02 +00:00
|
|
|
|
FD.BDEV.NAME .AZ "s1d1"
|
2018-07-11 15:13:29 +00:00
|
|
|
|
*--------------------------------------
|
2023-07-14 10:24:49 +00:00
|
|
|
|
* Z80 Reserved
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
*Z80CODE .EQ $300 0F300h
|
|
|
|
|
*Z80STACK .EQ $3CF 0F3CFh
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Z80.300 .HS 3200E1 LD (0E100H),A Back to 6502
|
|
|
|
|
|
2023-10-18 05:41:12 +00:00
|
|
|
|
.HS C300F3 JP 0F300h
|
2023-07-14 10:24:49 +00:00
|
|
|
|
Z80.300.L .EQ *-Z80.300
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Z80.1000 .HS 31CFF3 START: LD SP,0F3CFh Init Stack
|
|
|
|
|
.HS 3EFF LD A,0FFH Set Flag
|
|
|
|
|
.HS 320B00 LD (FLAG),A
|
|
|
|
|
.HS C300F3 JP 0F300h
|
|
|
|
|
.HS 00 FLAG: .DB 0
|
|
|
|
|
Z80.1000.L .EQ *-Z80.1000
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Z80.SAVE .EQ *
|
|
|
|
|
*--------------------------------------
|
2017-08-22 06:38:16 +00:00
|
|
|
|
MAN
|
2020-07-08 15:26:23 +00:00
|
|
|
|
SAVE usr/src/sys/kernel.s.init
|
|
|
|
|
LOAD usr/src/sys/kernel.s
|
2017-08-22 06:38:16 +00:00
|
|
|
|
ASM
|