fix Tetris 48kb

This commit is contained in:
Peter Ferrie 2019-01-15 21:55:40 -08:00
parent 0422b260c9
commit 9d104061f4

View File

@ -524,32 +524,46 @@ ProDOS_enter
sta sizehi sta sizehi
sta sizelo sta sizelo
jsr hddopendir jsr hddopendir
ldx @handles+1
lda bleftlo
sta @sizelo-1, x
lda blefthi
sta @sizehi-1, x
lda #0 lda #0
sta blkidx sta blkidx
beq @jmp_zp ;always beq @jmp_zp ;always
@imp_seek @imp_seek
lda #cmdseek ldx @handles+1
!byte $2c lda @sizelo-1, x
sta bleftlo
lda @sizehi-1, x
sta blefthi
lda #0
sta blkidx
sta blkofflo
sta blkoffhi
sta reqcmd
jsr @set_rdwrbuff
lda ldrhi
sta sizehi
lda ldrlo
sta sizelo
jsr hddrdwrpart
lda ldrhi
ora ldrlo
bne @jmp_zp
dec blkidx
beq @jmp_zp ;always
@imp_read @imp_read
lda #cmdread lda #cmdread
!byte $2c !byte $2c
@imp_write @imp_write
lda #cmdwrite lda #cmdwrite
sta reqcmd sta reqcmd
pha
jsr @set_rdwrbuff jsr @set_rdwrbuff
pla
pha
bne @set_blocks
lda ldrhi
sta sizehi
lda ldrlo
sta sizelo
@set_blocks
jsr hddrdwrpart jsr hddrdwrpart
pla
beq @jmp_zp ;seek doesn't return size
ldy #6 ldy #6
lda sizelo2 lda sizelo2
sta (packet), y sta (packet), y
@ -566,7 +580,7 @@ ProDOS_enter
iny iny
lda blefthi lda blefthi
sta (packet), y sta (packet), y
jmp @restore_zp bcs @restore_zp ;always
@imp_close @imp_close
lda @handles+1 lda @handles+1
@ -656,5 +670,10 @@ ProDOS_enter
@handle @handle
!byte 0, 0 ;only up to two handles at a time !byte 0, 0 ;only up to two handles at a time
@sizelo
!byte 0, 0 ;only up to two files at a time
@sizehi
!byte 0, 0 ;only up to two files at a time
@saved_zp @saved_zp
!fill (last_zp - first_zp) + 1 !fill (last_zp - first_zp) + 1