mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-01-05 19:29:37 +00:00
More progress on OSGBPB.
This commit is contained in:
parent
bc98a80e74
commit
a32db137ce
@ -63,7 +63,7 @@ OSFINDRET >>> ENTAUX
|
||||
* Supports commands A=1,2,3,4 others unsupported
|
||||
GBPBHND CMP #4
|
||||
BCC :S1
|
||||
RTS
|
||||
RTS ; Not supported: regs unchanged
|
||||
:S1 PHX
|
||||
PHY
|
||||
PHA
|
||||
@ -85,6 +85,7 @@ OSGBPBRET >>> ENTAUX
|
||||
PLY
|
||||
PLX
|
||||
LDA #$00 ; A=0 means supported command
|
||||
CLC ; SHOULD SET CARRY IF EOF
|
||||
RTS
|
||||
|
||||
* OSBPUT - write one byte to an open file
|
||||
|
@ -329,8 +329,23 @@ CFILE >>> ENTMAIN
|
||||
* A=4 : Read bytes from disk, ignoring seq pointer
|
||||
* All others unsupported
|
||||
GBPB >>> ENTMAIN
|
||||
* ...
|
||||
LDY GBPBHDL ; File ref number
|
||||
*
|
||||
* TODO: THIS ALWAYS READS ATM, NEEDS TO WRITE ALSO!!
|
||||
*
|
||||
LSR A ; Test LSB of A
|
||||
BCC :NOSEEK ; A=2 or 4, no seek
|
||||
LDA GBPBHDL ; File ref number
|
||||
STA GMARKPL+1
|
||||
LDY #$02 ; Copy file pointer
|
||||
:L0 LDA GBPBPTR+0,Y
|
||||
STA GMARKPL+2,Y
|
||||
DEY
|
||||
BMI :L0
|
||||
JSR MLI ; Perform seek
|
||||
DB SMARKCMD
|
||||
DW GMARKPL
|
||||
BCS :ERR
|
||||
:NOSEEK LDY GBPBHDL ; File ref number
|
||||
STY READPL2+1
|
||||
:L1 JSR MLI ; Read one byte
|
||||
DB READCMD
|
||||
@ -347,12 +362,15 @@ GBPB >>> ENTMAIN
|
||||
INC GBPBDAT+0 ; Increment data pointer
|
||||
BNE :S1
|
||||
INC GBPBDAT+1
|
||||
:S1 LDA GBPBNUM+0 ; Decrement number of bytes
|
||||
:S1 INC GBPBPTR+0 ; Increment file pointer
|
||||
BNE :S2
|
||||
INC GBPBPTR+1
|
||||
:S2 LDA GBPBNUM+0 ; Decrement number of bytes
|
||||
BNE :S3
|
||||
LDA GBPBNUM+1
|
||||
BEQ :ZERO ; Zero remaining, done!
|
||||
DEC GBPBNUM+1
|
||||
:S2 DEC GBPBNUM+0
|
||||
:S3 DEC GBPBNUM+0
|
||||
BRA :L1
|
||||
* ...
|
||||
:ERR
|
||||
@ -360,7 +378,7 @@ GBPB >>> ENTMAIN
|
||||
STA ZPMOS+0 ; .. to aux memory
|
||||
LDA GBPBAUXCB+1
|
||||
STA ZPMOS+1
|
||||
LDY #$0C+1
|
||||
LDY #$0C
|
||||
>>> WRTAUX
|
||||
:L2 LDA GBPBBLK,Y
|
||||
STA (ZPMOS),Y
|
||||
|
Loading…
Reference in New Issue
Block a user