megaload: fix issue where wrong sectors were getting loaded

seemed to be a subtle timing issue that was easy to hit on
AppleWin
This commit is contained in:
Vince Weaver 2018-10-13 16:55:29 -04:00
parent 1f6860c0a8
commit 26ed9b8d24

View File

@ -219,11 +219,11 @@ readfirst:
; read a file sector
readnext:
lda dirbuf, y
ldx dirbuf+1, y
sty TEMPY ; ** was phy **
lda dirbuf, y ; A = track
ldx dirbuf+1, y ; x = sector
sty TEMPY ; save t/s ptr ** was phy **
jsr seekread1
ldy TEMPY ; ** was ply **
ldy TEMPY ; restore t/s ptr ** was ply **
; if low count is non-zero then we are done
; (can happen only for partial last block)
@ -305,7 +305,7 @@ seekread1:
lda curtrk
cmp phase
beq repeat_until_right_sector
beq re_read_addr ; **was** repeat_until_right_sector
jsr seek
; [re-]read sector