mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-08-15 08:27:29 +00:00
Merge PR #122 'LOADFILE updated'
This commit is contained in:
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
129
auxmem.hostfs.s
129
auxmem.hostfs.s
@@ -713,19 +713,19 @@ FREERET
|
|||||||
LDA AUXBLK+3 ; MSB of total blks
|
LDA AUXBLK+3 ; MSB of total blks
|
||||||
SBC AUXBLK+1 ; MSB of blocks used
|
SBC AUXBLK+1 ; MSB of blocks used
|
||||||
TAY
|
TAY
|
||||||
LDA #$00 ; *TO DO* b16-b23 of free
|
LDA #$00 ; *TO DO* b16-b23 of free
|
||||||
* NEW
|
* NEW
|
||||||
JSR :FREEDEC ; Print 'AAYYXX blocks aaayyyxxx bytes '
|
JSR :FREEDEC ; Print 'AAYYXX blocks aaayyyxxx bytes '
|
||||||
LDX #<:FREE
|
LDX #<:FREE
|
||||||
LDY #>:FREE
|
LDY #>:FREE
|
||||||
JSR OUTSTR ; Print 'free'<nl>
|
JSR OUTSTR ; Print 'free'<nl>
|
||||||
LDX AUXBLK+0 ; Blocks used
|
LDX AUXBLK+0 ; Blocks used
|
||||||
LDY AUXBLK+1
|
LDY AUXBLK+1
|
||||||
LDA #$00 ; *TO DO* b16-b23 of used
|
LDA #$00 ; *TO DO* b16-b23 of used
|
||||||
JSR :FREEDEC ; Print 'AAYYXX blocks aaayyyxxx bytes '
|
JSR :FREEDEC ; Print 'AAYYXX blocks aaayyyxxx bytes '
|
||||||
LDX #<:USED
|
LDX #<:USED
|
||||||
LDY #>:USED
|
LDY #>:USED
|
||||||
JMP OUTSTR ; Print 'used'<nl>
|
JMP OUTSTR ; Print 'used'<nl>
|
||||||
|
|
||||||
* OLD
|
* OLD
|
||||||
* JSR PRDECXY ; Print in decimal
|
* JSR PRDECXY ; Print in decimal
|
||||||
@@ -748,20 +748,20 @@ FREERET
|
|||||||
STA FSNUM+3
|
STA FSNUM+3
|
||||||
* What's the maximum number of blocks?
|
* What's the maximum number of blocks?
|
||||||
* JSR PRHEX ; Blocks b16-b23 in hex
|
* JSR PRHEX ; Blocks b16-b23 in hex
|
||||||
JSR PR2HEX ; Blocks b0-b15 in hex
|
JSR PR2HEX ; Blocks b0-b15 in hex
|
||||||
LDX #<:BLOCKS
|
LDX #<:BLOCKS
|
||||||
LDY #>:BLOCKS
|
LDY #>:BLOCKS
|
||||||
JSR OUTSTR ; ' blocks '
|
JSR OUTSTR ; ' blocks '
|
||||||
STZ FSNUM+0 ; FSNUM=blocks*512
|
STZ FSNUM+0 ; FSNUM=blocks*512
|
||||||
ASL FSNUM+1
|
ASL FSNUM+1
|
||||||
ROL FSNUM+2
|
ROL FSNUM+2
|
||||||
ROL FSNUM+3
|
ROL FSNUM+3
|
||||||
LDX #FSNUM ; X=>number to print
|
LDX #FSNUM ; X=>number to print
|
||||||
LDY #8 ; Y=pad up to 8 digits
|
LDY #8 ; Y=pad up to 8 digits
|
||||||
JSR PRINTDEC ; Print it in decimal
|
JSR PRINTDEC ; Print it in decimal
|
||||||
LDX #<:BYTES
|
LDX #<:BYTES
|
||||||
LDY #>:BYTES
|
LDY #>:BYTES
|
||||||
JMP OUTSTR ; ' bytes '
|
JMP OUTSTR ; ' bytes '
|
||||||
:BLOCKS ASC ' blocks '
|
:BLOCKS ASC ' blocks '
|
||||||
DB 0
|
DB 0
|
||||||
:BYTES ASC ' bytes '
|
:BYTES ASC ' bytes '
|
||||||
@@ -877,10 +877,10 @@ MKERRLP
|
|||||||
LSR A
|
LSR A
|
||||||
LSR A
|
LSR A
|
||||||
JSR ERRHEX
|
JSR ERRHEX
|
||||||
STA $109
|
STA $108
|
||||||
PLA
|
PLA
|
||||||
JSR ERRHEX
|
JSR ERRHEX
|
||||||
STA $10A
|
STA $109
|
||||||
JMP $100
|
JMP $100
|
||||||
ERRHEX
|
ERRHEX
|
||||||
AND #15
|
AND #15
|
||||||
@@ -898,13 +898,13 @@ ERRMSG
|
|||||||
MKERROR1
|
MKERROR1
|
||||||
CMP #$40
|
CMP #$40
|
||||||
BCS MKERROR2
|
BCS MKERROR2
|
||||||
ORA #$30 ; <$40 -> $30-$3F
|
ORA #$30 ; <$40 -> $30-$3F
|
||||||
MKERROR2
|
MKERROR2
|
||||||
SEC
|
SEC
|
||||||
SBC #$37
|
SBC #$37
|
||||||
CMP #$28
|
CMP #$28
|
||||||
BCC MKERROR3
|
BCC MKERROR3
|
||||||
LDA #$00 ; I/O error
|
LDA #$00 ; I/O error
|
||||||
MKERROR3
|
MKERROR3
|
||||||
ASL A
|
ASL A
|
||||||
TAX
|
TAX
|
||||||
@@ -923,16 +923,16 @@ MKERROR4 DW ERROR27
|
|||||||
|
|
||||||
* $27 - I/O error (disk not formatted)
|
* $27 - I/O error (disk not formatted)
|
||||||
* $28 - No device con'd (drive not present) Disk not present
|
* $28 - No device con'd (drive not present) Disk not present
|
||||||
* $29 - (GEOS Driver is busy)
|
* $29 -(GSOS Driver is busy)
|
||||||
* $2A -
|
* $2A -
|
||||||
* $2B - Disk write protected. Disk write protected
|
* $2B - Disk write protected. Disk write protected
|
||||||
* $2C - (GEOS bad byte count)
|
* $2C -(GSOS bad byte count)
|
||||||
* $2D - (GEOS bad block number)
|
* $2D -(GSOS bad block number)
|
||||||
* $2E - Disk switched Disk changed
|
* $2E - Disk switched Disk changed
|
||||||
* $2F - Device is offline (drive empty)
|
* $2F - Device is offline (drive empty)
|
||||||
|
|
||||||
* $40 - Invalid pathname syntax. Bad filename
|
* $40 - Invalid pathname syntax. Bad filename
|
||||||
* $41 - Duplicate filename. (split from $47) Directory exists
|
* $41 -(Duplicate filename. (split from $47) Is a directory)
|
||||||
* $42 - File Control Block table full. Too many open
|
* $42 - File Control Block table full. Too many open
|
||||||
* $43 - Invalid reference number. Channel not open
|
* $43 - Invalid reference number. Channel not open
|
||||||
* $44 - Path not found. (Dir not found) File not found
|
* $44 - Path not found. (Dir not found) File not found
|
||||||
@@ -945,91 +945,90 @@ MKERROR4 DW ERROR27
|
|||||||
* $4B - Unsupported storage_type. Disk not recognised
|
* $4B - Unsupported storage_type. Disk not recognised
|
||||||
* $4C - End of file has been encountered. End of file
|
* $4C - End of file has been encountered. End of file
|
||||||
* $4D - Position out of range. Past end of file
|
* $4D - Position out of range. Past end of file
|
||||||
* $4E - Access error. (see also $4F) RD/WR: Insufficient access
|
* $4E - Access error. (see also $4F) RD/WR: Insufficient access, also Dir not empty
|
||||||
* $4F - Access error. (split from $4E) REN/DEL: Locked
|
* $4F - (GSOS Buffer too small) (Access error. (split from $4E) REN/DEL: Locked)
|
||||||
* $50 - File already open. Can't - file open
|
* $50 - File already open. Can't - file open
|
||||||
* $51 - Directory count error. Broken directory
|
* $51 - Directory count error. Broken directory
|
||||||
* $52 - Not a ProDOS disk. Disk not recognised
|
* $52 - Not a ProDOS disk. Disk not recognised
|
||||||
* $53 - Invalid parameter. Invalid parameter
|
* $53 - Invalid parameter. Invalid parameter
|
||||||
* $54 - (Dir not empty when deleting) Dir not empty
|
* $54 - (GSOS Out of memory) (Dir not empty when deleting) Dir not empty
|
||||||
* $55 - Volume Control Block table full.
|
* $55 - Volume Control Block table full.
|
||||||
* $56 - Bad buffer address.
|
* $56 - Bad buffer address.
|
||||||
* $57 - Duplicate volume.
|
* $57 - Duplicate volume.
|
||||||
* $58 - Bad volume bitmap.
|
* $58 - Bad volume bitmap.
|
||||||
* $59 - (GEOS File level out of range)
|
* $59 -(GSOS File level out of range)
|
||||||
* $5A - Bit map disk address is impossible. Sector not found
|
* $5A - Bit map disk address is impossible. Sector not found
|
||||||
* $5B - (GEOS Bad ChangePath pathname)
|
* $5B -(GSOS Bad ChangePath pathname)
|
||||||
* $5C - (GEOS Not executable file)
|
* $5C -(GSOS Not executable file)
|
||||||
* $5D - (EOF during load or save) Data lost
|
* $5D -(GSOS OS/FS not found) (EOF during load or save) Data lost
|
||||||
* $5E - (Couldn't open to save) Can't save
|
* $5E -(Couldn't open to save) Can't save
|
||||||
* $5F - (GEOS Too many applications)
|
* $5F -(GSOS Too many applications)
|
||||||
* $60+ - (GEOS)
|
* $60+ - (GSOS)
|
||||||
|
|
||||||
|
|
||||||
* AcornOS ProDOS
|
* AcornOS ProDOS
|
||||||
ERROR40 DW $CC00
|
ERROR40 DW $CC00
|
||||||
ASC 'Bad filename' ; $40 - Invalid pathname syntax
|
ASC 'Bad filename' ; $40 - Invalid pathname syntax
|
||||||
ERROR41 DW $C400
|
ERROR41 DW $C400
|
||||||
ASC 'Directory exists' ; $41 - Duplicate filename (split from $47)
|
ASC 'Is a directory' ; $41 - Duplicate filename (split from $47)
|
||||||
ERROR42 DW $C000
|
ERROR42 DW $C000
|
||||||
ASC 'Too many open' ; $42 - File Control Block table full
|
ASC 'Too many open' ; $42 - File Control Block table full
|
||||||
ERROR43 DW $DE00
|
ERROR43 DW $DE00
|
||||||
ASC 'Channel not open' ; $43 - Invalid reference number
|
ASC 'Channel not open' ; $43 - Invalid reference number
|
||||||
ERROR44 ; $44 - Path not found
|
ERROR44 ; $44 - Path not found
|
||||||
ERROR46 DW $D600
|
ERROR46 DW $D600
|
||||||
ASC 'File not found' ; $46 - File not found
|
ASC 'File not found' ; $46 - File not found
|
||||||
ERROR45 DW $D600
|
ERROR45 DW $D600
|
||||||
ASC 'Disk not found' ; $45 - Volume directory not found
|
ASC 'Disk not found' ; $45 - Volume directory not found
|
||||||
ERROR47 DW $C400
|
ERROR47 DW $C400
|
||||||
ASC 'File exists' ; $47 - Duplicate filename (see also $41)
|
ASC 'File exists' ; $47 - Duplicate filename (see also $41)
|
||||||
ERROR48 DW $C600
|
ERROR48 DW $C600
|
||||||
ASC 'Disk full' ; $48 - Overrun error
|
ASC 'Disk full' ; $48 - Overrun error
|
||||||
ERROR49 DW $B300
|
ERROR49 DW $B300
|
||||||
ASC 'Directory full' ; $49 - Volume directory full
|
ASC 'Directory full' ; $49 - Volume directory full
|
||||||
ERROR4A ; $4A - Incompatible file format
|
ERROR4A ; $4A - Incompatible file format
|
||||||
ERROR4B ; $4B - Unsupported storage_type
|
ERROR4B ; $4B - Unsupported storage_type
|
||||||
ERROR52 DW $C800
|
ERROR52 DW $C800
|
||||||
ASC 'Disk not recognised' ; $52 - Not a ProDOS disk
|
ASC 'Disk not recognised' ; $52 - Not a ProDOS disk
|
||||||
ERROR4C DW $DF00
|
ERROR4C DW $DF00
|
||||||
ASC 'End of file' ; $4C - End of file has been encountered
|
ASC 'End of file' ; $4C - End of file has been encountered
|
||||||
ERROR4D DW $C100
|
ERROR4D DW $C100
|
||||||
ASC 'Not open for update' ; $4D - Position out of range
|
ASC 'Not open for update' ; $4D - Position out of range
|
||||||
ERROR4E DW $BD00
|
ERROR4E DW $BD00
|
||||||
ASC 'Insufficient access' ; $4E - Access error (see also $4F)
|
ASC 'Insufficient access' ; $4E - Access error (see also $4F)
|
||||||
ERROR4F DW $C300
|
ERROR4F DW $C300
|
||||||
ASC 'Locked' ; $4F - Access error (split from $4E)
|
ASC 'Locked' ; $4F - Access error (split from $4E)
|
||||||
ERROR50 DW $C200
|
ERROR50 DW $C200
|
||||||
ASC 'Can'
|
ASC 'Can'
|
||||||
DB $27
|
DB $27
|
||||||
ASC 't - file open' ; $50 - File is open
|
ASC 't - file open' ; $50 - File is open
|
||||||
ERROR51 DW $A800
|
ERROR51 DW $A800
|
||||||
ASC 'Broken directory' ; $51 - Directory count error
|
ASC 'Broken directory' ; $51 - Directory count error
|
||||||
ERROR53 DW $DC00
|
ERROR53 DW $DC00
|
||||||
ASC 'Invalid parameter' ; $53 - Invalid parameter
|
ASC 'Invalid parameter' ; $53 - Invalid parameter
|
||||||
ERROR54 DW $D400
|
ERROR54 DW $D400
|
||||||
ASC 'Directory not empty' ; $54 - Directory not empty
|
ASC 'Directory not empty' ; $54 - Directory not empty
|
||||||
ERROR55 DW $FF00
|
ERROR55 DW $FF00
|
||||||
ASC 'ProDOS: VCB full' ; $55 - Volume Control Block table full
|
ASC 'ProDOS: VCB full' ; $55 - Volume Control Block table full
|
||||||
ERROR56 DW $FF00
|
ERROR56 DW $FF00
|
||||||
ASC 'ProDOS: Bad addr' ; $56 - Bad buffer address
|
ASC 'ProDOS: Bad addr' ; $56 - Bad buffer address
|
||||||
ERROR57 DW $FF00
|
ERROR57 DW $FF00
|
||||||
ASC 'ProDOS: Dup volm' ; $57 - Duplicate volume
|
ASC 'ProDOS: Dup volm' ; $57 - Duplicate volume
|
||||||
ERROR5B ; spare
|
ERROR5B ; spare
|
||||||
ERROR27 DW $FF00
|
ERROR27 DW $FF00
|
||||||
ASC 'I/O error' ; $27 - I/O error
|
ASC 'I/O error' ; $27 - I/O error
|
||||||
ERROR28 DW $D200
|
ERROR28 DW $D200
|
||||||
ASC 'Disk not present' ; $28 - No device detected/connected
|
ASC 'Disk not present' ; $28 - No device detected/connected
|
||||||
ERROR5A DW $FF00
|
ERROR5A DW $FF00
|
||||||
ASC 'Sector not found' ; $5A - Bit map disk address is impossible
|
ASC 'Sector not found' ; $5A - Bit map disk address is impossible
|
||||||
ERROR2B DW $C900
|
ERROR2B DW $C900
|
||||||
ASC 'Disk write protected' ; $2B - Disk write protected
|
ASC 'Disk write protected' ; $2B - Disk write protected
|
||||||
ERROR5D DW $CA00
|
ERROR5D DW $CA00
|
||||||
ASC 'Data lost' ; $5D - EOF during LOAD or SAVE
|
ASC 'Data lost' ; $5D - EOF during LOAD or SAVE
|
||||||
ERROR5E DW $C000
|
ERROR5E DW $C000
|
||||||
ASC 'Can'
|
ASC 'Can'
|
||||||
DB $27
|
DB $27
|
||||||
ASC 't save' ; $5E - Couldn't open for save
|
ASC 't save' ; $5E - Couldn't open for save
|
||||||
ERROR2E DW $C800
|
ERROR2E DW $C800
|
||||||
ASC 'Disk changed' ; $2E - Disk switched
|
ASC 'Disk changed' ; $2E - Disk switched
|
||||||
DB $00
|
DB $00
|
||||||
|
|
||||||
|
@@ -174,7 +174,7 @@ BYTE00 BEQ BYTE00A ; OSBYTE 0,0 - generate error
|
|||||||
RTS ; %000x1xxx host type, 'A'pple
|
RTS ; %000x1xxx host type, 'A'pple
|
||||||
BYTE00A BRK
|
BYTE00A BRK
|
||||||
DB $F7
|
DB $F7
|
||||||
HELLO ASC 'Applecorn MOS 2021-10-13'
|
HELLO ASC 'Applecorn MOS 2021-10-15'
|
||||||
DB $00 ; Unify MOS messages
|
DB $00 ; Unify MOS messages
|
||||||
|
|
||||||
|
|
||||||
|
182
mainmem.svc.s
182
mainmem.svc.s
@@ -15,6 +15,7 @@
|
|||||||
* 13-Oct-2021 OSFIND implementes CLOSE#0.
|
* 13-Oct-2021 OSFIND implementes CLOSE#0.
|
||||||
* 13-Oct-2021 FIND, BGET, BPUT optimised passing registers to main.
|
* 13-Oct-2021 FIND, BGET, BPUT optimised passing registers to main.
|
||||||
* 13-Oct-2021 ARGS, EOF returns errors, optimised.
|
* 13-Oct-2021 ARGS, EOF returns errors, optimised.
|
||||||
|
* 15-Oct-2021 LOADFILE updated.
|
||||||
|
|
||||||
|
|
||||||
INFOFILE >>> ENTMAIN
|
INFOFILE >>> ENTMAIN
|
||||||
@@ -49,6 +50,9 @@ DODELETE LDA #<MOSFILE ; Attempt to destroy file
|
|||||||
DB DESTCMD
|
DB DESTCMD
|
||||||
DW DESTPL
|
DW DESTPL
|
||||||
RTS
|
RTS
|
||||||
|
* Returns $4E for 'Dir is not empty'
|
||||||
|
* Need to separate from 'Dir is locked'
|
||||||
|
|
||||||
|
|
||||||
* ProDOS file handling to create a directory
|
* ProDOS file handling to create a directory
|
||||||
* Invoked by AppleMOS OSFILE
|
* Invoked by AppleMOS OSFILE
|
||||||
@@ -538,82 +542,152 @@ LOADFILE >>> ENTMAIN
|
|||||||
JSR PREPATH ; Preprocess pathname
|
JSR PREPATH ; Preprocess pathname
|
||||||
JSR WILDONE ; Handle any wildcards
|
JSR WILDONE ; Handle any wildcards
|
||||||
JSR EXISTS ; See if it exists ...
|
JSR EXISTS ; See if it exists ...
|
||||||
|
* BCS :EXIT2
|
||||||
CMP #$01 ; ... and is a file
|
CMP #$01 ; ... and is a file
|
||||||
BEQ :ISFILE
|
BEQ :ISFILE
|
||||||
JMP :NOTFND
|
ROL A ; 0->0, 2->5
|
||||||
:ISFILE STZ :BLOCKS
|
EOR #$05 ; 0->5, 2->0
|
||||||
|
ADC #$41 ; 0->$46, 2->$41
|
||||||
|
JMP :EXIT2 ; Return error
|
||||||
|
|
||||||
|
* EXISTS has done GETINFO, so file info already loaded
|
||||||
|
:ISFILE LDA FBEXEC ; If FBEXEC is zero, use addr
|
||||||
|
BEQ :CBADDR ; in the control block
|
||||||
|
LDA GINFOPL+5 ; Otherwise, use file's address
|
||||||
|
STA FBLOAD+0 ; Aux type LSB
|
||||||
|
LDA GINFOPL+6 ; Aux type MSB
|
||||||
|
STA FBLOAD+1
|
||||||
|
|
||||||
|
:CBADDR LDA #$60 ; *TO DO* Error=file too long
|
||||||
|
LDX GINFOPL+9
|
||||||
|
BNE :EXIT2 ; size>128K, too big to load
|
||||||
|
LDX GINFOPL+8
|
||||||
|
BMI :EXIT2 ; size>64K, too big to load
|
||||||
|
BEQ :EXITOK ; size=0, nothing to load
|
||||||
|
STX :BLOCKS
|
||||||
LDA #<MOSFILE
|
LDA #<MOSFILE
|
||||||
STA OPENPL+1
|
STA OPENPL+1
|
||||||
LDA #>MOSFILE
|
LDA #>MOSFILE
|
||||||
STA OPENPL+2
|
STA OPENPL+2
|
||||||
JSR OPENFILE
|
JSR OPENFILE
|
||||||
BCS :NOTFND ; File not found
|
BCS :EXIT2 ; File not opened
|
||||||
|
|
||||||
|
* LDA FBLOAD+0 ; A4=>start address to load to
|
||||||
|
* STA A4L
|
||||||
|
* LDA FBLOAD+1
|
||||||
|
* STA A4H
|
||||||
:L1 LDA OPENPL+5 ; File ref number
|
:L1 LDA OPENPL+5 ; File ref number
|
||||||
STA READPL+1
|
STA READPL+1
|
||||||
JSR RDFILE
|
JSR RDFILE
|
||||||
BCC :S1
|
* BCC :S1
|
||||||
CMP #$4C ; EOF
|
* CMP #$4C ; EOF
|
||||||
BEQ :EOF
|
* BEQ :EXITOK
|
||||||
BRA :READERR
|
* BEQ :EOF
|
||||||
:S1 LDA #<BLKBUF
|
* BRA :READERR
|
||||||
STA A1L
|
BCS :READERR ; Close file and return error
|
||||||
|
|
||||||
|
:S1
|
||||||
|
* CLC
|
||||||
|
LDA #<BLKBUF ; LSB of start of data buffer
|
||||||
|
STA A1L ; A1=>start of data buffer
|
||||||
|
ADC READPL+6 ; LSB of trans count
|
||||||
|
STA A2L ; A2=>end of data buffer
|
||||||
LDA #>BLKBUF
|
LDA #>BLKBUF
|
||||||
STA A1H
|
STA A1H
|
||||||
CLC
|
|
||||||
LDA #<BLKBUF
|
|
||||||
ADC READPL+6 ; LSB of trans count
|
|
||||||
STA A2L
|
|
||||||
LDA #>BLKBUF
|
|
||||||
ADC READPL+7 ; MSB of trans count
|
ADC READPL+7 ; MSB of trans count
|
||||||
STA A2H
|
STA A2H
|
||||||
LDA FBEXEC ; If FBEXEC is zero, use addr
|
LDA FBLOAD+0 ; A4=>address to load to
|
||||||
CMP #$00 ; in the control block
|
|
||||||
BEQ :CBADDR
|
|
||||||
LDA #<MOSFILE ; Otherwise use file addr
|
|
||||||
STA GINFOPL+1
|
|
||||||
LDA #>MOSFILE
|
|
||||||
STA GINFOPL+2
|
|
||||||
JSR GETINFO ; GET_FILE_INFO
|
|
||||||
BCS :READERR
|
|
||||||
LDA GINFOPL+5 ; Aux type LSB
|
|
||||||
STA FBLOAD+0
|
|
||||||
LDA GINFOPL+6 ; Aux type MSB
|
|
||||||
STA FBLOAD+1
|
|
||||||
:CBADDR LDA FBLOAD
|
|
||||||
STA A4L
|
STA A4L
|
||||||
STA FBEXEC ; EXEC = LOAD
|
|
||||||
LDA FBLOAD+1
|
LDA FBLOAD+1
|
||||||
STA A4H
|
STA A4H
|
||||||
STA FBEXEC+1
|
INC FBLOAD+1 ; Step to next block
|
||||||
LDX :BLOCKS
|
INC FBLOAD+1
|
||||||
:L2 CPX #$00
|
|
||||||
BEQ :S2
|
|
||||||
INC
|
* CLC
|
||||||
INC
|
* LDA A1L ; A2=>end of data buffer
|
||||||
DEX
|
* ADC READPL+6 ; LSB of trans count
|
||||||
BRA :L2
|
* STA A2L
|
||||||
:S2 STA A4H
|
* LDA A1H
|
||||||
|
* ADC READPL+7 ; MSB of trans count
|
||||||
|
* STA A2H
|
||||||
|
|
||||||
|
* LDA FBEXEC ; If FBEXEC is zero, use addr
|
||||||
|
* CMP #$00 ; in the control block
|
||||||
|
* BEQ :CBADDR
|
||||||
|
* LDA #<MOSFILE ; Otherwise use file addr
|
||||||
|
* STA GINFOPL+1
|
||||||
|
* LDA #>MOSFILE
|
||||||
|
* STA GINFOPL+2
|
||||||
|
* JSR GETINFO ; GET_FILE_INFO
|
||||||
|
* BCS :READERR
|
||||||
|
* LDA GINFOPL+5 ; Aux type LSB
|
||||||
|
* STA FBLOAD+0
|
||||||
|
* LDA GINFOPL+6 ; Aux type MSB
|
||||||
|
* STA FBLOAD+1
|
||||||
|
*:CBADDR LDA FBLOAD
|
||||||
|
* STA A4L
|
||||||
|
* STA FBEXEC ; EXEC = LOAD
|
||||||
|
* LDA FBLOAD+1
|
||||||
|
* STA A4H
|
||||||
|
* STA FBEXEC+1
|
||||||
|
* LDX :BLOCKS
|
||||||
|
*:L2 CPX #$00
|
||||||
|
* BEQ :S2
|
||||||
|
* INC
|
||||||
|
* INC
|
||||||
|
* DEX
|
||||||
|
* BRA :L2
|
||||||
|
*:S2 STA A4H
|
||||||
|
|
||||||
SEC ; Main -> AUX
|
SEC ; Main -> AUX
|
||||||
JSR AUXMOVE
|
JSR AUXMOVE ; A4 updated to next address
|
||||||
INC :BLOCKS
|
DEC :BLOCKS
|
||||||
BRA :L1
|
BNE :L1
|
||||||
:NOTFND LDA #$46 ; Nothing found
|
BEQ :EXITOK
|
||||||
PHA
|
|
||||||
BRA :EXIT
|
* INC :BLOCKS
|
||||||
:READERR LDA #$5D ; Read error
|
* BRA :L1
|
||||||
PHA
|
|
||||||
BRA :EOF2
|
:READERR CMP #$4C
|
||||||
:EOF LDA #$01 ; Success ('File')
|
BNE :EXITERR
|
||||||
PHA
|
:EXITOK LDA #$01 ; Success ('File')
|
||||||
:EOF2 LDA OPENPL+5 ; File ref num
|
:EXITERR PHA
|
||||||
|
LDA OPENPL+5 ; File ref num
|
||||||
STA CLSPL+1
|
STA CLSPL+1
|
||||||
JSR CLSFILE
|
JSR CLSFILE
|
||||||
:EXIT JSR UPDFB ; Update FILEBLK
|
PLA
|
||||||
|
CMP #$01
|
||||||
|
BNE :EXIT2
|
||||||
|
PHA
|
||||||
|
JSR UPDFB ; Update FILEBLK
|
||||||
JSR COPYFB ; Copy FILEBLK to auxmem
|
JSR COPYFB ; Copy FILEBLK to auxmem
|
||||||
PLA ; Get return code back
|
PLA ; Get return code back
|
||||||
>>> XF2AUX,OSFILERET
|
:EXIT2 >>> XF2AUX,OSFILERET
|
||||||
:BLOCKS DB $00
|
:BLOCKS DB $00
|
||||||
|
|
||||||
|
|
||||||
|
*:NOTFILE ROL A ; 0->0, 2->5
|
||||||
|
* EOR #$05 ; 0->5, 2->0
|
||||||
|
* ADC #$41 ; 0->$46, 2->$41
|
||||||
|
*:NOTFND PHA
|
||||||
|
* BRA :EXIT
|
||||||
|
*:READERR LDA #$5D ; Read error
|
||||||
|
* PHA
|
||||||
|
* BRA :EOF2
|
||||||
|
*:EXITOK
|
||||||
|
*:EOF LDA #$01 ; Success ('File')
|
||||||
|
* PHA
|
||||||
|
*:EOF2 LDA OPENPL+5 ; File ref num
|
||||||
|
* STA CLSPL+1
|
||||||
|
* JSR CLSFILE
|
||||||
|
*:EXIT JSR UPDFB ; Update FILEBLK
|
||||||
|
* JSR COPYFB ; Copy FILEBLK to auxmem
|
||||||
|
* PLA ; Get return code back
|
||||||
|
*:EXIT2 >>> XF2AUX,OSFILERET
|
||||||
|
*:BLOCKS DB $00
|
||||||
|
|
||||||
|
|
||||||
* ProDOS file handling for MOS OSFILE SAVE call
|
* ProDOS file handling for MOS OSFILE SAVE call
|
||||||
* Invoked by AppleMOS OSFILE
|
* Invoked by AppleMOS OSFILE
|
||||||
* Return A=01 if successful (ie: 'file')
|
* Return A=01 if successful (ie: 'file')
|
||||||
@@ -1115,7 +1189,3 @@ MAINRDEXIT >>> XF2AUX,NULLRTS ; Back to an RTS
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user