You're right about the different versions (there would only be one versioin of WAV generator, just an option... But two versions of the decoder and thus WAV compatibility
).
I've just had an idea.
I would like to try to set up a kind of
bank system.
Today the decoder code is dividied like this:
A/ Main program
1- Initialize VIA and set interrupt (a 1.0/1.1 version would require about 45 bytes)
2- Wait for start and load header and dictionaries (only "normal bytes" here, i.e. no compression)
3- Display "Loading" and name (3 bytes for ROM 1.1, about 19 required for 1.0, not counting things like JSR/RTS to call)
4- Load the program
5- Reset VIA, interrupt, launch the program (16 bytes for ROM 1.1, about 26 for ROM 1.0)
B/ Loading/Decoding routines (nothing specific ROM 1.0 or 1.1 here)
6- Synchronize
7- Read start byte and switch to adequate decoding method or end loading
8a- Decode byte in dictionary
8b- Decode a repeated byte (RLE)
8c- Decode a "normal" byte
9- Interrupt code
Well, it seems to me that I could first load a "common" (1.0/1.1) loader that would load the basic minimal code for fast loading "normal bytes", then load what it requires before executing it.
That would be:
A/ Main program
1- Call common area, filled with the common 1.0/1.1 intialize VIA and set interrupt version (about 45 bytes)
should save 18 bytes compared to today's loader
2- Wait for start and load header, along with Loading display + name code for 1.0/1.1
3- Call common area, to display "Loading" and name
could save 10 or 12 bytes
4a- Load the RLE and Dictionnaries code, crush the common area
4b- Load program at full speed with compression
4c- Load "Reset VIA, interrupt, launch program" code for 1.0/1.1 in common area, crushing dictionaries and RLE
5- Call common area to Reset VIA, interrupt, launch the program
could save 13 or 15 bytes
B/ Loading/Decoding routines (nothing specific ROM 1.0 or 1.1 here)
6- Interrupt code
7- Synchronize
8- Read start byte and switch to adequate decoding method or end loading
9- Decode a "normal" byte
10- Common area
RLE and dictionary decoding use 62 bytes
I think each loading of common area would require in the signal between 0.05 and 0.1 seconds, depends on its size. Which will be totally compensated by the fact that the initial (standard speed) loader will be shorter.
We might even end up being faster.
So the WAV would sequentially hold, for each part:
1- common loader (F16 speed)
2- header
3- display loading code
4- RLE and dictionaries code
5- Program
6- Exit code
Seems doable, though I have no idea yet how to do these intermediate loadings (bank switching), so no release date
The only drawback I see is that one will have to load the loader for every part... Today it is perfectly possible to load the loader only once, and then CALL#100 as much as you want for several parts in an adequate loader (saves 1.5 seconds for each part).
I think I will keep this as an option, that will be ROM 1.1 only (ok, I'm back at two versions, but most users don't use options anyway
).