At 01:41 PM 7/9/99 +0200, Laurens wrote:

>Just use the Fast 16-bit Loop I use in my routines instead of this one and
>the VRAM loading will go a lot faster. It is a bit complicated to understand
>(I wrote an article in Dutch about it), but it does work and is as fast as a
>'normal' 8-bit OTIR.

I use the same trick. But it's possible to do the pre-loop calculations
faster. This is the calculation I use:
        ;DE = number of bytes
        dec de
        inc e
        inc d
        ld  b,e
        ld  a,d
        ;B = initial inner loop (OTIR/DJNZ) counter
        ;A = outer loop (JR/JP) counter

By the way, I think your routine contains a bug. This is what you posted:
        ld      a,e
        ld      b,e
        sub     1       ;If 0, then set carry
        ld      a,d
        sbc     0       ;if B=E=0 then A=D-1 (for fast loop)
But if you run this with DE=#0103, the output is B=#03 and A=#01. This
means the outer loop won't loop, while it should loop once. So the
transfered data is #0100 bytes too short. This is also true for your "fixed
#4000" transfer (A=#3F instead of #40).

Another note:
It is possible to tell the BDOS to load #4000 bytes, even though there are
not that many bytes left in the file. In that case, all the remaining bytes
are read and the rest of the bytes are filled with zeroes. After the Random
Block Read call, HL contains the number of records actually read.

Bye,
                Maarten


****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****

Reply via email to