blockdev: fix bug recently introduced in load cmd

It would always load one byte less than told... This time it's right on
the money :)
This commit is contained in:
Virgil Dupras 2019-06-17 09:54:30 -04:00
parent 4b423a9dc6
commit 00778f73e1
1 changed files with 4 additions and 3 deletions

View File

@ -64,13 +64,14 @@ blkLoad:
ld hl, (SHELL_MEM_PTR)
call blkGetC
jr nz, .ioError
jr .intoLoop ; properly dec B + check on first iteration.
jr .intoLoop ; we'v already called blkGetC. don't call it
; again.
.loop:
call blkGetC
.intoLoop:
ld (hl), a
inc hl
call blkGetC
jr nz, .loopend
.intoLoop:
djnz .loop
.loopend:
; success