At 08:39 PM 7/8/99 +0200, you wrote:
>What's the fastest way to load say a screen 8 file into VRAM using MSX-DOS
>and a 16KB max buffer? Which file reading function, register size, buffer
>address are the best?
The fastest way is to crunch your data. If the decrunching is not too
difficult and the compression ratio is good, the time necessary for
decrunching is less than the time saved loading.
I prefer to load to #8000:
Loading at a 16K boundary lets you use the memory mapper easily.
#0000-#3FFF is not recommended, because it holds the interrupt handler
(unless you use IM2).
#4000-#7FFF works, but I'm not sure all DiskROMs can load to this address
directly. If they load using a buffer, it would be slow.
#C000-#FFFF is not good, as it contains the system RAM and the secundary
slot select register (#FFFF).
File reading function:
Random block read (BDOS routine). Use a block size of 1 and a block count
of 16K. This is just as fast as any other combination, because DOS
calculates the number of bytes internally. The advantage of a block size of
1 is that the block count is equal to the number of bytes to read.
Sector reading function:
#4010 in the main diskROM
This doesn't need the disk buffers in high RAM.
This is also why Martos' crack of Solid Snake saves to sectors instead of
files: the Solid Snake ROM backups the high RAM in the mapper, but the
crack uses that mapper space.
VRAM transfer:
OTIR works fine for me.
Recently someone mentioned you shouldn't OTIR to sprite data when sprites
are enabled. But in the case of GFX loading you probably don't want to try
anyway, because it would look ugly (sprites popping up as they're being
loaded). And if you don't use sprites, be sure to disable them, this speeds
up VDP command processing.
>How can you feed VRAM in a reasonable system friendly way while keeping
>disk performance as the next section of the file is being read?
If you load in 16K chunks, the overhead of the drive head not being at the
right position in the sector when the reading of the next block starts is
not that big.
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/)
****