mirror of
https://github.com/A2osX/A2osX.git
synced 2024-07-02 00:29:41 +00:00
Kernel 0.93+
This commit is contained in:
parent
851f76d9e9
commit
0c85d576b9
Binary file not shown.
|
@ -86,7 +86,7 @@ DEVPTRS3D2 .EQ $BF26
|
||||||
*DEVPTRS6D2 .EQ $BF2C
|
*DEVPTRS6D2 .EQ $BF2C
|
||||||
*DEVPTRS7D2 .EQ $BF2E
|
*DEVPTRS7D2 .EQ $BF2E
|
||||||
DEVNUM .EQ $BF30
|
DEVNUM .EQ $BF30
|
||||||
DEVCNT .EQ $BF31
|
DEVCNT .EQ $BF31 0 -> 13
|
||||||
DEVLST .EQ $BF32 -> $BF3F
|
DEVLST .EQ $BF32 -> $BF3F
|
||||||
*DEVLST0END .EQ $BF40 A 0 was added to ensure list ended with 0 if 14 devices in list
|
*DEVLST0END .EQ $BF40 A 0 was added to ensure list ended with 0 if 14 devices in list
|
||||||
*PRODOSCOPYRIGHT .EQ $BF41 ;free->$BF4B
|
*PRODOSCOPYRIGHT .EQ $BF41 ;free->$BF4B
|
||||||
|
|
|
@ -4,11 +4,10 @@ NEW
|
||||||
GP.START jmp GP.MLIENTRY $2E00-2EFF moved to $BF00
|
GP.START jmp GP.MLIENTRY $2E00-2EFF moved to $BF00
|
||||||
jspare jmp * will be changed to point to dispatcher.
|
jspare jmp * will be changed to point to dispatcher.
|
||||||
clockv rts changed to jmp ($4C) if clock present.
|
clockv rts changed to jmp ($4C) if clock present.
|
||||||
.DA tclk_in clock routine entry address.
|
.DA $D742 clock routine entry address.
|
||||||
GP.P8errv jmp XDOS.syserr error reporting hook.
|
GP.P8errv jmp XDOS.syserr error reporting hook.
|
||||||
sysdeath jmp sysdeath1 system failure hook.
|
sysdeath jmp sysdeath1 system failure hook.
|
||||||
p8error .DA #0
|
p8error .DA #0
|
||||||
drivertbl1 .DA nodevice
|
|
||||||
.DA nodevice
|
.DA nodevice
|
||||||
.DA nodevice
|
.DA nodevice
|
||||||
.DA nodevice
|
.DA nodevice
|
||||||
|
@ -16,7 +15,6 @@ drivertbl1 .DA nodevice
|
||||||
.DA nodevice
|
.DA nodevice
|
||||||
.DA nodevice
|
.DA nodevice
|
||||||
.DA nodevice
|
.DA nodevice
|
||||||
drivertbl2 .DA nodevice
|
|
||||||
.DA nodevice
|
.DA nodevice
|
||||||
.DA nodevice
|
.DA nodevice
|
||||||
.DA nodevice
|
.DA nodevice
|
||||||
|
@ -24,9 +22,11 @@ drivertbl2 .DA nodevice
|
||||||
.DA nodevice
|
.DA nodevice
|
||||||
.DA nodevice
|
.DA nodevice
|
||||||
.DA nodevice
|
.DA nodevice
|
||||||
.DA #0 devnum
|
.DA nodevice
|
||||||
GP.numdevs .DA #$ff count (-1) active devices
|
.DA nodevice
|
||||||
devlist .HS 00000000000000 up to 14 units may be active
|
.DA #0 DEVNUM
|
||||||
|
.DA #$ff DEVCNT : count (-1) active devices
|
||||||
|
.HS 00000000000000 DEVLST : up to 14 units may be active
|
||||||
.HS 00000000000000
|
.HS 00000000000000
|
||||||
.DA #0
|
.DA #0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -50,7 +50,7 @@ GP.FREE1 .EQ $BF58-*
|
||||||
* protected pages = 1, unprotected = 0
|
* protected pages = 1, unprotected = 0
|
||||||
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
memmap .HS C000000000000000
|
.HS C000000000000000 MEMTABL
|
||||||
.HS 0000000000000000
|
.HS 0000000000000000
|
||||||
.HS 0000000000000001
|
.HS 0000000000000001
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
|
|
@ -185,7 +185,8 @@ m128k sta idapple Save MACHID in temp location
|
||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
|
|
||||||
.1 stz $D700,x
|
.1
|
||||||
|
* stz $D700,x
|
||||||
stz $D800,x
|
stz $D800,x
|
||||||
stz $D900,x
|
stz $D900,x
|
||||||
stz $DA00,x
|
stz $DA00,x
|
||||||
|
@ -205,7 +206,7 @@ m128k sta idapple Save MACHID in temp location
|
||||||
sta ZPOutBufPtr+1
|
sta ZPOutBufPtr+1
|
||||||
jsr X.Unpak
|
jsr X.Unpak
|
||||||
|
|
||||||
ldx #XDOS.DATA.LEN
|
ldx #XDOS.DATA.LEN0
|
||||||
|
|
||||||
.3 stz XDOS.DATA-1,x
|
.3 stz XDOS.DATA-1,x
|
||||||
dex
|
dex
|
||||||
|
@ -513,7 +514,7 @@ LDR.SetupCLK stx ZPInBufPtr
|
||||||
LDR.SetupCLK.RTS
|
LDR.SetupCLK.RTS
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LDR.SetupRAM lda GP.numdevs
|
LDR.SetupRAM lda DEVCNT
|
||||||
cmp #13
|
cmp #13
|
||||||
bcs LDR.SetupCLK.RTS
|
bcs LDR.SetupCLK.RTS
|
||||||
|
|
||||||
|
@ -550,10 +551,10 @@ LDR.SetupRAM lda GP.numdevs
|
||||||
lda /RAMDRV
|
lda /RAMDRV
|
||||||
sta DEVPTRS3D2+1
|
sta DEVPTRS3D2+1
|
||||||
|
|
||||||
inc GP.numdevs count (-1) active devices
|
inc DEVCNT count (-1) active devices
|
||||||
ldx GP.numdevs
|
ldx DEVCNT
|
||||||
lda #$BF unit num of /RAM
|
lda #$BF unit num of /RAM
|
||||||
sta devlist,x
|
sta DEVLST,x
|
||||||
|
|
||||||
ldx #LDR.MSG.RAM
|
ldx #LDR.MSG.RAM
|
||||||
jmp LDR.PrintX
|
jmp LDR.PrintX
|
||||||
|
@ -568,7 +569,8 @@ LDR.BlkDevScan stz idxl
|
||||||
lda #7
|
lda #7
|
||||||
sta LDR.SlotIdx
|
sta LDR.SlotIdx
|
||||||
|
|
||||||
.1 jsr LDR.CheckDiskID
|
.1 lda LDR.SlotIdx
|
||||||
|
jsr LDR.CheckDiskID
|
||||||
bcs .8 if no ProDOS device in this slot.
|
bcs .8 if no ProDOS device in this slot.
|
||||||
|
|
||||||
ldy #$ff
|
ldy #$ff
|
||||||
|
@ -610,7 +612,7 @@ LDR.BlkDevScan stz idxl
|
||||||
and #$3 Device count minus 1
|
and #$3 Device count minus 1
|
||||||
inc
|
inc
|
||||||
ldx LDR.SlotIdx
|
ldx LDR.SlotIdx
|
||||||
sta LDR.DevCnt-1,x
|
sta LDR.SlotDevCnt-1,x
|
||||||
tax
|
tax
|
||||||
|
|
||||||
iny $CnFF
|
iny $CnFF
|
||||||
|
@ -631,25 +633,29 @@ LDR.BlkDevScan stz idxl
|
||||||
bne .1
|
bne .1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LDR.AddExtraDevs
|
LDR.AddExtraDevs
|
||||||
|
stz idxl
|
||||||
|
lda #$C7
|
||||||
|
sta idxl+1
|
||||||
|
|
||||||
lda #7
|
lda #7
|
||||||
sta LDR.SlotIdx
|
sta LDR.SlotIdx
|
||||||
|
|
||||||
.1 ldx LDR.SlotIdx
|
.1 ldx LDR.SlotIdx
|
||||||
lda LDR.DevCnt-1,x
|
lda LDR.SlotDevCnt-1,x
|
||||||
cmp #3
|
cmp #3
|
||||||
bcc .8
|
bcc .8
|
||||||
|
|
||||||
ldy LDR.DevType-1,x
|
ldy LDR.SlotDevType-1,x
|
||||||
bne .2
|
bne .2
|
||||||
|
|
||||||
jsr LDR.AddExtraBlkDev
|
jsr LDR.AddExtraBlkDevs
|
||||||
bra .8
|
bra .8
|
||||||
|
|
||||||
.2 jsr LDR.AddExtraSPDevs
|
.2 jsr LDR.AddExtraSPDevs
|
||||||
|
|
||||||
.8 dec LDR.SlotIdx
|
.8 dec LDR.SlotIdx
|
||||||
bne .1
|
bne .1
|
||||||
|
LDR.AddExtraDevs.RTS
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LDR.AddSPDevs jsr LDR.SetDevID setup the devid byte from attributes
|
LDR.AddSPDevs jsr LDR.SetDevID setup the devid byte from attributes
|
||||||
|
@ -658,7 +664,7 @@ LDR.AddSPDevs jsr LDR.SetDevID setup the devid byte from attributes
|
||||||
lda (idxl),y
|
lda (idxl),y
|
||||||
|
|
||||||
sta driveradr
|
sta driveradr
|
||||||
sta pscall+1 modify operand
|
sta .1+1 modify operand
|
||||||
clc
|
clc
|
||||||
adc #$03
|
adc #$03
|
||||||
sta spvect+1
|
sta spvect+1
|
||||||
|
@ -666,7 +672,7 @@ LDR.AddSPDevs jsr LDR.SetDevID setup the devid byte from attributes
|
||||||
lda idxl+1
|
lda idxl+1
|
||||||
sta driveradr+1
|
sta driveradr+1
|
||||||
sta spvect+2
|
sta spvect+2
|
||||||
sta pscall+2 modify operand
|
sta .1+2 modify operand
|
||||||
|
|
||||||
asl convert $Cn to $n0
|
asl convert $Cn to $n0
|
||||||
asl
|
asl
|
||||||
|
@ -683,12 +689,12 @@ LDR.AddSPDevs jsr LDR.SetDevID setup the devid byte from attributes
|
||||||
stz bloknml # of bytes to transfer
|
stz bloknml # of bytes to transfer
|
||||||
stz bloknml+1
|
stz bloknml+1
|
||||||
|
|
||||||
pscall jsr $0000 self modifying code
|
.1 jsr $0000 SELF MODIFIED
|
||||||
|
|
||||||
ldy #$FB
|
ldy #$FB
|
||||||
lda (idxl),y check device id
|
lda (idxl),y check device id
|
||||||
and #$02 SCSI?
|
and #$02 SCSI?
|
||||||
beq .1 no, no need to init Cocoon
|
beq .2 no, no need to init Cocoon
|
||||||
|
|
||||||
sta LDR.SPStatus.U device = 2 for SCSI
|
sta LDR.SPStatus.U device = 2 for SCSI
|
||||||
|
|
||||||
|
@ -696,39 +702,39 @@ pscall jsr $0000 self modifying code
|
||||||
.HS 00
|
.HS 00
|
||||||
.DA LDR.SPStatus.P ignore any errors.
|
.DA LDR.SPStatus.P ignore any errors.
|
||||||
|
|
||||||
.1 stz LDR.SPStatus.U set unit# = 0
|
.2 stz LDR.SPStatus.U set unit# = 0
|
||||||
jsr spvect call to get the device count.
|
jsr spvect call to get the device count.
|
||||||
.HS 00 this is a status call
|
.HS 00 this is a status call
|
||||||
.DA LDR.SPStatus.P
|
.DA LDR.SPStatus.P
|
||||||
|
|
||||||
lda LDR.SPStatus.Buf
|
lda LDR.SPStatus.Buf
|
||||||
beq .8 no devices, so done.
|
beq LDR.AddExtraDevs.RTS no devices, so done.
|
||||||
|
|
||||||
|
sta LDR.DevCnt
|
||||||
|
|
||||||
ldx LDR.SlotIdx
|
ldx LDR.SlotIdx
|
||||||
inc LDR.DevType-1,x set as smartport
|
inc LDR.SlotDevType-1,x set as smartport
|
||||||
|
|
||||||
.2 inc LDR.SPStatus.U
|
.3 inc LDR.SPStatus.U
|
||||||
|
|
||||||
jsr spvect call to get the device status
|
jsr spvect call to get the device status
|
||||||
.HS 00 this is a status call
|
.HS 00 this is a status call
|
||||||
.DA LDR.SPStatus.P
|
.DA LDR.SPStatus.P
|
||||||
bcs .7 no more device
|
bcs .7
|
||||||
|
|
||||||
lda LDR.SPStatus.Buf
|
lda LDR.SPStatus.Buf
|
||||||
bpl .2 not a block device
|
bpl .7 not a block device
|
||||||
|
|
||||||
ldx LDR.SlotIdx
|
ldx LDR.SlotIdx
|
||||||
inc LDR.DevCnt-1,x
|
inc LDR.SlotDevCnt-1,x
|
||||||
bra .2
|
|
||||||
|
|
||||||
.7 ldx LDR.SlotIdx
|
.7 dec LDR.DevCnt
|
||||||
lda LDR.DevCnt-1,x
|
bne .3
|
||||||
beq .8
|
|
||||||
|
|
||||||
cmp #2 add 1 or 2 devs
|
ldx LDR.SlotIdx
|
||||||
jmp LDR.AddBlkDevs
|
lda LDR.SlotDevCnt-1,x
|
||||||
|
beq LDR.AddBlkDevs.RTS
|
||||||
|
|
||||||
.8 rts
|
cmp #2 CC/CS, add 1 or 2 devs
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LDR.AddBlkDevs php how many drives (carry).
|
LDR.AddBlkDevs php how many drives (carry).
|
||||||
lda idxl+1 get index to global device table
|
lda idxl+1 get index to global device table
|
||||||
|
@ -741,9 +747,9 @@ LDR.AddBlkDevs php how many drives (carry).
|
||||||
asl in high nibble.
|
asl in high nibble.
|
||||||
|
|
||||||
ora devid combine with attributes.
|
ora devid combine with attributes.
|
||||||
ldx GP.numdevs
|
ldx DEVCNT
|
||||||
inx put device # into device list.
|
inx put device # into device list.
|
||||||
sta devlist,x
|
sta DEVLST,x
|
||||||
asl now form drive 2 device number, if any.
|
asl now form drive 2 device number, if any.
|
||||||
|
|
||||||
plp restore # of devices in carry.
|
plp restore # of devices in carry.
|
||||||
|
@ -751,29 +757,28 @@ LDR.AddBlkDevs php how many drives (carry).
|
||||||
bpl .1 branch if a 1 drive device (e.g. hard drive)
|
bpl .1 branch if a 1 drive device (e.g. hard drive)
|
||||||
|
|
||||||
inx else presume that 2nd drive is present.
|
inx else presume that 2nd drive is present.
|
||||||
sta devlist,x active device list.
|
sta DEVLST,x active device list.
|
||||||
|
|
||||||
.1 stx GP.numdevs save updated device count.
|
.1 stx DEVCNT save updated device count.
|
||||||
asl shift # of drives back into carry.
|
asl shift # of drives back into carry.
|
||||||
lda driveradr get high address of device driver.
|
lda driveradr get high address of device driver.
|
||||||
sta drivertbl1,y device driver table 1.
|
sta DEVPTRS,y device driver table 1.
|
||||||
bcc .2 branch if single drive.
|
bcc .2 branch if single drive.
|
||||||
sta drivertbl2,y device driver table 2.
|
sta DEVPTRS+16,y device driver table 2.
|
||||||
|
|
||||||
.2 lda driveradr+1
|
.2 lda driveradr+1
|
||||||
sta drivertbl1+1,y
|
sta DEVPTRS+1,y
|
||||||
bcc .3
|
bcc .3
|
||||||
sta drivertbl2+1,y
|
sta DEVPTRS+17,y
|
||||||
|
|
||||||
.3 rts
|
.3
|
||||||
|
LDR.AddBlkDevs.RTS
|
||||||
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LDR.AddExtraBlkDev
|
LDR.AddExtraBlkDevs
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LDR.AddExtraSPDevs
|
LDR.AddExtraSPDevs
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
ldy #$FF get smartport address.
|
ldy #$FF get smartport address.
|
||||||
lda (idxl),y
|
lda (idxl),y
|
||||||
clc
|
clc
|
||||||
|
@ -790,55 +795,51 @@ LDR.AddExtraSPDevs
|
||||||
.DA LDR.SPStatus.P
|
.DA LDR.SPStatus.P
|
||||||
|
|
||||||
lda LDR.SPStatus.Buf # of devices on smartport
|
lda LDR.SPStatus.Buf # of devices on smartport
|
||||||
|
|
||||||
cmp #$03
|
cmp #$03
|
||||||
bcc .8 only 2 devices,skip to next one.
|
bcc .8 only 2 devices,skip to next one.
|
||||||
inc add 1 for comparisons.
|
|
||||||
sta driveradr # of devices + 1.
|
|
||||||
|
|
||||||
* find block devices on this smartport
|
dec
|
||||||
|
dec
|
||||||
|
sta LDR.DevCnt
|
||||||
|
|
||||||
.1 cmp driveradr have we done all units in this slot?
|
lda #3
|
||||||
bcs .8 yes, skip to next slot.
|
sta LDR.SPStatus.U
|
||||||
|
|
||||||
sta LDR.SPStatus.U store the unit#.
|
.1 jsr spvect do status call
|
||||||
jsr spvect do status call
|
|
||||||
.HS 00
|
.HS 00
|
||||||
.DA LDR.SPStatus.P
|
.DA LDR.SPStatus.P
|
||||||
lda LDR.SPStatus.Buf is this a block device?
|
lda LDR.SPStatus.Buf is this a block device?
|
||||||
bpl .2
|
bpl .2
|
||||||
|
|
||||||
|
jsr LDR.MountSPDevs
|
||||||
|
bcs .8
|
||||||
|
|
||||||
|
.2 inc LDR.SPStatus.U
|
||||||
|
dec LDR.DevCnt
|
||||||
|
bne .1
|
||||||
.2 lda LDR.SPStatus.U go check the next unit#
|
|
||||||
inc
|
|
||||||
bra .1
|
|
||||||
|
|
||||||
.8 rts
|
.8 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LDR.FindFree dec Drive 0-1
|
LDR.MountSPDevs ldx #LDR.DEVPTRS.CNT-1
|
||||||
asl
|
|
||||||
asl
|
|
||||||
asl
|
|
||||||
tay
|
|
||||||
|
|
||||||
ldx #$0C
|
.1 ldy LDR.DEVPTRS.IDX,x
|
||||||
|
lda DEVPTRS,y device driver table 1
|
||||||
.1 ldy driveridx,x
|
|
||||||
lda drivertbl1,y device driver table 1
|
|
||||||
cmp #nodevice
|
cmp #nodevice
|
||||||
bne .2
|
bne .2
|
||||||
lda drivertbl1+1,y
|
|
||||||
|
lda DEVPTRS+1,y
|
||||||
cmp /nodevice
|
cmp /nodevice
|
||||||
beq .8
|
beq .3
|
||||||
|
|
||||||
.2 dex
|
.2 dex
|
||||||
bpl .1
|
bpl .1
|
||||||
clc
|
|
||||||
.8 rts ran out of space for devices, exit.
|
sec
|
||||||
*--------------------------------------
|
rts
|
||||||
LDR.MountSPDevs jsr lc1in write enable LC ram bank 1.
|
|
||||||
|
.3 jsr lc1in write enable LC ram bank 1.
|
||||||
|
|
||||||
tya divide index by 2
|
tya divide index by 2
|
||||||
lsr
|
lsr
|
||||||
tax
|
tax
|
||||||
|
@ -854,28 +855,22 @@ LDR.MountSPDevs jsr lc1in write enable LC ram bank 1.
|
||||||
|
|
||||||
lda RROMBNK2 write protect lc ram.
|
lda RROMBNK2 write protect lc ram.
|
||||||
|
|
||||||
inc GP.numdevs
|
inc DEVCNT
|
||||||
ldx GP.numdevs
|
ldx DEVCNT
|
||||||
tya
|
tya
|
||||||
lsr
|
|
||||||
cmp #$08
|
|
||||||
bcc .4 drive 2 mount
|
|
||||||
|
|
||||||
sbc #$08
|
asl convert to DSSS0000
|
||||||
ora #$08
|
|
||||||
|
|
||||||
.4 asl
|
|
||||||
asl
|
|
||||||
asl
|
asl
|
||||||
asl
|
asl
|
||||||
|
|
||||||
ora devid include device attributes
|
ora devid include device attributes
|
||||||
sta devlist,x in the active device list.
|
sta DEVLST,x in the active device list.
|
||||||
|
|
||||||
lda #remap_sp
|
lda #XDOS.SPREMAP
|
||||||
sta drivertbl1,y device driver table 1
|
sta DEVPTRS,y device driver table 1
|
||||||
lda /remap_sp
|
lda /XDOS.SPREMAP
|
||||||
sta drivertbl1+1,y
|
sta DEVPTRS+1,y
|
||||||
|
clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* self modifying jmp = smartport entry address
|
* self modifying jmp = smartport entry address
|
||||||
|
@ -963,27 +958,31 @@ LDR.SPStatus.U .DA #$00 unit number (code for smartport stat)
|
||||||
.DA LDR.SPStatus.Buf
|
.DA LDR.SPStatus.Buf
|
||||||
.DA #00 status code (0 = general status)
|
.DA #00 status code (0 = general status)
|
||||||
|
|
||||||
driveridx .DA #$06
|
LDR.DEVPTRS.CNT .EQ 14
|
||||||
.DA #$1E
|
|
||||||
.DA #$0E
|
LDR.DEVPTRS.IDX .DA #$16 S3D2
|
||||||
.DA #$1C
|
.DA #$06 S3D1
|
||||||
.DA #$0C
|
.DA #$1E S7D2
|
||||||
.DA #$1A
|
.DA #$0E S7D1
|
||||||
.DA #$0A
|
.DA #$1C S6D2
|
||||||
.DA #$14
|
.DA #$0C S6D1
|
||||||
.DA #$04
|
.DA #$1A S5D2
|
||||||
.DA #$12
|
.DA #$0A S5D1
|
||||||
.DA #$02
|
.DA #$14 S2D2
|
||||||
.DA #$18
|
.DA #$04 S2D1
|
||||||
.DA #$08
|
.DA #$12 S1D2
|
||||||
|
.DA #$02 S1D1
|
||||||
|
.DA #$18 S4D2
|
||||||
|
.DA #$08 S4D1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LDR.Print.CX .BS 1
|
LDR.Print.CX .BS 1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LDR.SPStatus.Buf .BS 8 8 bytes for smartport call
|
LDR.SPStatus.Buf .BS 8 8 bytes for smartport call
|
||||||
driveradr .BS 2
|
driveradr .BS 2
|
||||||
LDR.SlotIdx .BS 1
|
LDR.SlotIdx .BS 1
|
||||||
LDR.DevCnt .BS 7
|
LDR.DevCnt .BS 1
|
||||||
LDR.DevType .BS 7
|
LDR.SlotDevCnt .BS 7
|
||||||
|
LDR.SlotDevType .BS 7
|
||||||
LDR.cortland .DA #0 cortland loader flag (1 = Cortland)
|
LDR.cortland .DA #0 cortland loader flag (1 = Cortland)
|
||||||
LDR.BootFlag .DA #0 0 = normal boot, <>0 = return
|
LDR.BootFlag .DA #0 0 = normal boot, <>0 = return
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
|
|
@ -16,27 +16,27 @@ birdbye cld
|
||||||
|
|
||||||
* set up memory bitmap in global page
|
* set up memory bitmap in global page
|
||||||
|
|
||||||
L5D16 stz memmap,x P8 memory bitmap
|
L5D16 stz MEMTABL,x P8 memory bitmap
|
||||||
dex
|
dex
|
||||||
bpl L5D16
|
bpl L5D16
|
||||||
inc memmap+$17 protect global page
|
inc MEMTABL+$17 protect global page
|
||||||
lda #$CF protect zero page, stack and page 1
|
lda #$CF protect zero page, stack and page 1
|
||||||
sta memmap
|
sta MEMTABL
|
||||||
lda #$02
|
lda #$02
|
||||||
sta smparms init set mark parms pcount.
|
sta smparms init set mark parms pcount.
|
||||||
|
|
||||||
* drive selector
|
* drive selector
|
||||||
|
|
||||||
ldx GP.numdevs get device count and
|
ldx DEVCNT get device count and
|
||||||
stx lstpntr store in zero page.
|
stx lstpntr store in zero page.
|
||||||
lda devnum get last slot/drive
|
lda devnum get last slot/drive
|
||||||
bne volname
|
bne volname
|
||||||
|
|
||||||
ds2 ldx lstpntr get device list pointer.
|
ds2 ldx lstpntr get device list pointer.
|
||||||
lda devlist,x get unit number from list.
|
lda DEVLST,x get unit number from list.
|
||||||
cpx #$01 make sure it's real.
|
cpx #$01 make sure it's real.
|
||||||
bcs L5D3F if so, change list pointer.
|
bcs L5D3F if so, change list pointer.
|
||||||
ldx GP.numdevs get device count.
|
ldx DEVCNT get device count.
|
||||||
inx
|
inx
|
||||||
L5D3F dex decrement list pointer and restore.
|
L5D3F dex decrement list pointer and restore.
|
||||||
stx lstpntr
|
stx lstpntr
|
||||||
|
|
|
@ -146,7 +146,7 @@ dmgr lda unitnum get device # and
|
||||||
lsr
|
lsr
|
||||||
lsr
|
lsr
|
||||||
tax
|
tax
|
||||||
gocmd jmp (drivertbl1,x) goto driver (or error if no driver)
|
gocmd jmp (DEVPTRS,x) goto driver (or error if no driver)
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* ProDOS interrupt manager
|
* ProDOS interrupt manager
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
|
|
@ -621,7 +621,7 @@ L39D4 lda vnptr make path ptr same as volume ptr
|
||||||
jsr mvdevnums copy all device #'s to be examined.
|
jsr mvdevnums copy all device #'s to be examined.
|
||||||
lda devnum log current device 1st before searching
|
lda devnum log current device 1st before searching
|
||||||
bne L39F1 others.
|
bne L39F1 others.
|
||||||
L39E2 ldx GP.numdevs scan look list for devices we need
|
L39E2 ldx DEVCNT scan look list for devices we need
|
||||||
L39E5 lda loklst,x to search for the requested volume.
|
L39E5 lda loklst,x to search for the requested volume.
|
||||||
bne L39F4 branch if we've a device to look at.
|
bne L39F4 branch if we've a device to look at.
|
||||||
dex
|
dex
|
||||||
|
@ -630,7 +630,7 @@ L39ED lda #MLI.E.VNOTFND no mounted volume
|
||||||
sec error
|
sec error
|
||||||
L39F0 rts
|
L39F0 rts
|
||||||
|
|
||||||
L39F1 ldx GP.numdevs now remove the device from the list
|
L39F1 ldx DEVCNT now remove the device from the list
|
||||||
L39F4 cmp loklst,x of prospective devices.
|
L39F4 cmp loklst,x of prospective devices.
|
||||||
beq L39FE branch if match.
|
beq L39FE branch if match.
|
||||||
dex look until found.
|
dex look until found.
|
||||||
|
@ -654,13 +654,13 @@ L3A16 lda #$02 go read root dir into gbuf
|
||||||
jsr cmppnam is this the volume ?
|
jsr cmppnam is this the volume ?
|
||||||
bcs L39E2 if not
|
bcs L39E2 if not
|
||||||
L3A29 rts
|
L3A29 rts
|
||||||
mvdevnums ldx GP.numdevs copy all dev #'s to be checked.
|
mvdevnums ldx DEVCNT copy all dev #'s to be checked.
|
||||||
L3A2D lda devlist,x active device list.
|
L3A2D lda DEVLST,x active device list.
|
||||||
and #$F0 strip device type info.
|
and #$F0 strip device type info.
|
||||||
sta loklst,x copy them to a temp workspace
|
sta loklst,x copy them to a temp workspace
|
||||||
dex
|
dex
|
||||||
bpl L3A2D
|
bpl L3A2D
|
||||||
ldx GP.numdevs
|
ldx DEVCNT
|
||||||
rts
|
rts
|
||||||
fnddvcb lda #$00 look for vcb with this device#
|
fnddvcb lda #$00 look for vcb with this device#
|
||||||
ldy #$FF
|
ldy #$FF
|
||||||
|
|
|
@ -362,7 +362,7 @@ alcbufr1 lda (A3L),y this buffer must be on a page boundary.
|
||||||
inx
|
inx
|
||||||
L4DED dex test for conflicts.
|
L4DED dex test for conflicts.
|
||||||
jsr cmembit test for free buffer space
|
jsr cmembit test for free buffer space
|
||||||
and memmap,y P8 memory bitmap
|
and MEMTABL,y P8 memory bitmap
|
||||||
bne L4E1E report memory conflict, if any.
|
bne L4E1E report memory conflict, if any.
|
||||||
cpx datptr+1 test all 4 pages.
|
cpx datptr+1 test all 4 pages.
|
||||||
bne L4DED
|
bne L4DED
|
||||||
|
@ -372,8 +372,8 @@ L4DED dex test for conflicts.
|
||||||
inx
|
inx
|
||||||
L4DFE dex set proper bits to 1
|
L4DFE dex set proper bits to 1
|
||||||
jsr cmembit
|
jsr cmembit
|
||||||
ora memmap,y to mark it's allocation.
|
ora MEMTABL,y to mark it's allocation.
|
||||||
sta memmap,y
|
sta MEMTABL,y
|
||||||
cpx datptr+1 set all 4 pages
|
cpx datptr+1 set all 4 pages
|
||||||
bne L4DFE
|
bne L4DFE
|
||||||
ldy fcbptr calculate buffer number
|
ldy fcbptr calculate buffer number
|
||||||
|
@ -409,8 +409,8 @@ freebuf ldx bufaddrh get hi buffer address
|
||||||
L4E43 dex drop to next lower page.
|
L4E43 dex drop to next lower page.
|
||||||
jsr cmembit get bit and position to memtable of
|
jsr cmembit get bit and position to memtable of
|
||||||
eor #$FF this page. invert mask.
|
eor #$FF this page. invert mask.
|
||||||
and memmap,y mark address as free space.
|
and MEMTABL,y mark address as free space.
|
||||||
sta memmap,y
|
sta MEMTABL,y
|
||||||
cpx bufaddrh all pages freed ?
|
cpx bufaddrh all pages freed ?
|
||||||
bne L4E43 no.
|
bne L4E43 no.
|
||||||
L4E54 clc no error.
|
L4E54 clc no error.
|
||||||
|
@ -450,7 +450,7 @@ L4E76 clc
|
||||||
inx loop thru all affected pages.
|
inx loop thru all affected pages.
|
||||||
vldbuf1 dex check next lower page.
|
vldbuf1 dex check next lower page.
|
||||||
jsr cmembit
|
jsr cmembit
|
||||||
and memmap,y if 0 then no conflict.
|
and MEMTABL,y if 0 then no conflict.
|
||||||
bne L4E1E branch if conflict.
|
bne L4E1E branch if conflict.
|
||||||
cpx usrbuf+1 was that the last (lowest) page ?
|
cpx usrbuf+1 was that the last (lowest) page ?
|
||||||
bne vldbuf1 if not.
|
bne vldbuf1 if not.
|
||||||
|
@ -486,11 +486,10 @@ L4EB8 lda (usrbuf),y move all 4 pages of the buffer to
|
||||||
bpl L4EB8
|
bpl L4EB8
|
||||||
clc no errors
|
clc no errors
|
||||||
L4EC7 rts
|
L4EC7 rts
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
* move 3 pages of dispatcher from 'displc2' to 'dispadr'
|
* move 3 pages of dispatcher from 'displc2' to 'dispadr'
|
||||||
* this move routine must be resident above $E000 at all times
|
* this move routine must be resident above $E000 at all times
|
||||||
|
*--------------------------------------
|
||||||
calldisp lda RRAMWRAMBNK2 read/write RAM bank 2
|
calldisp lda RRAMWRAMBNK2 read/write RAM bank 2
|
||||||
lda RRAMWRAMBNK2
|
lda RRAMWRAMBNK2
|
||||||
|
|
||||||
|
@ -527,14 +526,11 @@ calldisp lda RRAMWRAMBNK2 read/write RAM bank 2
|
||||||
sta pwredup power up byte
|
sta pwredup power up byte
|
||||||
|
|
||||||
jmp $1000
|
jmp $1000
|
||||||
|
*--------------------------------------
|
||||||
* translate a prodos call into a smartport call
|
XDOS.SPREMAP ldx #$03 assume 3 parameters.
|
||||||
* to access unseen smartport devices
|
|
||||||
|
|
||||||
remap_sp ldx #$03 assume 3 parameters.
|
|
||||||
lda A4L command number
|
lda A4L command number
|
||||||
sta cmdnum
|
sta cmdnum
|
||||||
bne L4F1B taken if not status call
|
bne .1 taken if not status call
|
||||||
|
|
||||||
ldy #spstatlist set up memory for the status list buffer
|
ldy #spstatlist set up memory for the status list buffer
|
||||||
sty buf fake up the prodos parameters
|
sty buf fake up the prodos parameters
|
||||||
|
@ -542,55 +538,66 @@ remap_sp ldx #$03 assume 3 parameters.
|
||||||
sty buf+1
|
sty buf+1
|
||||||
stz bloknml set statcode = 0 for simple status call
|
stz bloknml set statcode = 0 for simple status call
|
||||||
|
|
||||||
L4F1B cmp #$03 format command ?
|
.1 cmp #$03 format command ?
|
||||||
bne L4F21 no.
|
bne .2 no.
|
||||||
|
|
||||||
ldx #$01 format has only 1 parameter.
|
ldx #$01 format has only 1 parameter.
|
||||||
L4F21 stx statparms set # of parms.
|
|
||||||
lda unitnum
|
.2 stx statparms set # of parms.
|
||||||
|
|
||||||
|
lda unitnum DSSS0000
|
||||||
lsr turn unit number into an index
|
lsr turn unit number into an index
|
||||||
lsr
|
lsr
|
||||||
lsr
|
lsr
|
||||||
lsr
|
lsr
|
||||||
tax
|
tax range = 1-15
|
||||||
|
|
||||||
lda spunit-1,x get the smartport unit number and
|
lda spunit-1,x get the smartport unit number and
|
||||||
sta sp_unitnum store into smartport parm list.
|
sta sp_unitnum store into smartport parm list.
|
||||||
lda spvectlo-1,x
|
lda spvectlo-1,x
|
||||||
sta sp_vector+1 copy smartport entry address
|
sta sp_vector+1 copy smartport entry address
|
||||||
lda spvecthi-1,x
|
lda spvecthi-1,x
|
||||||
sta sp_vector+2
|
sta sp_vector+2
|
||||||
|
|
||||||
ldx #$04 copy buffer pointer and block #
|
ldx #$04 copy buffer pointer and block #
|
||||||
L4F3F lda buf-1,x from prodos parameters
|
|
||||||
|
.3 lda buf-1,x from prodos parameters
|
||||||
sta sp_bufptr-1,x to smartport parameter block
|
sta sp_bufptr-1,x to smartport parameter block
|
||||||
dex
|
dex
|
||||||
bne L4F3F
|
bne .3
|
||||||
|
|
||||||
sp_vector jsr $0000 smartport call (entry address gets modified)
|
sp_vector jsr $0000 smartport call (entry address gets modified)
|
||||||
cmdnum .HS 00 command #
|
cmdnum .HS 00 command #
|
||||||
.DA statparms
|
.DA statparms
|
||||||
bcs L4F6E
|
bcs .9
|
||||||
|
|
||||||
ldx cmdnum status call ?
|
ldx cmdnum status call ?
|
||||||
bne L4F6E no...
|
bne .9 no...
|
||||||
|
|
||||||
ldx spstatlist+1 else get the block count
|
ldx spstatlist+1 else get the block count
|
||||||
ldy spstatlist+2
|
ldy spstatlist+2
|
||||||
lda spstatlist get the returned status.
|
lda spstatlist get the returned status.
|
||||||
bit #$10 is there a disk present ?
|
bit #$10 is there a disk present ?
|
||||||
bne L4F65 yes, check for write protected.
|
beq .8
|
||||||
lda #$2F return offline error.
|
|
||||||
bra L4F6D
|
|
||||||
L4F65 and #$44 mask all but write allowed and write
|
|
||||||
eor #$40 protected bits. if allowed and not
|
|
||||||
beq L4F6E protected, exit with carry clear
|
|
||||||
lda #$2B else return write protected error.
|
|
||||||
L4F6D sec
|
|
||||||
L4F6E rts
|
|
||||||
|
|
||||||
|
and #$44 mask all but write allowed and write
|
||||||
|
eor #$40 protected bits. if allowed and not
|
||||||
|
* clc
|
||||||
|
beq .9 protected, exit with carry clear
|
||||||
|
|
||||||
|
lda #MLI.E.WRTPROT else return write protected error.
|
||||||
|
.HS 2C BIT ABS
|
||||||
|
.8 lda #MLI.E.OFFLINE return offline error.
|
||||||
|
sec
|
||||||
|
.9 rts
|
||||||
|
*--------------------------------------
|
||||||
statparms .HS 03 # of parms (always 3 except format)
|
statparms .HS 03 # of parms (always 3 except format)
|
||||||
sp_unitnum .HS 00 unit number
|
sp_unitnum .HS 00 unit number
|
||||||
sp_bufptr .HS 0000 data buffer
|
sp_bufptr .HS 0000 data buffer
|
||||||
.HS 000000 block number (3 bytes)
|
.HS 000000 block number (3 bytes)
|
||||||
|
*--------------------------------------
|
||||||
* data tables
|
* data tables
|
||||||
|
*--------------------------------------
|
||||||
scnums .HS D3000000 table of valid mli command numbers.
|
scnums .HS D3000000 table of valid mli command numbers.
|
||||||
.HS 40410000808182
|
.HS 40410000808182
|
||||||
.HS 65C0C1C2C3C4C5C6
|
.HS 65C0C1C2C3C4C5C6
|
||||||
|
@ -601,9 +608,6 @@ pcntbl .HS 02FFFFFF parameter counts for the calls
|
||||||
.HS 04070102070A0201
|
.HS 04070102070A0201
|
||||||
.HS 0103030404010102
|
.HS 0103030404010102
|
||||||
.HS 02FF020202
|
.HS 02FF020202
|
||||||
|
|
||||||
* command table
|
|
||||||
|
|
||||||
cmdtable .DA create
|
cmdtable .DA create
|
||||||
.DA destroy
|
.DA destroy
|
||||||
.DA rename
|
.DA rename
|
||||||
|
@ -646,7 +650,7 @@ inftabl .HS 1E101F2080939421
|
||||||
deathmsg .HS 20
|
deathmsg .HS 20
|
||||||
.AS -"RESTART SYSTEM-$01"
|
.AS -"RESTART SYSTEM-$01"
|
||||||
.HS 20
|
.HS 20
|
||||||
|
*--------------------------------------
|
||||||
XDOS.DATA .DUMMY
|
XDOS.DATA .DUMMY
|
||||||
|
|
||||||
* note: this area is accessed by code that depends on the order of these
|
* note: this area is accessed by code that depends on the order of these
|
||||||
|
@ -669,8 +673,9 @@ d_dev .HS 00 device number of this directory entry
|
||||||
d_head .HS 0000 address of <sub> directory header
|
d_head .HS 0000 address of <sub> directory header
|
||||||
d_entblk .HS 0000 address of block which contains entry
|
d_entblk .HS 0000 address of block which contains entry
|
||||||
d_entnum .HS 00 entry number within block
|
d_entnum .HS 00 entry number within block
|
||||||
d_stor .HS 0000000000000000 file name
|
|
||||||
.HS 0000000000000000
|
d_stor .BS 16 file name
|
||||||
|
|
||||||
d_filid .HS 00 user's identification byte
|
d_filid .HS 00 user's identification byte
|
||||||
d_frst .HS 0000 first block of file
|
d_frst .HS 0000 first block of file
|
||||||
d_usage .HS 0000 # of blocks allocated to this file
|
d_usage .HS 0000 # of blocks allocated to this file
|
||||||
|
@ -757,24 +762,36 @@ bufaddrl .HS 00
|
||||||
bufaddrh .HS 00
|
bufaddrh .HS 00
|
||||||
delflag .HS 00 used by 'detree' to know if called from delete (destroy).
|
delflag .HS 00 used by 'detree' to know if called from delete (destroy).
|
||||||
|
|
||||||
|
pathbuf .BS 64+2
|
||||||
|
|
||||||
|
.LIST ON
|
||||||
|
XDOS.DATA.LEN0 .EQ *-XDOS.DATA
|
||||||
|
.LIST OFF
|
||||||
|
|
||||||
* variables used by mli for smartport interface
|
* variables used by mli for smartport interface
|
||||||
|
|
||||||
spstatlist .HS 00000000
|
spstatlist .HS 00000000
|
||||||
spunit .HS 0000000000000000
|
|
||||||
.HS 0000000000000000
|
|
||||||
|
|
||||||
spvectlo .HS 0000000000000000 storage for low byte of smartport entry.
|
spunit .HS 00000000000000 14+1 for S0D2
|
||||||
.HS 00000000000000
|
.HS 00
|
||||||
spvecthi .HS 0000000000000000 storage for high byte of smartport entry.
|
|
||||||
.HS 00000000000000
|
.HS 00000000000000
|
||||||
|
|
||||||
|
spvectlo .HS 00000000000000 storage for low byte of smartport entry.
|
||||||
|
.HS 00
|
||||||
|
.HS 00000000000000
|
||||||
|
|
||||||
|
spvecthi .HS 00000000000000 storage for high byte of smartport entry.
|
||||||
|
.HS 00
|
||||||
|
.HS 00000000000000
|
||||||
|
|
||||||
|
.LIST ON
|
||||||
XDOS.DATA.LEN .EQ *-XDOS.DATA
|
XDOS.DATA.LEN .EQ *-XDOS.DATA
|
||||||
|
.LIST OFF
|
||||||
.ED
|
.ED
|
||||||
|
|
||||||
* zero fill to page boundary - 3 ($FEFD). so that cortland flag stays within page boundary.
|
* zero fill to page boundary - 3 ($FEFD). so that cortland flag stays within page boundary.
|
||||||
.LIST ON
|
.LIST ON
|
||||||
XDOS.FREE .EQ $FEFD-*-XDOS.DATA.LEN (ProDOS 2.0.3 = $0C)
|
XDOS.FREE .EQ $FEFD-*-XDOS.DATA.LEN (2.0.3 = $0C)
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
cortdisp .EQ $FEFD
|
cortdisp .EQ $FEFD
|
||||||
cortflag .EQ $FEFF cortland flag. 1 = Cortland system (must stay within page boundary)
|
cortflag .EQ $FEFF cortland flag. 1 = Cortland system (must stay within page boundary)
|
||||||
|
|
|
@ -954,9 +954,12 @@ docheck lda A4L command #.
|
||||||
rts end of obj xrw_0
|
rts end of obj xrw_0
|
||||||
|
|
||||||
.LIST ON
|
.LIST ON
|
||||||
XRW.FREE .EQ $D700-* (ProDOS 2.0.3 = $02)
|
XRW.FREE1 .EQ $D742-* (2.0.3 = $02)
|
||||||
|
.LIST OFF
|
||||||
|
|
||||||
|
.LIST ON
|
||||||
|
XRW.FREE2 .EQ $d800-$D742-125
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
.BS XRW.FREE
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
XRW.LEN .EQ *-XRW.START
|
XRW.LEN .EQ *-XRW.START
|
||||||
MAN
|
MAN
|
||||||
|
|
|
@ -140,12 +140,9 @@ q6h .EQ $C08D disk port
|
||||||
q7l .EQ $C08E disk port
|
q7l .EQ $C08E disk port
|
||||||
q7h .EQ $C08F disk port
|
q7h .EQ $C08F disk port
|
||||||
|
|
||||||
auxmove .EQ $C311 move (3C)-(3E) to (42)
|
|
||||||
xfer .EQ $C314
|
xfer .EQ $C314
|
||||||
|
|
||||||
rwts .EQ $D000 disk ii driver in bank 1
|
rwts .EQ $D000 disk ii driver in bank 1
|
||||||
pathbuf .EQ $D700 pathname buffer
|
|
||||||
tclk_in .EQ $D742 clock driver in bank 2
|
|
||||||
fcbbuf .EQ $D800 fcb buffer
|
fcbbuf .EQ $D800 fcb buffer
|
||||||
vcbbuf .EQ $D900 vcb buffer
|
vcbbuf .EQ $D900 vcb buffer
|
||||||
bmbuf .EQ $DA00 512 byte bitmap buffer
|
bmbuf .EQ $DA00 512 byte bitmap buffer
|
||||||
|
|
Loading…
Reference in New Issue
Block a user