Some groundwork for OSGBPB.

This commit is contained in:
Bobbi Webber-Manners 2022-09-18 21:33:57 -04:00
parent 26501923c8
commit 2a65154486
3 changed files with 33 additions and 6 deletions

View File

@ -60,11 +60,23 @@ OSFINDRET >>> ENTAUX
RTS
* OSGBPB - Get/Put a block of bytes to/from an open file
GBPBHND LDA #<OSGBPBM
LDY #>OSGBPBM
JMP PRSTR
OSGBPBM ASC 'OSGBPB.'
DB $00
GBPBHND PHX
PHY
PHA
JSR XYtoLPTR ; Copy control block to GBPBBLK ..
LDY #$0C ; .. in main memory
>>> WRTMAIN
:L1 LDA (OSLPTR),Y
STA GBPBBLK,Y
DEY
BNE :L1
>>> WRTAUX
PLA ; A represents the command
>>> XF2MAIN,GBPB
OSGBPBRET >>> ENTAUX
PLY
PLX
RTS
* OSBPUT - write one byte to an open file
BPUTHND PHX

View File

@ -15,7 +15,14 @@ CMDPATH EQU $0280 ; Path used to start Applecorn
MOSFILE1 EQU $0300 ; length + 64 bytes
MOSFILE2 EQU $0341 ; length + 64 bytes
MOSFILE EQU MOSFILE1
* $0382 ; $3C bytes here
GBPBBLK EQU $0382
GBPBHDL EQU $GBPBBLK+0 ; File handle
GBPBDAT EQU $GBPBBLK+1 ; Pointer to data
GBPBNUM EQU $GBPBBLK+5 ; Num bytes to transfer
GBPBPTR EQU $GBPBBLK+9 ; File pointer
GBPBEND EQU GBPBBLK+12
* $038F ; $2F bytes here
*
FILEBLK EQU $03BE
FBPTR EQU FILEBLK+0 ; Pointer to name (in aux)

View File

@ -322,6 +322,14 @@ CFILE >>> ENTMAIN
PLX
BCS FINDEXIT
* ProDOS file handling for MOS OSGBPB call
* A=1 : Write bytes to disk, using new seq pointer
* A=2 : Write bytes to disk, ignoring seq pointer
* A=3 : Read bytes from disk, using new seq pointer
* A=4 : Read bytes from disk, ignoring seq pointer
GBPB >>> ENTMAIN
* ...
>>> XF2AUX,OSGBPBRET
* ProDOS file handling for MOS OSBGET call
* Returns with char read in A and error num in Y (or 0)