mirror of https://github.com/A2osX/A2osX.git
Kernel 0.93+ ProDOS 2.0.3 src
This commit is contained in:
parent
230fed8d88
commit
e2d53a4911
Binary file not shown.
|
@ -33,7 +33,7 @@ resetv .EQ $FA62 monitor reset entry
|
|||
REGDSP .EQ $FAD7 DISPLAY WORKING REGISTERS
|
||||
PREAD .EQ $FB1E READ GAME PADDLE X
|
||||
INIT .EQ $FB2F INITIALIZE TEXT SCREEN
|
||||
SETTXT .EQ $FB93 SET UP TEXT SCREEN (NOT 2E!)
|
||||
SETTXT .EQ $FB39 SET UP TEXT SCREEN (NOT 2E!)
|
||||
SETGR .EQ $FB40 SET UP GRAPHICS SCREEN
|
||||
SETWND .EQ $FB4B SET NORMAL TEXT WINDOW
|
||||
TABV .EQ $FB5B
|
||||
|
@ -41,7 +41,7 @@ SETPWRC .EQ $FB6F
|
|||
version .EQ $FBB3 monitor ROM id byte
|
||||
zidbyte .EQ $FBC0 monitor ROM id byte
|
||||
BASCALC .EQ $FBC1 CALCULATE TEXT BASE ADDRESS (NOT 2E!}
|
||||
BELL1 .EQ $FBD9 BEEP SPEAKER IF CTRL-G
|
||||
BELL1 .EQ $FBDD BEEP SPEAKER IF CTRL-G
|
||||
BELL2 .EQ $FBE4 BEEP SPEAKER ONCE
|
||||
ADVANCE .EQ $FBF4 TEXT CURSOR ONE TO RIGHT
|
||||
VIDOUT .EQ $FBFD OUTPUT ASCII TO SCREEN ONLY
|
||||
|
|
|
@ -17,7 +17,7 @@ BASH .EQ $29 TEXT BASE HIGH
|
|||
BEND .EQ $2C LORES RIGHT END H LINE
|
||||
VBOT .EQ $2D LORES BOTTOM OF V LINE
|
||||
COLOR .EQ $30 LORES COLOR
|
||||
INVFLG .EQ $31 NORMAL/INVERSE /FLASH (FF,7F,3F)
|
||||
INVFLG .EQ $32 NORMAL/INVERSE /FLASH (FF,7F,3F)
|
||||
PROMPT .EQ $33 HOLDS PROMPT SYMBOL
|
||||
CSWL .EQ $36 OUTPUT CHARACTER HOOK LOW
|
||||
CSWH .EQ $37 OUTPUT CHARACTER HOOK HIGH
|
||||
|
|
|
@ -3,64 +3,64 @@ NEW
|
|||
* object code = cclock_0
|
||||
* Cortland clock driver
|
||||
* $2F80-$2FFC moved to $D742
|
||||
|
||||
ofsC .EQ *-tclk_in offset to Cortland clock org
|
||||
*--------------------------------------
|
||||
ofsC .EQ *-tclk_in offset to Cortland clock org
|
||||
|
||||
cclock_0
|
||||
>SHORTMX 8 bit mode.
|
||||
lda statereg state register.
|
||||
sta savestate save for restore after tool call.
|
||||
and #$CF clear the read/write aux memory bits.
|
||||
sta statereg make it real
|
||||
clc set e = 0 to set native mode
|
||||
>SHORTMX 8 bit mode.
|
||||
lda statereg state register.
|
||||
sta savestate save for restore after tool call.
|
||||
and #$CF clear the read/write aux memory bits.
|
||||
sta statereg make it real
|
||||
clc set e = 0 to set native mode
|
||||
xce
|
||||
>LONGMX 16 bit mode.
|
||||
lda ##$0000 zero out result space.
|
||||
pha push 4 words for hex time result
|
||||
>LONGMX 16 bit mode.
|
||||
lda ##$0000 zero out result space.
|
||||
pha push 4 words for hex time result
|
||||
pha
|
||||
pha
|
||||
pha
|
||||
>IIGS ReadTimeHex
|
||||
>SHORTM back to 8 bit to get results from stack
|
||||
lda savestate restore state register
|
||||
>SHORTM back to 8 bit to get results from stack
|
||||
lda savestate restore state register
|
||||
sta statereg
|
||||
pla pull off seconds and ignore
|
||||
pla pull off seconds and ignore
|
||||
pla
|
||||
sta p8time minutes
|
||||
sta p8time minutes
|
||||
pla
|
||||
sta p8time+1 hours
|
||||
pla year
|
||||
H2FB1 cmp #100 out of range?
|
||||
bcc H2FB9 no, go ahead and store
|
||||
sbc #$64 else put back in range.
|
||||
bra H2FB1 try again
|
||||
H2FB9 sta p8date+1 year
|
||||
sta p8time+1 hours
|
||||
pla year
|
||||
H2FB1 cmp #100 out of range?
|
||||
bcc H2FB9 no, go ahead and store
|
||||
sbc #$64 else put back in range.
|
||||
bra H2FB1 try again
|
||||
H2FB9 sta p8date+1 year
|
||||
pla
|
||||
inc increment day for Prodos 8 format.
|
||||
sta p8date day
|
||||
pla month
|
||||
inc increment month for Prodos 8 format.
|
||||
asl shift month as it sits in between
|
||||
asl the year and day values.
|
||||
inc increment day for Prodos 8 format.
|
||||
sta p8date day
|
||||
pla month
|
||||
inc increment month for Prodos 8 format.
|
||||
asl shift month as it sits in between
|
||||
asl the year and day values.
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
ora p8date put all but the top bit of month
|
||||
sta p8date value in the day byte.
|
||||
rol p8date+1 put hi bit of month in low bit of year
|
||||
pla pull of unused byte
|
||||
pla pull off day of week. stack now clean.
|
||||
sec go back to emulation mode
|
||||
xce to continue with Prodos 8
|
||||
ora p8date put all but the top bit of month
|
||||
sta p8date value in the day byte.
|
||||
rol p8date+1 put hi bit of month in low bit of year
|
||||
pla pull of unused byte
|
||||
pla pull off day of week. stack now clean.
|
||||
sec go back to emulation mode
|
||||
xce to continue with Prodos 8
|
||||
rts
|
||||
savestate .EQ *-ofsC
|
||||
.HS 00 state of the state register
|
||||
.HS 00 state of the state register
|
||||
.AS "JIMJAYKERRY&MIKE"
|
||||
.HS 0000000000000000 pad 0's until length
|
||||
.HS 0000000000000000 of driver = 125 bytes.
|
||||
.HS 0000000000000000 of driver = 125 bytes.
|
||||
.HS 000000000000
|
||||
cclk_end .EQ * end of obj cclock_0.
|
||||
.HS 000000 pad to page boundary
|
||||
cclk_end .EQ * end of obj cclock_0.
|
||||
.HS 000000 pad to page boundary
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE USR/SRC/PRODOS.203/PRODOS.S.CCLK
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,21 +3,21 @@ NEW
|
|||
* object code = mli_1
|
||||
* global page
|
||||
|
||||
ofsG .EQ $2E00-MLI offset to global org
|
||||
.BS $2E00-*
|
||||
H2E00 jmp mlient1 $2E00-2EFF moved to $BF00
|
||||
ofsG .EQ $2E00-MLI offset to global org
|
||||
.BS $2E00-*
|
||||
H2E00 jmp mlient1 $2E00-2EFF moved to $BF00
|
||||
jspare .EQ *-ofsG
|
||||
jmp jspare will be changed to point to dispatcher.
|
||||
clockv .EQ *-ofsG P8 clock vector
|
||||
rts changed to jmp ($4C) if clock present.
|
||||
.DA tclk_in clock routine entry address.
|
||||
p8errv .EQ *-ofsG error reporting hook.
|
||||
jmp jspare will be changed to point to dispatcher.
|
||||
clockv .EQ *-ofsG P8 clock vector
|
||||
rts changed to jmp ($4C) if clock present.
|
||||
.DA tclk_in clock routine entry address.
|
||||
p8errv .EQ *-ofsG error reporting hook.
|
||||
jmp syserr1
|
||||
sysdeath .EQ *-ofsG
|
||||
jmp sysdeath1 system failure hook.
|
||||
p8error .EQ *-ofsG P8 error code
|
||||
jmp sysdeath1 system failure hook.
|
||||
p8error .EQ *-ofsG P8 error code
|
||||
.DA #0
|
||||
drivertbl1 .EQ *-ofsG device driver table 1
|
||||
drivertbl1 .EQ *-ofsG device driver table 1
|
||||
.DA nodevice
|
||||
.DA nodevice
|
||||
.DA nodevice
|
||||
|
@ -26,7 +26,7 @@ drivertbl1 .EQ *-ofsG device driver table 1
|
|||
.DA nodevice
|
||||
.DA nodevice
|
||||
.DA nodevice
|
||||
drivertbl2 .EQ *-ofsG device driver table 2
|
||||
drivertbl2 .EQ *-ofsG device driver table 2
|
||||
.DA nodevice
|
||||
.DA nodevice
|
||||
.DA nodevice
|
||||
|
@ -35,12 +35,12 @@ drivertbl2 .EQ *-ofsG device driver table 2
|
|||
.DA nodevice
|
||||
.DA nodevice
|
||||
.DA nodevice
|
||||
*devnum .EQ *-ofsG most recent accessed device
|
||||
*devnum .EQ *-ofsG most recent accessed device
|
||||
.DA #0
|
||||
numdevs .EQ *-ofsG count (-1) active devices
|
||||
numdevs .EQ *-ofsG count (-1) active devices
|
||||
.DA #$ff
|
||||
devlist .EQ *-ofsG active device list
|
||||
.HS 00000000000000 up to 14 units may be active
|
||||
devlist .EQ *-ofsG active device list
|
||||
.HS 00000000000000 up to 14 units may be active
|
||||
.HS 00000000000000
|
||||
.DA #0
|
||||
|
||||
|
@ -49,9 +49,9 @@ mlient1 .EQ *-ofsG
|
|||
php
|
||||
sei
|
||||
jmp mlicont
|
||||
aftirq .EQ *-ofsG irq returns here.
|
||||
sta RRAMWRAMBNK1 read/write RAM bank 1
|
||||
jmp fix45 restore $45 after interrupt in LC
|
||||
aftirq .EQ *-ofsG irq returns here.
|
||||
sta RRAMWRAMBNK1 read/write RAM bank 1
|
||||
jmp fix45 restore $45 after interrupt in LC
|
||||
oldacc .EQ *-ofsG
|
||||
.DA #0
|
||||
afbank .EQ *-ofsG
|
||||
|
@ -60,7 +60,7 @@ afbank .EQ *-ofsG
|
|||
* memory map of lower 48k. each bit represents 1 page.
|
||||
* protected pages = 1, unprotected = 0
|
||||
|
||||
memmap .EQ *-ofsG P8 memory bitmap
|
||||
memmap .EQ *-ofsG P8 memory bitmap
|
||||
.HS C000000000000000
|
||||
.HS 0000000000000000
|
||||
.HS 0000000000000001
|
||||
|
@ -69,89 +69,89 @@ memmap .EQ *-ofsG P8 memory bitmap
|
|||
* these can only be changed thru the mli call setbuf.
|
||||
|
||||
buftbl .EQ *-ofsG
|
||||
.HS 0000 file #1
|
||||
.HS 0000 file #2
|
||||
.HS 0000 file #3
|
||||
.HS 0000 file #4
|
||||
.HS 0000 file #5
|
||||
.HS 0000 file #6
|
||||
.HS 0000 file #7
|
||||
.HS 0000 file #8
|
||||
.HS 0000 file #1
|
||||
.HS 0000 file #2
|
||||
.HS 0000 file #3
|
||||
.HS 0000 file #4
|
||||
.HS 0000 file #5
|
||||
.HS 0000 file #6
|
||||
.HS 0000 file #7
|
||||
.HS 0000 file #8
|
||||
|
||||
* table of interrupt vectors. these can only be changed
|
||||
* by the mli call allocate_interrupt. values of the registers
|
||||
* at the time of the most recent interrupt are stored here along
|
||||
* with the address interrupted.
|
||||
|
||||
inttbl .EQ *-ofsG interrupt table
|
||||
.HS 0000 int #1
|
||||
.HS 0000 int #2
|
||||
.HS 0000 int #3
|
||||
.HS 0000 int #4
|
||||
p8areg .EQ *-ofsG A register savearea
|
||||
inttbl .EQ *-ofsG interrupt table
|
||||
.HS 0000 int #1
|
||||
.HS 0000 int #2
|
||||
.HS 0000 int #3
|
||||
.HS 0000 int #4
|
||||
p8areg .EQ *-ofsG A register savearea
|
||||
.DA #0
|
||||
p8xreg .EQ *-ofsG X register savearea
|
||||
p8xreg .EQ *-ofsG X register savearea
|
||||
.DA #0
|
||||
p8yreg .EQ *-ofsG Y register savearea
|
||||
p8yreg .EQ *-ofsG Y register savearea
|
||||
.DA #0
|
||||
p8sreg .EQ *-ofsG S register savearea
|
||||
p8sreg .EQ *-ofsG S register savearea
|
||||
.DA #0
|
||||
p8preg .EQ *-ofsG P register savearea
|
||||
p8preg .EQ *-ofsG P register savearea
|
||||
.DA #0
|
||||
bankid .EQ *-ofsG bank ID byte (ROM/RAM)
|
||||
bankid .EQ *-ofsG bank ID byte (ROM/RAM)
|
||||
.DA #1
|
||||
intadr .EQ *-ofsG interrupt return address
|
||||
intadr .EQ *-ofsG interrupt return address
|
||||
.HS 0000
|
||||
p8date .EQ *-ofsG bits 15-9=yr, 8-5=mo, 4-0=day
|
||||
p8date .EQ *-ofsG bits 15-9=yr, 8-5=mo, 4-0=day
|
||||
.HS 0000
|
||||
p8time .EQ *-ofsG bits 12-8=hr, 5-0=min, low-hi format
|
||||
p8time .EQ *-ofsG bits 12-8=hr, 5-0=min, low-hi format
|
||||
.HS 0000
|
||||
flevel .EQ *-ofsG current file level
|
||||
flevel .EQ *-ofsG current file level
|
||||
.DA #0
|
||||
bubit .EQ *-ofsG backup bit disable, setfileinfo only
|
||||
bubit .EQ *-ofsG backup bit disable, setfileinfo only
|
||||
.DA #0
|
||||
spare1 .EQ *-ofsG used to save acc
|
||||
spare1 .EQ *-ofsG used to save acc
|
||||
.DA #0
|
||||
newpfxptr .EQ *-ofsG appletalk alternate prefix ptr
|
||||
newpfxptr .EQ *-ofsG appletalk alternate prefix ptr
|
||||
.DA #0
|
||||
*machid .EQ *-ofsG machine ID byte
|
||||
*machid .EQ *-ofsG machine ID byte
|
||||
.DA #0
|
||||
rommap .EQ *-ofsG slot ROM bit map
|
||||
rommap .EQ *-ofsG slot ROM bit map
|
||||
.DA #0
|
||||
preflag .EQ *-ofsG prefix active flag
|
||||
preflag .EQ *-ofsG prefix active flag
|
||||
.DA #0
|
||||
mliact .EQ *-ofsG MLI active flag
|
||||
mliact .EQ *-ofsG MLI active flag
|
||||
.DA #0
|
||||
mliretn .EQ *-ofsG last MLI call return address
|
||||
mliretn .EQ *-ofsG last MLI call return address
|
||||
.DA 0
|
||||
mlix .EQ *-ofsG MLI X register savearea
|
||||
mlix .EQ *-ofsG MLI X register savearea
|
||||
.DA #0
|
||||
mliy .EQ *-ofsG MLI Y register savearea
|
||||
mliy .EQ *-ofsG MLI Y register savearea
|
||||
.DA #0
|
||||
|
||||
* language card bank switching routines which must reside at $BFA0 because
|
||||
* workstation software patches this area
|
||||
|
||||
HBFA0 .EQ *-ofsG
|
||||
GP.HBFA0 eor $E000 test for rom enable
|
||||
beq .1 taken if ram enabled
|
||||
GP.HBFA0 eor $E000 test for rom enable
|
||||
beq .1 taken if ram enabled
|
||||
sta RROMBNK2 read ROM
|
||||
bne .2 always
|
||||
.1 lda bnkbyt2 for alternate ram
|
||||
eor $D000 test
|
||||
beq .2 branch if not alternate ram
|
||||
lda RRAMWRAMBNK2 else enable alt $D000
|
||||
.2 pla return code
|
||||
rti re-enable interrupts and return
|
||||
bne .2 always
|
||||
.1 lda bnkbyt2 for alternate ram
|
||||
eor $D000 test
|
||||
beq .2 branch if not alternate ram
|
||||
lda RRAMWRAMBNK2 else enable alt $D000
|
||||
.2 pla return code
|
||||
rti re-enable interrupts and return
|
||||
|
||||
mlicont .EQ *-ofsG
|
||||
sec
|
||||
ror mliact notify interrupt routines MLI active.
|
||||
lda $E000 preserve language card/rom orientation
|
||||
sta bnkbyt1 for proper restoration when mli exits.
|
||||
ror mliact notify interrupt routines MLI active.
|
||||
lda $E000 preserve language card/rom orientation
|
||||
sta bnkbyt1 for proper restoration when mli exits.
|
||||
lda $D000
|
||||
sta bnkbyt2
|
||||
lda RRAMWRAMBNK1 force ram card on
|
||||
lda RRAMWRAMBNK1 force ram card on
|
||||
lda RRAMWRAMBNK1 with write allowed
|
||||
jmp xdosmli
|
||||
|
||||
|
@ -163,19 +163,19 @@ GP.irqxit0 beq .2 branch if ram card enabled.
|
|||
bmi .1 branch if alternate $D000 enabled.
|
||||
|
||||
lsr determine if no ram card present.
|
||||
bcc .3 branch if rom only system.
|
||||
bcc .3 branch if rom only system.
|
||||
|
||||
lda RROMWRAMBNK2 enable rom
|
||||
bcs .3 always taken
|
||||
lda RROMWRAMBNK2 enable rom
|
||||
bcs .3 always taken
|
||||
|
||||
.1 lda RRAMWRAMBNK2 enable alternate $D000
|
||||
.2 lda #$01 preset bankid for rom.
|
||||
sta bankid (reset if ram card interrupt)
|
||||
.3 lda p8areg restore acc
|
||||
rti exit
|
||||
.1 lda RRAMWRAMBNK2 enable alternate $D000
|
||||
.2 lda #$01 preset bankid for rom.
|
||||
sta bankid (reset if ram card interrupt)
|
||||
.3 lda p8areg restore acc
|
||||
rti exit
|
||||
|
||||
irqent .EQ *-ofsG this entry only used when rom
|
||||
bit RRAMWRAMBNK1 was enabled at time of interrupt.
|
||||
irqent .EQ *-ofsG this entry only used when rom
|
||||
bit RRAMWRAMBNK1 was enabled at time of interrupt.
|
||||
bit RRAMWRAMBNK1
|
||||
jmp irqrecev
|
||||
|
||||
|
@ -183,14 +183,14 @@ bnkbyt1 .EQ *-ofsG
|
|||
.DA #0
|
||||
bnkbyt2 .EQ *-ofsG
|
||||
.DA #0
|
||||
.HS 00000000 pad to before $BFFA
|
||||
.DA #4 gsos compatibility byte ($BFFA)
|
||||
.DA #0 pad
|
||||
.DA #0 reserved
|
||||
.DA #0 version # of running interpreter
|
||||
.DA #0 preserved for System Utilities
|
||||
kversion .EQ *-ofsG kernal version
|
||||
.HS 23 represents release 2.0.3
|
||||
.HS 00000000 pad to before $BFFA
|
||||
.DA #4 gsos compatibility byte ($BFFA)
|
||||
.DA #0 pad
|
||||
.DA #0 reserved
|
||||
.DA #0 version # of running interpreter
|
||||
.DA #0 preserved for System Utilities
|
||||
kversion .EQ *-ofsG kernal version
|
||||
.HS 23 represents release 2.0.3
|
||||
|
||||
* end of obj mli_1
|
||||
*--------------------------------------
|
||||
|
|
|
@ -6,7 +6,7 @@ NEW
|
|||
* address $FFCB (ROM rts opcode) for rom switching to function.
|
||||
|
||||
lanirq .EQ *-ofsR2
|
||||
.BS $2D9B-*
|
||||
.BS $2D9B-*
|
||||
H2D9B pha $2D9B-2DFF moved to $FF9B-FFFF
|
||||
lda accsav
|
||||
sta oldacc
|
||||
|
@ -44,18 +44,18 @@ lreset .EQ *-ofsR2
|
|||
pha
|
||||
jmp gorom
|
||||
rreset .EQ *-ofsR2
|
||||
.DA resetv-1 rts to resetv
|
||||
.DA resetv-1 rts to resetv
|
||||
fix45 .EQ *-ofsR2
|
||||
sta p8areg A register savearea
|
||||
sta p8areg A register savearea
|
||||
lda oldacc
|
||||
sta accsav
|
||||
lda RRAMWRAMBNK1 read/write RAM bank 1
|
||||
lda RRAMWRAMBNK1 read/write RAM bank 1
|
||||
lda RRAMWRAMBNK1
|
||||
lda afbank
|
||||
jmp irqxit0
|
||||
stypfx .EQ *-ofsR2 fix appletalk PFI bug
|
||||
stypfx .EQ *-ofsR2 fix appletalk PFI bug
|
||||
sty newpfxptr
|
||||
sty preflag prefix flag
|
||||
sty preflag prefix flag
|
||||
rts
|
||||
stapfx .EQ *-ofsR2
|
||||
sta newpfxptr
|
||||
|
@ -64,10 +64,10 @@ stapfx .EQ *-ofsR2
|
|||
|
||||
* these 3 vectors hard-coded into processor
|
||||
|
||||
.DA nmivect nmi handler
|
||||
.DA lreset reset handler
|
||||
.DA nmivect nmi handler
|
||||
.DA lreset reset handler
|
||||
irqv .EQ *-ofsR2
|
||||
.DA lanirq irq handler
|
||||
.DA lanirq irq handler
|
||||
|
||||
* end of obj mli_3
|
||||
*--------------------------------------
|
||||
|
|
|
@ -44,19 +44,19 @@ prostart lda unitnum
|
|||
sta kversion at least 48k ?
|
||||
eor kversion
|
||||
sec
|
||||
bne m48k if not.
|
||||
bne m48k if not.
|
||||
|
||||
sta kversion try again to be sure
|
||||
sta kversion try again to be sure
|
||||
lda kversion
|
||||
bne m48k still not.
|
||||
bne m48k still not.
|
||||
|
||||
lda RROMBNK2 read ROM
|
||||
lda RROMBNK2 read ROM
|
||||
jsr whchrom get preliminary system config
|
||||
bcs m48k machine too small
|
||||
lda idapple
|
||||
and #$20
|
||||
bne m64k if at least 64k //+.
|
||||
m48k jmp H22EB need enhanced IIe
|
||||
bne m64k if at least 64k //+.
|
||||
m48k jmp H22EB need enhanced IIe
|
||||
|
||||
* we have 64k, now determine model: //e , iic, or Cortland (//gs)
|
||||
|
||||
|
@ -64,61 +64,61 @@ m64k ldx #H2367 yx=2367 relocation table
|
|||
ldy /H2367
|
||||
jsr reloc
|
||||
lda kversion
|
||||
sta xdosver save current version for dir use
|
||||
sta xdosver save current version for dir use
|
||||
|
||||
H20CE bcc H20D3
|
||||
H20CE bcc H20D3
|
||||
jmp relocerr
|
||||
|
||||
H20D3 lda RROMBNK2 read ROM
|
||||
ldx version ROM id byte
|
||||
H20D3 lda RROMBNK2 read ROM
|
||||
ldx version ROM id byte
|
||||
cpx #$06
|
||||
bne H211D then it's a //e
|
||||
bne H211D then it's a //e
|
||||
lda #$E0
|
||||
bit zidbyte another ROM id byte
|
||||
bit zidbyte another ROM id byte
|
||||
php
|
||||
lda idapple
|
||||
and #$37
|
||||
plp
|
||||
bvc set3 if //c or //x
|
||||
bmi set7 if //e
|
||||
bvc set3 if //c or //x
|
||||
bmi set7 if //e
|
||||
|
||||
set3 php
|
||||
ora #$08
|
||||
plp
|
||||
bpl mach2 if //c
|
||||
bpl mach2 if //c
|
||||
ora #$40
|
||||
bpl H20FD always taken.
|
||||
bpl H20FD always taken.
|
||||
|
||||
mach2 inc cflag //c or later
|
||||
mach2 inc cflag //c or later
|
||||
bvs H20FD
|
||||
set7 ora #$80
|
||||
|
||||
H20FD sta idapple
|
||||
lda RROMBNK2 read ROM
|
||||
sec
|
||||
jsr idroutine returns system info
|
||||
bcs H211D branch if // family
|
||||
inc cortland it's a Cortland, set loader flag
|
||||
stz vmode force setvid to reset cursor
|
||||
jsr setvid reset output to screen
|
||||
jsr idroutine returns system info
|
||||
bcs H211D branch if // family
|
||||
inc cortland it's a Cortland, set loader flag
|
||||
stz vmode force setvid to reset cursor
|
||||
jsr setvid reset output to screen
|
||||
lda setuprts
|
||||
bne H211D branch if prodos 8 alone
|
||||
bne H211D branch if prodos 8 alone
|
||||
|
||||
* running from gs/os shell so zero out os_boot for appletalk
|
||||
|
||||
sta OS_BOOT indicates O/S initially booted.
|
||||
jsr patch101 patch for gs/os - rev note #101
|
||||
sta OS_BOOT indicates O/S initially booted.
|
||||
jsr patch101 patch for gs/os - rev note #101
|
||||
|
||||
* put dispatcher in bank 2 of language card
|
||||
|
||||
H211D lda LDR.MLIONLINE.P+1 place boot devnum in globals
|
||||
H211D lda LDR.MLIONLINE.P+1 place boot devnum in globals
|
||||
sta LDR.MLIREADBLOCK.P+1
|
||||
sta devnum last device used
|
||||
jsr devsrch finish setting up globals
|
||||
sta devnum last device used
|
||||
jsr devsrch finish setting up globals
|
||||
lda LDR.MLIREADBLOCK.P+1
|
||||
sta devnum
|
||||
jsr lc1in switch in language card bank 1.
|
||||
ldx #rlclk64 set up clock
|
||||
jsr lc1in switch in language card bank 1.
|
||||
ldx #rlclk64 set up clock
|
||||
ldy /rlclk64
|
||||
jsr reloc
|
||||
|
||||
|
@ -127,114 +127,114 @@ H2139 bcs H20CE
|
|||
sta jspare+1 P8 system death vector
|
||||
lda /calldisp
|
||||
sta jspare+2
|
||||
lda RRAMWRAMBNK2 read/write RAM bank 2
|
||||
lda RRAMWRAMBNK2 read/write RAM bank 2
|
||||
lda RRAMWRAMBNK2
|
||||
ldx #altdsptbl GQuit dispatcher
|
||||
ldx #altdsptbl GQuit dispatcher
|
||||
ldy /altdsptbl
|
||||
lda setuprts
|
||||
cmp #$02 is this a GQuit setup?
|
||||
beq H216E taken to use GQuit dispatcher.
|
||||
ldx #newquitbl else, use Bird's Better Bye
|
||||
ldy /newquitbl if correct machine.
|
||||
lda machid machine ID byte
|
||||
bit #$00 //c ?
|
||||
bne H216E if yes, can use.
|
||||
cmp #$02 is this a GQuit setup?
|
||||
beq H216E taken to use GQuit dispatcher.
|
||||
ldx #newquitbl else, use Bird's Better Bye
|
||||
ldy /newquitbl if correct machine.
|
||||
lda machid machine ID byte
|
||||
bit #$00 //c ?
|
||||
bne H216E if yes, can use.
|
||||
and #$C2
|
||||
cmp #$82 //e with 80 col card ?
|
||||
beq H216E if yes, can use.
|
||||
ldx #dsp64 else, use original quit code
|
||||
cmp #$82 //e with 80 col card ?
|
||||
beq H216E if yes, can use.
|
||||
ldx #dsp64 else, use original quit code
|
||||
ldy /dsp64
|
||||
inc newquitflag using old quit code so set flag
|
||||
inc newquitflag using old quit code so set flag
|
||||
|
||||
H216E jsr reloc
|
||||
lda #$EE byte to distinguish LC bank 2
|
||||
lda #$EE byte to distinguish LC bank 2
|
||||
sta $D000
|
||||
jsr lc1in switch in LC bank 1
|
||||
jsr lc1in switch in LC bank 1
|
||||
bcs H2139
|
||||
|
||||
* test for 128k needed to install ram disk
|
||||
|
||||
lda machid machine ID byte
|
||||
lda machid machine ID byte
|
||||
and #$30
|
||||
eor #$30
|
||||
bne noramdsk if < 128k
|
||||
bne noramdsk if < 128k
|
||||
ldx #$FF
|
||||
php save interrupt status
|
||||
pla in acc.
|
||||
sei no interrupts.
|
||||
sta SETALTZP use alt zero page/stack
|
||||
stx auxsp init aux sp to $FF
|
||||
sta CLRALTZP use main zero page/stack
|
||||
pha restore interrupt status
|
||||
php save interrupt status
|
||||
pla in acc.
|
||||
sei no interrupts.
|
||||
sta SETALTZP use alt zero page/stack
|
||||
stx auxsp init aux sp to $FF
|
||||
sta CLRALTZP use main zero page/stack
|
||||
pha restore interrupt status
|
||||
plp
|
||||
sta CLRC3ROM enable internal slot 3 ROM
|
||||
jsr H2C80 install ram disk
|
||||
sta CLRC3ROM enable internal slot 3 ROM
|
||||
jsr H2C80 install ram disk
|
||||
|
||||
* check interrupt vector to determine ROM version
|
||||
|
||||
noramdsk lda RROMWRAMBNK2 read ROM/write RAM bank 2
|
||||
ldy irqv interrupt vector
|
||||
ldx irqv+1 x = high byte
|
||||
jsr lc1in set language card bank 1 to r/w
|
||||
cpx #$D0 is it > $D000 (old roms)
|
||||
noramdsk lda RROMWRAMBNK2 read ROM/write RAM bank 2
|
||||
ldy irqv interrupt vector
|
||||
ldx irqv+1 x = high byte
|
||||
jsr lc1in set language card bank 1 to r/w
|
||||
cpx #$D0 is it > $D000 (old roms)
|
||||
lda #$00
|
||||
bcs H21C5 branch if old roms
|
||||
sta SETALTZP use alt zero page/stack
|
||||
lda #$FF set aux sp = $FF
|
||||
bcs H21C5 branch if old roms
|
||||
sta SETALTZP use alt zero page/stack
|
||||
lda #$FF set aux sp = $FF
|
||||
sta auxsp
|
||||
stx irqv+1 interrupt vector
|
||||
sty irqv save irq vector in aux lc
|
||||
sta CLRALTZP use main zero page/stack
|
||||
stx irqv+1 save irq vector in main lc
|
||||
stx irqv+1 interrupt vector
|
||||
sty irqv save irq vector in aux lc
|
||||
sta CLRALTZP use main zero page/stack
|
||||
stx irqv+1 save irq vector in main lc
|
||||
sty irqv
|
||||
lda #$01
|
||||
|
||||
H21C5 sta irqflag 1 = new roms
|
||||
H21C5 sta irqflag 1 = new roms
|
||||
stz cortflag assume not Cortland system
|
||||
lda cortland running on a Cortland ?
|
||||
beq H21D5 branch if not.
|
||||
inc cortflag yes it's Cortland
|
||||
lda cortland running on a Cortland ?
|
||||
beq H21D5 branch if not.
|
||||
inc cortflag yes it's Cortland
|
||||
bra docard
|
||||
|
||||
* check for a rom in slot 3. if no rom, use internal $C300 firmware
|
||||
|
||||
H21D5 sta CLRC3ROM enable internal slot 3 ROM
|
||||
lda rommap slot ROM bit map
|
||||
and #$08 mask all but slot 3
|
||||
bne isromin3 taken if rom in slot 3
|
||||
bra H2247 else continue booting
|
||||
lda rommap slot ROM bit map
|
||||
and #$08 mask all but slot 3
|
||||
bne isromin3 taken if rom in slot 3
|
||||
bra H2247 else continue booting
|
||||
|
||||
* found a rom in slot 3. is it an external, identifiable 80 col card
|
||||
* with interrupt routines? if so, enable it else use internal $C300 firmware.
|
||||
|
||||
isromin3 sta SETC3ROM enable slot 3 rom
|
||||
lda $C305 check card id bytes
|
||||
isromin3 sta SETC3ROM enable slot 3 rom
|
||||
lda $C305 check card id bytes
|
||||
cmp #$38
|
||||
bne hitswtch not terminal card
|
||||
bne hitswtch not terminal card
|
||||
lda $C307
|
||||
cmp #$18
|
||||
bne hitswtch
|
||||
lda $C30B
|
||||
cmp #$01
|
||||
bne hitswtch
|
||||
lda $C30C is it an apple 80 col compatible card?
|
||||
lda $C30C is it an apple 80 col compatible card?
|
||||
and #$F0
|
||||
cmp #$80
|
||||
bne hitswtch if not.
|
||||
lda machid machine ID byte
|
||||
bne hitswtch if not.
|
||||
lda machid machine ID byte
|
||||
and #$C8
|
||||
cmp #$C0 is it a //+ ?
|
||||
beq docard yes
|
||||
cmp #$C0 is it a //+ ?
|
||||
beq docard yes
|
||||
lda $C3FA
|
||||
cmp #$2C does card have an interrupt handler?
|
||||
beq docard yes
|
||||
cmp #$2C does card have an interrupt handler?
|
||||
beq docard yes
|
||||
|
||||
hitswtch sta CLRC3ROM enable internal $C300 firmware
|
||||
|
||||
* verify that the card in aux slot is actually present
|
||||
|
||||
sta SET80STORE enable 80-col store
|
||||
sta SETPAGE2 switch in text page 2
|
||||
sta SET80STORE enable 80-col store
|
||||
sta SETPAGE2 switch in text page 2
|
||||
lda #$EE
|
||||
sta txtp2
|
||||
asl
|
||||
|
@ -244,84 +244,84 @@ hitswtch sta CLRC3ROM enable internal $C300 firmware
|
|||
lsr
|
||||
lsr txtp2
|
||||
cmp txtp2
|
||||
.BS *-$2230
|
||||
|
||||
H2230 sta CLRPAGE2 main memory
|
||||
sta CLR80STORE disable 80-col store
|
||||
beq docard branch if card is there
|
||||
lda machid machine ID byte
|
||||
and #$FD clear 80-col bit 2 (no card)
|
||||
bne H2244 always
|
||||
sta CLR80STORE disable 80-col store
|
||||
beq docard branch if card is there
|
||||
lda machid machine ID byte
|
||||
and #$FD clear 80-col bit 2 (no card)
|
||||
bne H2244 always
|
||||
|
||||
docard lda machid
|
||||
ora #$02 turn bit 2 on (80-col card is present)
|
||||
ora #$02 turn bit 2 on (80-col card is present)
|
||||
|
||||
H2244 sta machid
|
||||
H2247 lda cortland are we running on a //gs ?
|
||||
beq H225D if not.
|
||||
lda #$4C enable clock routine by putting a jmp
|
||||
sta clockv in front of clock vector
|
||||
ldx #cortclock yx = relocation table
|
||||
ldy /cortclock for cortland clock driver
|
||||
beq H225D if not.
|
||||
lda #$4C enable clock routine by putting a jmp
|
||||
sta clockv in front of clock vector
|
||||
ldx #cortclock yx = relocation table
|
||||
ldy /cortclock for cortland clock driver
|
||||
jsr reloc
|
||||
lda #$01 set bit 0 = clock present
|
||||
lda #$01 set bit 0 = clock present
|
||||
tsb machid
|
||||
|
||||
H225D lda setuprts get setup entry point flag
|
||||
beq H2267 taken if normal boot.
|
||||
lda RROMBNK2 read ROM
|
||||
rts return to caller at setup entry point.
|
||||
beq H2267 taken if normal boot.
|
||||
lda RROMBNK2 read ROM
|
||||
rts return to caller at setup entry point.
|
||||
|
||||
setuprts .DA #$00 0 = normal boot, <>0 = return
|
||||
|
||||
* set prefix to boot device
|
||||
|
||||
H2267 jsr MLI online
|
||||
H2267 jsr MLI
|
||||
.DA #MLIONLINE
|
||||
.DA LDR.MLIONLINE.P
|
||||
bcs relocerr
|
||||
|
||||
lda pbuf+1 get volume name length.
|
||||
and #$0F strip devnum
|
||||
lda pbuf+1 get volume name length.
|
||||
and #$0F strip devnum
|
||||
beq relocerr
|
||||
|
||||
inc add 1 for leading '/'
|
||||
sta pbuf save prefix length.
|
||||
lda #'/' place leading '/' in prefix buffer
|
||||
inc add 1 for leading '/'
|
||||
sta pbuf save prefix length.
|
||||
lda #'/' place leading '/' in prefix buffer
|
||||
sta pbuf+1
|
||||
|
||||
jsr MLI set prefix
|
||||
jsr MLI
|
||||
.DA #MLISETPREFIX
|
||||
.DA LDR.MLISETPREFIX.P
|
||||
bcs relocerr
|
||||
|
||||
tax =0
|
||||
stx dst
|
||||
ldy #$02 read directory into buffer
|
||||
ldy #$02 read directory into buffer
|
||||
lda /DirBlkBuf
|
||||
|
||||
H228E sta dst+1
|
||||
sta LDR.MLIREADBLOCK.P+4
|
||||
sty LDR.MLIREADBLOCK.P+5
|
||||
stx LDR.MLIREADBLOCK.P+6
|
||||
sta LDR.MLIREADBLOCK.P+3
|
||||
sty LDR.MLIREADBLOCK.P+4
|
||||
stx LDR.MLIREADBLOCK.P+5
|
||||
|
||||
jsr MLI read block
|
||||
jsr MLI
|
||||
.DA #MLIREADBLOCK
|
||||
.DA LDR.MLIREADBLOCK.P
|
||||
bcs relocerr
|
||||
|
||||
ldy #$03 get next block# from link
|
||||
ldy #$03 get next block# from link
|
||||
lda (dst),y
|
||||
tax
|
||||
dey
|
||||
ora (dst),y if both bytes are the same
|
||||
beq H22B7 then no more blocks of directory.
|
||||
ora (dst),y if both bytes are the same
|
||||
beq H22B7 then no more blocks of directory.
|
||||
lda (dst),y
|
||||
tay
|
||||
lda dst+1
|
||||
clc
|
||||
adc #$02 add $200 to buffer pointer
|
||||
cmp /dbuf+$800 until it points past end of buffer.
|
||||
bcc H228E if ok, read next block.
|
||||
adc #$02 add $200 to buffer pointer
|
||||
cmp /dbuf+$800 until it points past end of buffer.
|
||||
bcc H228E if ok, read next block.
|
||||
|
||||
H22B7 jmp lodintrp jmp to 'licode' (load interpreter)
|
||||
|
||||
|
@ -362,27 +362,27 @@ LDR.MLISETPREFIX.P
|
|||
|
||||
LDR.MLIREADBLOCK.P
|
||||
.DA #3
|
||||
.DA #0 unit number
|
||||
.DA #0 unit number
|
||||
.DA 0 2 byte data buffer
|
||||
.DA 0 2 byte block number
|
||||
.DA 0 2 byte block number
|
||||
|
||||
cortland .BS 1 cortland loader flag (1 = Cortland)
|
||||
newquitflag .BS 1 1 = old quit code
|
||||
|
||||
H232B .DA #1 move interpreter loader code
|
||||
.DA lodintrp destination address
|
||||
.DA H257B-licode length to move
|
||||
.DA licode source address
|
||||
.DA #$01 move $3F0 vectors
|
||||
.DA p3vect destination
|
||||
.DA $0010 16 bytes to move
|
||||
.DA H257B source
|
||||
H232B .DA #1 move interpreter loader code
|
||||
.DA lodintrp destination address
|
||||
.DA H257B-licode length to move
|
||||
.DA licode source address
|
||||
.DA #$01 move $3F0 vectors
|
||||
.DA p3vect destination
|
||||
.DA $0010 16 bytes to move
|
||||
.DA H257B source
|
||||
.DA #$01
|
||||
.DA lookptr
|
||||
.DA $0002
|
||||
.DA dst
|
||||
.DA #$01 move 128k test to zero page
|
||||
.DA tst128 destination
|
||||
.DA #$01 move 128k test to zero page
|
||||
.DA tst128 destination
|
||||
.DA LDR.Test128.Len
|
||||
.DA LDR.Test128
|
||||
.HS FF done
|
||||
|
@ -393,103 +393,103 @@ dsp64 .DA #$01 move p8 dispatcher code
|
|||
.DA disp1obj source
|
||||
.HS FF done
|
||||
|
||||
newquitbl .DA #$01 move Bird's Bye code
|
||||
.DA displc2 dest
|
||||
.DA GQdisp-birdbye length (must be <= 3 pages)
|
||||
.DA birdbye source
|
||||
.HS FF done
|
||||
newquitbl .DA #$01 move Bird's Bye code
|
||||
.DA displc2 dest
|
||||
.DA GQdisp-birdbye length (must be <= 3 pages)
|
||||
.DA birdbye source
|
||||
.HS FF done
|
||||
|
||||
altdsptbl .DA #$01 move GQuit launcher
|
||||
altdsptbl .DA #$01 move GQuit launcher
|
||||
.DA displc2 destination
|
||||
.DA $0300 length (must be <= 3 pages)
|
||||
.DA GQdisp source
|
||||
.DA #$01 move a copy of GQuit launcher
|
||||
.DA dispadr to dispadr for gsos
|
||||
.DA $0300 length (must be <= 3 pages)
|
||||
.DA GQdisp source
|
||||
.DA $0300 length (must be <= 3 pages)
|
||||
.DA GQdisp source
|
||||
.DA #$01 move a copy of GQuit launcher
|
||||
.DA dispadr to dispadr for gsos
|
||||
.DA $0300 length (must be <= 3 pages)
|
||||
.DA GQdisp source
|
||||
.HS FF done
|
||||
|
||||
* tables for moving 64k version of mli for execution
|
||||
|
||||
H2367 .DA #$01 relocation table. 1=move src to dst
|
||||
.DA lanirq destination
|
||||
.DA H2E00-H2D9B length to move
|
||||
.DA H2D9B source
|
||||
H2367 .DA #$01 relocation table. 1=move src to dst
|
||||
.DA lanirq destination
|
||||
.DA H2E00-H2D9B length to move
|
||||
.DA H2D9B source
|
||||
.DA #$01
|
||||
.DA MLI globals
|
||||
.DA $0100 in one page
|
||||
.DA MLI globals
|
||||
.DA $0100 in one page
|
||||
.DA H2E00
|
||||
.HS 00 0=clear buffers $D700-$DDFF
|
||||
.HS 00 0=clear buffers $D700-$DDFF
|
||||
.DA pathbuf
|
||||
.DA xdosorg-pathbuf
|
||||
.DA #$01
|
||||
.DA xdosorg
|
||||
.DA ramsrc-xdosobj length of mli
|
||||
.DA ramsrc-xdosobj length of mli
|
||||
.DA xdosobj
|
||||
.DA #$01
|
||||
.DA rwts
|
||||
.DA disp1obj-blockio length of disk ii driver
|
||||
.DA blockio
|
||||
.HS FF done
|
||||
.HS FF done
|
||||
|
||||
* move thunderclock
|
||||
|
||||
rlclk64 .DA #$01 relocation table. 1=move src to dst
|
||||
.DA tclk_in destination
|
||||
rlclk64 .DA #$01 relocation table. 1=move src to dst
|
||||
.DA tclk_in destination
|
||||
.DA tclk_end-tclock_0 length of thunderclock driver
|
||||
.DA tclock_0 source
|
||||
.DA #$04 4=relocate and move program
|
||||
.DA tclock_0 source
|
||||
.DA #$04 4=relocate and move program
|
||||
.DA tclk_in
|
||||
.DA H2F69-tclock_0
|
||||
.DA tclk_in
|
||||
.HS 00
|
||||
.HS C1C1
|
||||
clock64 .DA #$00
|
||||
.HS FF done
|
||||
.HS FF done
|
||||
|
||||
* move cortland clock
|
||||
|
||||
cortclock .DA #$01 relocation table. 1=move src to dst
|
||||
.DA tclk_in destination
|
||||
cortclock .DA #$01 relocation table. 1=move src to dst
|
||||
.DA tclk_in destination
|
||||
.DA cclk_end-cclock_0 length of cortland clock driver
|
||||
.DA cclock_0 source
|
||||
.HS FF done
|
||||
.DA cclock_0 source
|
||||
.HS FF done
|
||||
|
||||
* load and run appletalk configuration file (atinit) if present
|
||||
* or continue loading and running .system file
|
||||
|
||||
* loader origin $800
|
||||
|
||||
ofsL .EQ *-lodintrp offset from loader org
|
||||
ofsL .EQ *-lodintrp offset from loader org
|
||||
|
||||
licode jsr MLI check for file 'atinit'
|
||||
.DA #MLIGETFILEINFO
|
||||
.DA gfi_list
|
||||
bcc gfi_ok branch if 'atinit' file found
|
||||
cmp #$46 file not found?
|
||||
beq H23DF if so, continue loading interpreter
|
||||
bcc gfi_ok branch if 'atinit' file found
|
||||
cmp #$46 file not found?
|
||||
beq H23DF if so, continue loading interpreter
|
||||
bne H23E2
|
||||
gfi_ok lda gfi_type
|
||||
cmp #$E2 is 'atinit' correct file type?
|
||||
bne H23E2 error - wrong file type
|
||||
jsr MLI open 'atinit' file
|
||||
cmp #$E2 is 'atinit' correct file type?
|
||||
bne H23E2 error - wrong file type
|
||||
jsr MLI open 'atinit' file
|
||||
.DA #$C8
|
||||
.DA atopen parms
|
||||
bne H23E2 error
|
||||
lda #$9F max size = 39.75k ($2000-$BF00)
|
||||
.DA atopen
|
||||
bne H23E2 error
|
||||
lda #$9F max size = 39.75k ($2000-$BF00)
|
||||
sta rdlen+1
|
||||
stz rdlen
|
||||
jsr MLI read 'atinit' file to 'sysentry'
|
||||
jsr MLI read 'atinit' file to 'sysentry'
|
||||
.DA #$CA
|
||||
.DA rdparm
|
||||
bne H23E2 error - too big
|
||||
jsr MLI close 'atinit' file
|
||||
bne H23E2 error - too big
|
||||
jsr MLI close 'atinit' file
|
||||
.DA #$CC
|
||||
.DA clparm
|
||||
bne H23E2 error
|
||||
bne H23E2 error
|
||||
lda RROMBNK2 enable ROM
|
||||
jsr sysentry execute ATinit
|
||||
H23DF jmp goloadint execute .system file
|
||||
H23DF jmp goloadint execute .system file
|
||||
|
||||
* fatal error
|
||||
|
||||
|
@ -511,53 +511,53 @@ gfi_type .EQ *-ofsL
|
|||
.HS 00000000
|
||||
.HS 0000000000000000
|
||||
.HS 0000
|
||||
atopen .EQ *-ofsL parms to open 'atinit'
|
||||
atopen .EQ *-ofsL parms to open 'atinit'
|
||||
.HS 03
|
||||
.DA atinitname
|
||||
.DA iobuf i/o buffer
|
||||
.HS 01 ref# hard coded since no other files
|
||||
.DA iobuf i/o buffer
|
||||
.HS 01 ref# hard coded since no other files
|
||||
atinitname .EQ *-ofsL
|
||||
.DA #06 length of name
|
||||
.AS -"atinit" name of appletalk config file
|
||||
.DA #06 length of name
|
||||
.AS -"atinit" name of appletalk config file
|
||||
goloadint .EQ *-ofsL
|
||||
|
||||
lda /dbuf search directory buffer
|
||||
lda /dbuf search directory buffer
|
||||
sta idxl+1
|
||||
lda #$04 start 1 entry past header
|
||||
bne H2434 always.
|
||||
H2432 lda idxl calc next entry position
|
||||
lda #$04 start 1 entry past header
|
||||
bne H2434 always.
|
||||
H2432 lda idxl calc next entry position
|
||||
H2434 clc
|
||||
adc dbuf+35 inc to next entry address
|
||||
adc dbuf+35 inc to next entry address
|
||||
sta idxl
|
||||
bcs H2451 branch if page cross.
|
||||
adc dbuf+35 test for end of block.
|
||||
bcc H2453 branch if not page cross
|
||||
bcs H2451 branch if page cross.
|
||||
adc dbuf+35 test for end of block.
|
||||
bcc H2453 branch if not page cross
|
||||
lda idxl+1
|
||||
lsr end of block?
|
||||
bcc H2453 no.
|
||||
cmp #$09 end of directory?
|
||||
bne H244D no.
|
||||
jmp nointrp no interpreter, go quit.
|
||||
H244D lda #$04 reset index to 1st entry in next block.
|
||||
lsr end of block?
|
||||
bcc H2453 no.
|
||||
cmp #$09 end of directory?
|
||||
bne H244D no.
|
||||
jmp nointrp no interpreter, go quit.
|
||||
H244D lda #$04 reset index to 1st entry in next block.
|
||||
sta idxl
|
||||
H2451 inc idxl+1 inc to next page.
|
||||
H2453 ldy #$10 check file type.
|
||||
lda #$FF must be a prodos sys file
|
||||
H2451 inc idxl+1 inc to next page.
|
||||
H2453 ldy #$10 check file type.
|
||||
lda #$FF must be a prodos sys file
|
||||
eor (idxl),y
|
||||
bne H2432 if not sys.
|
||||
tay see if active
|
||||
bne H2432 if not sys.
|
||||
tay see if active
|
||||
lda (idxl),y
|
||||
beq H2432 if deleted file.
|
||||
and #$0F strip file 'kind'.
|
||||
sta pbuf save length of name.
|
||||
cmp #$08 must be at least 'x.system'
|
||||
bcc H2432 else, ignore it.
|
||||
tay compare last 7 chars for '.system'
|
||||
beq H2432 if deleted file.
|
||||
and #$0F strip file 'kind'.
|
||||
sta pbuf save length of name.
|
||||
cmp #$08 must be at least 'x.system'
|
||||
bcc H2432 else, ignore it.
|
||||
tay compare last 7 chars for '.system'
|
||||
ldx #$06
|
||||
H246C lda (idxl),y
|
||||
eor iterp,x
|
||||
asl
|
||||
bne H2432 branch if something else
|
||||
bne H2432 branch if something else
|
||||
dey
|
||||
dex
|
||||
bpl H246C
|
||||
|
@ -565,62 +565,62 @@ H246C lda (idxl),y
|
|||
H247A iny
|
||||
lda (idxl),y
|
||||
sta pbuf,y
|
||||
ora #$80 msb on so can be displayed if error
|
||||
ora #$80 msb on so can be displayed if error
|
||||
sta iomess+$11,y
|
||||
cpy pbuf
|
||||
bne H247A
|
||||
lda #$A0 space after name
|
||||
lda #$A0 space after name
|
||||
sta iomess+$12,y
|
||||
tya error message length
|
||||
adc #$13 (carry set)
|
||||
tya error message length
|
||||
adc #$13 (carry set)
|
||||
sta ierlen
|
||||
jsr MLI open interpreter file
|
||||
jsr MLI open interpreter file
|
||||
.DA #$C8
|
||||
.DA opparm
|
||||
bne badlod
|
||||
jsr MLI get eof (length of file)
|
||||
jsr MLI get eof (length of file)
|
||||
.DA #$D1
|
||||
.DA efparm
|
||||
bne badlod
|
||||
lda eof+2
|
||||
bne toolong
|
||||
lda eof+1
|
||||
cmp #$9F max size = 39.75k ($2000-$BF00)
|
||||
cmp #$9F max size = 39.75k ($2000-$BF00)
|
||||
bcs toolong
|
||||
sta rdlen+1
|
||||
lda eof
|
||||
sta rdlen (read entire file)
|
||||
jsr MLI read interpreter file
|
||||
sta rdlen (read entire file)
|
||||
jsr MLI read interpreter file
|
||||
.DA #$CA
|
||||
.DA rdparm
|
||||
beq H24C8 go close if successfully read.
|
||||
cmp #$56 memory conflict?
|
||||
beq toolong then too large
|
||||
bne badlod else, unable to load.
|
||||
H24C8 jsr MLI close interpreter file
|
||||
beq H24C8 go close if successfully read.
|
||||
cmp #$56 memory conflict?
|
||||
beq toolong then too large
|
||||
bne badlod else, unable to load.
|
||||
H24C8 jsr MLI close interpreter file
|
||||
.DA #$CC
|
||||
.DA clparm
|
||||
bne badlod hopefully never taken
|
||||
bne badlod hopefully never taken
|
||||
|
||||
* if booting on a //c then see if esc is in keyboard buffer
|
||||
* and clear it. it may have been pressed to shift speed
|
||||
* of accelerator chip
|
||||
|
||||
lda cflag
|
||||
beq H24DF taken if not booting on a //c
|
||||
lda kbd else, check for keypress
|
||||
cmp #$9B escape?
|
||||
bne H24DF if not.
|
||||
sta KBDSTROBE clear keyboard
|
||||
beq H24DF taken if not booting on a //c
|
||||
lda kbd else, check for keypress
|
||||
cmp #$9B escape?
|
||||
bne H24DF if not.
|
||||
sta KBDSTROBE clear keyboard
|
||||
H24DF lda RROMBNK2 enable ROM
|
||||
jmp sysentry go run interpreter
|
||||
cflag .EQ *-ofsL
|
||||
.HS 00 set if a //c.
|
||||
nointrp .EQ *-ofsL no interpreter found,
|
||||
.HS 00 set if a //c.
|
||||
nointrp .EQ *-ofsL no interpreter found,
|
||||
jsr MLI so quit.
|
||||
.DA #$65
|
||||
.DA quitparm
|
||||
badlod ldy ierlen center the error message
|
||||
badlod ldy ierlen center the error message
|
||||
lda #$27
|
||||
sec
|
||||
sbc ierlen
|
||||
|
@ -646,76 +646,76 @@ iomess .EQ *-ofsL
|
|||
.AS -" X.System *********"
|
||||
ierlen .EQ *-ofsL
|
||||
.HS 00
|
||||
opparm .EQ *-ofsL parms for open call
|
||||
opparm .EQ *-ofsL parms for open call
|
||||
.HS 03
|
||||
.DA pbuf
|
||||
.DA iobuf
|
||||
.HS 01
|
||||
efparm .EQ *-ofsL parms for get eof call
|
||||
efparm .EQ *-ofsL parms for get eof call
|
||||
.HS 02
|
||||
.DA #01
|
||||
eof .EQ *-ofsL
|
||||
.HS 000000 length of file.
|
||||
rdparm .EQ *-ofsL parms for read call
|
||||
.HS 000000 length of file.
|
||||
rdparm .EQ *-ofsL parms for read call
|
||||
.HS 04
|
||||
.HS 01
|
||||
.DA sysentry
|
||||
rdlen .EQ *-ofsL
|
||||
.HS 0000
|
||||
.HS 0000
|
||||
clparm .EQ *-ofsL parms for close call
|
||||
clparm .EQ *-ofsL parms for close call
|
||||
.HS 01
|
||||
.HS 00
|
||||
quitparm .EQ *-ofsL parms for quit call
|
||||
quitparm .EQ *-ofsL parms for quit call
|
||||
.HS 04
|
||||
.HS 00
|
||||
.HS 0000
|
||||
.HS 00
|
||||
.HS 0000
|
||||
iterp .EQ *-ofsL interpreter suffix that is required
|
||||
iterp .EQ *-ofsL interpreter suffix that is required
|
||||
.AS -".SYSTEM"
|
||||
|
||||
* 16 bytes moved to $03F0 vectors
|
||||
|
||||
H257B .DA breakv
|
||||
.DA oldrst
|
||||
.DA #$5A powerup byte
|
||||
jmp oldrst '&' vector
|
||||
jmp oldrst ctrl-y vector
|
||||
.DA #$5A powerup byte
|
||||
jmp oldrst '&' vector
|
||||
jmp oldrst ctrl-y vector
|
||||
.HS 004000
|
||||
.DA irqent global page interrupt vector
|
||||
lc1in lda RRAMWRAMBNK1 read/write language card RAM bank 1
|
||||
.DA irqent global page interrupt vector
|
||||
lc1in lda RRAMWRAMBNK1 read/write language card RAM bank 1
|
||||
lda RRAMWRAMBNK1
|
||||
rts
|
||||
|
||||
* determine which system model and save in machine id (idapple)
|
||||
|
||||
whchrom stz idapple assume standard apple //
|
||||
ldx version check hardware id
|
||||
cpx #$38 is it apple // (autostart rom)?
|
||||
beq H25BE if yes
|
||||
whchrom stz idapple assume standard apple //
|
||||
ldx version check hardware id
|
||||
cpx #$38 is it apple // (autostart rom)?
|
||||
beq H25BE if yes
|
||||
lda #$80
|
||||
cpx #$06 apple //e?
|
||||
beq H25BC if yes
|
||||
cpx #$06 apple //e?
|
||||
beq H25BC if yes
|
||||
lda #$40
|
||||
cpx #$EA apple //+?
|
||||
bne H25B6 it not, then machine is unknown.
|
||||
ldx $FB1E apple /// in emulation?
|
||||
cpx #$EA apple //+?
|
||||
bne H25B6 it not, then machine is unknown.
|
||||
ldx $FB1E apple /// in emulation?
|
||||
cpx #$AD
|
||||
beq H25BC taken if apple //+.
|
||||
lda #$D0 test again for apple /// emulation
|
||||
cpx #$8A because will only have 48k memory.
|
||||
bne H25B6 if taken, then machine is unknown.
|
||||
H25B4 sec apple /// emulation is not allowed
|
||||
rts because insufficient memory.
|
||||
H25B6 lda #$02 machine unknown
|
||||
beq H25BC taken if apple //+.
|
||||
lda #$D0 test again for apple /// emulation
|
||||
cpx #$8A because will only have 48k memory.
|
||||
bne H25B6 if taken, then machine is unknown.
|
||||
H25B4 sec apple /// emulation is not allowed
|
||||
rts because insufficient memory.
|
||||
H25B6 lda #$02 machine unknown
|
||||
sta (dst),y
|
||||
bne H25D9 always.
|
||||
H25BC sta idapple save machine id
|
||||
bne H25D9 always.
|
||||
H25BC sta idapple save machine id
|
||||
|
||||
* check for language card ram
|
||||
|
||||
H25BE jsr lc1in switch in language card bank 1
|
||||
H25BE jsr lc1in switch in language card bank 1
|
||||
lda #$AA
|
||||
sta $D000
|
||||
eor $D000 if LC present, result = 0.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -4,30 +4,30 @@ NEW
|
|||
* /RAM driver (main bank portion)
|
||||
* origin = $FF00
|
||||
|
||||
ofsR2 .EQ *-lcdest offset from ram driver org
|
||||
ofsR2 .EQ *-lcdest offset from ram driver org
|
||||
|
||||
lcsrc cld no decimal.
|
||||
ldx #$0B save 13 bytes of parms
|
||||
lcsrc cld no decimal.
|
||||
ldx #$0B save 13 bytes of parms
|
||||
H2D03 lda A1L,x
|
||||
sta a1l1,x
|
||||
dex
|
||||
bpl H2D03
|
||||
ldx #$01
|
||||
H2D0D lda passit,x save xfer vectors
|
||||
H2D0D lda passit,x save xfer vectors
|
||||
sta sp1,x
|
||||
dex
|
||||
bpl H2D0D
|
||||
lda A4L get command.
|
||||
beq stat 0 = status
|
||||
cmp #$04 check for command too high.
|
||||
bcs ioerr if it is, i/o error
|
||||
lda A4L get command.
|
||||
beq stat 0 = status
|
||||
cmp #$04 check for command too high.
|
||||
bcs ioerr if it is, i/o error
|
||||
eor #$03
|
||||
sta A4L 0=format, 2=read, 1=write
|
||||
sta A4L 0=format, 2=read, 1=write
|
||||
beq format
|
||||
ldy bloknml+1 check for large block number.
|
||||
bne ioerr too big.
|
||||
lda bloknml block #
|
||||
bmi ioerr largest block number is $7F
|
||||
ldy bloknml+1 check for large block number.
|
||||
bne ioerr too big.
|
||||
lda bloknml block #
|
||||
bmi ioerr largest block number is $7F
|
||||
|
||||
* at this point, control is passed to the code in the alternate 64k.
|
||||
* it it used for read, write and format. after the request is completed,
|
||||
|
@ -36,51 +36,51 @@ H2D0D lda passit,x save xfer vectors
|
|||
format lda #ramdest card entry point
|
||||
sta passit
|
||||
lda /ramdest
|
||||
gocard .EQ *-ofsR2 also used by 'mainwrt'
|
||||
gocard .EQ *-ofsR2 also used by 'mainwrt'
|
||||
sta passit+1
|
||||
sec direction ram -> card
|
||||
clv start with original zero page
|
||||
jmp xfer transfer control
|
||||
ioerr lda #$27
|
||||
sec direction ram -> card
|
||||
clv start with original zero page
|
||||
jmp xfer transfer control
|
||||
ioerr lda #$27
|
||||
bne H2D41
|
||||
lda #$2B write protect error.
|
||||
H2D41 sec flags error
|
||||
lda #$2B write protect error.
|
||||
H2D41 sec flags error
|
||||
bcs H2D47
|
||||
noerr .EQ *-ofsR2
|
||||
stat lda #$00
|
||||
clc
|
||||
H2D47 php save status
|
||||
pha and error code.
|
||||
ldx #$0B restore 13 byes of parms
|
||||
H2D4B lda a1l1,x
|
||||
H2D47 php save status
|
||||
pha and error code.
|
||||
ldx #$0B restore 13 byes of parms
|
||||
H2D4B lda a1l1,x
|
||||
sta A1L,x
|
||||
dex
|
||||
bpl H2D4B
|
||||
lda sp1 restore xfer parms.
|
||||
bit $6060 addr $FF58 must = rts ($60) as in ROM
|
||||
lda sp1 restore xfer parms.
|
||||
bit $6060 addr $FF58 must = rts ($60) as in ROM
|
||||
sta passit
|
||||
lda sp1+1
|
||||
sta passit+1
|
||||
pla restore error code
|
||||
plp and status.
|
||||
pla restore error code
|
||||
plp and status.
|
||||
rts
|
||||
mainwrt .EQ *-ofsR2 transfer data to card.
|
||||
sta SETWRITEAUX write to alt 48K
|
||||
mainwrt .EQ *-ofsR2 transfer data to card.
|
||||
sta SETWRITEAUX write to alt 48K
|
||||
ldy #$00
|
||||
H2D6A lda (A1L),y pointers set in card by 'setptr'
|
||||
H2D6A lda (A1L),y pointers set in card by 'setptr'
|
||||
sta (A4L),y
|
||||
lda (A2L),y
|
||||
sta (A3L),y
|
||||
dey
|
||||
bne H2D6A
|
||||
sta CLRWRITEAUX write to main 48K.
|
||||
lda #donewrt done writing card
|
||||
sta CLRWRITEAUX write to main 48K.
|
||||
lda #donewrt done writing card
|
||||
sta passit
|
||||
lda /donewrt
|
||||
jmp gocard
|
||||
sp1 .EQ *-ofsR2
|
||||
.HS 0000
|
||||
a1l1 .EQ *-ofsR2 13 bytes of storage
|
||||
.HS 0000
|
||||
a1l1 .EQ *-ofsR2 13 bytes of storage
|
||||
|
||||
* end of obj ram_2
|
||||
|
||||
|
|
|
@ -5,17 +5,17 @@ NEW
|
|||
* /RAM installer - transfer part of the driver to the aux bank
|
||||
* and front part of the driver to the main bank (language card).
|
||||
|
||||
RAM_1 .BS $2C80-*
|
||||
RAM_1 .BS $2C80-*
|
||||
|
||||
H2C80 ldy #$99 move $9A bytesfrom lcsrc to lcdest.
|
||||
H2C80 ldy #$99 move $9A bytesfrom lcsrc to lcdest.
|
||||
|
||||
.1 lda lcsrc,y transfer main bank portion of driver
|
||||
.1 lda lcsrc,y transfer main bank portion of driver
|
||||
sta lcdest,y
|
||||
dey
|
||||
cpy #$FF
|
||||
bne .1
|
||||
|
||||
ldx #ramsrc set up to move aux portion of driver
|
||||
ldx #ramsrc set up to move aux portion of driver
|
||||
stx A1L
|
||||
dex
|
||||
stx A2L
|
||||
|
@ -25,19 +25,19 @@ H2C80 ldy #$99 move $9A bytesfrom lcsrc to lcdest.
|
|||
stx A2L+1
|
||||
lda #ramdest
|
||||
sta A4L
|
||||
lda /ramdest ramsrc to ramdest
|
||||
lda /ramdest ramsrc to ramdest
|
||||
sta A4L+1
|
||||
sec irection = to aux bank.
|
||||
sec irection = to aux bank.
|
||||
jsr auxmove move aux bank portion of driver.
|
||||
|
||||
lda #lcdest put driver address into
|
||||
sta drivertbl2+6 slot 3, drive 2.
|
||||
sta drivertbl2+6 slot 3, drive 2.
|
||||
lda /lcdest
|
||||
sta drivertbl2+7
|
||||
|
||||
inc numdevs count (-1) active devices
|
||||
inc numdevs count (-1) active devices
|
||||
ldx numdevs
|
||||
lda #$BF unit num of /RAM
|
||||
lda #$BF unit num of /RAM
|
||||
sta devlist,x
|
||||
rts end of obj ram_1
|
||||
|
||||
|
|
|
@ -16,101 +16,101 @@ NEW
|
|||
* $60-$67: returns blocks $68-$7F in bank 1 of language card
|
||||
* $68-$7F: returns blocks $68-$7F in bank 2 of language card
|
||||
|
||||
ofsR0 .EQ *-ramdest offset to /RAM driver org
|
||||
ofsR0 .EQ *-ramdest offset to /RAM driver org
|
||||
|
||||
ramsrc lda RD80STORE read 80 store
|
||||
pha save for later
|
||||
sta CLR80STORE turn off 80 store
|
||||
ldx #$04 move the parameters for use:
|
||||
L5109 lda A4L,x cmd, unit, bufptr and block (lo)
|
||||
sta tcmd,x -> tcmd, tunit, R2L, R2H, R01
|
||||
ramsrc lda RD80STORE read 80 store
|
||||
pha save for later
|
||||
sta CLR80STORE turn off 80 store
|
||||
ldx #$04 move the parameters for use:
|
||||
L5109 lda A4L,x cmd, unit, bufptr and block (lo)
|
||||
sta tcmd,x -> tcmd, tunit, R2L, R2H, R01
|
||||
dex
|
||||
bpl L5109
|
||||
and formatflg format the volume first time
|
||||
bne L514F thru, or when requested.
|
||||
ldx bloknml save R01 during format.
|
||||
lda /vblock1 block to be cleared.
|
||||
jsr clrbuf1 clears all buffers.
|
||||
ldy #$03 format volume in 2 chunks.
|
||||
L511F lda VDIR,y
|
||||
and formatflg format the volume first time
|
||||
bne L514F thru, or when requested.
|
||||
ldx bloknml save R01 during format.
|
||||
lda /vblock1 block to be cleared.
|
||||
jsr clrbuf1 clears all buffers.
|
||||
ldy #$03 format volume in 2 chunks.
|
||||
L511F lda VDIR,y
|
||||
sta vblock1+4,y
|
||||
dey
|
||||
bpl L511F
|
||||
lda #$FE set last block as unusable
|
||||
sta BITMAP+15 to protect vectors.
|
||||
tya set bitmap bits to $FF.
|
||||
ldy #$0E 15 bytes to set
|
||||
L5130 sta BITMAP,y
|
||||
lda #$FE set last block as unusable
|
||||
sta BITMAP+15 to protect vectors.
|
||||
tya set bitmap bits to $FF.
|
||||
ldy #$0E 15 bytes to set
|
||||
L5130 sta BITMAP,y
|
||||
dey
|
||||
bne L5130
|
||||
sty BITMAP first byte = 0.
|
||||
ldy #$07 do other chunk
|
||||
L513B lda access,y
|
||||
sty BITMAP first byte = 0.
|
||||
ldy #$07 do other chunk
|
||||
L513B lda access,y
|
||||
sta vblock1+34,y
|
||||
dey
|
||||
bpl L513B
|
||||
lda formatflg if 0, set to $FF
|
||||
bne L51AA else exitcard.
|
||||
sty formatflg y = $FF, won't format next time.
|
||||
stx R01 restore R01
|
||||
lda formatflg if 0, set to $FF
|
||||
bne L51AA else exitcard.
|
||||
sty formatflg y = $FF, won't format next time.
|
||||
stx R01 restore R01
|
||||
|
||||
* use the requested block number to determine
|
||||
* which routine performs the transfer
|
||||
|
||||
L514F asl R01 block requested -> page requested.
|
||||
lda R01 get page requested.
|
||||
cmp #$BF in language card ?
|
||||
bcs L5163 yes, do it.
|
||||
cmp #$06 bitmap ?
|
||||
L514F asl R01 block requested -> page requested.
|
||||
lda R01 get page requested.
|
||||
cmp #$BF in language card ?
|
||||
bcs L5163 yes, do it.
|
||||
cmp #$06 bitmap ?
|
||||
bne L5160
|
||||
jmp tbmap yes, transfer bitmap
|
||||
L5160 jmp treg else normal transfer.
|
||||
jmp tbmap yes, transfer bitmap
|
||||
L5160 jmp treg else normal transfer.
|
||||
|
||||
* when a block between $60 and $7F is requested, it must be spirited into/from
|
||||
* the language card area of the 64k card. this requires a 2 stage move:
|
||||
* into the temp buffer and then to it's real destination.
|
||||
|
||||
L5163 tax save R1 for later.
|
||||
jsr setptr get direction
|
||||
php and save it.
|
||||
bcs L51B8 if it's a write.
|
||||
lcrd .EQ *-ofsR0
|
||||
txa get R1 back
|
||||
cmp #$CF which bank is it in ?
|
||||
bcs L5173 in main bank.
|
||||
ora #$10 in secondary bank.
|
||||
bne L5179 branch always.
|
||||
L5173 sta RRAMWRAMBNK2 turn on main $D000
|
||||
L5163 tax save R1 for later.
|
||||
jsr setptr get direction
|
||||
php and save it.
|
||||
bcs L51B8 if it's a write.
|
||||
lcrd .EQ *-ofsR0
|
||||
txa get R1 back
|
||||
cmp #$CF which bank is it in ?
|
||||
bcs L5173 in main bank.
|
||||
ora #$10 in secondary bank.
|
||||
bne L5179 branch always.
|
||||
L5173 sta RRAMWRAMBNK2 turn on main $D000
|
||||
sta RRAMWRAMBNK2
|
||||
L5179 sta R01 restore R1.
|
||||
lda R2H save R2 for later
|
||||
L5179 sta R01 restore R1.
|
||||
lda R2H save R2 for later
|
||||
pha
|
||||
ldx R2L
|
||||
sta SETALTZP use alternate zero page/stack
|
||||
lda /dbuf set R2 to dbuf
|
||||
sta SETALTZP use alternate zero page/stack
|
||||
lda /dbuf set R2 to dbuf
|
||||
sta R2H
|
||||
lda #dbuf
|
||||
sta R2L
|
||||
jsr setptr set pointers
|
||||
tay A > 0 from setptr
|
||||
L5194 lda (A1L),y move A1,A2 to A4,A3
|
||||
jsr setptr set pointers
|
||||
tay A > 0 from setptr
|
||||
L5194 lda (A1L),y move A1,A2 to A4,A3
|
||||
sta (A4L),y
|
||||
lda (A2L),y
|
||||
sta (A3L),y
|
||||
dey
|
||||
bne L5194
|
||||
sta CLRALTZP use main zero page/stack
|
||||
L51A2 stx R2L
|
||||
pla restore R2
|
||||
sta CLRALTZP use main zero page/stack
|
||||
L51A2 stx R2L
|
||||
pla restore R2
|
||||
sta R2H
|
||||
plp get direction.
|
||||
L51AA bcs L51B5 write, done with move.
|
||||
sta RRAMWRAMBNK1 switch in MLI part of LC
|
||||
plp get direction.
|
||||
L51AA bcs L51B5 write, done with move.
|
||||
sta RRAMWRAMBNK1 switch in MLI part of LC
|
||||
sta RRAMWRAMBNK1
|
||||
jsr blockdo0 read, transfer dbuf to main
|
||||
L51B5 jmp exitcard
|
||||
L51B8 jsr blockdo0 transfer main to dbuf.
|
||||
jmp lcrd transfer dbuf to language card
|
||||
L51B5 jmp exitcard
|
||||
L51B8 jsr blockdo0 transfer main to dbuf.
|
||||
jmp lcrd transfer dbuf to language card
|
||||
|
||||
* blockdo0 transfers a block between main memory and the 64k card. R1 contains
|
||||
* the page address of the block in the card; R2 contains the page address of
|
||||
|
@ -118,58 +118,58 @@ L51B8 jsr blockdo0 transfer main to dbuf.
|
|||
* language card, so the language card is always switched in. if cmd is 2, a
|
||||
* write is done (R2->R1); if cmd is 1, a read is done (R1->R2).
|
||||
|
||||
blockdo0 .EQ *-ofsR0 set up R1 = dbuf
|
||||
blockdo0 .EQ *-ofsR0 set up R1 = dbuf
|
||||
lda /dbuf
|
||||
blockdo1 .EQ *-ofsR0
|
||||
blockdo1 .EQ *-ofsR0
|
||||
sta R01
|
||||
blockdo .EQ *-ofsR0
|
||||
jsr setptr set pointers.
|
||||
bcs L51DB it's a write.
|
||||
sta CLRWRITEAUX transfer buffer directly to main.
|
||||
tay 0 left from setptr.
|
||||
L51CC lda (A1L),y transfer A1,A2 to A4,A3
|
||||
blockdo .EQ *-ofsR0
|
||||
jsr setptr set pointers.
|
||||
bcs L51DB it's a write.
|
||||
sta CLRWRITEAUX transfer buffer directly to main.
|
||||
tay 0 left from setptr.
|
||||
L51CC lda (A1L),y transfer A1,A2 to A4,A3
|
||||
sta (A4L),y
|
||||
lda (A2L),y
|
||||
sta (A3L),y
|
||||
dey
|
||||
bne L51CC
|
||||
sta SETWRITEAUX back the way it was.
|
||||
donewrt .EQ *-ofsR0 mainwrt returns here
|
||||
sta SETWRITEAUX back the way it was.
|
||||
donewrt .EQ *-ofsR0 mainwrt returns here
|
||||
rts
|
||||
L51DB lda #mainwrt pointers set up,
|
||||
sta passit pass control to main ram
|
||||
L51DB lda #mainwrt pointers set up,
|
||||
sta passit pass control to main ram
|
||||
lda /mainwrt
|
||||
jmp ex1 set passit+1 and transfer
|
||||
jmp ex1 set passit+1 and transfer
|
||||
|
||||
* setptr is used by other routines to set up pointers and dtect read or write
|
||||
|
||||
setptr .EQ *-ofsR0
|
||||
lda tcmd is it read or write ?
|
||||
setptr .EQ *-ofsR0
|
||||
lda tcmd is it read or write ?
|
||||
lsr
|
||||
bcs L5208 taken if write.
|
||||
lda R2H destination page
|
||||
bcs L5208 taken if write.
|
||||
lda R2H destination page
|
||||
sta A4L+1
|
||||
sta A3L+1
|
||||
lda R2L
|
||||
sta A4L
|
||||
sta A3L
|
||||
lda R01 source page
|
||||
lda R01 source page
|
||||
sta A1L+1
|
||||
sta A2L+1
|
||||
lda #$00 source page aligned
|
||||
lda #$00 source page aligned
|
||||
sta A1L
|
||||
sta A2L
|
||||
beq L5223
|
||||
L5208 lda R2H source page
|
||||
L5208 lda R2H source page
|
||||
sta A1L+1
|
||||
sta A2L+1
|
||||
lda R2L
|
||||
sta A1L
|
||||
sta A2L
|
||||
lda R01 destination page
|
||||
lda R01 destination page
|
||||
sta A4L+1
|
||||
sta A3L+1
|
||||
lda #$00 destination page aligned
|
||||
lda #$00 destination page aligned
|
||||
sta A4L
|
||||
sta A3L
|
||||
L5223 inc A2L+1
|
||||
|
@ -179,21 +179,21 @@ L5223 inc A2L+1
|
|||
* tzip is called if blocks 0,1,4,5 are requested.
|
||||
* on write it does nothing, on read it returns 0's.
|
||||
|
||||
tzip jsr clrbuf0 fill dbuf with 0's
|
||||
jsr blockdo transfer the 0's
|
||||
jmp exitcard and return
|
||||
tzip jsr clrbuf0 fill dbuf with 0's
|
||||
jsr blockdo transfer the 0's
|
||||
jmp exitcard and return
|
||||
|
||||
* clrbuf fills the buffer indicated by R01 to 0's.
|
||||
* should only be called on a read or format.
|
||||
|
||||
clrbuf0 .EQ *-ofsR0
|
||||
lda /dbuf dbuf is temp buffer.
|
||||
clrbuf1 .EQ *-ofsR0
|
||||
sta R01 assign to block.
|
||||
clrbuf2 .EQ *-ofsR0
|
||||
jsr setptr set pointers
|
||||
tay acc = 0
|
||||
L523A sta (A1L),y
|
||||
clrbuf0 .EQ *-ofsR0
|
||||
lda /dbuf dbuf is temp buffer.
|
||||
clrbuf1 .EQ *-ofsR0
|
||||
sta R01 assign to block.
|
||||
clrbuf2 .EQ *-ofsR0
|
||||
jsr setptr set pointers
|
||||
tay acc = 0
|
||||
L523A sta (A1L),y
|
||||
sta (A2L),y
|
||||
dey
|
||||
bne L523A
|
||||
|
@ -203,32 +203,32 @@ L523A sta (A1L),y
|
|||
* so that 8k data files will be contiguous (the index
|
||||
* blocks will not be placed within data).
|
||||
|
||||
treg .EQ *-ofsR0
|
||||
cmp #$04 page 4 = vdir
|
||||
bne L524A not vdir, continue
|
||||
lda #$07 else transfer block 7
|
||||
treg .EQ *-ofsR0
|
||||
cmp #$04 page 4 = vdir
|
||||
bne L524A not vdir, continue
|
||||
lda #$07 else transfer block 7
|
||||
bne L5258
|
||||
L524A cmp #$0F if any page < $F (block 8) requested,
|
||||
bcc tzip it is invalid.
|
||||
ldx #$00 x = # of iterations.
|
||||
lda bloknml use true block #.
|
||||
cmp #$5D beyond 8k blocks ?
|
||||
bcc L525B no, do normal
|
||||
sbc #$50 else subtract offset
|
||||
L5258 jmp times2 and multiply by 2
|
||||
L524A cmp #$0F if any page < $F (block 8) requested,
|
||||
bcc tzip it is invalid.
|
||||
ldx #$00 x = # of iterations.
|
||||
lda bloknml use true block #.
|
||||
cmp #$5D beyond 8k blocks ?
|
||||
bcc L525B no, do normal
|
||||
sbc #$50 else subtract offset
|
||||
L5258 jmp times2 and multiply by 2
|
||||
|
||||
* determine which 8k chunk it is in, place in x;
|
||||
* block offset into chunk goes into y.
|
||||
|
||||
L525B sec
|
||||
sbc #$08 block=block-6
|
||||
L525E cmp #$11 if <=17 then done
|
||||
L525B sec
|
||||
sbc #$08 block=block-6
|
||||
L525E cmp #$11 if <=17 then done
|
||||
bcc L5268
|
||||
sbc #$11 else block=block-17.
|
||||
inx iteration count.
|
||||
bpl L525E should branch always
|
||||
.HS 00 otherwise crash !!!
|
||||
L5268 tay remainder in y
|
||||
sbc #$11 else block=block-17.
|
||||
inx iteration count.
|
||||
bpl L525E should branch always
|
||||
.HS 00 otherwise crash !!!
|
||||
L5268 tay remainder in y
|
||||
|
||||
* if remainder is 1 then it's an index block:
|
||||
* start index blocks at $1000,$2000...$19FF.
|
||||
|
@ -237,107 +237,107 @@ L5268 tay remainder in y
|
|||
* otherwise, it is some other data block.
|
||||
* page is 32 + (16 * x) + (2 * y)
|
||||
|
||||
cpy #$01 is it index block ?
|
||||
bne L5273 no.
|
||||
txa index = 2 * (8 + x)
|
||||
cpy #$01 is it index block ?
|
||||
bne L5273 no.
|
||||
txa index = 2 * (8 + x)
|
||||
clc
|
||||
adc #$08
|
||||
bne L5285 multiply by 2.
|
||||
L5273 inx iteration + 1.
|
||||
txa page = 2 * (16 + 8x)
|
||||
bne L5285 multiply by 2.
|
||||
L5273 inx iteration + 1.
|
||||
txa page = 2 * (16 + 8x)
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
sta R01
|
||||
tya get offset into 8k chunk
|
||||
beq L5281 if 0, no offset
|
||||
dey else offset = 2 * y
|
||||
tya get offset into 8k chunk
|
||||
beq L5281 if 0, no offset
|
||||
dey else offset = 2 * y
|
||||
tya
|
||||
L5281 clc
|
||||
L5281 clc
|
||||
adc R01
|
||||
times2 .EQ *-ofsR0
|
||||
L5285 asl acc = 2 * acc
|
||||
jsr blockdo1 store in R01 and transfer
|
||||
jmp exitcard and return
|
||||
times2 .EQ *-ofsR0
|
||||
L5285 asl acc = 2 * acc
|
||||
jsr blockdo1 store in R01 and transfer
|
||||
jmp exitcard and return
|
||||
|
||||
* when block 3 is requested, the bitmap is returned. the real bitmap is only
|
||||
* 16 bytes long; the rest of the block is synthesized. the temporary buffer
|
||||
* at $800 is used to build/read a full size bitmap block.
|
||||
|
||||
tbmap .EQ *-ofsR0
|
||||
lda /dbuf use temp buffer as block
|
||||
tbmap .EQ *-ofsR0
|
||||
lda /dbuf use temp buffer as block
|
||||
sta R01
|
||||
jsr setptr set pointers, test read/write.
|
||||
bcs L52A9 branch if it's write.
|
||||
jsr setptr set pointers, test read/write.
|
||||
bcs L52A9 branch if it's write.
|
||||
jsr clrbuf2
|
||||
ldy #$0F put real bitmap there
|
||||
L529B lda BITMAP,y
|
||||
ldy #$0F put real bitmap there
|
||||
L529B lda BITMAP,y
|
||||
sta (A1L),y
|
||||
dey
|
||||
bpl L529B
|
||||
jsr blockdo move temp buf to user buf
|
||||
jsr blockdo move temp buf to user buf
|
||||
jmp exitcard
|
||||
L52A9 jsr blockdo move user buf to temp buf
|
||||
L52A9 jsr blockdo move user buf to temp buf
|
||||
jsr setptr
|
||||
ldy #$0F move temp buf to bitmap.
|
||||
L52B1 lda (A4L),y (pointer set by setptr)
|
||||
ldy #$0F move temp buf to bitmap.
|
||||
L52B1 lda (A4L),y (pointer set by setptr)
|
||||
sta BITMAP,y
|
||||
dey
|
||||
bpl L52B1
|
||||
jmp exitcard
|
||||
|
||||
formatflg .EQ *-ofsR0
|
||||
.HS 00 not formatted yet
|
||||
.HS 00 not formatted yet
|
||||
tcmd .EQ *-ofsR0
|
||||
.HS 00 command
|
||||
.HS 00 unit (not used)
|
||||
.HS 00 command
|
||||
.HS 00 unit (not used)
|
||||
R2L .EQ *-ofsR0
|
||||
.HS 00 R2 = user buffer
|
||||
.HS 00 R2 = user buffer
|
||||
R2H .EQ *-ofsR0
|
||||
.HS 00
|
||||
R01 .EQ *-ofsR0
|
||||
.HS 00 page requested
|
||||
.HS 00 page requested
|
||||
BITMAP .EQ *-ofsR0
|
||||
.HS 00FFFFFF blocks 0-7 used
|
||||
.HS FFFFFFFF
|
||||
.HS 00FFFFFF blocks 0-7 used
|
||||
.HS FFFFFFFF
|
||||
.HS FFFFFFFE
|
||||
VDIR .EQ *-ofsR0 start of vdir.
|
||||
.HS F3 storage type = F, name length = 3
|
||||
.AS -"RAM"
|
||||
.HS FFFFFFFF
|
||||
.HS FFFFFFFE
|
||||
VDIR .EQ *-ofsR0 start of vdir.
|
||||
.HS F3 storage type = F, name length = 3
|
||||
.AS "RAM"
|
||||
access .EQ *-ofsR0
|
||||
.DA #$C3 destroy, rename, read enabled
|
||||
.HS 27 entry length
|
||||
.DA #$C3 destroy, rename, read enabled
|
||||
.HS 27 entry length
|
||||
.HS 0D
|
||||
.HS 0000
|
||||
.HS 0300 block 3
|
||||
.HS 7F 128 blocks
|
||||
.HS 0300 block 3
|
||||
.HS 7F 128 blocks
|
||||
|
||||
exitcard .EQ *-ofsR0
|
||||
lda RRAMWRAMBNK1 restore language card
|
||||
lda RRAMWRAMBNK1 restore language card
|
||||
lda RRAMWRAMBNK1
|
||||
pla get 80store
|
||||
bpl L52EA 80store wasn't on
|
||||
sta SET80STORE enable 80store
|
||||
L52EA jmp bypass jump around passit
|
||||
pla get 80store
|
||||
bpl L52EA 80store wasn't on
|
||||
sta SET80STORE enable 80store
|
||||
L52EA jmp bypass jump around passit
|
||||
passit .EQ *-ofsR0
|
||||
.HS 0000
|
||||
.HS 0000
|
||||
bypass .EQ *-ofsR0
|
||||
lda #noerr set up return to noerr
|
||||
lda #noerr set up return to noerr
|
||||
sta passit
|
||||
lda /noerr
|
||||
ex1 .EQ *-ofsR0
|
||||
ex1 .EQ *-ofsR0
|
||||
sta passit+1 also used by blockwrite
|
||||
clc transfer card to main
|
||||
clv use standard zeropage/stack
|
||||
jmp xfer jmp back from language card.
|
||||
clc transfer card to main
|
||||
clv use standard zeropage/stack
|
||||
jmp xfer jmp back from language card.
|
||||
|
||||
* NOTE: the previous section of code MUST NOT use $3FE or $3FF
|
||||
* since the interrupt vector must go there if aux interrupts
|
||||
* are to be used. no room for expansion here !!
|
||||
|
||||
.HS 0000 $3FE-$3FF
|
||||
.HS 0000 $3FE-$3FF
|
||||
|
||||
* end of obj ram_0
|
||||
*--------------------------------------
|
||||
|
|
|
@ -9,312 +9,312 @@ NEW
|
|||
* must remain somewhere between $E000-$F7FF. this routine must be less
|
||||
* than 3 pages in length.
|
||||
|
||||
ofsS .EQ *-dispadr offset to dispatcher org
|
||||
ofsS .EQ *-dispadr offset to dispatcher org
|
||||
|
||||
disp1obj lda RROMBNK2 read ROM
|
||||
sta CLR80DISP disable 80 col hardware
|
||||
sta CLRALTCHAR normal LC, flashing UC
|
||||
sta CLR80STORE disable 80 column store
|
||||
jsr setnorm set normal text mode
|
||||
jsr init init text screen
|
||||
jsr setvid reset output to screen
|
||||
jsr setkbd reset input to keyboard
|
||||
ldx #$17 clear the memory bitmap
|
||||
lda #$01 but protect page $BF00.
|
||||
sta memmap,x P8 memory bitmap
|
||||
disp1obj lda RROMBNK2 read ROM
|
||||
sta CLR80DISP disable 80 col hardware
|
||||
sta CLRALTCHAR normal LC, flashing UC
|
||||
sta CLR80STORE disable 80 column store
|
||||
jsr setnorm set normal text mode
|
||||
jsr init init text screen
|
||||
jsr setvid reset output to screen
|
||||
jsr setkbd reset input to keyboard
|
||||
ldx #$17 clear the memory bitmap
|
||||
lda #$01 but protect page $BF00.
|
||||
sta memmap,x P8 memory bitmap
|
||||
dex
|
||||
lda #$00
|
||||
L5A22 sta memmap,x
|
||||
L5A22 sta memmap,x
|
||||
dex
|
||||
bpl L5A22
|
||||
lda #$CF protect zero page, stack and
|
||||
sta memmap $400-$7FF (text screen display)
|
||||
L5A2D jsr home clear screen
|
||||
jsr crout position top/left
|
||||
lda #$CF protect zero page, stack and
|
||||
sta memmap $400-$7FF (text screen display)
|
||||
L5A2D jsr home clear screen
|
||||
jsr crout position top/left
|
||||
ldx #dsp1msg0-dsp1msgs
|
||||
jsr prntmsg 'enter prefix...'
|
||||
lda #$03 line 3
|
||||
jsr prntmsg 'enter prefix...'
|
||||
lda #$03 line 3
|
||||
sta cv
|
||||
jsr crout
|
||||
jsr MLI get prefix
|
||||
jsr MLI get prefix
|
||||
.DA #$C7
|
||||
.DA dsp1pfx
|
||||
ldx pbuf get prefix length
|
||||
lda #$00 put 0 at end of prefix
|
||||
ldx pbuf get prefix length
|
||||
lda #$00 put 0 at end of prefix
|
||||
sta pbuf+1,x
|
||||
ldx pbuf get length.
|
||||
beq L5A5D if no prefix to display.
|
||||
L5A52 lda pbuf,x display prefix directly to screen
|
||||
ora #$80 normal text
|
||||
sta vline5-1,x line 5
|
||||
ldx pbuf get length.
|
||||
beq L5A5D if no prefix to display.
|
||||
L5A52 lda pbuf,x display prefix directly to screen
|
||||
ora #$80 normal text
|
||||
sta vline5-1,x line 5
|
||||
dex
|
||||
bne L5A52
|
||||
L5A5D ldx #$00
|
||||
L5A5D ldx #$00
|
||||
dec cv
|
||||
jsr crout
|
||||
getkey .EQ *-ofsS
|
||||
jsr rdkey input char with cursor
|
||||
cmp #$8D cr ?
|
||||
beq L5ABD yes, accept what is entered.
|
||||
pha no, save the char.
|
||||
jsr clreol clear rest of line.
|
||||
pla get char back
|
||||
cmp #$9B esc ?
|
||||
beq L5A2D yes, start over
|
||||
cmp #$98 ctrl-x ?
|
||||
L5A76 beq L5A2D then start over
|
||||
cmp #$89 tab ?
|
||||
getkey .EQ *-ofsS
|
||||
jsr rdkey input char with cursor
|
||||
cmp #$8D cr ?
|
||||
beq L5ABD yes, accept what is entered.
|
||||
pha no, save the char.
|
||||
jsr clreol clear rest of line.
|
||||
pla get char back
|
||||
cmp #$9B esc ?
|
||||
beq L5A2D yes, start over
|
||||
cmp #$98 ctrl-x ?
|
||||
L5A76 beq L5A2D then start over
|
||||
cmp #$89 tab ?
|
||||
beq badkey
|
||||
cmp #$FF delete ?
|
||||
beq L5A84 if yes
|
||||
cmp #$88 backspace ?
|
||||
bne L5A91 if not
|
||||
L5A84 cpx #$00 at column 0 ?
|
||||
beq L5A8B if so, do nothing
|
||||
dec ch else move left
|
||||
dex dec char count
|
||||
L5A8B jsr clreol clear rest of line
|
||||
jmp getkey get another char
|
||||
L5A91 bcs L5A99
|
||||
badkey jsr bell output bell for bad key
|
||||
jmp getkey and get another.
|
||||
L5A99 cmp #$DB below 'Z' ?
|
||||
bcc L5A9F if yes
|
||||
and #$DF else shift to uppercase.
|
||||
L5A9F cmp #$AE below '.' ?
|
||||
cmp #$FF delete ?
|
||||
beq L5A84 if yes
|
||||
cmp #$88 backspace ?
|
||||
bne L5A91 if not
|
||||
L5A84 cpx #$00 at column 0 ?
|
||||
beq L5A8B if so, do nothing
|
||||
dec ch else move left
|
||||
dex dec char count
|
||||
L5A8B jsr clreol clear rest of line
|
||||
jmp getkey get another char
|
||||
L5A91 bcs L5A99
|
||||
badkey jsr bell output bell for bad key
|
||||
jmp getkey and get another.
|
||||
L5A99 cmp #$DB below 'Z' ?
|
||||
bcc L5A9F if yes
|
||||
and #$DF else shift to uppercase.
|
||||
L5A9F cmp #$AE below '.' ?
|
||||
bcc badkey
|
||||
cmp #$DB above 'Z' ?
|
||||
cmp #$DB above 'Z' ?
|
||||
bcs badkey
|
||||
cmp #$BA below ':' ?
|
||||
cmp #$BA below ':' ?
|
||||
bcc goodkey
|
||||
cmp #$C1 at or above 'A' ?
|
||||
cmp #$C1 at or above 'A' ?
|
||||
bcc badkey
|
||||
goodkey inx
|
||||
cpx #$27 more than 39 chars ?
|
||||
bcs L5A76 then too many, go restart.
|
||||
sta pbuf,x save it
|
||||
goodkey inx
|
||||
cpx #$27 more than 39 chars ?
|
||||
bcs L5A76 then too many, go restart.
|
||||
sta pbuf,x save it
|
||||
jsr cout
|
||||
jmp getkey get another.
|
||||
L5ABD cpx #$00 prefix length = 0 ?
|
||||
beq L5AD3 if yes, don't set length.
|
||||
stx pbuf set prefix length.
|
||||
jsr MLI call mli to set prefix.
|
||||
.DA #$C6
|
||||
.DA dsp1pfx
|
||||
bcc L5AD3 if ok, go get filename.
|
||||
jsr bell if not, ring bell
|
||||
lda #$00 and try again for prefix.
|
||||
L5AD1 beq L5A76
|
||||
L5AD3 jsr home clear screen for application name.
|
||||
jmp getkey get another.
|
||||
L5ABD cpx #$00 prefix length = 0 ?
|
||||
beq L5AD3 if yes, don't set length.
|
||||
stx pbuf set prefix length.
|
||||
jsr MLI call mli to set prefix.
|
||||
.DA #$C6
|
||||
.DA dsp1pfx
|
||||
bcc L5AD3 if ok, go get filename.
|
||||
jsr bell if not, ring bell
|
||||
lda #$00 and try again for prefix.
|
||||
L5AD1 beq L5A76
|
||||
L5AD3 jsr home clear screen for application name.
|
||||
jsr crout
|
||||
ldx #disp1msg-dsp1msgs
|
||||
jsr prntmsg 'enter pathname...'
|
||||
retryrich .EQ *-ofsS
|
||||
lda #$03 line 3
|
||||
jsr prntmsg 'enter pathname...'
|
||||
retryrich .EQ *-ofsS
|
||||
lda #$03 line 3
|
||||
sta cv
|
||||
jsr crout
|
||||
ldx #$00
|
||||
loop1 .EQ *-ofsS
|
||||
jsr rdkey input char with cursor.
|
||||
cmp #$9B esc ?
|
||||
bne L5AF4 if not esc.
|
||||
lda ch esc pressed in column 0 ?
|
||||
bne L5AD3 if not, get pathname again.
|
||||
beq L5AD1 if so, get prefix again.
|
||||
L5AF4 cmp #$98 ctrl-x ?
|
||||
L5AF6 beq L5AD3 then cancel and get pathname again.
|
||||
cmp #$89 tab ?
|
||||
beq L5B09 not good.
|
||||
cmp #$FF delete ?
|
||||
beq L5B04 delete char.
|
||||
cmp #$88 backspace ?
|
||||
loop1 .EQ *-ofsS
|
||||
jsr rdkey input char with cursor.
|
||||
cmp #$9B esc ?
|
||||
bne L5AF4 if not esc.
|
||||
lda ch esc pressed in column 0 ?
|
||||
bne L5AD3 if not, get pathname again.
|
||||
beq L5AD1 if so, get prefix again.
|
||||
L5AF4 cmp #$98 ctrl-x ?
|
||||
L5AF6 beq L5AD3 then cancel and get pathname again.
|
||||
cmp #$89 tab ?
|
||||
beq L5B09 not good.
|
||||
cmp #$FF delete ?
|
||||
beq L5B04 delete char.
|
||||
cmp #$88 backspace ?
|
||||
bne L5B07
|
||||
L5B04 jmp delchar delete char.
|
||||
L5B07 bcs L5B0F if > $88 then char may be acceptable.
|
||||
L5B09 jsr bell output bell (ctl-G)
|
||||
jmp loop1 not good.
|
||||
L5B0F cmp #$8D cr ?
|
||||
beq L5B3C then done.
|
||||
cmp #$DB less than 'Z' ?
|
||||
bcc L5B19 no.
|
||||
and #$DF make sure it's uppercase.
|
||||
L5B19 cmp #$AE '.' ?
|
||||
bcc L5B09 not good if less.
|
||||
cmp #$DB less than '[' ?
|
||||
bcs L5B09 not good.
|
||||
cmp #$BA <= '9' ?
|
||||
bcc L5B29 then ok.
|
||||
cmp #$C1 greater than 'A' ?
|
||||
bcc L5B09 if not, then no good.
|
||||
L5B29 pha it's good, save it.
|
||||
jsr clreol clear to end of line
|
||||
L5B04 jmp delchar delete char.
|
||||
L5B07 bcs L5B0F if > $88 then char may be acceptable.
|
||||
L5B09 jsr bell output bell (ctl-G)
|
||||
jmp loop1 not good.
|
||||
L5B0F cmp #$8D cr ?
|
||||
beq L5B3C then done.
|
||||
cmp #$DB less than 'Z' ?
|
||||
bcc L5B19 no.
|
||||
and #$DF make sure it's uppercase.
|
||||
L5B19 cmp #$AE '.' ?
|
||||
bcc L5B09 not good if less.
|
||||
cmp #$DB less than '[' ?
|
||||
bcs L5B09 not good.
|
||||
cmp #$BA <= '9' ?
|
||||
bcc L5B29 then ok.
|
||||
cmp #$C1 greater than 'A' ?
|
||||
bcc L5B09 if not, then no good.
|
||||
L5B29 pha it's good, save it.
|
||||
jsr clreol clear to end of line
|
||||
pla
|
||||
jsr cout print it
|
||||
jsr cout print it
|
||||
inx
|
||||
cpx #$27 more than 39 chars ?
|
||||
bcs L5AF6 too long, get pathname again.
|
||||
sta pbuf,x store it.
|
||||
jmp loop1 get another char
|
||||
L5B3C lda #$A0
|
||||
jsr cout after cr, blank out the cursor.
|
||||
stx pbuf put length in front of the name.
|
||||
jsr MLI get file info for pathname in pbuf
|
||||
.DA #$C4
|
||||
.DA dsp1info
|
||||
bcc L5B4F if no errors.
|
||||
cpx #$27 more than 39 chars ?
|
||||
bcs L5AF6 too long, get pathname again.
|
||||
sta pbuf,x store it.
|
||||
jmp loop1 get another char
|
||||
L5B3C lda #$A0
|
||||
jsr cout after cr, blank out the cursor.
|
||||
stx pbuf put length in front of the name.
|
||||
jsr MLI get file info for pathname in pbuf
|
||||
.DA #$C4
|
||||
.DA dsp1info
|
||||
bcc L5B4F if no errors.
|
||||
jmp dsp1error
|
||||
L5B4F lda dsp1type
|
||||
cmp #$FF is it a SYS file ?
|
||||
beq L5B5B yes.
|
||||
lda #$01 not SYS file error.
|
||||
L5B4F lda dsp1type
|
||||
cmp #$FF is it a SYS file ?
|
||||
beq L5B5B yes.
|
||||
lda #$01 not SYS file error.
|
||||
jmp dsp1error
|
||||
L5B5B lda #$00 it's a system file
|
||||
L5B5B lda #$00 it's a system file
|
||||
sta dsp1cln
|
||||
jsr MLI close all open files
|
||||
.DA #$CC
|
||||
.DA dsp1cls
|
||||
jsr MLI close all open files
|
||||
.DA #$CC
|
||||
.DA dsp1cls
|
||||
bcc L5B6B
|
||||
jmp dsp1error
|
||||
L5B6B lda dsp1acess check for proper access.
|
||||
and #$01 is read disabled ?
|
||||
bne L5B77 no, access ok.
|
||||
lda #$27 i/o error
|
||||
L5B6B lda dsp1acess check for proper access.
|
||||
and #$01 is read disabled ?
|
||||
bne L5B77 no, access ok.
|
||||
lda #$27 i/o error
|
||||
jmp dsp1error
|
||||
L5B77 jsr MLI open the file
|
||||
.DA #$C8
|
||||
.DA dsp1open
|
||||
L5B77 jsr MLI open the file
|
||||
.DA #$C8
|
||||
.DA dsp1open
|
||||
bcc L5B82
|
||||
jmp dsp1error
|
||||
L5B82 lda dsp1refn copy the reference number
|
||||
L5B82 lda dsp1refn copy the reference number
|
||||
sta dsp1rdn
|
||||
sta dsp1eofn
|
||||
jsr MLI get eof
|
||||
.DA #$D1
|
||||
.DA dsp1eof
|
||||
jsr MLI get eof
|
||||
.DA #$D1
|
||||
.DA dsp1eof
|
||||
bcs L5BE2
|
||||
lda dsp1eofb+2 3rd of 3 bytes.
|
||||
beq L5B9C if 0 then ok
|
||||
lda #$27 else i/o error because
|
||||
bne L5BE2 file is too large.
|
||||
L5B9C lda dsp1eofb move eof to # of bytes to read.
|
||||
lda dsp1eofb+2 3rd of 3 bytes.
|
||||
beq L5B9C if 0 then ok
|
||||
lda #$27 else i/o error because
|
||||
bne L5BE2 file is too large.
|
||||
L5B9C lda dsp1eofb move eof to # of bytes to read.
|
||||
sta dsp1cnt
|
||||
lda dsp1eofb+1
|
||||
sta dsp1cnt+1
|
||||
jsr MLI read the file
|
||||
.DA #$CA
|
||||
.DA dsp1read
|
||||
php save the status.
|
||||
jsr MLI close the file.
|
||||
.DA #$CC
|
||||
.DA dsp1cls
|
||||
jsr MLI read the file
|
||||
.DA #$CA
|
||||
.DA dsp1read
|
||||
php save the status.
|
||||
jsr MLI close the file.
|
||||
.DA #$CC
|
||||
.DA dsp1cls
|
||||
bcc L5BBB
|
||||
L5BB7 plp get status (it is irrelevant now)
|
||||
bne L5BE2 if close generated an error
|
||||
plp here if close was ok.
|
||||
L5BBB bcs L5BB7 error.
|
||||
jmp sysentry execute system file
|
||||
delchar .EQ *-ofsS
|
||||
lda ch is cursor in column 0 ?
|
||||
beq L5BD3 yes, ignore it.
|
||||
L5BB7 plp get status (it is irrelevant now)
|
||||
bne L5BE2 if close generated an error
|
||||
plp here if close was ok.
|
||||
L5BBB bcs L5BB7 error.
|
||||
jmp sysentry execute system file
|
||||
delchar .EQ *-ofsS
|
||||
lda ch is cursor in column 0 ?
|
||||
beq L5BD3 yes, ignore it.
|
||||
dex
|
||||
lda #$A0 blank out the cursor
|
||||
lda #$A0 blank out the cursor
|
||||
jsr cout
|
||||
dec ch
|
||||
dec ch point to last char entered
|
||||
jsr cout and blank it too.
|
||||
dec ch point to that location.
|
||||
L5BD3 jmp loop1 get next char.
|
||||
prntmsg .EQ *-ofsS
|
||||
L5BD6 lda dsp1msgs,x
|
||||
dec ch point to last char entered
|
||||
jsr cout and blank it too.
|
||||
dec ch point to that location.
|
||||
L5BD3 jmp loop1 get next char.
|
||||
prntmsg .EQ *-ofsS
|
||||
L5BD6 lda dsp1msgs,x
|
||||
beq L5BE1
|
||||
jsr cout
|
||||
inx
|
||||
bne L5BD6
|
||||
L5BE1 rts
|
||||
L5BE1 rts
|
||||
|
||||
* dispatcher 1 error handler
|
||||
|
||||
dsp1error .EQ *-ofsS
|
||||
L5BE2 sta errnum
|
||||
lda #$0C display error message on line 13
|
||||
dsp1error .EQ *-ofsS
|
||||
L5BE2 sta errnum
|
||||
lda #$0C display error message on line 13
|
||||
sta cv
|
||||
jsr crout
|
||||
lda errnum
|
||||
cmp #$01
|
||||
bne L5BF5
|
||||
ldx #dsp1err1-dsp1msgs not a type 'sys' file
|
||||
bne L5C0B handled separately.
|
||||
L5BF5 cmp #$40 syntax error in pathname ?
|
||||
bne L5C0B handled separately.
|
||||
L5BF5 cmp #$40 syntax error in pathname ?
|
||||
beq L5C09
|
||||
cmp #$44 bad subdirectory path ?
|
||||
cmp #$44 bad subdirectory path ?
|
||||
beq L5C09
|
||||
cmp #$45 volume not found ?
|
||||
cmp #$45 volume not found ?
|
||||
beq L5C09
|
||||
cmp #$46 file not found ?
|
||||
cmp #$46 file not found ?
|
||||
beq L5C09
|
||||
ldx #dsp1err2-dsp1msgs if not the errors above then 'i/o error'
|
||||
bne L5C0B
|
||||
L5C09 ldx #dsp1err3-dsp1msgs otherwise display 'file/path not found'
|
||||
L5C0B jsr prntmsg
|
||||
jmp retryrich retry for application pathname
|
||||
L5C09 ldx #dsp1err3-dsp1msgs otherwise display 'file/path not found'
|
||||
L5C0B jsr prntmsg
|
||||
jmp retryrich retry for application pathname
|
||||
|
||||
dsp1msgs .EQ *-ofsS
|
||||
dsp1msg0 .EQ *-ofsS
|
||||
.AS -"ENTER PREFIX (PRESS "RETURN" TO ACCEPT)"
|
||||
.HS 00
|
||||
disp1msg .EQ *-ofsS
|
||||
dsp1msgs .EQ *-ofsS
|
||||
dsp1msg0 .EQ *-ofsS
|
||||
.AS -'ENTER PREFIX (PRESS "RETURN" TO ACCEPT)'
|
||||
.HS 00
|
||||
disp1msg .EQ *-ofsS
|
||||
.AS -"ENTER PATHNAME OF NEXT APPLICATION"
|
||||
.HS 00
|
||||
dsp1err1 .EQ *-ofsS
|
||||
.DA #$87
|
||||
.HS 00
|
||||
dsp1err1 .EQ *-ofsS
|
||||
.DA #$87
|
||||
.AS -'NOT A TYPE "SYS" FILE'
|
||||
.HS 00
|
||||
dsp1err2 .EQ *-ofsS
|
||||
.DA #$87
|
||||
.HS 00
|
||||
dsp1err2 .EQ *-ofsS
|
||||
.DA #$87
|
||||
.AS -"I/O ERROR "
|
||||
.HS 00
|
||||
dsp1err3 .EQ *-ofsS
|
||||
.DA #$87
|
||||
.HS 00
|
||||
dsp1err3 .EQ *-ofsS
|
||||
.DA #$87
|
||||
.AS -"FILE/PATH NOT FOUND "
|
||||
.HS 00
|
||||
dsp1info .EQ *-ofsS get file info parms
|
||||
.DA #$0A 10 parameters
|
||||
.HS 00
|
||||
dsp1info .EQ *-ofsS get file info parms
|
||||
.DA #$0A 10 parameters
|
||||
.DA pbuf pathname buffer
|
||||
dsp1acess .EQ *-ofsS
|
||||
.HS 00 access
|
||||
dsp1type .EQ *-ofsS
|
||||
.HS 00 file type
|
||||
.BS 13 the rest are unimportant
|
||||
dsp1open .EQ *-ofsS open file parms
|
||||
.HS 03 3 parameters for open
|
||||
.DA pbuf pathname buffer
|
||||
.DA fbuf fcb buffer
|
||||
dsp1refn .EQ *-ofsS
|
||||
.HS 00 reference #
|
||||
dsp1cls .EQ *-ofsS close file parms
|
||||
.DA #01 1 parameter for close
|
||||
dsp1cln .EQ *-ofsS
|
||||
.HS 00 reference #
|
||||
dsp1read .EQ *-ofsS
|
||||
.HS 04 4 parameters for read
|
||||
dsp1rdn .EQ *-ofsS
|
||||
.HS 00 reference #
|
||||
.DA sysentry .SYS load address
|
||||
dsp1cnt .EQ *-ofsS
|
||||
.HS 0000 byte count
|
||||
.HS 0000
|
||||
dsp1eof .EQ *-ofsS get eof parms
|
||||
.HS 02 2 parameters
|
||||
dsp1eofn .EQ *-ofsS
|
||||
.HS 00 reference #
|
||||
dsp1eofb .EQ *-ofsS
|
||||
.HS 000000 3 byte eof
|
||||
dsp1pfx .EQ *-ofsS get/set prefix parms
|
||||
.DA #01 1 parameter
|
||||
.DA pbuf prefix buffer
|
||||
dsp1acess .EQ *-ofsS
|
||||
.HS 00 access
|
||||
dsp1type .EQ *-ofsS
|
||||
.HS 00 file type
|
||||
.BS 13 the rest are unimportant
|
||||
dsp1open .EQ *-ofsS open file parms
|
||||
.HS 03 3 parameters for open
|
||||
.DA pbuf pathname buffer
|
||||
.DA fbuf fcb buffer
|
||||
dsp1refn .EQ *-ofsS
|
||||
.HS 00 reference #
|
||||
dsp1cls .EQ *-ofsS close file parms
|
||||
.DA #01 1 parameter for close
|
||||
dsp1cln .EQ *-ofsS
|
||||
.HS 00 reference #
|
||||
dsp1read .EQ *-ofsS
|
||||
.HS 04 4 parameters for read
|
||||
dsp1rdn .EQ *-ofsS
|
||||
.HS 00 reference #
|
||||
.DA sysentry .SYS load address
|
||||
dsp1cnt .EQ *-ofsS
|
||||
.HS 0000 byte count
|
||||
.HS 0000
|
||||
dsp1eof .EQ *-ofsS get eof parms
|
||||
.HS 02 2 parameters
|
||||
dsp1eofn .EQ *-ofsS
|
||||
.HS 00 reference #
|
||||
dsp1eofb .EQ *-ofsS
|
||||
.HS 000000 3 byte eof
|
||||
dsp1pfx .EQ *-ofsS get/set prefix parms
|
||||
.DA #01 1 parameter
|
||||
.DA pbuf prefix buffer
|
||||
|
||||
disp1end .EQ *
|
||||
.BS $300-disp1end+disp1obj fill to page boundary
|
||||
disp1end .EQ *
|
||||
.BS $300-disp1end+disp1obj fill to page boundary
|
||||
|
||||
* end of obj sel_0
|
||||
*--------------------------------------
|
||||
|
|
|
@ -3,322 +3,322 @@ NEW
|
|||
* object code = sel_1
|
||||
* Bird's Better Bye at org = dispadr
|
||||
|
||||
ofsB .EQ *-dispadr offset to Bird's Bye org
|
||||
ofsB .EQ *-dispadr offset to Bird's Bye org
|
||||
|
||||
birdbye cld
|
||||
birdbye cld
|
||||
lda RROMBNK2 read ROM
|
||||
stz softev
|
||||
lda /dispadr set reset vector to 'dispadr'
|
||||
lda /dispadr set reset vector to 'dispadr'
|
||||
sta softev+1
|
||||
jsr setpwrc create power-up byte
|
||||
jsr setpwrc create power-up byte
|
||||
lda #$A0
|
||||
jsr $C300 initialize 80 column text card
|
||||
jsr $C300 initialize 80 column text card
|
||||
ldx #$17
|
||||
|
||||
* set up memory bitmap in global page
|
||||
|
||||
L5D16 stz memmap,x P8 memory bitmap
|
||||
L5D16 stz memmap,x P8 memory bitmap
|
||||
dex
|
||||
bpl L5D16
|
||||
inc memmap+$17 protect global page
|
||||
lda #$CF protect zero page, stack and page 1
|
||||
inc memmap+$17 protect global page
|
||||
lda #$CF protect zero page, stack and page 1
|
||||
sta memmap
|
||||
lda #$02
|
||||
sta smparms init set mark parms pcount.
|
||||
sta smparms init set mark parms pcount.
|
||||
|
||||
* drive selector
|
||||
|
||||
ldx numdevs get device count and
|
||||
stx lstpntr store in zero page.
|
||||
lda devnum get last slot/drive
|
||||
ldx numdevs get device count and
|
||||
stx lstpntr store in zero page.
|
||||
lda devnum get last slot/drive
|
||||
bne volname
|
||||
ds2 .EQ *-ofsB
|
||||
L5D32 ldx lstpntr get device list pointer.
|
||||
lda devlist,x get unit number from list.
|
||||
cpx #$01 make sure it's real.
|
||||
bcs L5D3F if so, change list pointer.
|
||||
ldx numdevs get device count.
|
||||
ds2 .EQ *-ofsB
|
||||
L5D32 ldx lstpntr get device list pointer.
|
||||
lda devlist,x get unit number from list.
|
||||
cpx #$01 make sure it's real.
|
||||
bcs L5D3F if so, change list pointer.
|
||||
ldx numdevs get device count.
|
||||
inx
|
||||
L5D3F dex decrement list pointer and restore.
|
||||
L5D3F dex decrement list pointer and restore.
|
||||
stx lstpntr
|
||||
|
||||
* get and store volume name
|
||||
|
||||
volname sta ol_unit store unit number for online.
|
||||
volname sta ol_unit store unit number for online.
|
||||
jsr MLI
|
||||
.DA #$C5 online call
|
||||
.DA ol_parms
|
||||
bcs L5D32 error check.
|
||||
stz dlevel haven't read root directory yet.
|
||||
lda pbuf+1 load description byte.
|
||||
and #$0F mask for name length.
|
||||
beq L5D32 if 0, then try next unit.
|
||||
adc #$02 add 2 to length.
|
||||
tax name length in x.
|
||||
vnam1 .EQ *-ofsB
|
||||
stx pbuf save the name length
|
||||
lda #$2F '/'
|
||||
sta pbuf+1 slash before and
|
||||
sta pbuf,x after name.
|
||||
stz pbuf+1,x null after complete name.
|
||||
.DA #$C5 online call
|
||||
.DA ol_parms
|
||||
bcs L5D32 error check.
|
||||
stz dlevel haven't read root directory yet.
|
||||
lda pbuf+1 load description byte.
|
||||
and #$0F mask for name length.
|
||||
beq L5D32 if 0, then try next unit.
|
||||
adc #$02 add 2 to length.
|
||||
tax name length in x.
|
||||
vnam1 .EQ *-ofsB
|
||||
stx pbuf save the name length
|
||||
lda #$2F '/'
|
||||
sta pbuf+1 slash before and
|
||||
sta pbuf,x after name.
|
||||
stz pbuf+1,x null after complete name.
|
||||
|
||||
* open and read directory
|
||||
|
||||
jsr MLI
|
||||
.DA #$C8 open
|
||||
.DA op_parms
|
||||
bcc L5D7F good open.
|
||||
lda dlevel trying to open root directory ?
|
||||
beq L5D32 yes, just move to next volume.
|
||||
jsr bell1 no, generate bell tone
|
||||
jsr popdir and stay at same level.
|
||||
.DA #$C8 open
|
||||
.DA op_parms
|
||||
bcc L5D7F good open.
|
||||
lda dlevel trying to open root directory ?
|
||||
beq L5D32 yes, just move to next volume.
|
||||
jsr bell1 no, generate bell tone
|
||||
jsr popdir and stay at same level.
|
||||
stx pbuf
|
||||
jmp keyloop
|
||||
L5D7F inc dlevel
|
||||
stz filecount zero file count.
|
||||
lda op_refn get file reference number
|
||||
sta rd_refn store in read
|
||||
sta sm_refn and setmark parm lists.
|
||||
lda #$2B set read parm list for
|
||||
sta dhdr_len directory header length.
|
||||
L5D7F inc dlevel
|
||||
stz filecount zero file count.
|
||||
lda op_refn get file reference number
|
||||
sta rd_refn store in read
|
||||
sta sm_refn and setmark parm lists.
|
||||
lda #$2B set read parm list for
|
||||
sta dhdr_len directory header length.
|
||||
stz dhdr_len+1
|
||||
jsr doread read directory
|
||||
jsr doread read directory
|
||||
bcs L5DB3
|
||||
ldx #$03
|
||||
L5D9A lda sysentry+$23,x copy directory info
|
||||
sta entlen,x to zero page.
|
||||
L5D9A lda sysentry+$23,x copy directory info
|
||||
sta entlen,x to zero page.
|
||||
dex
|
||||
bpl L5D9A
|
||||
sta dhdr_len put entry length in read parm list.
|
||||
lda #$01 set block file counter to 1.
|
||||
sta dhdr_len put entry length in read parm list.
|
||||
lda #$01 set block file counter to 1.
|
||||
sta blkfl
|
||||
stz fpos_mid zero out msb's of file position
|
||||
stz fpos_hi in setmark parm list.
|
||||
lda filecnt any files in directory ?
|
||||
stz fpos_mid zero out msb's of file position
|
||||
stz fpos_hi in setmark parm list.
|
||||
lda filecnt any files in directory ?
|
||||
ora filecnt+1
|
||||
bne L5DB5 if so, continue
|
||||
L5DB3 bra L5E29 else go close directory file.
|
||||
L5DB5 bit filecnt+1 check msb of file count.
|
||||
bmi L5DB3 if set then done.
|
||||
L5DB9 lda fpos_mid get mid byte of setmark file position.
|
||||
and #$FE reset lsb
|
||||
sta fpos_mid and save.
|
||||
ldy blkfl block file counter
|
||||
bne L5DB5 if so, continue
|
||||
L5DB3 bra L5E29 else go close directory file.
|
||||
L5DB5 bit filecnt+1 check msb of file count.
|
||||
bmi L5DB3 if set then done.
|
||||
L5DB9 lda fpos_mid get mid byte of setmark file position.
|
||||
and #$FE reset lsb
|
||||
sta fpos_mid and save.
|
||||
ldy blkfl block file counter
|
||||
lda #$00
|
||||
cpy entblk have we read all entries in this block ?
|
||||
bcc L5DCE if not, continue.
|
||||
tay if so, zero y-reg and
|
||||
sty blkfl reset block counter / flag
|
||||
cpy entblk have we read all entries in this block ?
|
||||
bcc L5DCE if not, continue.
|
||||
tay if so, zero y-reg and
|
||||
sty blkfl reset block counter / flag
|
||||
inc fpos_mid
|
||||
|
||||
* set up setmark parameters for next file to be read.
|
||||
* if transfer to second sector, handle it.
|
||||
|
||||
L5DCC inc fpos_mid
|
||||
L5DCE dey decrement file block counter
|
||||
L5DCC inc fpos_mid
|
||||
L5DCE dey decrement file block counter
|
||||
clc
|
||||
bmi L5DD8
|
||||
adc entlen add entry length to acc.
|
||||
bcc L5DCE determine if we flopped into 2nd half of
|
||||
bcs L5DCC block, if so inc mid byte position.
|
||||
L5DD8 adc #$04 add 4 and put in
|
||||
sta fpos_lo low byte of setmark.
|
||||
jsr MLI call mli
|
||||
.DA #$CE set mark
|
||||
.DA #smparms parameters address = $0060
|
||||
adc entlen add entry length to acc.
|
||||
bcc L5DCE determine if we flopped into 2nd half of
|
||||
bcs L5DCC block, if so inc mid byte position.
|
||||
L5DD8 adc #$04 add 4 and put in
|
||||
sta fpos_lo low byte of setmark.
|
||||
jsr MLI call mli
|
||||
.DA #$CE set mark
|
||||
.DA #smparms parameters address = $0060
|
||||
.HS 00
|
||||
bcs L5DB3 error
|
||||
bcs L5DB3 error
|
||||
jsr doread
|
||||
bcs L5DB3 error.
|
||||
inc blkfl increase count of files read.
|
||||
bcs L5DB3 error.
|
||||
inc blkfl increase count of files read.
|
||||
lda sysentry file type/length.
|
||||
and #$F0 mask off high nibble.
|
||||
beq L5DB9 deleted file, try next one.
|
||||
dec filecnt decrement low file count.
|
||||
and #$F0 mask off high nibble.
|
||||
beq L5DB9 deleted file, try next one.
|
||||
dec filecnt decrement low file count.
|
||||
bne L5DF8
|
||||
dec filecnt+1 and high if necessary.
|
||||
L5DF8 ror sysentry+$1E check access bit.
|
||||
bcc L5DB5 if no read, try next file.
|
||||
dec filecnt+1 and high if necessary.
|
||||
L5DF8 ror sysentry+$1E check access bit.
|
||||
bcc L5DB5 if no read, try next file.
|
||||
lda sysentry+$10 get file type.
|
||||
cmp #$0F directory file ?
|
||||
beq L5E08 then continue.
|
||||
cmp #$FF system file ?
|
||||
bne L5DB5 no, read next file.
|
||||
L5E08 ldx filecount get valid files read.
|
||||
cpx #$80 if greater than size of filename buffer
|
||||
bcs L5E29 then close directory
|
||||
sta filetyps,x else store filetype in zero page
|
||||
jsr namecalc and go set up storage area.
|
||||
cmp #$0F directory file ?
|
||||
beq L5E08 then continue.
|
||||
cmp #$FF system file ?
|
||||
bne L5DB5 no, read next file.
|
||||
L5E08 ldx filecount get valid files read.
|
||||
cpx #$80 if greater than size of filename buffer
|
||||
bcs L5E29 then close directory
|
||||
sta filetyps,x else store filetype in zero page
|
||||
jsr namecalc and go set up storage area.
|
||||
ldy #$0F
|
||||
L5E15 lda sysentry,y get byte of filename
|
||||
sta (fnstore),y store in directed area
|
||||
L5E15 lda sysentry,y get byte of filename
|
||||
sta (fnstore),y store in directed area
|
||||
dey
|
||||
bpl L5E15
|
||||
iny y = 0
|
||||
and #$0F mask off low nibble (name length)
|
||||
sta (fnstore),y restore in name buffer
|
||||
inc filecount increment valid file counter
|
||||
bne L5DB5 get next file (branch always)
|
||||
L5E26 jmp ds2 error. try next unit.
|
||||
L5E29 jsr MLI close directory file
|
||||
.DA #$CC
|
||||
.DA cl_parms
|
||||
bcs L5E26 error.
|
||||
jsr settxt use full screen for windows
|
||||
iny y = 0
|
||||
and #$0F mask off low nibble (name length)
|
||||
sta (fnstore),y restore in name buffer
|
||||
inc filecount increment valid file counter
|
||||
bne L5DB5 get next file (branch always)
|
||||
L5E26 jmp ds2 error. try next unit.
|
||||
L5E29 jsr MLI close directory file
|
||||
.DA #$CC
|
||||
.DA cl_parms
|
||||
bcs L5E26 error.
|
||||
jsr settxt use full screen for windows
|
||||
jsr home
|
||||
lda #$17 cursor at bottom of screen.
|
||||
jsr TABV set vertical position.
|
||||
lda #$17 cursor at bottom of screen.
|
||||
jsr TABV set vertical position.
|
||||
ldy #$00
|
||||
lda #$14 horizontal position.
|
||||
jsr sethorz print message.
|
||||
jsr homecurs cursor to upper/left.
|
||||
lda #$14 horizontal position.
|
||||
jsr sethorz print message.
|
||||
jsr homecurs cursor to upper/left.
|
||||
ldx #$00
|
||||
L5E48 lda pbuf+1,x
|
||||
L5E48 lda pbuf+1,x
|
||||
beq showfiles
|
||||
jsr output
|
||||
inx
|
||||
bne L5E48
|
||||
showfiles stz valcnt
|
||||
stz topname init top filename index.
|
||||
lda filecount # of valid files.
|
||||
beq L5EB0 if no files.
|
||||
cmp #$15 more than what will fit on screen ?
|
||||
bcc L5E61 no.
|
||||
lda #$14 limit to 20 files on the screen.
|
||||
L5E61 sta gp_cnt
|
||||
lda #$02 set window dimensions
|
||||
showfiles stz valcnt
|
||||
stz topname init top filename index.
|
||||
lda filecount # of valid files.
|
||||
beq L5EB0 if no files.
|
||||
cmp #$15 more than what will fit on screen ?
|
||||
bcc L5E61 no.
|
||||
lda #$14 limit to 20 files on the screen.
|
||||
L5E61 sta gp_cnt
|
||||
lda #$02 set window dimensions
|
||||
sta wndtop
|
||||
sta wndlft
|
||||
lda #$16
|
||||
sta wndwdth
|
||||
sta wndbtm
|
||||
L5E6F jsr nameprnt output filename to screen
|
||||
L5E6F jsr nameprnt output filename to screen
|
||||
inc valcnt
|
||||
dec gp_cnt file counter.
|
||||
bne L5E6F continue printing names.
|
||||
dec gp_cnt file counter.
|
||||
bne L5E6F continue printing names.
|
||||
stz valcnt
|
||||
beq L5EAA if last file, it needs to be inverse.
|
||||
uparrow jsr nameprnt print old name in normal.
|
||||
ldx valcnt get old name number.
|
||||
beq L5EAA if already at the top name
|
||||
dec valcnt else fix index.
|
||||
lda cv current cursor line.
|
||||
cmp #$02 at top line of window ?
|
||||
bne L5EAA no, move up normally.
|
||||
dec topname fix offset index
|
||||
lda #$16 else sroll windows down a line.
|
||||
bne L5EA7 branch always.
|
||||
dnarrow jsr nameprnt print old name in normal.
|
||||
ldx valcnt get old name number.
|
||||
inx add one.
|
||||
beq L5EAA if last file, it needs to be inverse.
|
||||
uparrow jsr nameprnt print old name in normal.
|
||||
ldx valcnt get old name number.
|
||||
beq L5EAA if already at the top name
|
||||
dec valcnt else fix index.
|
||||
lda cv current cursor line.
|
||||
cmp #$02 at top line of window ?
|
||||
bne L5EAA no, move up normally.
|
||||
dec topname fix offset index
|
||||
lda #$16 else sroll windows down a line.
|
||||
bne L5EA7 branch always.
|
||||
dnarrow jsr nameprnt print old name in normal.
|
||||
ldx valcnt get old name number.
|
||||
inx add one.
|
||||
cpx filecount
|
||||
bcs L5EAA if already at last filename
|
||||
stx valcnt else update index.
|
||||
lda cv current cursor line.
|
||||
cmp #$15 at bottom line of window ?
|
||||
bne L5EAA no, move cursor normally.
|
||||
inc topname update offset index
|
||||
lda #$17 else scroll up a line.
|
||||
L5EA7 jsr cout
|
||||
L5EAA jsr setinv set inverse text mode.
|
||||
bcs L5EAA if already at last filename
|
||||
stx valcnt else update index.
|
||||
lda cv current cursor line.
|
||||
cmp #$15 at bottom line of window ?
|
||||
bne L5EAA no, move cursor normally.
|
||||
inc topname update offset index
|
||||
lda #$17 else scroll up a line.
|
||||
L5EA7 jsr cout
|
||||
L5EAA jsr setinv set inverse text mode.
|
||||
jsr nameprnt output last filename.
|
||||
keyloop .EQ *-ofsB
|
||||
L5EB0 lda kbd get keyboard input.
|
||||
bpl L5EB0 loop until key pressed.
|
||||
sta KBDSTROBE clear strobe.
|
||||
jsr setnorm set normal text mode.
|
||||
ldx filecount are any files displayed ?
|
||||
beq L5ECB no, don't accept arrow keys or return.
|
||||
cmp #$8D return ?
|
||||
beq L5EF4 then run selected file.
|
||||
cmp #$8A down ?
|
||||
beq dnarrow move down a name.
|
||||
cmp #$8B up ?
|
||||
beq uparrow move up a name.
|
||||
L5ECB cmp #$89 tab ?
|
||||
beq L5EED new volume.
|
||||
cmp #$9B esc ?
|
||||
bne L5EB0 no, try again else pop up a directory.
|
||||
keyloop .EQ *-ofsB
|
||||
L5EB0 lda kbd get keyboard input.
|
||||
bpl L5EB0 loop until key pressed.
|
||||
sta KBDSTROBE clear strobe.
|
||||
jsr setnorm set normal text mode.
|
||||
ldx filecount are any files displayed ?
|
||||
beq L5ECB no, don't accept arrow keys or return.
|
||||
cmp #$8D return ?
|
||||
beq L5EF4 then run selected file.
|
||||
cmp #$8A down ?
|
||||
beq dnarrow move down a name.
|
||||
cmp #$8B up ?
|
||||
beq uparrow move up a name.
|
||||
L5ECB cmp #$89 tab ?
|
||||
beq L5EED new volume.
|
||||
cmp #$9B esc ?
|
||||
bne L5EB0 no, try again else pop up a directory.
|
||||
|
||||
* pop a directory level
|
||||
|
||||
jsr popdir
|
||||
dec dlevel
|
||||
bra L5EF1
|
||||
popdir .EQ *-ofsB
|
||||
popdir .EQ *-ofsB
|
||||
ldx pbuf
|
||||
L5EDD dex
|
||||
L5EDD dex
|
||||
lda pbuf,x
|
||||
cmp #$2F slash
|
||||
cmp #$2F slash
|
||||
bne L5EDD
|
||||
cpx #$01
|
||||
bne L5EEC
|
||||
ldx pbuf
|
||||
L5EEC rts
|
||||
L5EED jmp ds2 set up new unit number.
|
||||
L5EF0 inx
|
||||
L5EF1 jmp vnam1 get new directory info.
|
||||
L5EEC rts
|
||||
L5EED jmp ds2 set up new unit number.
|
||||
L5EF0 inx
|
||||
L5EF1 jmp vnam1 get new directory info.
|
||||
|
||||
* run selected file
|
||||
|
||||
L5EF4 jsr MLI set prefix
|
||||
.DA #$C6
|
||||
.DA pf_parms
|
||||
bcs L5EED error.
|
||||
ldx valcnt get name number.
|
||||
jsr namecalc set up name storage area (on return y=0)
|
||||
ldx pbuf get prefix length.
|
||||
L5F04 iny start at y = 1.
|
||||
lda (fnstore),y get character of name.
|
||||
L5EF4 jsr MLI set prefix
|
||||
.DA #$C6
|
||||
.DA pf_parms
|
||||
bcs L5EED error.
|
||||
ldx valcnt get name number.
|
||||
jsr namecalc set up name storage area (on return y=0)
|
||||
ldx pbuf get prefix length.
|
||||
L5F04 iny start at y = 1.
|
||||
lda (fnstore),y get character of name.
|
||||
inx
|
||||
sta pbuf,x store in prefix buffer.
|
||||
cpy namelen check length of name.
|
||||
bcc L5F04 loop until all transferred.
|
||||
stx pbuf put prefix length into buffer.
|
||||
ldy valcnt get file number.
|
||||
lda filetyps,y get file type.
|
||||
bpl L5EF0 branch if directory.
|
||||
jsr settxt reset to full window.
|
||||
jsr home makes for no flash.
|
||||
lda #$95 ctrl-u
|
||||
jsr cout turn off 80 columns.
|
||||
jsr MLI open file
|
||||
.DA #$C8
|
||||
.DA op_parms
|
||||
bcs L5EED if error.
|
||||
lda op_refn move reference number
|
||||
sta rd_refn for read.
|
||||
lda #$FF read the entire file.
|
||||
sta pbuf,x store in prefix buffer.
|
||||
cpy namelen check length of name.
|
||||
bcc L5F04 loop until all transferred.
|
||||
stx pbuf put prefix length into buffer.
|
||||
ldy valcnt get file number.
|
||||
lda filetyps,y get file type.
|
||||
bpl L5EF0 branch if directory.
|
||||
jsr settxt reset to full window.
|
||||
jsr home makes for no flash.
|
||||
lda #$95 ctrl-u
|
||||
jsr cout turn off 80 columns.
|
||||
jsr MLI open file
|
||||
.DA #$C8
|
||||
.DA op_parms
|
||||
bcs L5EED if error.
|
||||
lda op_refn move reference number
|
||||
sta rd_refn for read.
|
||||
lda #$FF read the entire file.
|
||||
sta dhdr_len
|
||||
sta dhdr_len+1
|
||||
jsr doread read selected file.
|
||||
php save possible error.
|
||||
jsr MLI close file. ignore any error from close
|
||||
.DA #$CC
|
||||
.DA cl_parms
|
||||
plp restore status from read.
|
||||
bcs L5EED if any errors.
|
||||
jsr doread read selected file.
|
||||
php save possible error.
|
||||
jsr MLI close file. ignore any error from close
|
||||
.DA #$CC
|
||||
.DA cl_parms
|
||||
plp restore status from read.
|
||||
bcs L5EED if any errors.
|
||||
jmp sysentry execute selected system file.
|
||||
|
||||
* output messages. on entry: acc = horizontal position,
|
||||
* y = index to message teminated by 0.
|
||||
|
||||
sethorz .EQ *-ofsB
|
||||
sethorz .EQ *-ofsB
|
||||
sta ch
|
||||
msgout .EQ *-ofsB
|
||||
L5F4C lda dsp2msg,y
|
||||
msgout .EQ *-ofsB
|
||||
L5F4C lda dsp2msg,y
|
||||
beq L5F57
|
||||
jsr cout
|
||||
iny
|
||||
bne L5F4C
|
||||
L5F57 rts
|
||||
L5F57 rts
|
||||
|
||||
* name pointer calculator for name storage area
|
||||
|
||||
namecalc .EQ *-ofsB
|
||||
stz fnstore+1 init high byte of 16-bit shift
|
||||
namecalc .EQ *-ofsB
|
||||
stz fnstore+1 init high byte of 16-bit shift
|
||||
txa
|
||||
asl shift to high nibble
|
||||
asl shift to high nibble
|
||||
rol fnstore+1
|
||||
asl
|
||||
rol fnstore+1
|
||||
|
@ -326,13 +326,13 @@ namecalc .EQ *-ofsB
|
|||
rol fnstore+1
|
||||
asl
|
||||
rol fnstore+1
|
||||
sta fnstore low pointer
|
||||
sta fnstore low pointer
|
||||
lda /iobuf
|
||||
clc
|
||||
adc fnstore+1
|
||||
sta fnstore+1
|
||||
ldy #$00
|
||||
lda (fnstore),y file name length
|
||||
lda (fnstore),y file name length
|
||||
sta namelen
|
||||
rts
|
||||
|
||||
|
@ -340,79 +340,79 @@ namecalc .EQ *-ofsB
|
|||
|
||||
nameprnt .EQ *-ofsB
|
||||
lda #$02
|
||||
sta ch80col horizontal position = 2.
|
||||
ldx valcnt filename number
|
||||
sta ch80col horizontal position = 2.
|
||||
ldx valcnt filename number
|
||||
txa
|
||||
sec
|
||||
sbc topname calculate line # to display name
|
||||
sbc topname calculate line # to display name
|
||||
inc
|
||||
inc
|
||||
jsr TABV set vertical position.
|
||||
lda filetyps,x get filetype (x is unchanged by tabv).
|
||||
bmi L5F99 branch if system file.
|
||||
stz ch80col adjust cursor position.
|
||||
lda invflg save current inverse setting
|
||||
jsr TABV set vertical position.
|
||||
lda filetyps,x get filetype (x is unchanged by tabv).
|
||||
bmi L5F99 branch if system file.
|
||||
stz ch80col adjust cursor position.
|
||||
lda invflg ave current inverse setting
|
||||
pha
|
||||
ldy #fldrmsg-dsp2msg
|
||||
jsr msgout display the folder.
|
||||
pla restore inverse setting.
|
||||
jsr msgout display the folder.
|
||||
pla restore inverse setting.
|
||||
sta invflg
|
||||
L5F99 jsr outsp output a space.
|
||||
jsr namecalc calc name location.
|
||||
L5F9F iny y = 1 (first time).
|
||||
lda (fnstore),y get name character.
|
||||
jsr output put on screen.
|
||||
cpy namelen end of name ?
|
||||
bcc L5F9F no.
|
||||
outsp .EQ *-ofsB output a space.
|
||||
L5F99 jsr outsp output a space.
|
||||
jsr namecalc calc name location.
|
||||
L5F9F iny y = 1 (first time).
|
||||
lda (fnstore),y get name character.
|
||||
jsr output put on screen.
|
||||
cpy namelen end of name ?
|
||||
bcc L5F9F no.
|
||||
outsp .EQ *-ofsB output a space.
|
||||
lda #$A0
|
||||
bne L5FB1 branch always.
|
||||
homecurs .EQ *-ofsB screen control - home cursor
|
||||
bne L5FB1 branch always.
|
||||
homecurs .EQ *-ofsB screen control - home cursor
|
||||
lda #$99
|
||||
output .EQ *-ofsB
|
||||
ora #$80 set high bit.
|
||||
L5FB1 jmp cout output to screen.
|
||||
doread .EQ *-ofsB
|
||||
jsr MLI mli read call
|
||||
.DA #$CA
|
||||
.DA rd_parms
|
||||
output .EQ *-ofsB
|
||||
ora #$80 set high bit.
|
||||
L5FB1 jmp cout output to screen.
|
||||
doread .EQ *-ofsB
|
||||
jsr MLI mli read call
|
||||
.DA #$CA
|
||||
.DA rd_parms
|
||||
rts
|
||||
|
||||
* data area
|
||||
|
||||
dsp2msg .EQ *-ofsB
|
||||
dsp2msg .EQ *-ofsB
|
||||
.AS -"RETURN: Select | TAB: Chg Vol | "
|
||||
.AS -"ESC: Back"
|
||||
.DA #$00
|
||||
fldrmsg .EQ *-ofsB
|
||||
.DA #$0F inverse control code
|
||||
.HS 1B enable mousetext
|
||||
.AS -"XY" folder characters
|
||||
.HS 18 disable mousetext
|
||||
.HS 0E normal control code
|
||||
.DA #$00
|
||||
fldrmsg .EQ *-ofsB
|
||||
.DA #$0F inverse control code
|
||||
.HS 1B enable mousetext
|
||||
.AS -"XY" folder characters
|
||||
.HS 18 disable mousetext
|
||||
.HS 0E normal control code
|
||||
.HS 00
|
||||
op_parms .EQ *-ofsB open parameters
|
||||
.DA #$03 3 parms
|
||||
.DA pbuf pathname
|
||||
.DA op_buf file buffer
|
||||
op_refn .EQ *-ofsB
|
||||
.HS 00 reference number
|
||||
cl_parms .EQ *-ofsB close parameters
|
||||
.HS 01 1 parm
|
||||
.HS 00 reference number.
|
||||
ol_parms .EQ *-ofsB online parameters
|
||||
.HS 02 2 parms
|
||||
ol_unit .EQ *-ofsB
|
||||
.HS 60 unit number, default = s6, d1
|
||||
.DA pbuf+1 data buffer
|
||||
pf_parms .EQ *-ofsB set prefix parameters
|
||||
.DA #01 one parm
|
||||
.DA pbuf pathname
|
||||
rd_parms .EQ *-ofsB read parameters
|
||||
.DA #04 4 parms
|
||||
rd_refn .EQ *-ofsB
|
||||
.HS 01 reference number
|
||||
.DA sysentry data buffer
|
||||
op_parms .EQ *-ofsB open parameters
|
||||
.DA #$03 3 parms
|
||||
.DA pbuf pathname
|
||||
.DA op_buf file buffer
|
||||
op_refn .EQ *-ofsB
|
||||
.HS 00 reference number
|
||||
cl_parms .EQ *-ofsB close parameters
|
||||
.HS 01 1 parm
|
||||
.HS 00 reference number.
|
||||
ol_parms .EQ *-ofsB online parameters
|
||||
.HS 02 2 parms
|
||||
ol_unit .EQ *-ofsB
|
||||
.HS 60 unit number, default = s6, d1
|
||||
.DA pbuf+1 data buffer
|
||||
pf_parms .EQ *-ofsB set prefix parameters
|
||||
.DA #01 one parm
|
||||
.DA pbuf pathname
|
||||
rd_parms .EQ *-ofsB read parameters
|
||||
.DA #04 4 parms
|
||||
rd_refn .EQ *-ofsB
|
||||
.HS 01 reference number
|
||||
.DA sysentry data buffer
|
||||
|
||||
* these last 2 parms (4 bytes) may extend past $300 length limit since
|
||||
* the request count is set prior to using the parm block and the transfer
|
||||
|
@ -420,8 +420,8 @@ rd_refn .EQ *-ofsB
|
|||
* .HS 0000 requested length
|
||||
* .HS 0000 actual length
|
||||
|
||||
dhdr_len .EQ *-ofsB directory header length
|
||||
.HS 00 (actually uses 2 bytes)
|
||||
dhdr_len .EQ *-ofsB directory header length
|
||||
.HS 00 (actually uses 2 bytes)
|
||||
|
||||
* end of obj sel_1
|
||||
*--------------------------------------
|
||||
|
|
|
@ -13,14 +13,14 @@ NEW
|
|||
* (as other replacement quit code is supposed to do) because GQuit checks
|
||||
* this to see if this version of quit code is available.
|
||||
|
||||
ofsQ .EQ *-dispadr offset to GQuit dispatcher org
|
||||
ofsQ .EQ *-dispadr offset to GQuit dispatcher org
|
||||
|
||||
GQdisp lda RRAMWRAMBNK1 read/write LC bank 1
|
||||
GQdisp lda RRAMWRAMBNK1 read/write LC bank 1
|
||||
clc
|
||||
xce 16 bit native mode.
|
||||
jmp P8QUIT go to GQuit.
|
||||
xce 16 bit native mode.
|
||||
jmp P8QUIT go to GQuit.
|
||||
.HS 0000000000 offset to paragraph boundary.
|
||||
.AS "GQ" id bytes so GQuit can identify this
|
||||
.AS "GQ" id bytes so GQuit can identify this
|
||||
|
||||
* load application
|
||||
*
|
||||
|
@ -39,124 +39,124 @@ GQdisp lda RRAMWRAMBNK1 read/write LC bank 1
|
|||
* so in case of an error setting the P8 prefix, it can be displayed in the
|
||||
* error message.
|
||||
|
||||
>SHORTM 8 bit accumulator
|
||||
>SHORTM 8 bit accumulator
|
||||
|
||||
pha save the switch status.
|
||||
ldx ##inbuf point to passed prefix.
|
||||
jsr copyvol copy the name into the buffer.
|
||||
pla retrieve the switch status
|
||||
pha save the switch status.
|
||||
ldx ##inbuf point to passed prefix.
|
||||
jsr copyvol copy the name into the buffer.
|
||||
pla retrieve the switch status
|
||||
|
||||
* go into emulation mode to load and run Prodos 8 application
|
||||
|
||||
sec
|
||||
xce 8 bit emulation mode
|
||||
ora #$00 switching from P16 to P8 ?
|
||||
beq L602D no.
|
||||
xce 8 bit emulation mode
|
||||
ora #$00 switching from P16 to P8 ?
|
||||
beq L602D no.
|
||||
|
||||
* switching from P16 to P8 so pass prefix 0 from P16 to the P8 prefix. the
|
||||
* prefix is passed at $00/0200 by GQuit.
|
||||
|
||||
L6020 jsr MLI set prefix
|
||||
L6020 jsr MLI set prefix
|
||||
.DA #$C6
|
||||
.DA pfxparms
|
||||
bcc L602D if prefix ok.
|
||||
jsr gqerror error handler.
|
||||
bra L6020 try again
|
||||
bcc L602D if prefix ok.
|
||||
jsr gqerror error handler.
|
||||
bra L6020 try again
|
||||
|
||||
* load application at $2000
|
||||
|
||||
L602D xce native mode (carry clear)
|
||||
>LONGX 16 bit regs, 8 bit acc.
|
||||
lda pbuf+1 is the application name
|
||||
cmp #$2F a complete pathname ?
|
||||
bne L603D no, use prefix as volume name
|
||||
ldx ##pbuf else use the application name.
|
||||
jsr copyvol copy the volume name to buffer.
|
||||
L603D sec back to emulation mode.
|
||||
L602D xce native mode (carry clear)
|
||||
>LONGX 16 bit regs, 8 bit acc.
|
||||
lda pbuf+1 is the application name
|
||||
cmp #$2F a complete pathname ?
|
||||
bne L603D no, use prefix as volume name
|
||||
ldx ##pbuf else use the application name.
|
||||
jsr copyvol copy the volume name to buffer.
|
||||
L603D sec back to emulation mode.
|
||||
xce
|
||||
L603F jsr MLI open the application file
|
||||
L603F jsr MLI open the application file
|
||||
.DA #$C8
|
||||
.DA opnparms
|
||||
bcc L604C if open ok.
|
||||
jsr gqerror handle error.
|
||||
bra L603F try again.
|
||||
L604C lda oprefnum copy ref number to parameter lists
|
||||
sta eofrefn
|
||||
sta rdrefnum
|
||||
sta closeref
|
||||
bcc L604C if open ok.
|
||||
jsr gqerror handle error.
|
||||
bra L603F try again.
|
||||
L604C lda oprefnum copy ref number to parameter lists
|
||||
sta eofrefn
|
||||
sta rdrefnum
|
||||
sta closeref
|
||||
|
||||
* do a geteof call for how many bytes to read
|
||||
|
||||
L6058 jsr MLI get eof
|
||||
L6058 jsr MLI get eof
|
||||
.DA #$D1
|
||||
.DA eofparms
|
||||
bcc L6065 eof ok.
|
||||
jsr gqerror handle error.
|
||||
bra L6058 try again.
|
||||
bcc L6065 eof ok.
|
||||
jsr gqerror handle error.
|
||||
bra L6058 try again.
|
||||
|
||||
* store the size of the file in the read parameter list
|
||||
|
||||
L6065 lda eofval
|
||||
sta rdcount
|
||||
lda eofval+1
|
||||
sta rdcount+1
|
||||
L6071 jsr MLI read
|
||||
L6065 lda eofval
|
||||
sta rdcount
|
||||
lda eofval+1
|
||||
sta rdcount+1
|
||||
L6071 jsr MLI read
|
||||
.DA #$CA
|
||||
.DA readparm
|
||||
bcc L607E read ok
|
||||
jsr gqerror
|
||||
bra L6071
|
||||
L607E jsr MLI close
|
||||
bcc L607E read ok
|
||||
jsr gqerror
|
||||
bra L6071
|
||||
L607E jsr MLI close
|
||||
.DA #$CC
|
||||
.DA closeprm
|
||||
bcc L608B close ok
|
||||
jsr gqerror
|
||||
bra L607E
|
||||
L608B jsr dolaunch check for possible 2nd pathname.
|
||||
bne L6099 if none then run program
|
||||
jsr ckfordrv else make sure the file is online.
|
||||
bcc L6099 if so then run the program.
|
||||
lda #$45 volume not found error.
|
||||
bra L60AB
|
||||
L6099 lda RROMBNK2 enable ROM
|
||||
jmp sysentry execute the system application
|
||||
bcc L608B close ok
|
||||
jsr gqerror
|
||||
bra L607E
|
||||
L608B jsr dolaunch check for possible 2nd pathname.
|
||||
bne L6099 if none then run program
|
||||
jsr ckfordrv else make sure the file is online.
|
||||
bcc L6099 if so then run the program.
|
||||
lda #$45 volume not found error.
|
||||
bra L60AB
|
||||
L6099 lda RROMBNK2 enable ROM
|
||||
jmp sysentry execute the system application
|
||||
|
||||
gqerror .EQ *-ofsQ
|
||||
clc
|
||||
xce 16 bit native mode
|
||||
xce 16 bit native mode
|
||||
>LONGMX
|
||||
jsr mountvol mount volume.
|
||||
bcs L60AB if error.
|
||||
sec back to emulation mode.
|
||||
jsr mountvol mount volume.
|
||||
bcs L60AB if error.
|
||||
sec back to emulation mode.
|
||||
xce
|
||||
rts
|
||||
|
||||
* generate a fatal error while running under Prodos 8.
|
||||
* on input, acc = error code. this routine does not return.
|
||||
|
||||
L60AB clc native mode
|
||||
L60AB clc native mode
|
||||
xce
|
||||
>LONGMX
|
||||
and ##$00FF mask off high byte of error code.
|
||||
pha put on stack for IntMath tool call.
|
||||
pea $0000 errval>>16
|
||||
pea errval push address of string buffer.
|
||||
pea $0004 make string 4 digits long.
|
||||
>IIGS Int2Hex convert value to hex string.
|
||||
pha make space for return value.
|
||||
pea $0000 quitstr1>>16
|
||||
pea quitstr1 push first error message address
|
||||
pea $0000 quitstr2>>16
|
||||
pea quitstr2 push second error message address
|
||||
pea $0000 button1>>16
|
||||
pea button1 push first button text address
|
||||
pea $0000 quitbtn2>>16
|
||||
pea quitbtn2 push 2nd button text address (null)
|
||||
and ##$00FF mask off high byte of error code.
|
||||
pha put on stack for IntMath tool call.
|
||||
pea $0000 errval>>16
|
||||
pea errval push address of string buffer.
|
||||
pea $0004 make string 4 digits long.
|
||||
>IIGS Int2Hex convert value to hex string.
|
||||
pha make space for return value.
|
||||
pea $0000 quitstr1>>16
|
||||
pea quitstr1 push first error message address
|
||||
pea $0000 quitstr2>>16
|
||||
pea quitstr2 push second error message address
|
||||
pea $0000 button1>>16
|
||||
pea button1 push first button text address
|
||||
pea $0000 quitbtn2>>16
|
||||
pea quitbtn2 push 2nd button text address (null)
|
||||
>IIGS TLTextMountVolume make the dialog box
|
||||
pla retrieve button press (not used)
|
||||
sec emulation mode
|
||||
pla retrieve button press (not used)
|
||||
sec emulation mode
|
||||
xce
|
||||
jsr MLI quit back to GQuit
|
||||
jsr MLI quit back to GQuit
|
||||
.DA #$65
|
||||
.DA quitparms
|
||||
|
||||
|
@ -167,57 +167,57 @@ L60AB clc native mode
|
|||
* carry set if no window displayed or if had window and 'esc' pressed.
|
||||
|
||||
mountvol .EQ *-ofsQ
|
||||
ldy ##$0000 volbuf>>16
|
||||
ldx ##volbuf set up pointer to volume name.
|
||||
ldy ##$0000 volbuf>>16
|
||||
ldx ##volbuf set up pointer to volume name.
|
||||
|
||||
* if error is 'volume not found' or 'no disk in drive' then display the
|
||||
* Mount Volume window, otherwise return with carry set.
|
||||
|
||||
and ##$00FF mask just in case.
|
||||
cmp ##$0045 volume not found ?
|
||||
beq L6101 yes
|
||||
cmp ##$002F no disk in drive ?
|
||||
beq L6101 yes
|
||||
sec indicate error not handled.
|
||||
rts return with error code still in acc.
|
||||
and ##$00FF mask just in case.
|
||||
cmp ##$0045 volume not found ?
|
||||
beq L6101 yes
|
||||
cmp ##$002F no disk in drive ?
|
||||
beq L6101 yes
|
||||
sec indicate error not handled.
|
||||
rts return with error code still in acc.
|
||||
|
||||
L6101 pha save error code in case esc pressed.
|
||||
phy pointer to volume name.
|
||||
L6101 pha save error code in case esc pressed.
|
||||
phy pointer to volume name.
|
||||
phx
|
||||
tsc
|
||||
phd save D reg.
|
||||
tcd point D reg at stack.
|
||||
lda [$01] get length byte and leading separator.
|
||||
dec don't count leading separator.
|
||||
xba then swap the bytes so the volume name
|
||||
sta [$01] doesn't cpntain the separator.
|
||||
pha room for result.
|
||||
pea $0000 mountmsg>>16
|
||||
pea mountmsg
|
||||
phy hi word of pointer to volume name.
|
||||
inx skip separator.
|
||||
phx lo word of pointer to volume name.
|
||||
pea $0000 button1>>16
|
||||
pea button1 'Return'
|
||||
pea $0000 button2>>16
|
||||
pea button2 'Escape'
|
||||
phd save D reg.
|
||||
tcd point D reg at stack.
|
||||
lda [$01] get length byte and leading separator.
|
||||
dec don't count leading separator.
|
||||
xba then swap the bytes so the volume name
|
||||
sta [$01] doesn't cpntain the separator.
|
||||
pha room for result.
|
||||
pea $0000 mountmsg>>16
|
||||
pea mountmsg
|
||||
phy hi word of pointer to volume name.
|
||||
inx skip separator.
|
||||
phx lo word of pointer to volume name.
|
||||
pea $0000 button1>>16
|
||||
pea button1 'Return'
|
||||
pea $0000 button2>>16
|
||||
pea button2 'Escape'
|
||||
>IIGS TLTextMountVolume
|
||||
lda [$01] restore first 2 bytes of vilume name
|
||||
lda [$01] restore first 2 bytes of vilume name
|
||||
xba back to their original positions
|
||||
inc and values.
|
||||
sta [$01]
|
||||
pla which button: 1=Return 2=Escape.
|
||||
pld restore D reg.
|
||||
plx pull volume name pointer off stack
|
||||
sta [$01]
|
||||
pla which button: 1=Return 2=Escape.
|
||||
pld restore D reg.
|
||||
plx pull volume name pointer off stack
|
||||
plx
|
||||
cmp ##$0001 which button was pressed ?
|
||||
bne L613C if Escape pressed.
|
||||
clc indicate Return was pressed.
|
||||
pla pull original error code off stack.
|
||||
rts return with carry clear.
|
||||
L613C sec indicate Escape was pressed.
|
||||
pla restore error code.
|
||||
rts return with carry set.
|
||||
cmp ##$0001 which button was pressed ?
|
||||
bne L613C if Escape pressed.
|
||||
clc indicate Return was pressed.
|
||||
pla pull original error code off stack.
|
||||
rts return with carry clear.
|
||||
L613C sec indicate Escape was pressed.
|
||||
pla restore error code.
|
||||
rts return with carry set.
|
||||
|
||||
* copy the volume name from the given pathname to the volume name buffer.
|
||||
*
|
||||
|
@ -225,20 +225,20 @@ L613C sec indicate Escape was pressed.
|
|||
* output: volume name is stored in volbuf.
|
||||
|
||||
copyvol .EQ *-ofsQ
|
||||
lda >1,x get the first slash
|
||||
sta volbuf+1
|
||||
ldy ##$0002 initialize the length count.
|
||||
lda >1,x get the first slash
|
||||
sta volbuf+1
|
||||
ldy ##$0002 initialize the length count.
|
||||
|
||||
L6148 lda >2,x now copy the volume name up to
|
||||
cmp #$2F the separating slash.
|
||||
L6148 lda >2,x now copy the volume name up to
|
||||
cmp #$2F the separating slash.
|
||||
beq L6156
|
||||
sta volbuf,y
|
||||
inx
|
||||
iny
|
||||
bra L6148
|
||||
L6156 dey fix character count.
|
||||
tya length.
|
||||
sta volbuf store the resultant string length.
|
||||
L6156 dey fix character count.
|
||||
tya length.
|
||||
sta volbuf store the resultant string length.
|
||||
rts
|
||||
|
||||
* translate a filename message from the message center to the currently
|
||||
|
@ -248,109 +248,109 @@ L6156 dey fix character count.
|
|||
* application elst the z-flag is clear if it couldn't be done.
|
||||
|
||||
dolaunch .EQ *-ofsQ
|
||||
lda sysentry does the app start with a jump ?
|
||||
cmp #$4C
|
||||
bne L616F no, doesn't follow the convention.
|
||||
lda #$EE check for the signature bytes.
|
||||
cmp sysentry+3
|
||||
bne L616F 1st one doesn't match, skip it.
|
||||
cmp sysentry+4
|
||||
beq L6170 both match, go get a filename message.
|
||||
L616F rts just return to launch the app.
|
||||
lda sysentry does the app start with a jump ?
|
||||
cmp #$4C
|
||||
bne L616F no, doesn't follow the convention.
|
||||
lda #$EE check for the signature bytes.
|
||||
cmp sysentry+3
|
||||
bne L616F 1st one doesn't match, skip it.
|
||||
cmp sysentry+4
|
||||
beq L6170 both match, go get a filename message.
|
||||
L616F rts just return to launch the app.
|
||||
|
||||
L6170 lda #$FF put flag conditioning value on
|
||||
pha the stack (assume error).
|
||||
clc native 16-bit mode.
|
||||
L6170 lda #$FF put flag conditioning value on
|
||||
pha the stack (assume error).
|
||||
clc native 16-bit mode.
|
||||
xce
|
||||
>LONGMX
|
||||
pha make room on stack for user id.
|
||||
>IIGS MMStartUp start up the memory manager.
|
||||
pla get the user id and
|
||||
pha leave it on the stack.
|
||||
pha make room on stack for user id.
|
||||
>IIGS MMStartUp start up the memory manager.
|
||||
pla get the user id and
|
||||
pha leave it on the stack.
|
||||
pha
|
||||
pha make room on stack for new handle.
|
||||
pea $0000
|
||||
pea $000A get a 10 byte block of memory.
|
||||
pha put user id on stack.
|
||||
pea $0000 totally unrestricted block.
|
||||
pha LocationPtr (not used)
|
||||
pha make room on stack for new handle.
|
||||
pea $0000
|
||||
pea $000A get a 10 byte block of memory.
|
||||
pha put user id on stack.
|
||||
pea $0000 totally unrestricted block.
|
||||
pha LocationPtr (not used)
|
||||
pha
|
||||
>IIGS NewHandle go get the block of memory.
|
||||
pla get the handle from the stack.
|
||||
>IIGS NewHandle go get the block of memory.
|
||||
pla get the handle from the stack.
|
||||
plx
|
||||
bcs L620A branch if error, no memory available.
|
||||
phx leave the handle on the stack.
|
||||
bcs L620A branch if error, no memory available.
|
||||
phx leave the handle on the stack.
|
||||
pha
|
||||
pea $0002 'get' a message.
|
||||
pea $0001 get a type 1 (filename) message.
|
||||
phx put the message handle on the stack
|
||||
pha (still in acc and x regs)
|
||||
pea $0002 'get' a message.
|
||||
pea $0001 get a type 1 (filename) message.
|
||||
phx put the message handle on the stack
|
||||
pha (still in acc and x regs)
|
||||
>IIGS MessageCenter
|
||||
bcs L6203 branch if no message.
|
||||
pha leave 4 bytes free on stack
|
||||
pha (will be used as a direct page pointer)
|
||||
tsc get the stack pointer.
|
||||
phd save current direct register.
|
||||
inc point to new direct page space.
|
||||
tcd make a new direct page.
|
||||
lda [$04] de-reference the handle.
|
||||
bcs L6203 branch if no message.
|
||||
pha leave 4 bytes free on stack
|
||||
pha (will be used as a direct page pointer)
|
||||
tsc get the stack pointer.
|
||||
phd save current direct register.
|
||||
inc point to new direct page space.
|
||||
tcd make a new direct page.
|
||||
lda [$04] de-reference the handle.
|
||||
sta $00
|
||||
ldy ##$0002
|
||||
lda [$04],y
|
||||
sta $02
|
||||
ldy ##$0006 get the message command.
|
||||
ldy ##$0006 get the message command.
|
||||
lda [$00],y
|
||||
bne bad_msg if print, then skip it.
|
||||
lda $00 adjust pointer to filename string.
|
||||
bne bad_msg if print, then skip it.
|
||||
lda $00 adjust pointer to filename string.
|
||||
clc
|
||||
adc ##$0008
|
||||
sta $00
|
||||
bcc L61D1
|
||||
inc $02
|
||||
L61D1 lda [$00] get the length of the string.
|
||||
and ##$00FF mask off high (leaving just the length)
|
||||
>SHORTM 8 bit accumulator
|
||||
cmp sysentry+5 check against length of app buffer.
|
||||
beq L61DF if equal then continue with move.
|
||||
bcs bad_msg if too long then bad message.
|
||||
L61D1 lda [$00] get the length of the string.
|
||||
and ##$00FF mask off high (leaving just the length)
|
||||
>SHORTM 8 bit accumulator
|
||||
cmp sysentry+5 check against length of app buffer.
|
||||
beq L61DF if equal then continue with move.
|
||||
bcs bad_msg if too long then bad message.
|
||||
L61DF tay string length.
|
||||
L61E0 lda [$00],y get a character.
|
||||
sta sysentry+6,y store it in the app's filename buffer
|
||||
sta inbuf,y and in prefix buffer.
|
||||
L61E0 lda [$00],y get a character.
|
||||
sta sysentry+6,y store it in the app's filename buffer
|
||||
sta inbuf,y and in prefix buffer.
|
||||
dey
|
||||
bpl L61E0
|
||||
lda #$00 change flag conditioning value on stack
|
||||
sta $0D,s to indicate a filename is passed.
|
||||
lda #$00 change flag conditioning value on stack
|
||||
sta $0D,s to indicate a filename is passed.
|
||||
bad_msg
|
||||
>LONGM 16-bit acc.
|
||||
pld restore direct register.
|
||||
pla fix stack because handle and userid
|
||||
pla still on stack.
|
||||
pea $0003 now delete the message (done with it).
|
||||
pea $0001 message type 1.
|
||||
>LONGM 16-bit acc.
|
||||
pld restore direct register.
|
||||
pla fix stack because handle and userid
|
||||
pla still on stack.
|
||||
pea $0003 now delete the message (done with it).
|
||||
pea $0001 message type 1.
|
||||
pha garbage handle (not used).
|
||||
pha
|
||||
>IIGS MessageCenter go delete the message.
|
||||
L6203 >IIGS DisposeHandle throw away message (handle is on stack)
|
||||
L620A >IIGS MMShutDown shutdown the memory manager (userid is
|
||||
sec on stack).
|
||||
xce back to emulation mode.
|
||||
>IIGS MessageCenter go delete the message.
|
||||
L6203 >IIGS DisposeHandle throw away message (handle is on stack)
|
||||
L620A >IIGS MMShutDown shutdown the memory manager (userid is
|
||||
sec on stack).
|
||||
xce back to emulation mode.
|
||||
|
||||
pla condition z-flag with value on stack.
|
||||
bne L6231 then done.
|
||||
ldx inbuf get length of pathname.
|
||||
lda #$2F look for slash.
|
||||
pla condition z-flag with value on stack.
|
||||
bne L6231 then done.
|
||||
ldx inbuf get length of pathname.
|
||||
lda #$2F look for slash.
|
||||
L621B cmp inbuf,x
|
||||
beq L6225 when found, set prefix.
|
||||
beq L6225 when found, set prefix.
|
||||
dex
|
||||
bne L621B
|
||||
bra L6231 if no slash, just skip it.
|
||||
L6225 dex don't include trailing slash.
|
||||
stx inbuf set new length.
|
||||
jsr MLI set the P8 prefix.
|
||||
bra L6231 if no slash, just skip it.
|
||||
L6225 dex don't include trailing slash.
|
||||
stx inbuf set new length.
|
||||
jsr MLI set the P8 prefix.
|
||||
.DA #$C6
|
||||
.DA pfxparms
|
||||
lda #$00 set z-flag
|
||||
lda #$00 set z-flag
|
||||
L6231 rts and go launch the app.
|
||||
|
||||
* check for disk volume
|
||||
|
@ -360,36 +360,36 @@ L6231 rts and go launch the app.
|
|||
* carry set = disk not found
|
||||
|
||||
ckfordrv .EQ *-ofsQ
|
||||
SEL2.ckfordrv clc native mode
|
||||
SEL2.ckfordrv clc native mode
|
||||
xce
|
||||
>LONGX 16-bit regs, 8-bit acc.
|
||||
>LONGX 16-bit regs, 8-bit acc.
|
||||
ldx ##sysentry+6 point to pathname buffer.
|
||||
jsr copyvol copy volume name to pathname buffer.
|
||||
.1 sec emulation mode.
|
||||
jsr copyvol copy volume name to pathname buffer.
|
||||
.1 sec emulation mode.
|
||||
xce
|
||||
jsr MLI get info on the volume.
|
||||
jsr MLI get info on the volume.
|
||||
.DA #$C4
|
||||
.DA gfiparms
|
||||
bcc .2 branch if volume found,
|
||||
clc (native mode)
|
||||
bcc .2 branch if volume found,
|
||||
clc (native mode)
|
||||
xce
|
||||
>LONGMX
|
||||
jsr mountvol else ask user to mount the volume.
|
||||
jsr mountvol else ask user to mount the volume.
|
||||
bcc .1 if <return> pressed, then try again.
|
||||
sec emulation mode.
|
||||
sec emulation mode.
|
||||
xce
|
||||
sec disk not found.
|
||||
sec disk not found.
|
||||
.2 rts
|
||||
|
||||
* Prodos 8 parameter lists
|
||||
|
||||
pfxparms .EQ *-ofsQ set prefix parms.
|
||||
pfxparms .EQ *-ofsQ set prefix parms.
|
||||
.DA #01 one parm.
|
||||
.DA inbuf address of prefix.
|
||||
opnparms .EQ *-ofsQ open parms.
|
||||
opnparms .EQ *-ofsQ open parms.
|
||||
.DA #3 3 parms.
|
||||
.DA pbuf pathname
|
||||
.DA op_buf i/o buffer
|
||||
.DA pbuf pathname
|
||||
.DA op_buf i/o buffer
|
||||
oprefnum .EQ *-ofsQ
|
||||
.HS 00 reference #
|
||||
eofparms .EQ *-ofsQ
|
||||
|
@ -401,33 +401,33 @@ eofval .EQ *-ofsQ
|
|||
readparm .EQ *-ofsQ
|
||||
.DA #04 4 parms
|
||||
rdrefnum .EQ *-ofsQ
|
||||
.HS 00 reference #
|
||||
.DA sysentry read into $2000 (bank 0).
|
||||
.HS 00 reference #
|
||||
.DA sysentry read into $2000 (bank 0).
|
||||
rdcount .EQ *-ofsQ
|
||||
.HS 0000 # of bytes to read.
|
||||
.HS 0000 transfer count
|
||||
.HS 0000 # of bytes to read.
|
||||
.HS 0000 transfer count
|
||||
closeprm .EQ *-ofsQ
|
||||
.DA #1 1 parm
|
||||
closeref .EQ *-ofsQ
|
||||
.HS 00 reference #
|
||||
.HS 00 reference #
|
||||
quitparms .EQ *-ofsQ
|
||||
.DA #04 4 parms.
|
||||
.DA #04 4 parms.
|
||||
.HS 00 quit back to launcher (GQuit)
|
||||
.HS 0000
|
||||
.HS 00
|
||||
.HS 0000
|
||||
gfiparms .EQ *-ofsQ get file info parms.
|
||||
.DA #$0A 10 parms
|
||||
.DA volbuf volume buffer
|
||||
gfiparms .EQ *-ofsQ get file info parms.
|
||||
.DA #$0A 10 parms
|
||||
.DA volbuf volume buffer
|
||||
.DA #0 access
|
||||
.DA #0 file type
|
||||
.DA 0 aux type
|
||||
.DA 0 aux type
|
||||
.DA #0 storage type
|
||||
.DA 0 blocks used
|
||||
.DA 0 modification date
|
||||
.DA 0 modification time
|
||||
.DA 0 creation date
|
||||
.DA 0 creation time
|
||||
.DA 0 blocks used
|
||||
.DA 0 modification date
|
||||
.DA 0 modification time
|
||||
.DA 0 creation date
|
||||
.DA 0 creation time
|
||||
|
||||
* messages for P8 fatal error. maximum length of message is 35 characters.
|
||||
* the error code will be displayed immediately after the final character.
|
||||
|
@ -438,9 +438,9 @@ quitstr1 .EQ *-ofsQ
|
|||
quitstr2 .EQ *-ofsQ
|
||||
.DA #$14
|
||||
.AS "ProDOS Error = $"
|
||||
errval .EQ *-ofsQ hex error code gets stored here
|
||||
errval .EQ *-ofsQ hex error code gets stored here
|
||||
.AS " "
|
||||
quitbtn2 .EQ *-ofsQ null string (no 2nd button)
|
||||
quitbtn2 .EQ *-ofsQ null string (no 2nd button)
|
||||
.HS 00
|
||||
|
||||
* messages for P8 mount volume. maximum length of message is 35 characters.
|
||||
|
@ -454,9 +454,9 @@ button1 .EQ *-ofsQ
|
|||
.AS "Accept: "
|
||||
.DA #$1B mousetext on
|
||||
.DA #$0F inverse on
|
||||
.DA #$4D mousetext return
|
||||
.DA #$0E normal on
|
||||
.DA #$18 mousetext off
|
||||
.DA #$4D mousetext return
|
||||
.DA #$0E normal on
|
||||
.DA #$18 mousetext off
|
||||
button2 .EQ *-ofsQ
|
||||
.DA #$0B
|
||||
.AS "Cancel: Esc"
|
||||
|
|
|
@ -6,65 +6,65 @@ NEW
|
|||
|
||||
* $2F00-2F7C moved to $D742
|
||||
|
||||
ofsT .EQ *-tclk_in offset to Thunderclock org
|
||||
ofsT .EQ *-tclk_in offset to Thunderclock org
|
||||
|
||||
tclock_0 ldx clkslt clock slot = $C1.
|
||||
lda clkmode,x save current mode
|
||||
tclock_0 ldx clkslt clock slot = $C1.
|
||||
lda clkmode,x save current mode
|
||||
pha
|
||||
lda #$A3 send numeric mode byte to Thunderclock
|
||||
lda #$A3 send numeric mode byte to Thunderclock
|
||||
jsr wttcp
|
||||
clkslt .EQ *-ofsT+2 points to $C1.
|
||||
clkslt .EQ *-ofsT+2 points to $C1.
|
||||
|
||||
TCLK.clkslt jsr rdtcp read month, day of week, day of month
|
||||
clc and time into input buffer.
|
||||
ldx #$04 index for 5 values.
|
||||
ldy #$0C read minutes 1st, month last.
|
||||
.1 lda inbuf,y convert values to binary.
|
||||
and #$07 no value > 5 decimal.
|
||||
sta pcl 'tens' place value
|
||||
asl multiply by 10
|
||||
TCLK.clkslt jsr rdtcp read month, day of week, day of month
|
||||
clc and time into input buffer.
|
||||
ldx #$04 index for 5 values.
|
||||
ldy #$0C read minutes 1st, month last.
|
||||
.1 lda inbuf,y convert values to binary.
|
||||
and #$07 no value > 5 decimal.
|
||||
sta pcl 'tens' place value
|
||||
asl multiply by 10
|
||||
asl
|
||||
adc pcl
|
||||
asl
|
||||
adc inbuf+1,y add to ascii 'ones' place
|
||||
sec and subtract out the ascii
|
||||
adc inbuf+1,y add to ascii 'ones' place
|
||||
sec and subtract out the ascii
|
||||
sbc #$B0
|
||||
sta pcl,x save converted value.
|
||||
dey index to next lowest value
|
||||
sta pcl,x save converted value.
|
||||
dey index to next lowest value
|
||||
dey
|
||||
dey
|
||||
dex are there more values?
|
||||
bpl .1 if yes.
|
||||
tay contains month
|
||||
dex are there more values?
|
||||
bpl .1 if yes.
|
||||
tay contains month
|
||||
lsr
|
||||
ror
|
||||
ror
|
||||
ror high bit of month held in carry
|
||||
ror high bit of month held in carry
|
||||
ora A1L
|
||||
sta p8date save low value of date.
|
||||
sta p8date save low value of date.
|
||||
php save high bit of month.
|
||||
and #$1F isolate day.
|
||||
adc tdays-1,y (y = month)
|
||||
bcc .2 branch if not Sept 13 thru 30th
|
||||
adc #$03 adj for mod 7 when day > 256
|
||||
and #$1F isolate day.
|
||||
adc tdays-1,y (y = month)
|
||||
bcc .2 branch if not Sept 13 thru 30th
|
||||
adc #$03 adj for mod 7 when day > 256
|
||||
.2 sec
|
||||
.3 sbc #$07
|
||||
bcs .3 loop until < 0.
|
||||
adc #$07 make it in the range of 0-6.
|
||||
sbc pch the delta provides years offset.
|
||||
bcs .3 loop until < 0.
|
||||
adc #$07 make it in the range of 0-6.
|
||||
sbc pch the delta provides years offset.
|
||||
bcs .4 branch if positive
|
||||
adc #$07 else make it positive again.
|
||||
adc #$07 else make it positive again.
|
||||
.4 tay
|
||||
lda yradj,y look up year
|
||||
plp and combine it with hi bit of month
|
||||
lda yradj,y look up year
|
||||
plp and combine it with hi bit of month
|
||||
rol
|
||||
sta p8date+1 P8 date
|
||||
lda A1L+1 hour
|
||||
sta p8time+1 P8 time
|
||||
lda A2L minute
|
||||
sta p8date+1 P8 date
|
||||
lda A1L+1 hour
|
||||
sta p8time+1 P8 time
|
||||
lda A2L minute
|
||||
sta p8time
|
||||
pla restore previous mode.
|
||||
ldx clkslt clock slot = $C1
|
||||
pla restore previous mode.
|
||||
ldx clkslt clock slot = $C1
|
||||
sta clkmode,x
|
||||
H2F69 rts
|
||||
|
||||
|
@ -72,18 +72,18 @@ H2F69 rts
|
|||
* one entry for each month. the values are modulo 256.
|
||||
|
||||
tdays .EQ *-ofsT
|
||||
.DA #$00 January
|
||||
.DA #$1F February
|
||||
.DA #$3B March
|
||||
.DA #$5A April
|
||||
.DA #$78 May
|
||||
.DA #$97 June
|
||||
.DA #$B5 July
|
||||
.DA #$D3 August
|
||||
.DA #$F2 September
|
||||
.DA #$14 October (MOD 256)
|
||||
.DA #$33 November
|
||||
.DA #$51 December
|
||||
.DA #$00 January
|
||||
.DA #$1F February
|
||||
.DA #$3B March
|
||||
.DA #$5A April
|
||||
.DA #$78 May
|
||||
.DA #$97 June
|
||||
.DA #$B5 July
|
||||
.DA #$D3 August
|
||||
.DA #$F2 September
|
||||
.DA #$14 October (MOD 256)
|
||||
.DA #$33 November
|
||||
.DA #$51 December
|
||||
|
||||
* the following table is used to look up the current year, based on
|
||||
* the current month, day and day of week. The 1st entry corresponds
|
||||
|
@ -92,15 +92,15 @@ tdays .EQ *-ofsT
|
|||
* the days of the week.
|
||||
|
||||
yradj .EQ *-ofsT
|
||||
.DA #$07 Monday
|
||||
.DA #$0C Sunday
|
||||
.DA #$0B Saturday
|
||||
.DA #$0A Friday
|
||||
.DA #$09 Thursday
|
||||
.DA #$08 Wednesday
|
||||
.DA #$08 Tuesday
|
||||
tclk_end .EQ * end of obj tclock_0.
|
||||
.HS 000000 pad
|
||||
.DA #$07 Monday
|
||||
.DA #$0C Sunday
|
||||
.DA #$0B Saturday
|
||||
.DA #$0A Friday
|
||||
.DA #$09 Thursday
|
||||
.DA #$08 Wednesday
|
||||
.DA #$08 Tuesday
|
||||
tclk_end .EQ * end of obj tclock_0.
|
||||
.HS 000000 pad
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE USR/SRC/PRODOS.203/PRODOS.S.TCLK
|
||||
|
|
|
@ -16,7 +16,7 @@ NewHandle .EQ $0902
|
|||
PtrToHand .EQ $2802
|
||||
MessageCenter .EQ $1501
|
||||
DisposeHandle .EQ $1002
|
||||
MMShutDown .EQ $0303
|
||||
MMShutDown .EQ $0302
|
||||
ReadTimeHex .EQ $0D03
|
||||
Int2Hex .EQ $220B
|
||||
TLTextMountVolume .EQ $1201
|
||||
|
|
Loading…
Reference in New Issue