2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2017-08-22 06:38:16 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2017-10-18 15:32:56 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPPtr1 .EQ ZPKERNEL
|
|
|
|
|
ZPPtr2 .EQ ZPKERNEL+2
|
|
|
|
|
ZPPtr3 .EQ ZPKERNEL+4
|
|
|
|
|
ZPPtr4 .EQ ZPKERNEL+6
|
2018-01-15 06:50:44 +00:00
|
|
|
|
pDrv .EQ ZPKERNEL+8
|
|
|
|
|
pDev .EQ ZPKERNEL+10
|
|
|
|
|
|
2017-10-18 15:32:56 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-21 16:27:07 +00:00
|
|
|
|
SYS.BASL0 .EQ $400
|
|
|
|
|
*--------------------------------------
|
2017-08-22 06:38:16 +00:00
|
|
|
|
Kernel.Init sei
|
|
|
|
|
ldx #$FF
|
|
|
|
|
txs
|
|
|
|
|
sta SETALTZP
|
|
|
|
|
|
|
|
|
|
stx A2osX.SaveSM
|
|
|
|
|
stx A2osX.SaveSX
|
|
|
|
|
|
|
|
|
|
sta CLRALTZP Make sure MAIN ZP is enabled for X.PRINT.F
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Kernel.Init2 >LDAXI MSG.Init2
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
|
2017-12-22 21:24:30 +00:00
|
|
|
|
>LDAXI MSG.MAIN
|
2017-11-22 16:27:50 +00:00
|
|
|
|
jsr PrintFAX
|
|
|
|
|
|
2017-12-22 21:24:30 +00:00
|
|
|
|
>LDYAI A2osX.MAIN
|
2017-11-22 16:27:50 +00:00
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
>LDYAI CORE.Run
|
|
|
|
|
>STYA ZPPtr2
|
2017-12-22 21:24:30 +00:00
|
|
|
|
>LDYAI A2osX.MAIN.S^$FFFF
|
2017-11-22 16:27:50 +00:00
|
|
|
|
>STYA ZPPtr3
|
|
|
|
|
jsr Kernel.Move
|
|
|
|
|
|
2017-12-22 21:24:30 +00:00
|
|
|
|
>LDAXI MSG.AUX
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
|
|
|
|
|
>LDYAI A2osX.AUX
|
|
|
|
|
>STYA A1L Src Start Address (MAIN)
|
|
|
|
|
>LDYAI A2osX.GP
|
|
|
|
|
>STYA A2L Src End Address (MAIN)
|
|
|
|
|
|
|
|
|
|
>LDYAI X.GUIOSD
|
|
|
|
|
>STYA A4L Dst Address (AUX)
|
|
|
|
|
|
|
|
|
|
sec Main To Aux
|
|
|
|
|
jsr AuxMove
|
|
|
|
|
|
2017-11-22 16:27:50 +00:00
|
|
|
|
>LDAXI MSG.GP
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>LDYAI A2osX.GP
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
>LDYAI A2osX.SYSCALL
|
|
|
|
|
>STYA ZPPtr2
|
2017-11-22 16:27:50 +00:00
|
|
|
|
>LDYAI A2osX.GP.S^$FFFF
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>STYA ZPPtr3
|
|
|
|
|
jsr Kernel.Move
|
|
|
|
|
|
|
|
|
|
sta CLRALTZP
|
|
|
|
|
|
|
|
|
|
>LDAXI MSG.D2
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
|
|
|
|
|
sta SETALTZP
|
2017-08-28 15:35:10 +00:00
|
|
|
|
bit RRAMWRAMBNK2
|
|
|
|
|
bit RRAMWRAMBNK2
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI A2osX.D2
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
>LDYAI $D000
|
|
|
|
|
>STYA ZPPtr2
|
2017-11-22 16:27:50 +00:00
|
|
|
|
>LDYAI A2osX.D2.S^$FFFF
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>STYA ZPPtr3
|
|
|
|
|
jsr Kernel.Move
|
|
|
|
|
|
|
|
|
|
sta CLRALTZP
|
|
|
|
|
|
|
|
|
|
>LDAXI MSG.D1
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
|
|
|
|
|
sta SETALTZP
|
2017-08-28 15:35:10 +00:00
|
|
|
|
bit RRAMWRAMBNK1
|
|
|
|
|
bit RRAMWRAMBNK1
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI A2osX.D1
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
>LDYAI $D000
|
|
|
|
|
>STYA ZPPtr2
|
2017-11-22 16:27:50 +00:00
|
|
|
|
>LDYAI A2osX.D1.S^$FFFF
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>STYA ZPPtr3
|
|
|
|
|
jsr Kernel.Move
|
|
|
|
|
|
|
|
|
|
sta CLRALTZP
|
|
|
|
|
|
|
|
|
|
>LDAXI MSG.E0
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
|
|
|
|
|
sta SETALTZP
|
2017-08-28 15:35:10 +00:00
|
|
|
|
bit RRAMWRAMBNK1
|
|
|
|
|
bit RRAMWRAMBNK1
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI A2osX.E0
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
>LDYAI $E000
|
|
|
|
|
>STYA ZPPtr2
|
2017-11-22 16:27:50 +00:00
|
|
|
|
>LDYAI A2osX.E0.S^$FFFF
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>STYA ZPPtr3
|
|
|
|
|
jsr Kernel.Move
|
|
|
|
|
|
|
|
|
|
sta CLRALTZP Make MAIN ZP is enabled for X.PRINT.F
|
|
|
|
|
|
|
|
|
|
cli
|
|
|
|
|
|
|
|
|
|
jsr KConfigLoad
|
|
|
|
|
|
|
|
|
|
lda A2osX.HZ
|
|
|
|
|
pha push HZ
|
|
|
|
|
>LDAXI MSG.HZ
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
|
|
|
|
|
jsr CPU.Init
|
|
|
|
|
|
|
|
|
|
>LDAXI MSG.Init2.OK
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
>DEBUGOA
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Kernel.Init3 sta SETALTZP
|
|
|
|
|
bit RRAMWRAMBNK1
|
|
|
|
|
bit RRAMWRAMBNK1
|
2017-08-28 15:35:10 +00:00
|
|
|
|
|
2017-10-16 15:41:48 +00:00
|
|
|
|
ldx #Kernel.ZP.S-1
|
|
|
|
|
|
|
|
|
|
.1 lda Kernel.ZP,x
|
|
|
|
|
sta CHARGET,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
jsr MemMgrInit
|
|
|
|
|
jsr PS0Init
|
|
|
|
|
bcs *
|
|
|
|
|
>LDYAI MSG.Init3
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
jsr DevMgrInit
|
|
|
|
|
bcs *
|
|
|
|
|
|
|
|
|
|
jsr IrqMgrInit
|
|
|
|
|
bcs *
|
|
|
|
|
|
|
|
|
|
jsr EvtMgrInit
|
|
|
|
|
bcs *
|
|
|
|
|
|
|
|
|
|
jsr FltMgrInit
|
|
|
|
|
bcs *
|
|
|
|
|
|
|
|
|
|
jsr TskMgrInit
|
|
|
|
|
bcs *
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hPREFIX
|
|
|
|
|
lda (pPs),y
|
2017-08-25 06:37:21 +00:00
|
|
|
|
>SYSCALL GetMemPtr.A
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>LDYAI MSG.Prefix
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
>PUSHWI STARTUP.CMDLINE
|
|
|
|
|
>LDYAI MSG.Startup
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI STARTUP.CMDLINE
|
2017-08-24 15:29:22 +00:00
|
|
|
|
>SYSCALL ExpandStr.YA
|
2017-08-22 06:38:16 +00:00
|
|
|
|
phx Save Expanded CMDLINE for discard
|
2017-08-28 15:35:10 +00:00
|
|
|
|
|
2017-10-19 06:19:54 +00:00
|
|
|
|
>SYSCALL CreatePS.YA
|
2017-09-06 15:00:10 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
pla
|
2017-08-25 06:37:21 +00:00
|
|
|
|
>SYSCALL FreeMem.A ...discard...
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI MSG.Init3.OK
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
>DEBUGOA
|
|
|
|
|
|
2017-08-29 15:19:09 +00:00
|
|
|
|
jmp CORE.Run
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
.9 >PUSHA
|
|
|
|
|
>LDYAI MSG.StartupErr
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2017-08-22 06:38:16 +00:00
|
|
|
|
bra * No need to discard Expanded CMDLINE
|
|
|
|
|
*--------------------------------------
|
2017-10-16 15:41:48 +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
|
|
|
|
|
beq IsDigit.9
|
|
|
|
|
|
|
|
|
|
IsDigit cmp #'0'
|
|
|
|
|
bcc IsDigit.9
|
|
|
|
|
cmp #'9'+1
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
IsDigit.9 sec
|
|
|
|
|
rts
|
|
|
|
|
.EP
|
|
|
|
|
Kernel.ZP.S .EQ *-Kernel.ZP
|
|
|
|
|
*--------------------------------------
|
2017-08-22 06:38:16 +00:00
|
|
|
|
Kernel.Move ldy #0
|
|
|
|
|
.1 inc ZPPtr3
|
|
|
|
|
bne .2
|
|
|
|
|
inc ZPPtr3+1
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPPtr1),y
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
inc ZPPtr2+1
|
|
|
|
|
bne .1
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CPU.Init >LDAXI MSG.CPU
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
|
|
|
|
|
jsr Detect6502 A = CPU type
|
|
|
|
|
sta A2osX.CPUTYPE
|
|
|
|
|
ldx MSG.CPUTYPEH,y
|
|
|
|
|
lda MSG.CPUTYPEL,y
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
|
|
|
|
|
lda MACHID
|
2017-10-27 14:56:46 +00:00
|
|
|
|
and #MACHID.T
|
|
|
|
|
cmp #MACHID.T.IIc
|
2017-08-22 06:38:16 +00:00
|
|
|
|
beq CPU.Init.Z80
|
|
|
|
|
|
|
|
|
|
>LDAXI MSG.CPU.SPEED
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
|
|
|
|
|
stz A2osX.RANDOM16
|
|
|
|
|
stz A2osX.RANDOM16+1
|
|
|
|
|
|
|
|
|
|
php
|
|
|
|
|
sei
|
|
|
|
|
|
|
|
|
|
.1 bit VBL
|
|
|
|
|
bpl .2
|
|
|
|
|
|
|
|
|
|
.2 bit VBL
|
|
|
|
|
bmi .2
|
|
|
|
|
|
|
|
|
|
ldx #0 Count LO
|
|
|
|
|
lda #0 Count HI
|
|
|
|
|
|
|
|
|
|
.3 ldy #3 (2)
|
|
|
|
|
|
|
|
|
|
.4 nop (2)
|
|
|
|
|
dey (2)
|
|
|
|
|
bne .4 (2*)
|
|
|
|
|
|
|
|
|
|
inc A2osX.RANDOM16 (6)
|
|
|
|
|
bne .5 (2*)
|
|
|
|
|
|
|
|
|
|
inc A2osX.RANDOM16+1 (6)
|
|
|
|
|
bit VBL (4)
|
|
|
|
|
bpl .3 (2*)
|
|
|
|
|
bmi .6
|
|
|
|
|
|
|
|
|
|
.5 nop (2)
|
|
|
|
|
nop (2)
|
|
|
|
|
nop (2)
|
|
|
|
|
bit VBL (4)
|
|
|
|
|
bpl .3 (2*)
|
|
|
|
|
|
|
|
|
|
.6 plp
|
|
|
|
|
|
|
|
|
|
stz A2osX.CPUSPEED
|
|
|
|
|
|
|
|
|
|
.7 sec
|
|
|
|
|
lda A2osX.RANDOM16
|
|
|
|
|
sbc #100
|
|
|
|
|
tax
|
|
|
|
|
lda A2osX.RANDOM16+1
|
|
|
|
|
sbc /100
|
|
|
|
|
bcc .8
|
|
|
|
|
|
|
|
|
|
stx A2osX.RANDOM16
|
|
|
|
|
sta A2osX.RANDOM16+1
|
|
|
|
|
inc A2osX.CPUSPEED
|
|
|
|
|
bra .7
|
|
|
|
|
|
|
|
|
|
.8 lda A2osX.RANDOM16
|
|
|
|
|
sta A2osX.CPUSPEED+1
|
|
|
|
|
pha push CPU speed LO
|
|
|
|
|
lda A2osX.CPUSPEED
|
|
|
|
|
pha push CPU speed HI
|
|
|
|
|
>LDAXI MSG.CPU.SPEEDOK
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
|
|
|
|
|
CPU.Init.Z80 >LDAXI MSG.Z80
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
jsr DetectZ80
|
|
|
|
|
bcs .9
|
|
|
|
|
sta A2osX.Z80SLOT
|
|
|
|
|
pha Push Z80Slot
|
|
|
|
|
|
|
|
|
|
tax
|
2017-10-19 15:27:38 +00:00
|
|
|
|
lda #A2osX.S.Z80
|
|
|
|
|
sta A2osX.S,x
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
>LDAXI MSG.Z80.OK
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 >LDAXI MSG.Z80.KO
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
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
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DetectZ80 ldx #Z80Code.Size
|
|
|
|
|
.1 lda Z80Code.Start-1,x
|
|
|
|
|
sta $1000-1,x 00000H for Z80
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
stz ZPPtr1
|
|
|
|
|
lda #$C1
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.2 sta (ZPPtr1)
|
|
|
|
|
lda $100D
|
|
|
|
|
bmi .8
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
lda ZPPtr1+1
|
|
|
|
|
cmp #$C8
|
|
|
|
|
beq .9 CS
|
|
|
|
|
clc
|
|
|
|
|
adc #$20
|
|
|
|
|
sta $100A
|
|
|
|
|
bra .2
|
|
|
|
|
|
|
|
|
|
.8 lda ZPPtr1+1
|
|
|
|
|
and #$0F
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
KConfigLoad >LDAXI MSG.KCREAD
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
|
|
|
|
|
jsr MLI
|
|
|
|
|
.DA #MLIOPEN
|
|
|
|
|
.DA MLIOPEN00
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
lda MLIOPEN00+5
|
|
|
|
|
sta MLIREAD00+1
|
|
|
|
|
sta MLICLOSE00+1
|
|
|
|
|
|
|
|
|
|
jsr MLI
|
|
|
|
|
.DA #MLIREAD
|
|
|
|
|
.DA MLIREAD00
|
|
|
|
|
php
|
|
|
|
|
pha
|
|
|
|
|
jsr MLI
|
|
|
|
|
.DA #MLICLOSE
|
|
|
|
|
.DA MLICLOSE00
|
|
|
|
|
pla
|
|
|
|
|
plp
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDAXI MSG.KCREAD.OK
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 >LDAXI MSG.KCREAD.KO
|
|
|
|
|
jsr PrintFAX
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-11-21 16:27:07 +00:00
|
|
|
|
Z80Code.Start .HS 31FF00 START: LD SP,000FFH Init Stack
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.HS 3EFF LD A,0FFH Set Flag
|
|
|
|
|
.HS 320D00 LD (FLAG),A
|
|
|
|
|
.HS 3200E1 LD (0E100H),A Back to 6502
|
|
|
|
|
.HS 18F3 JR START Loop
|
|
|
|
|
.HS 00 FLAG: .DB 0
|
|
|
|
|
Z80Code.Size .EQ *-Z80Code.Start
|
|
|
|
|
*--------------------------------------
|
2017-10-27 06:36:46 +00:00
|
|
|
|
MemMgrInit >LDYAI Mem.MHiMem
|
|
|
|
|
>STYA Mem.HiMem
|
|
|
|
|
>STYA Mem.Free
|
|
|
|
|
>LDYAI Mem.MLoMem
|
|
|
|
|
>STYA Mem.LoMem
|
|
|
|
|
stz Mem.LastSlot Reserve Slot #0
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
sta SETWRITEAUX
|
|
|
|
|
|
2017-10-27 06:36:46 +00:00
|
|
|
|
>LDYAI Mem.XHiMem
|
|
|
|
|
>STYA Mem.HiMem
|
|
|
|
|
>STYA Mem.Free
|
|
|
|
|
>LDYAI Mem.XLoMem
|
|
|
|
|
>STYA Mem.LoMem
|
|
|
|
|
stz Mem.LastSlot Reserve Slot #0
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
sta CLRWRITEAUX
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
PS0Init ldx #S.DEV*2 NUL,SYS
|
|
|
|
|
|
|
|
|
|
.1 lda DevMgr.NUL-1,x
|
2017-10-27 06:36:46 +00:00
|
|
|
|
sta Dev.Table-1,x
|
2017-08-22 06:38:16 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .1
|
2017-11-21 16:27:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
sta SET80STORE
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.2 lda DevMgr.SYS.TITLE,y
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
cmp #$40
|
|
|
|
|
bcc .10
|
|
|
|
|
cmp #$5F
|
|
|
|
|
bcs .10
|
|
|
|
|
and #$3F
|
|
|
|
|
|
|
|
|
|
.10 php
|
|
|
|
|
sei
|
|
|
|
|
sta SETPAGE2
|
|
|
|
|
sta SYS.BASL0,x
|
|
|
|
|
sta CLRPAGE2
|
|
|
|
|
plp
|
|
|
|
|
|
|
|
|
|
iny
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-11-21 16:27:07 +00:00
|
|
|
|
lda DevMgr.SYS.TITLE,y
|
|
|
|
|
beq .5
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-11-21 16:27:07 +00:00
|
|
|
|
cmp #$40
|
|
|
|
|
bcc .11
|
|
|
|
|
cmp #$5F
|
|
|
|
|
bcs .11
|
|
|
|
|
and #$3F
|
|
|
|
|
|
|
|
|
|
.11 sta SYS.BASL0,x
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
inx
|
|
|
|
|
bra .2
|
|
|
|
|
|
|
|
|
|
.3 lda #$20
|
|
|
|
|
|
|
|
|
|
.4 php
|
|
|
|
|
sei
|
|
|
|
|
sta SETPAGE2
|
|
|
|
|
sta SYS.BASL0,x
|
|
|
|
|
sta CLRPAGE2
|
|
|
|
|
plp
|
|
|
|
|
|
|
|
|
|
.5 lda #$20
|
|
|
|
|
sta SYS.BASL0,x
|
|
|
|
|
|
|
|
|
|
inx
|
|
|
|
|
cpx #40
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
sta CLR80STORE
|
|
|
|
|
|
|
|
|
|
>LDYAI CORE.S.PS0 Select Process 0 (Kernel)
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>STYA pPs
|
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
>LDYAI K.STACKTOP
|
|
|
|
|
>STYA pStack
|
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>LDYAI DEV.SYS
|
2017-11-21 16:27:07 +00:00
|
|
|
|
>SYSCALL MkNod.YA Will open SYS
|
2017-08-22 06:38:16 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hStdIn
|
|
|
|
|
sta (pPs),y
|
2017-09-20 15:09:55 +00:00
|
|
|
|
sta CORE.S.PS0+S.PS.hStdIn
|
2017-08-22 06:38:16 +00:00
|
|
|
|
ldy #S.PS.hStdOut
|
|
|
|
|
sta (pPs),y
|
2017-09-20 15:09:55 +00:00
|
|
|
|
sta CORE.S.PS0+S.PS.hStdOut
|
2017-08-22 06:38:16 +00:00
|
|
|
|
ldy #S.PS.hStdErr
|
|
|
|
|
sta (pPs),y
|
2017-09-20 15:09:55 +00:00
|
|
|
|
sta CORE.S.PS0+S.PS.hStdErr
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2017-11-21 16:27:07 +00:00
|
|
|
|
DevMgr.SYS.TITLE >CSTR "A2osX System Screen"
|
|
|
|
|
*--------------------------------------
|
2017-08-22 06:38:16 +00:00
|
|
|
|
DevMgr.NUL cld
|
|
|
|
|
jmp (DevMgr.NUL.Code,x)
|
|
|
|
|
.DA #S.DEV.S.WRITE+S.DEV.S.READ+S.DEV.S.OPENED
|
|
|
|
|
.BS 6
|
2017-09-14 15:21:06 +00:00
|
|
|
|
>CSTR "NUL" NAME
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.HS 00 NAME must Be 4 bytes long
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgr.SYS cld
|
|
|
|
|
jmp (DevMgr.SYS.Code,x)
|
|
|
|
|
.DA #S.DEV.S.WRITE+S.DEV.S.READ
|
|
|
|
|
.BS 6
|
2017-09-14 15:21:06 +00:00
|
|
|
|
>CSTR "SYS" NAME
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.HS 00 NAME must Be 4 bytes long
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* 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
|
|
|
|
|
>SYSCALL PrintF.YA
|
|
|
|
|
php
|
2017-08-22 06:38:16 +00:00
|
|
|
|
sei
|
|
|
|
|
>LDYA $FFFE
|
2017-10-18 15:32:56 +00:00
|
|
|
|
>STYA IRQ.OldFFFE
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>LDYAI K.IrqHAuxLC
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>STYA $FFFE
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>LDYAI GP.IrqH
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>STYA K.MLI.PARAMS+2
|
|
|
|
|
>MLICALL MLIALLOCIRQ
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
lda K.MLI.PARAMS+1
|
2017-10-18 15:32:56 +00:00
|
|
|
|
sta IRQ.INTNUM
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
|
|
|
|
plp
|
|
|
|
|
|
|
|
|
|
jsr IrqMgrInit.Mouse
|
|
|
|
|
bcs .1
|
|
|
|
|
|
2017-12-18 16:36:21 +00:00
|
|
|
|
lda #"V"
|
2017-11-21 16:27:07 +00:00
|
|
|
|
sta SYS.BASL0+38
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>LDYAI K.IrqH.VBL
|
|
|
|
|
>STYA K.IrqH+1
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI MSG.IRQ.VBL
|
|
|
|
|
>SYSCALL PrintF.YA
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 jsr IrqMgrInit.TClock
|
|
|
|
|
bcs .8
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-12-18 16:36:21 +00:00
|
|
|
|
lda #"C"
|
2017-11-21 16:27:07 +00:00
|
|
|
|
sta SYS.BASL0+38
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>LDYAI K.IrqH.TClock
|
|
|
|
|
>STYA K.IrqH+1
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI MSG.IRQ.CLOCK
|
|
|
|
|
>SYSCALL PrintF.YA
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.8 jsr IrqMgrInit.HZ2Tick
|
|
|
|
|
|
2017-12-18 16:36:21 +00:00
|
|
|
|
lda #"P"
|
2017-11-21 16:27:07 +00:00
|
|
|
|
sta SYS.BASL0+38
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI MSG.IRQ.POLL
|
|
|
|
|
>SYSCALL PrintF.YA
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 plp
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
IrqMgrInit.HZ2Tick
|
|
|
|
|
ldx #50
|
|
|
|
|
lda A2osX.HZ
|
|
|
|
|
sta CORE.TickPer10t
|
|
|
|
|
sta CORE.Tick10t
|
|
|
|
|
cmp #5
|
|
|
|
|
beq .1
|
|
|
|
|
ldx #60
|
|
|
|
|
|
|
|
|
|
.1 stx CORE.TickPerSec
|
|
|
|
|
stx CORE.TickSec
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
IrqMgrInit.Mouse
|
2017-08-22 06:38:16 +00:00
|
|
|
|
stz ZPPtr1 Try finding a Mouse Card...
|
|
|
|
|
lda #$C1
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.1 ldx #Mouse.SIG-Mouse.OFS-1
|
|
|
|
|
|
|
|
|
|
.2 ldy Mouse.OFS,x
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
cmp Mouse.SIG,x
|
|
|
|
|
bne .3
|
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
|
|
|
|
bra .4
|
|
|
|
|
|
|
|
|
|
.3 inc ZPPtr1+1 no match, try next slot....
|
|
|
|
|
lda ZPPtr1+1
|
|
|
|
|
cmp #$C8
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.4 lda ZPPtr1+1
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
sta IRQ.VBL.MSM+2
|
|
|
|
|
sta IRQ.VBL.MRM+2
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
and #$0f
|
2017-10-27 14:56:46 +00:00
|
|
|
|
sta IRQ.VBL.0n
|
2017-08-22 06:38:16 +00:00
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
sta IRQ.VBL.n0
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-10-19 06:19:54 +00:00
|
|
|
|
ldy #$13 SERVEMOUSE
|
2017-08-22 06:38:16 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2017-10-27 14:56:46 +00:00
|
|
|
|
sta IRQ.VBL.MSM+1
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-10-19 06:19:54 +00:00
|
|
|
|
ldy #$14 READMOUSE
|
2017-08-22 06:38:16 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2017-10-27 14:56:46 +00:00
|
|
|
|
sta IRQ.VBL.MRM+1
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-10-19 06:19:54 +00:00
|
|
|
|
ldy #$12 SETMOUSE
|
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sta .7+1
|
|
|
|
|
|
|
|
|
|
lda #9 #MOUSEMODx.INTVBL+MOUSEMODx.ACTIVE
|
|
|
|
|
|
|
|
|
|
ldx ZPPtr1+1 DEVSLOTCn
|
|
|
|
|
stx .7+2
|
2017-10-27 14:56:46 +00:00
|
|
|
|
ldy IRQ.VBL.n0
|
2017-09-21 15:29:45 +00:00
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
php
|
|
|
|
|
sei
|
|
|
|
|
|
2017-09-21 15:29:45 +00:00
|
|
|
|
bit RROMBNK2 Renable ROM to allow MOUSE II firmware works properly
|
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.7 jsr $ffff self Modified, CALL SETMOUSE
|
2017-10-11 15:37:41 +00:00
|
|
|
|
bcs .9
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
bit RRAMWRAMBNK1 Back To LC Ram
|
|
|
|
|
bit RRAMWRAMBNK1
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
|
|
|
|
jsr IrqMgrInit.HZ2Tick
|
|
|
|
|
|
|
|
|
|
dec CORE.IRQMode
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
plp
|
2017-10-11 15:37:41 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2017-09-21 15:29:45 +00:00
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
.9 plp
|
|
|
|
|
sec
|
2017-08-22 06:38:16 +00:00
|
|
|
|
rts
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
Mouse.OFS .HS 05070B0CFB
|
|
|
|
|
Mouse.SIG .HS 38180120D6
|
|
|
|
|
*--------------------------------------
|
2017-10-11 15:37:41 +00:00
|
|
|
|
IrqMgrInit.TClock
|
|
|
|
|
stz ZPPtr1 Try finding a Mouse Card...
|
|
|
|
|
lda #$C1
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.1 ldy #31
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPPtr1),y
|
|
|
|
|
cmp TClock.SIG,y
|
|
|
|
|
bne .3
|
|
|
|
|
dey
|
|
|
|
|
bpl .2
|
|
|
|
|
bra .4
|
|
|
|
|
|
|
|
|
|
.3 inc ZPPtr1+1 no match, try next slot....
|
|
|
|
|
lda ZPPtr1+1
|
|
|
|
|
cmp #$C8
|
|
|
|
|
bne .1
|
|
|
|
|
|
2017-12-18 16:36:21 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
.4 lda ZPPtr1+1 get $Cn
|
|
|
|
|
and #$f
|
|
|
|
|
tax get $0n
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
tay get $n0
|
2017-10-27 14:56:46 +00:00
|
|
|
|
sty IRQ.VBL.n0
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
2017-12-18 16:36:21 +00:00
|
|
|
|
php
|
|
|
|
|
sei
|
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
lda #$40 Enable interrupt
|
|
|
|
|
sta $c080,y
|
|
|
|
|
sta $478,x
|
|
|
|
|
sta $7f8,x
|
|
|
|
|
|
|
|
|
|
lda #64
|
|
|
|
|
sta CORE.TickPerSec
|
|
|
|
|
sta CORE.TickSec
|
|
|
|
|
|
|
|
|
|
lda #11
|
|
|
|
|
sta CORE.TickPer10t
|
|
|
|
|
sta CORE.Tick10t
|
|
|
|
|
|
|
|
|
|
dec CORE.IRQMode
|
|
|
|
|
|
2017-12-18 16:36:21 +00:00
|
|
|
|
plp
|
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
TClock.SIG .HS 0878282c58ff700538b00118b8087848
|
|
|
|
|
.HS 8a489848adffcf201ac86868ba8df807
|
|
|
|
|
*--------------------------------------
|
2017-08-31 15:35:15 +00:00
|
|
|
|
DevMgrInit >LDYAI MSG.DEV
|
|
|
|
|
>SYSCALL PrintF.YA
|
|
|
|
|
|
2017-11-07 16:28:34 +00:00
|
|
|
|
lda DEVCNT
|
|
|
|
|
sta DevMgrInit.DEVCNT
|
|
|
|
|
|
|
|
|
|
.1 ldx DevMgrInit.DEVCNT
|
|
|
|
|
lda DEVLST,x
|
|
|
|
|
|
2017-11-08 07:14:35 +00:00
|
|
|
|
and #$F0
|
|
|
|
|
|
2017-11-07 16:28:34 +00:00
|
|
|
|
asl
|
|
|
|
|
php Save Drive 1/2 in C
|
2017-11-08 07:14:35 +00:00
|
|
|
|
ror DSSS0000
|
2017-11-07 16:28:34 +00:00
|
|
|
|
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
2017-11-08 07:14:35 +00:00
|
|
|
|
|
|
|
|
|
tax 000DSSS0
|
|
|
|
|
lsr 0000DSSS
|
|
|
|
|
and #$7
|
2017-11-07 16:28:34 +00:00
|
|
|
|
sta DEV.HEADER+S.DEV.BUSID
|
|
|
|
|
|
2018-01-09 16:31:56 +00:00
|
|
|
|
lda DEVPTRS,x
|
|
|
|
|
sta DEV.HEADER+S.DEV.ROM.JMP
|
|
|
|
|
|
2017-11-07 16:28:34 +00:00
|
|
|
|
lda DEVPTRS+1,x
|
2018-01-09 16:31:56 +00:00
|
|
|
|
sta DEV.HEADER+S.DEV.ROM.JMP+1
|
|
|
|
|
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
stz ZPPtr1
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-11-07 16:28:34 +00:00
|
|
|
|
plp
|
|
|
|
|
lda #0
|
|
|
|
|
adc #1 Make DevID 1 or 2
|
2017-08-22 06:38:16 +00:00
|
|
|
|
sta DEV.HEADER+S.DEV.DEVID
|
|
|
|
|
|
2017-11-07 16:28:34 +00:00
|
|
|
|
lda ZPPtr1+1
|
2017-11-08 07:14:35 +00:00
|
|
|
|
|
2017-11-07 16:28:34 +00:00
|
|
|
|
cmp #$D0 Disk II Driver is $D000
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
jsr DevMgrInit.DII
|
|
|
|
|
lda #A2osX.S.DII
|
|
|
|
|
bra .7 Go mark slot as USED
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-11-07 16:28:34 +00:00
|
|
|
|
.2 cmp #$FF /RAM is always $FF00
|
|
|
|
|
bne .3
|
|
|
|
|
jsr DevMgrInit.RAM
|
|
|
|
|
bra .8
|
|
|
|
|
|
2018-01-09 16:31:56 +00:00
|
|
|
|
.3 and #$F0
|
2017-11-07 16:28:34 +00:00
|
|
|
|
cmp #$C0
|
|
|
|
|
beq .4
|
|
|
|
|
|
2018-01-09 16:31:56 +00:00
|
|
|
|
jsr DevMgrInit.USR Outside ROM space, User loaded BLK dev
|
2017-11-07 16:28:34 +00:00
|
|
|
|
bra .8
|
|
|
|
|
|
|
|
|
|
.4 ldx #SmartPort.SIG-SmartPort.OFS-1
|
|
|
|
|
|
|
|
|
|
.5 ldy SmartPort.OFS,x Check if there is a smartport firmware
|
2017-08-22 06:38:16 +00:00
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
cmp SmartPort.SIG,x
|
|
|
|
|
bne .8 not a Disk Controller...
|
|
|
|
|
dex
|
2017-11-07 16:28:34 +00:00
|
|
|
|
bpl .5
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
ldy #7
|
|
|
|
|
lda (ZPPtr1),y
|
2017-11-07 16:28:34 +00:00
|
|
|
|
bne .6 $Cn07=00 : SmartPort
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-11-07 16:28:34 +00:00
|
|
|
|
lda ZPPtr1 get $Cn
|
|
|
|
|
and #$f get $0n
|
|
|
|
|
cmp DEV.HEADER+S.DEV.BUSID same as SSS ?
|
|
|
|
|
beq .51
|
|
|
|
|
|
|
|
|
|
inc DEV.HEADER+S.DEV.DEVID Remapped SP devices....
|
|
|
|
|
inc DEV.HEADER+S.DEV.DEVID Add 2 to DEVID (2 & 3)
|
|
|
|
|
|
|
|
|
|
.51 jsr DevMgrInit.SP
|
|
|
|
|
lda #A2osX.S.SP
|
2017-08-22 06:38:16 +00:00
|
|
|
|
bra .7
|
|
|
|
|
|
2017-11-07 16:28:34 +00:00
|
|
|
|
.6 jsr DevMgrInit.BLK
|
|
|
|
|
lda #A2osX.S.BLK
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-11-07 16:28:34 +00:00
|
|
|
|
.7 ldx DEV.HEADER+S.DEV.BUSID
|
2017-10-19 15:27:38 +00:00
|
|
|
|
sta A2osX.S,x
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-11-07 16:28:34 +00:00
|
|
|
|
.8 dec DevMgrInit.DEVCNT
|
2018-01-09 16:31:56 +00:00
|
|
|
|
bmi .80
|
|
|
|
|
jmp .1
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-11-08 07:14:35 +00:00
|
|
|
|
.80 clc
|
2017-08-22 06:38:16 +00:00
|
|
|
|
rts
|
2017-11-07 16:28:34 +00:00
|
|
|
|
DevMgrInit.DEVCNT
|
|
|
|
|
.BS 1
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgrInit.DII >LDYAI A2osX.DIIDrv
|
2017-11-07 16:28:34 +00:00
|
|
|
|
jmp DevMgrInit.AddDev
|
|
|
|
|
*--------------------------------------
|
2017-11-08 07:14:35 +00:00
|
|
|
|
DevMgrInit.RAM >LDYAI A2osX.RamDrv
|
2017-11-07 16:28:34 +00:00
|
|
|
|
jmp DevMgrInit.AddDev
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
2018-01-09 16:31:56 +00:00
|
|
|
|
DevMgrInit.USR >LDYAI A2osX.BlkDrv
|
|
|
|
|
jmp DevMgrInit.AddDev
|
|
|
|
|
*--------------------------------------
|
2017-08-22 06:38:16 +00:00
|
|
|
|
DevMgrInit.BLK ldy #$ff
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sta DEV.HEADER+S.DEV.ROM.JMP
|
|
|
|
|
|
2018-01-09 16:31:56 +00:00
|
|
|
|
>LDYAI A2osX.BlkDrv
|
2017-11-07 16:28:34 +00:00
|
|
|
|
jmp DevMgrInit.AddDev
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgrInit.SP ldy #$ff
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
clc
|
|
|
|
|
adc #3 Compute smartport entry point
|
2018-01-09 16:31:56 +00:00
|
|
|
|
sta .1+1
|
2017-08-22 06:38:16 +00:00
|
|
|
|
sta DEV.HEADER+S.DEV.ROM.JMP
|
|
|
|
|
lda ZPPtr1+1
|
2018-01-09 16:31:56 +00:00
|
|
|
|
sta .1+2
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2018-01-09 16:31:56 +00:00
|
|
|
|
lda DEV.HEADER+S.DEV.DEVID
|
2017-08-22 06:38:16 +00:00
|
|
|
|
sta SP.DEV.STATUS.DEVID
|
|
|
|
|
|
2018-01-09 16:31:56 +00:00
|
|
|
|
.1 jsr $ffff Self Modified
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.DA #0 Status
|
|
|
|
|
.DA SP.DEV.STATUS
|
2017-11-07 16:28:34 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2017-10-27 06:36:46 +00:00
|
|
|
|
lda SP.DEV.STATUS.DATA+S.DSTAT.S
|
2017-08-22 06:38:16 +00:00
|
|
|
|
sta DEV.HEADER+S.DEV.S
|
|
|
|
|
|
2018-01-09 16:31:56 +00:00
|
|
|
|
>LDYAI A2osX.PrtDrv
|
2017-08-22 06:38:16 +00:00
|
|
|
|
jsr DevMgrInit.AddDev
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgrInit.AddDev
|
2018-01-09 16:31:56 +00:00
|
|
|
|
>STYA DEV.HEADER+S.DEV.DRV.JMP
|
2017-08-22 06:38:16 +00:00
|
|
|
|
lda DevMgr.Count
|
|
|
|
|
cmp #K.DEV.MAX
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
inc DevMgr.Count
|
2017-08-25 06:37:21 +00:00
|
|
|
|
>SYSCALL GetDevByID.A
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>STYA ZPPtr2
|
|
|
|
|
|
|
|
|
|
lda DEV.HEADER+S.DEV.BUSID
|
|
|
|
|
ora #$30
|
2017-09-21 15:29:45 +00:00
|
|
|
|
sta DEV.HEADER+S.DEV.NAME+1 SnDy
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
lda DEV.HEADER+S.DEV.DEVID
|
|
|
|
|
ora #$30
|
2017-09-21 15:29:45 +00:00
|
|
|
|
sta DEV.HEADER+S.DEV.NAME+3 SxDn
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.DEV-1
|
|
|
|
|
|
|
|
|
|
.1 lda DEV.HEADER,y
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
dey
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2017-10-26 16:01:54 +00:00
|
|
|
|
.9 lda #K.E.OOH
|
2017-08-22 06:38:16 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-01-09 16:31:56 +00:00
|
|
|
|
DEV.HEADER cld
|
2017-08-22 06:38:16 +00:00
|
|
|
|
jmp ($ffff,x)
|
|
|
|
|
.DA #S.DEV.S.BLOCK S
|
|
|
|
|
.BS 1 F
|
|
|
|
|
.BS 1 BUS.ID
|
|
|
|
|
.BS 1 DEV.ID
|
|
|
|
|
.BS 2 ROM.JMP
|
|
|
|
|
.BS 1
|
2017-09-21 15:29:45 +00:00
|
|
|
|
>CSTR "S1D1" 5 bytes
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
SmartPort.OFS .HS 010305
|
|
|
|
|
SmartPort.SIG .HS 200003
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SP.DEV.STATUS .DA #3
|
|
|
|
|
SP.DEV.STATUS.DEVID
|
|
|
|
|
.BS 1
|
|
|
|
|
.DA SP.DEV.STATUS.DATA
|
|
|
|
|
.DA #3 return DIB
|
|
|
|
|
SP.DEV.STATUS.DATA
|
2017-10-27 06:36:46 +00:00
|
|
|
|
.BS S.DSTAT
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-31 15:35:15 +00:00
|
|
|
|
EvtMgrInit >LDYAI MSG.EVT
|
|
|
|
|
>SYSCALL PrintF.YA
|
|
|
|
|
lda #$A5
|
2017-08-22 06:38:16 +00:00
|
|
|
|
sta A2osX.TIMER16
|
|
|
|
|
lda #$9B
|
|
|
|
|
sta A2osX.TIMER16+1
|
|
|
|
|
|
2017-10-27 06:36:46 +00:00
|
|
|
|
lda /Evt.Table
|
2017-08-22 06:38:16 +00:00
|
|
|
|
sta pEvent+1
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-08-31 15:35:15 +00:00
|
|
|
|
FltMgrInit >LDYAI MSG.FLT
|
|
|
|
|
>SYSCALL PrintF.YA
|
2017-10-27 06:36:46 +00:00
|
|
|
|
stz Flt.Table
|
2017-08-22 06:38:16 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-08-31 15:35:15 +00:00
|
|
|
|
TskMgrInit >LDYAI MSG.TSK
|
|
|
|
|
>SYSCALL PrintF.YA
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
jsr CORE.PSSelect0
|
|
|
|
|
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>LDYAI K.ENV.SIZE get a buffer for ENV
|
2017-08-28 15:35:10 +00:00
|
|
|
|
>SYSCALL GetMem0.YA make sure blank!!
|
2017-08-22 06:38:16 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
ldy #S.PS.hENV
|
|
|
|
|
sta (pPs),y
|
|
|
|
|
|
2017-08-24 12:46:48 +00:00
|
|
|
|
>LDYAI K.Buf256
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>STYA K.MLI.PARAMS+1
|
|
|
|
|
>MLICALL MLIGETPREFIX
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2017-09-11 06:11:57 +00:00
|
|
|
|
ldy K.Buf256
|
|
|
|
|
iny
|
|
|
|
|
lda #0
|
|
|
|
|
jsr K.GetMem.YA
|
|
|
|
|
>STYA ZPPtr1
|
2017-08-22 06:38:16 +00:00
|
|
|
|
txa
|
|
|
|
|
ldy #S.PS.hPREFIX
|
|
|
|
|
sta (pPs),y
|
2017-09-11 06:11:57 +00:00
|
|
|
|
|
|
|
|
|
ldy K.Buf256
|
|
|
|
|
lda #0
|
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
|
|
|
|
|
.4 lda K.Buf256,y
|
|
|
|
|
dey
|
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
>PUSHW ZPPtr1 push ENV value = PREFIX
|
2017-08-22 06:38:16 +00:00
|
|
|
|
|
2017-09-11 06:11:57 +00:00
|
|
|
|
>PUSHWI I.ENV.A2osX push ENV name = A2OSX
|
2017-08-22 06:38:16 +00:00
|
|
|
|
>SYSCALL SetEnv
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDYAI I.ENV.PATH
|
2017-08-24 15:29:22 +00:00
|
|
|
|
>SYSCALL PutEnv.YA
|
2017-08-22 06:38:16 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDYAI I.ENV.LIB
|
2017-08-24 15:29:22 +00:00
|
|
|
|
>SYSCALL PutEnv.YA
|
2017-08-22 06:38:16 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDYAI I.ENV.DRV
|
2017-08-24 15:29:22 +00:00
|
|
|
|
>SYSCALL PutEnv.YA
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2017-11-22 16:27:50 +00:00
|
|
|
|
MSG.Init2 >CSTR "A2osX[Stage2]:Init\nInstalling KERNEL...\n"
|
2017-12-22 21:24:30 +00:00
|
|
|
|
MSG.MAIN >CSTR " - $1100 Main...\n"
|
|
|
|
|
MSG.AUX >CSTR " - $0C00 Aux...\n"
|
2017-11-22 16:27:50 +00:00
|
|
|
|
MSG.GP >CSTR " - $BD00 Global Page...\n"
|
2017-08-22 06:38:16 +00:00
|
|
|
|
MSG.D1 >CSTR " - $D000 Bank1...\n"
|
|
|
|
|
MSG.D2 >CSTR " - $D000 Bank2...\n"
|
|
|
|
|
MSG.E0 >CSTR " - $E000...\n"
|
|
|
|
|
MSG.HZ >CSTR "Kernel SYS Timer Set For %d0 hz Machine.\n"
|
|
|
|
|
MSG.Init2.OK >CSTR "A2osX[Stage2]:Complete.\n"
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MSG.Init3 >CSTR "A2osX[Stage3]:Init\r\n"
|
|
|
|
|
MSG.DEV >CSTR "-Device Manager...\r\n"
|
|
|
|
|
MSG.IRQ >CSTR "-Interrupt Manager...\r\n"
|
2017-10-11 15:37:41 +00:00
|
|
|
|
MSG.IRQ.VBL >CSTR " (Mouse VBL IRQ Activated)\r\n"
|
|
|
|
|
MSG.IRQ.CLOCK >CSTR " (Clock Card IRQ Activated)\r\n"
|
|
|
|
|
MSG.IRQ.POLL >CSTR " (Polling Mode)\r\n"
|
2017-08-22 06:38:16 +00:00
|
|
|
|
MSG.EVT >CSTR "-Event Manager...\r\n"
|
|
|
|
|
MSG.FLT >CSTR "-Path Filter...\r\n"
|
|
|
|
|
MSG.TSK >CSTR "-Task Manager...\r\n"
|
2017-08-28 15:35:10 +00:00
|
|
|
|
MSG.Prefix >CSTR "Prefix:%s\r\n"
|
|
|
|
|
MSG.Startup >CSTR "Executing Kernel Startup Script...\r\nCmd:%s\r\n"
|
2017-08-22 06:38:16 +00:00
|
|
|
|
MSG.StartupErr >CSTR "Failed : [$%h]\r\n"
|
|
|
|
|
MSG.Init3.OK >CSTR "A2osX[Stage3]:Complete.\r\n"
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MSG.CPU >CSTR "Checking CPU..."
|
|
|
|
|
MSG.CPU.SPEED >CSTR "Detecting CPU Speed..."
|
|
|
|
|
MSG.CPUTYPEL .DA #MSG.6502
|
|
|
|
|
.DA #MSG.65C02
|
|
|
|
|
.DA #MSG.65R02
|
|
|
|
|
.DA #MSG.65816
|
|
|
|
|
MSG.CPUTYPEH .DA /MSG.6502
|
|
|
|
|
.DA /MSG.65C02
|
|
|
|
|
.DA /MSG.65R02
|
|
|
|
|
.DA /MSG.65816
|
|
|
|
|
MSG.6502 >CSTR "6502.\n"
|
|
|
|
|
MSG.65C02 >CSTR "65C02.\n"
|
|
|
|
|
MSG.65R02 >CSTR "65R02.\n"
|
|
|
|
|
MSG.65816 >CSTR "65816.\n"
|
|
|
|
|
MSG.CPU.SPEEDOK >CSTR "%d.%02d Mhz.\n"
|
|
|
|
|
MSG.Z80 >CSTR "Detecting Z80 CPU..."
|
|
|
|
|
MSG.Z80.OK >CSTR "Detected In Slot %d.\n"
|
|
|
|
|
MSG.Z80.KO >CSTR "Not Detected.\n"
|
|
|
|
|
MSG.KCREAD >CSTR "Reading Kernel Config File..."
|
|
|
|
|
MSG.KCREAD.OK >CSTR "OK\n"
|
|
|
|
|
MSG.KCREAD.KO >CSTR "\nError While Reading Kernel Config File, Using Default.\n"
|
|
|
|
|
*--------------------------------------
|
2017-09-14 15:21:06 +00:00
|
|
|
|
DEV.SYS >CSTR "SYS"
|
2017-08-30 15:26:34 +00:00
|
|
|
|
I.ENV.A2osX >CSTR "A2OSX"
|
|
|
|
|
I.ENV.PATH >CSTR "PATH=${A2OSX}SBIN/;${A2OSX}BIN/"
|
|
|
|
|
I.ENV.LIB >CSTR "LIB=${A2OSX}LIB/"
|
|
|
|
|
I.ENV.DRV >CSTR "DRV=${A2OSX}DRV/"
|
2017-08-28 15:35:10 +00:00
|
|
|
|
STARTUP.CMDLINE >CSTR "${A2OSX}SBIN/SHELL ${A2OSX}A2osX.STARTUP"
|
2017-08-22 06:38:16 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MLIOPEN00 .DA #3
|
|
|
|
|
.DA A2OSXCONF
|
2017-11-22 16:27:50 +00:00
|
|
|
|
.DA $B000
|
2017-08-22 06:38:16 +00:00
|
|
|
|
.BS 1
|
|
|
|
|
A2OSXCONF >PSTR "A2osX.KCONFIG"
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MLIREAD00 .DA #4
|
|
|
|
|
.BS 1
|
|
|
|
|
.DA A2osX.HZ
|
|
|
|
|
.DA 16
|
|
|
|
|
.BS 2
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MLICLOSE00 .DA #1
|
|
|
|
|
.BS 1
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.INIT
|
|
|
|
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
|
|
|
|
ASM
|