retry failed reads, ignore failed writes

This commit is contained in:
Peter Ferrie 2022-06-16 22:07:06 -07:00
parent c2684183f1
commit 25ce7890b5
3 changed files with 30 additions and 9 deletions

Binary file not shown.

View File

@ -19,10 +19,10 @@
;
; LC RAM BANK 2
; D000..D5FF - ProRWTS data
; D600..D8B6 - ProRWTS code
; D8B7..DC6F - ProRWTS glue code
; DC70..DC75 - backup of stack (during gameplay and self-running demos)
; DC76..DC7B - okvs cache (attract state saved across self-running demo)
; D600..D8BD - ProRWTS code
; D8BE..DC76 - ProRWTS glue code
; DC77..DC7C - backup of stack (during gameplay and self-running demos)
; DC7D..DC82 - okvs cache (attract state saved across self-running demo)
; ...unused...
; DFB4..DFFF - (de)acceleration function
;
@ -214,8 +214,8 @@ PRELAUNCH_STANDARD_SIZE = 61 ; LoadStandardPrelaunch, eventually to be d
; shared symbols for prelaunch and effects to call ProRWTS2 functions
iCurBlockLo = $D601 ; constant
iCurBlockHi = $D603 ; constant
launchpatch = $D855 ; glue.launch.a
itraverse = $DB44 ; Roger Rabbit, avoid, use Infiltrator 2 style instead
launchpatch = $D85C ; glue.launch.a
itraverse = $DB4B ; Roger Rabbit, avoid, use Infiltrator 2 style instead
; also Columns (via file in disk image)
ldrlo = $55 ; constant
ldrhi = $56 ; constant

View File

@ -521,6 +521,7 @@ slot ldx $cfff
sta unrcommand2 + 2
} ;rwts_mode = 0 and aligned_read = 0 and enable_write = 1
sta unrcommand3 + 2
sta unrgetreq + 2
iny ;STA
sty unrblokhi1
sty unrunit1 + 2
@ -562,6 +563,7 @@ slot ldx $cfff
sta unrblokhi2
ldy #$ad ;LDA
sty unrblokhi3
sty unrgetreq
iny ;LDX
sty unrbloklo2
} ;rwts_mode = 1 and write_sparse = 1
@ -569,6 +571,12 @@ slot ldx $cfff
sta unrunit1 + 1
lda #<paddr
sta unrunit1 + 3
!if (rwts_mode and write_sparse) = 0 {
lda #$ad ;LDA
sta unrgetreq
} ;if rwts_mode = 0 or write_sparse = 0
lda #<pcommand
sta unrgetreq + 1
;use SmartPort entrypoint instead
@ -3547,7 +3555,20 @@ pcommand !byte $2c ;hide packet in non-SmartPort mode
unrppacket = unrelochdd + (* - reloc)
!word unrelochdd + (packet - reloc)
} ;use_smartport = 1
bcs retry
bcc goodread
unrgetreq = unrelochdd + (* - reloc)
lda reqcmd
!if use_smartport = 1 {
nop ;allow replacing "lda reqcmd" with "lda pcommand" in extended SmartPort mode
} ;use_smartport = 1
;read failures are assumed to be transient
;write failures are assumed to be permanent
cmp #cmdread
beq retry
goodread
!if no_interrupts = 1 {
plp
} ;no_interrupts = 1