A2osX/ProDOS.203/ProDOS.S.LDR.A.txt

770 lines
20 KiB
Plaintext
Raw Normal View History

2019-09-11 15:53:33 +00:00
NEW
AUTO 3,1
2019-09-16 20:50:08 +00:00
*--------------------------------------
2019-09-11 15:53:33 +00:00
H2000 jmp prostart
jmp atalkset appletalk setup for network boot
jmp p16start GQuit setup for gs/os
2019-09-12 15:56:38 +00:00
LDR.MSG.AppleII .AS -"Apple II"
2019-10-19 18:35:30 +00:00
LDR.MSG.ProDOS .AS -"ProDOS 8 V2.0.3tc "
2019-09-12 15:56:38 +00:00
.AS -"06-May-93"
H202F .AS -" "
2019-09-12 06:39:47 +00:00
LDR.MSG.Copyright
2019-09-12 15:56:38 +00:00
.AS -"Copyright Apple Computer, Inc., 1983-93"
2019-09-12 06:39:47 +00:00
LDR.MSG.Reserved
2019-09-12 15:56:38 +00:00
.AS -"All Rights Reserved."
2019-09-11 15:53:33 +00:00
p16start inc setuprts set = 2 for GQuit rts
atalkset inc setuprts set = 1 for appletalk rts
prostart lda unitnum
sta LDR.MLIONLINE.P+1
jsr LDR.Splash
* test for at least a 65c02
sed
lda #$99 a negative #
clc
adc #$01 +1 in decimal = 0 (positive)
cld
bmi m48k if 6502 because will not clear N flag
* machine at least an m65c02
lda #$01 patch for the gs rom
trb statereg to force off intcxrom
ldx #H232B yx=232B location table
ldy /H232B
jsr reloc move interpreter loader to $800
bcs m48k error
* test for at least 64k
ldy #$00
lda #$FF
sta kversion at least 48k ?
eor kversion
sec
2019-09-13 20:48:05 +00:00
bne m48k if not.
2019-09-11 15:53:33 +00:00
2019-09-13 20:48:05 +00:00
sta kversion try again to be sure
2019-09-11 15:53:33 +00:00
lda kversion
2019-09-13 20:48:05 +00:00
bne m48k still not.
2019-09-11 15:53:33 +00:00
2019-09-13 20:48:05 +00:00
lda RROMBNK2 read ROM
2019-09-11 15:53:33 +00:00
jsr whchrom get preliminary system config
bcs m48k machine too small
lda idapple
and #$20
2019-09-13 20:48:05 +00:00
bne m64k if at least 64k //+.
m48k jmp H22EB need enhanced IIe
2019-09-11 15:53:33 +00:00
* we have 64k, now determine model: //e , iic, or Cortland (//gs)
m64k ldx #H2367 yx=2367 relocation table
ldy /H2367
jsr reloc
lda kversion
2019-09-13 20:48:05 +00:00
sta xdosver save current version for dir use
2019-09-11 15:53:33 +00:00
2019-09-13 20:48:05 +00:00
H20CE bcc H20D3
2019-09-11 15:53:33 +00:00
jmp relocerr
2019-09-13 20:48:05 +00:00
H20D3 lda RROMBNK2 read ROM
ldx version ROM id byte
2019-09-11 15:53:33 +00:00
cpx #$06
2019-09-13 20:48:05 +00:00
bne H211D then it's a //e
2019-09-11 15:53:33 +00:00
lda #$E0
2019-09-13 20:48:05 +00:00
bit zidbyte another ROM id byte
2019-09-11 15:53:33 +00:00
php
lda idapple
and #$37
plp
2019-09-13 20:48:05 +00:00
bvc set3 if //c or //x
bmi set7 if //e
2019-09-11 15:53:33 +00:00
set3 php
ora #$08
plp
2019-09-13 20:48:05 +00:00
bpl mach2 if //c
2019-09-11 15:53:33 +00:00
ora #$40
2019-09-13 20:48:05 +00:00
bpl H20FD always taken.
2019-09-11 15:53:33 +00:00
2019-09-13 20:48:05 +00:00
mach2 inc cflag //c or later
2019-09-11 15:53:33 +00:00
bvs H20FD
2019-09-13 06:37:52 +00:00
set7 ora #$80
2019-09-11 15:53:33 +00:00
2019-09-13 06:37:52 +00:00
H20FD sta idapple
2019-09-12 06:39:47 +00:00
lda RROMBNK2 read ROM
2019-09-11 15:53:33 +00:00
sec
2019-09-13 20:48:05 +00:00
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
2019-09-11 15:53:33 +00:00
lda setuprts
2019-09-13 20:48:05 +00:00
bne H211D branch if prodos 8 alone
2019-09-11 15:53:33 +00:00
* running from gs/os shell so zero out os_boot for appletalk
2019-09-13 20:48:05 +00:00
sta OS_BOOT indicates O/S initially booted.
jsr patch101 patch for gs/os - rev note #101
2019-09-11 15:53:33 +00:00
* put dispatcher in bank 2 of language card
2019-09-13 20:48:05 +00:00
H211D lda LDR.MLIONLINE.P+1 place boot devnum in globals
2019-09-11 15:53:33 +00:00
sta LDR.MLIREADBLOCK.P+1
2019-09-13 20:48:05 +00:00
sta devnum last device used
jsr devsrch finish setting up globals
2019-09-11 15:53:33 +00:00
lda LDR.MLIREADBLOCK.P+1
sta devnum
2019-09-13 20:48:05 +00:00
jsr lc1in switch in language card bank 1.
ldx #rlclk64 set up clock
2019-09-11 15:53:33 +00:00
ldy /rlclk64
jsr reloc
2019-09-13 06:37:52 +00:00
H2139 bcs H20CE
2019-09-11 15:53:33 +00:00
lda #calldisp
sta jspare+1 P8 system death vector
lda /calldisp
sta jspare+2
2019-09-13 20:48:05 +00:00
lda RRAMWRAMBNK2 read/write RAM bank 2
2019-09-12 06:39:47 +00:00
lda RRAMWRAMBNK2
2019-09-13 20:48:05 +00:00
ldx #altdsptbl GQuit dispatcher
2019-09-11 15:53:33 +00:00
ldy /altdsptbl
lda setuprts
2019-09-13 20:48:05 +00:00
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.
2019-09-11 15:53:33 +00:00
and #$C2
2019-09-13 20:48:05 +00:00
cmp #$82 //e with 80 col card ?
beq H216E if yes, can use.
ldx #dsp64 else, use original quit code
2019-09-11 15:53:33 +00:00
ldy /dsp64
2019-09-13 20:48:05 +00:00
inc newquitflag using old quit code so set flag
2019-09-11 15:53:33 +00:00
2019-09-13 06:37:52 +00:00
H216E jsr reloc
2019-09-13 20:48:05 +00:00
lda #$EE byte to distinguish LC bank 2
2019-09-11 15:53:33 +00:00
sta $D000
2019-09-13 20:48:05 +00:00
jsr lc1in switch in LC bank 1
2019-09-11 15:53:33 +00:00
bcs H2139
* test for 128k needed to install ram disk
2019-09-13 20:48:05 +00:00
lda machid machine ID byte
2019-09-11 15:53:33 +00:00
and #$30
eor #$30
2019-09-13 20:48:05 +00:00
bne noramdsk if < 128k
2019-09-11 15:53:33 +00:00
ldx #$FF
2019-09-13 20:48:05 +00:00
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
2019-09-11 15:53:33 +00:00
plp
2019-09-13 20:48:05 +00:00
sta CLRC3ROM enable internal slot 3 ROM
2019-09-15 15:13:48 +00:00
jsr RAMDRV.Install
2019-09-11 15:53:33 +00:00
* check interrupt vector to determine ROM version
2019-09-13 20:48:05 +00:00
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)
2019-09-11 15:53:33 +00:00
lda #$00
2019-09-13 20:48:05 +00:00
bcs H21C5 branch if old roms
sta SETALTZP use alt zero page/stack
lda #$FF set aux sp = $FF
2019-09-11 15:53:33 +00:00
sta auxsp
2019-09-13 20:48:05 +00:00
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
2019-09-11 15:53:33 +00:00
sty irqv
lda #$01
2019-09-13 20:48:05 +00:00
H21C5 sta irqflag 1 = new roms
2019-09-11 15:53:33 +00:00
stz cortflag assume not Cortland system
2019-09-13 20:48:05 +00:00
lda cortland running on a Cortland ?
beq H21D5 branch if not.
inc cortflag yes it's Cortland
2019-09-11 15:53:33 +00:00
bra docard
* check for a rom in slot 3. if no rom, use internal $C300 firmware
2019-09-13 06:37:52 +00:00
H21D5 sta CLRC3ROM enable internal slot 3 ROM
2019-09-13 20:48:05 +00:00
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
2019-09-11 15:53:33 +00:00
* 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.
2019-09-13 20:48:05 +00:00
isromin3 sta SETC3ROM enable slot 3 rom
lda $C305 check card id bytes
2019-09-11 15:53:33 +00:00
cmp #$38
2019-09-13 20:48:05 +00:00
bne hitswtch not terminal card
2019-09-12 06:39:47 +00:00
lda $C307
2019-09-11 15:53:33 +00:00
cmp #$18
bne hitswtch
2019-09-12 06:39:47 +00:00
lda $C30B
2019-09-11 15:53:33 +00:00
cmp #$01
bne hitswtch
2019-09-13 20:48:05 +00:00
lda $C30C is it an apple 80 col compatible card?
2019-09-11 15:53:33 +00:00
and #$F0
cmp #$80
2019-09-13 20:48:05 +00:00
bne hitswtch if not.
lda machid machine ID byte
2019-09-11 15:53:33 +00:00
and #$C8
2019-09-13 20:48:05 +00:00
cmp #$C0 is it a //+ ?
beq docard yes
2019-09-12 15:56:38 +00:00
lda $C3FA
2019-09-13 20:48:05 +00:00
cmp #$2C does card have an interrupt handler?
beq docard yes
2019-09-11 15:53:33 +00:00
2019-09-12 06:39:47 +00:00
hitswtch sta CLRC3ROM enable internal $C300 firmware
2019-09-11 15:53:33 +00:00
* verify that the card in aux slot is actually present
2019-09-13 20:48:05 +00:00
sta SET80STORE enable 80-col store
sta SETPAGE2 switch in text page 2
2019-09-11 15:53:33 +00:00
lda #$EE
sta txtp2
asl
asl txtp2
cmp txtp2
bne H2230
lsr
lsr txtp2
cmp txtp2
2019-09-13 20:48:05 +00:00
2019-09-13 06:37:52 +00:00
H2230 sta CLRPAGE2 main memory
2019-09-13 20:48:05 +00:00
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
2019-09-11 15:53:33 +00:00
2019-09-13 06:37:52 +00:00
docard lda machid
2019-09-13 20:48:05 +00:00
ora #$02 turn bit 2 on (80-col card is present)
2019-09-11 15:53:33 +00:00
2019-09-13 06:37:52 +00:00
H2244 sta machid
H2247 lda cortland are we running on a //gs ?
2019-09-13 20:48:05 +00:00
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
2019-09-11 15:53:33 +00:00
jsr reloc
2019-09-13 20:48:05 +00:00
lda #$01 set bit 0 = clock present
2019-09-11 15:53:33 +00:00
tsb machid
2019-09-13 06:37:52 +00:00
H225D lda setuprts get setup entry point flag
2019-09-13 20:48:05 +00:00
beq H2267 taken if normal boot.
lda RROMBNK2 read ROM
rts return to caller at setup entry point.
2019-09-11 15:53:33 +00:00
setuprts .DA #$00 0 = normal boot, <>0 = return
* set prefix to boot device
2019-09-13 20:48:05 +00:00
H2267 jsr MLI
2019-09-11 15:53:33 +00:00
.DA #MLIONLINE
.DA LDR.MLIONLINE.P
bcs relocerr
2019-09-13 20:48:05 +00:00
lda pbuf+1 get volume name length.
and #$0F strip devnum
2019-09-11 15:53:33 +00:00
beq relocerr
2019-09-13 20:48:05 +00:00
inc add 1 for leading '/'
sta pbuf save prefix length.
lda #'/' place leading '/' in prefix buffer
2019-09-12 06:39:47 +00:00
sta pbuf+1
2019-09-11 15:53:33 +00:00
2019-09-13 20:48:05 +00:00
jsr MLI
2019-09-11 15:53:33 +00:00
.DA #MLISETPREFIX
.DA LDR.MLISETPREFIX.P
bcs relocerr
tax =0
2019-09-12 06:39:47 +00:00
stx dst
2019-09-13 20:48:05 +00:00
ldy #$02 read directory into buffer
2019-09-11 15:53:33 +00:00
lda /DirBlkBuf
2019-09-13 06:37:52 +00:00
H228E sta dst+1
2019-09-13 20:48:05 +00:00
sta LDR.MLIREADBLOCK.P+3
sty LDR.MLIREADBLOCK.P+4
stx LDR.MLIREADBLOCK.P+5
2019-09-11 15:53:33 +00:00
2019-09-13 20:48:05 +00:00
jsr MLI
2019-09-11 15:53:33 +00:00
.DA #MLIREADBLOCK
.DA LDR.MLIREADBLOCK.P
bcs relocerr
2019-09-13 20:48:05 +00:00
ldy #$03 get next block# from link
2019-09-12 06:39:47 +00:00
lda (dst),y
2019-09-11 15:53:33 +00:00
tax
dey
2019-09-13 20:48:05 +00:00
ora (dst),y if both bytes are the same
beq H22B7 then no more blocks of directory.
2019-09-12 06:39:47 +00:00
lda (dst),y
2019-09-11 15:53:33 +00:00
tay
2019-09-12 06:39:47 +00:00
lda dst+1
2019-09-11 15:53:33 +00:00
clc
2019-09-13 20:48:05 +00:00
adc #$02 add $200 to buffer pointer
cmp /dbuf+$800 until it points past end of buffer.
bcc H228E if ok, read next block.
2019-09-11 15:53:33 +00:00
2019-09-17 18:38:45 +00:00
H22B7 jmp $800 jmp to "load interpreter" code
2019-09-11 15:53:33 +00:00
* relocation/configuration error
2019-09-12 06:39:47 +00:00
relocerr sta RROMBNK2 read ROM
2019-09-11 15:53:33 +00:00
jsr home
ldy #$1D
2019-09-13 06:37:52 +00:00
.1 lda LDR.MSG.LdrErr,y
2019-09-11 15:53:33 +00:00
sta vline12+4,y
dey
bpl .1
bmi *
2019-09-13 06:37:52 +00:00
LDR.MSG.LdrErr .AS -"Relocation/Configuration Error"
2019-09-11 15:53:33 +00:00
2019-09-12 15:56:38 +00:00
H22EB ldy #$23
2019-09-11 15:53:33 +00:00
2019-09-13 06:37:52 +00:00
.1 lda LDR.MSG.EnhErr,y
2019-09-11 15:53:33 +00:00
sta vline14+2,y
dey
bpl .1
bmi *
2019-09-13 06:37:52 +00:00
LDR.MSG.EnhErr .AS -"REQUIRES ENHANCED APPLE IIE OR LATER"
2019-09-11 15:53:33 +00:00
LDR.MLIONLINE.P .DA #2
.DA #$60
2019-09-12 06:39:47 +00:00
.DA pbuf+1
2019-09-11 15:53:33 +00:00
LDR.MLISETPREFIX.P
.DA #1
2019-09-12 06:39:47 +00:00
.DA pbuf
2019-09-11 15:53:33 +00:00
LDR.MLIREADBLOCK.P
.DA #3
2019-09-13 20:48:05 +00:00
.DA #0 unit number
2019-09-11 15:53:33 +00:00
.DA 0 2 byte data buffer
2019-09-13 20:48:05 +00:00
.DA 0 2 byte block number
2019-09-11 15:53:33 +00:00
cortland .BS 1 cortland loader flag (1 = Cortland)
newquitflag .BS 1 1 = old quit code
2019-09-13 20:48:05 +00:00
H232B .DA #1 move interpreter loader code
2019-09-17 18:38:45 +00:00
.DA $800 destination address
.DA licode.end-licode length to move
.DA LOADINT source address
2019-09-13 20:48:05 +00:00
.DA #$01 move $3F0 vectors
.DA p3vect destination
.DA $0010 16 bytes to move
.DA H257B source
2019-09-17 18:38:45 +00:00
2019-09-13 06:37:52 +00:00
.DA #$01
2019-09-17 18:38:45 +00:00
.DA lookptr destination address
.DA $0002 length to move
.DA dst source
2019-09-13 20:48:05 +00:00
.DA #$01 move 128k test to zero page
.DA tst128 destination
2019-09-17 18:38:45 +00:00
.DA LDR.Test128.Len length to move
.DA LDR.Test128 source
2019-09-13 06:37:52 +00:00
.HS FF done
2019-09-11 15:53:33 +00:00
2019-09-13 06:37:52 +00:00
dsp64 .DA #$01 move p8 dispatcher code
.DA displc2 destination
2019-09-15 15:13:48 +00:00
.DA $0300 length (must be <= 3 pages)
.DA SEL0 source
2019-09-13 06:37:52 +00:00
.HS FF done
2019-09-11 15:53:33 +00:00
2019-09-13 20:48:05 +00:00
newquitbl .DA #$01 move Bird's Bye code
.DA displc2 dest
2019-09-15 15:13:48 +00:00
.DA $0300 length (must be <= 3 pages)
.DA SEL1 source
2019-09-13 20:48:05 +00:00
.HS FF done
2019-09-11 15:53:33 +00:00
2019-09-13 20:48:05 +00:00
altdsptbl .DA #$01 move GQuit launcher
2019-09-13 06:37:52 +00:00
.DA displc2 destination
2019-09-13 20:48:05 +00:00
.DA $0300 length (must be <= 3 pages)
2019-09-15 15:13:48 +00:00
.DA SEL2 source
2019-09-13 20:48:05 +00:00
.DA #$01 move a copy of GQuit launcher
.DA dispadr to dispadr for gsos
.DA $0300 length (must be <= 3 pages)
2019-09-15 15:13:48 +00:00
.DA SEL2 source
2019-09-13 06:37:52 +00:00
.HS FF done
2019-09-11 15:53:33 +00:00
* tables for moving 64k version of mli for execution
2019-09-13 20:48:05 +00:00
H2367 .DA #$01 relocation table. 1=move src to dst
2019-09-15 15:13:48 +00:00
.DA $ff9b destination
.DA $100-$9B length to move
.DA IRQ source
2019-09-13 06:37:52 +00:00
.DA #$01
2019-09-15 15:13:48 +00:00
.DA MLI dst
2019-09-13 20:48:05 +00:00
.DA $0100 in one page
2019-09-15 15:13:48 +00:00
.DA GP src
2019-09-13 20:48:05 +00:00
.HS 00 0=clear buffers $D700-$DDFF
2019-09-16 20:50:08 +00:00
.DA $D700 start
.DA $0700 len
2019-09-15 15:13:48 +00:00
2019-09-13 06:37:52 +00:00
.DA #$01
2019-09-15 15:13:48 +00:00
.DA $DE00 dst
.DA $2100 length of mli
.DA XDOS src
2019-09-13 06:37:52 +00:00
.DA #$01
2019-09-15 15:13:48 +00:00
.DA $D000
.DA $0700 length of disk ii driver
.DA XRW
2019-09-13 20:48:05 +00:00
.HS FF done
2019-09-11 15:53:33 +00:00
* move thunderclock
2019-09-13 20:48:05 +00:00
rlclk64 .DA #$01 relocation table. 1=move src to dst
2019-09-16 06:06:02 +00:00
.DA $D742 destination
.DA TCLK.END-TCLK.START length of thunderclock driver
.DA TCLK source
2019-09-15 15:13:48 +00:00
2019-09-13 20:48:05 +00:00
.DA #$04 4=relocate and move program
2019-09-16 06:06:02 +00:00
.DA TCLK.START
.DA TCLK.CEND-TCLK.START
.DA TCLK.START
2019-09-13 06:37:52 +00:00
.HS 00
.HS C1C1
clock64 .DA #$00
2019-09-13 20:48:05 +00:00
.HS FF done
2019-09-11 15:53:33 +00:00
* move cortland clock
2019-09-13 20:48:05 +00:00
cortclock .DA #$01 relocation table. 1=move src to dst
2019-09-16 06:06:02 +00:00
.DA $D742 destination
.DA CCLK.END-CCLK.START length of cortland clock driver
.DA CCLK source
2019-09-13 20:48:05 +00:00
.HS FF done
2019-09-11 15:53:33 +00:00
* load and run appletalk configuration file (atinit) if present
* or continue loading and running .system file
* loader origin $800
2019-09-17 18:38:45 +00:00
LOADINT .PH $800
2019-09-11 15:53:33 +00:00
2019-09-17 18:38:45 +00:00
licode jsr MLI check for file 'atinit'
2019-09-11 15:53:33 +00:00
.DA #MLIGETFILEINFO
.DA gfi_list
2019-09-13 20:48:05 +00:00
bcc gfi_ok branch if 'atinit' file found
cmp #$46 file not found?
beq H23DF if so, continue loading interpreter
2019-09-11 15:53:33 +00:00
bne H23E2
2019-09-17 18:38:45 +00:00
2019-09-13 06:37:52 +00:00
gfi_ok lda gfi_type
2019-09-13 20:48:05 +00:00
cmp #$E2 is 'atinit' correct file type?
bne H23E2 error - wrong file type
jsr MLI open 'atinit' file
2019-09-13 06:37:52 +00:00
.DA #$C8
2019-09-13 20:48:05 +00:00
.DA atopen
bne H23E2 error
lda #$9F max size = 39.75k ($2000-$BF00)
2019-09-13 06:37:52 +00:00
sta rdlen+1
stz rdlen
2019-09-13 20:48:05 +00:00
jsr MLI read 'atinit' file to 'sysentry'
2019-09-13 06:37:52 +00:00
.DA #$CA
.DA rdparm
2019-09-13 20:48:05 +00:00
bne H23E2 error - too big
jsr MLI close 'atinit' file
2019-09-13 06:37:52 +00:00
.DA #$CC
.DA clparm
2019-09-13 20:48:05 +00:00
bne H23E2 error
2019-09-13 06:37:52 +00:00
lda RROMBNK2 enable ROM
jsr sysentry execute ATinit
2019-09-13 20:48:05 +00:00
H23DF jmp goloadint execute .system file
2019-09-11 15:53:33 +00:00
* fatal error
2019-09-17 18:38:45 +00:00
H23E2 ldx $23F0 BUG: should be ATINIT.ERR
H23E5 lda $23F0,x BUG: should be ATINIT.ERR
2019-09-11 15:53:33 +00:00
sta vline16,x
dex
bne H23E5
beq *
2019-09-17 18:38:45 +00:00
ATINIT.ERR .DA #$1A length of message
2019-09-13 06:37:52 +00:00
.AS -"Unable to load ATInit file"
2019-09-11 15:53:33 +00:00
2019-09-17 18:38:45 +00:00
gfi_list .DA #$0A
2019-09-13 06:37:52 +00:00
.DA atinitname
.HS 00
2019-09-17 18:38:45 +00:00
gfi_type .HS 00000000
2019-09-13 06:37:52 +00:00
.HS 0000000000000000
.HS 0000
2019-09-17 18:38:45 +00:00
atopen .HS 03
2019-09-13 06:37:52 +00:00
.DA atinitname
2019-09-13 20:48:05 +00:00
.DA iobuf i/o buffer
.HS 01 ref# hard coded since no other files
2019-09-17 18:38:45 +00:00
atinitname .DA #06 length of name
2019-09-13 20:48:05 +00:00
.AS -"atinit" name of appletalk config file
2019-09-17 18:38:45 +00:00
goloadint
2019-09-13 20:48:05 +00:00
lda /dbuf search directory buffer
2019-09-13 06:37:52 +00:00
sta idxl+1
2019-09-13 20:48:05 +00:00
lda #$04 start 1 entry past header
bne H2434 always.
H2432 lda idxl calc next entry position
2019-09-13 06:37:52 +00:00
H2434 clc
2019-09-13 20:48:05 +00:00
adc dbuf+35 inc to next entry address
2019-09-13 06:37:52 +00:00
sta idxl
2019-09-13 20:48:05 +00:00
bcs H2451 branch if page cross.
adc dbuf+35 test for end of block.
bcc H2453 branch if not page cross
2019-09-13 06:37:52 +00:00
lda idxl+1
2019-09-13 20:48:05 +00:00
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.
2019-09-13 06:37:52 +00:00
sta idxl
2019-09-13 20:48:05 +00:00
H2451 inc idxl+1 inc to next page.
H2453 ldy #$10 check file type.
lda #$FF must be a prodos sys file
2019-09-13 06:37:52 +00:00
eor (idxl),y
2019-09-13 20:48:05 +00:00
bne H2432 if not sys.
tay see if active
2019-09-13 06:37:52 +00:00
lda (idxl),y
2019-09-13 20:48:05 +00:00
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'
2019-09-13 06:37:52 +00:00
ldx #$06
H246C lda (idxl),y
eor iterp,x
asl
2019-09-13 20:48:05 +00:00
bne H2432 branch if something else
2019-09-13 06:37:52 +00:00
dey
dex
bpl H246C
ldy #$00
H247A iny
lda (idxl),y
sta pbuf,y
2019-09-13 20:48:05 +00:00
ora #$80 msb on so can be displayed if error
2019-09-13 06:37:52 +00:00
sta iomess+$11,y
cpy pbuf
bne H247A
2019-09-13 20:48:05 +00:00
lda #$A0 space after name
2019-09-13 06:37:52 +00:00
sta iomess+$12,y
2019-09-13 20:48:05 +00:00
tya error message length
adc #$13 (carry set)
2019-09-13 06:37:52 +00:00
sta ierlen
2019-09-13 20:48:05 +00:00
jsr MLI open interpreter file
2019-09-13 06:37:52 +00:00
.DA #$C8
.DA opparm
bne badlod
2019-09-13 20:48:05 +00:00
jsr MLI get eof (length of file)
2019-09-13 06:37:52 +00:00
.DA #$D1
.DA efparm
bne badlod
lda eof+2
bne toolong
lda eof+1
2019-09-13 20:48:05 +00:00
cmp #$9F max size = 39.75k ($2000-$BF00)
2019-09-13 06:37:52 +00:00
bcs toolong
sta rdlen+1
lda eof
2019-09-13 20:48:05 +00:00
sta rdlen (read entire file)
jsr MLI read interpreter file
2019-09-13 06:37:52 +00:00
.DA #$CA
.DA rdparm
2019-09-13 20:48:05 +00:00
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
2019-09-13 06:37:52 +00:00
.DA #$CC
.DA clparm
2019-09-13 20:48:05 +00:00
bne badlod hopefully never taken
2019-09-11 15:53:33 +00:00
* 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
2019-09-13 06:37:52 +00:00
lda cflag
2019-09-13 20:48:05 +00:00
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
2019-09-13 06:37:52 +00:00
H24DF lda RROMBNK2 enable ROM
jmp sysentry go run interpreter
2019-09-17 18:38:45 +00:00
cflag .HS 00 set if a //c.
nointrp jsr MLI no interpreter found,so quit.
2019-09-13 06:37:52 +00:00
.DA #$65
.DA quitparm
2019-09-13 20:48:05 +00:00
badlod ldy ierlen center the error message
2019-09-13 06:37:52 +00:00
lda #$27
sec
sbc ierlen
lsr
adc ierlen
tax
H24FA lda iomess,y
sta vline16,x
dex
dey
bpl H24FA
bmi H2511
toolong ldy #$1E
H2508 lda lgmess,y
sta vline16+5,y
dey
bpl H2508
H2511 bmi H2511
2019-09-17 18:38:45 +00:00
lgmess .AS -"** System program too large **"
iomess .AS -"** Unable to load"
2019-09-13 06:37:52 +00:00
.AS -" X.System *********"
2019-09-17 18:38:45 +00:00
ierlen .HS 00
opparm .HS 03
2019-09-13 06:37:52 +00:00
.DA pbuf
.DA iobuf
.HS 01
2019-09-17 18:38:45 +00:00
efparm .HS 02
2019-09-13 06:37:52 +00:00
.DA #01
2019-09-17 18:38:45 +00:00
eof .HS 000000 length of file.
rdparm .HS 04
2019-09-13 06:37:52 +00:00
.HS 01
.DA sysentry
2019-09-17 18:38:45 +00:00
rdlen .HS 0000
2019-09-13 06:37:52 +00:00
.HS 0000
2019-09-17 18:38:45 +00:00
clparm .HS 01
2019-09-13 06:37:52 +00:00
.HS 00
2019-09-17 18:38:45 +00:00
quitparm .HS 04
2019-09-13 06:37:52 +00:00
.HS 00
.HS 0000
.HS 00
.HS 0000
2019-09-17 18:38:45 +00:00
iterp .AS -".SYSTEM" interpreter suffix that is required
licode.end .EP
2019-09-11 15:53:33 +00:00
* 16 bytes moved to $03F0 vectors
H257B .DA breakv
2019-09-13 06:37:52 +00:00
.DA oldrst
2019-09-13 20:48:05 +00:00
.DA #$5A powerup byte
jmp oldrst '&' vector
jmp oldrst ctrl-y vector
2019-09-13 06:37:52 +00:00
.HS 004000
2019-09-13 20:48:05 +00:00
.DA irqent global page interrupt vector
lc1in lda RRAMWRAMBNK1 read/write language card RAM bank 1
2019-09-13 06:37:52 +00:00
lda RRAMWRAMBNK1
rts
2019-09-11 15:53:33 +00:00
* determine which system model and save in machine id (idapple)
2019-09-13 20:48:05 +00:00
whchrom stz idapple assume standard apple //
ldx version check hardware id
cpx #$38 is it apple // (autostart rom)?
beq H25BE if yes
2019-09-13 06:37:52 +00:00
lda #$80
2019-09-13 20:48:05 +00:00
cpx #$06 apple //e?
beq H25BC if yes
2019-09-13 06:37:52 +00:00
lda #$40
2019-09-13 20:48:05 +00:00
cpx #$EA apple //+?
bne H25B6 it not, then machine is unknown.
ldx $FB1E apple /// in emulation?
2019-09-13 06:37:52 +00:00
cpx #$AD
2019-09-13 20:48:05 +00:00
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
2019-09-13 06:37:52 +00:00
sta (dst),y
2019-09-13 20:48:05 +00:00
bne H25D9 always.
H25BC sta idapple save machine id
2019-09-11 15:53:33 +00:00
* check for language card ram
2019-09-13 20:48:05 +00:00
H25BE jsr lc1in switch in language card bank 1
2019-09-13 06:37:52 +00:00
lda #$AA
sta $D000
eor $D000 if LC present, result = 0.
bne H25B4 othewise, insufficient memory.
lsr $D000 check lc again
lda #$55
eor $D000
bne H25B4 not sufficent memory.
lda #$20 LC ram is available
ora idapple
H25D9 jmp tst128 jumps to page 0 routine below
2019-09-11 15:53:33 +00:00
* test for 128k. use page 0 for this routine
2019-09-13 06:37:52 +00:00
LDR.Test128 sta idapple H25DC-2621 was moved to location tst128
bpl not128 if already determined < 128k
lda #$EE
sta SETWRITEAUX write to aux mem while on main zp
sta SETREADAUX and read aux mem.
sta dbuf write these locs just to test aux mem
2019-09-17 18:38:45 +00:00
sta $800 1k apart from each other.
2019-09-13 06:37:52 +00:00
lda dbuf
cmp #$EE
bne noaux
asl dbuf may be sparse mem mapping so
asl change value and see what happens.
cmp dbuf
bne noaux branch if not sparse mapping.
2019-09-17 18:38:45 +00:00
cmp $800
2019-09-13 06:37:52 +00:00
bne H2606 if not sparse.
noaux sec no aux memory available.
bcs H2607
H2606 clc
H2607 sta CLRWRITEAUX switch back to main memory
sta CLRREADAUX
bcs not128 if < 128k
lda idapple
ora #$30 set id = 128k present
sta idapple
not128 lda lookptr+1
sec
sbc #$05
sta lookptr+1
bcs H2620
dec lookptr
H2620 clc
rts
2019-09-12 15:56:38 +00:00
LDR.Test128.len .EQ *-LDR.Test128
2019-09-16 20:50:08 +00:00
*--------------------------------------
2019-09-11 15:53:33 +00:00
MAN
SAVE usr/src/prodos.203/prodos.s.ldr.a
LOAD usr/src/prodos.203/prodos.s
2019-09-11 15:53:33 +00:00
ASM