FloppyBuilder evolution
Posted: Tue Jan 19, 2016 8:42 pm
I created this new topic to discuss the changes in the new versions, I'm looking for feedback, so if something seems to you to be a bad idea then by all means express yourself
I've been discussing with Chema and Iss about their use of the system, and so far most of the changes have been in the actual loader code, not the FloppyBuilder itself, but for the next evolution of the system the program itself will have to be modified.
One of the first things I'd like to mention is that I'm not planning to be backward compatible with the previous versions, so upgrading to a new version may not work well. That being said, the modifications should be relatively easy to apply, and I plan to add a new instruction to define the format version the description file was created for, and FloppyBuilder will output warnings or errors if it knows that it is not compatible with the version you targeted, so at least it will not silently fail.
So, here is a first list of what I was thinking in doing:
- Add a "FormatVersion" instruction, followed by the FloppyBuilder version. DONE
If you have in your script "FormatVersion 0.19" and you try to use it in version 0.20 of the FloppyBuilder, it will tell you that you need to fix your script.
- Add a "WriteLoader" instruction. DONE
it will behave as the existing AddFile instruction except it will not add the loader in the list of files, and it will automatically generate the defines with the location of the loader in memory, as well as the sector and track positions.
- Remove the loading address from the "AddFile" instruction. DONE
After having used the system for quite a while now, I realize that the loading code always knew where the file was going to be loaded, so ultimately we are just wasting space in the file directory information for nothing.
- Add new macro magic values. DONE
We have {FileIndex} and {FileSize}, we should probably also have {FileTrack}, {FileSector}, {FileIsCompressed}
- Add some parameter to auto generate defines based on file names. PENDING
If you have a "AddFile MySuperFont.hir" it could automatically generate #define LOADER_MYSUPERFONT_HIR_INDEX 23 using the name of the file to generate the define
- Allow two different formats for the file directory table. PENDING
Right now we have individual arrays for sector, track, size, address, but in some cases it would be more practical to have the data interleaved
- Modify the detection of compressed/uncompressed files. DONE
Right now the loader checks if the compressed size of a file is equal to the uncompressed size and uses that to decide which loading code to use.
I suggest removing one of the two size information, and store the "compressed" flag as the high bit of the Sector number, that will not make the code any more complex, but that's two bytes less per entry of the directory.
- Possibility to add defines at the command line. (from Iss) DONE
This would allow the possibility to generate different DSK files using the same script, by having some defines passed on the command line and exported in the header file (precedence of the command line version if there's already a define with that value in the script)
- Defines should appear *after* the AddFile commands. (from Iss) DONE
For coherence, all the AddDefines should refer to the previous AddFile instead of being before.
- Jasmin support. PENDING
With a bit of work the code can be made compatible to both Jasmin and Microdisc without any size or performance cost.
- Allow the loading of uncompressed files on non page size multiple. DONE
Right now compressed files can be loaded in any buffer that is large enough to contain them, but uncompressed files overwrite memory by multiples of 256 bytes, which is unpractical.
- Loading/Saving indicators support. PENDING
Right now if you want to show an animation while loading (spinning disk, rasters, message), you have to manually edit the api source code. Ideally it should just be a function to call.
How does that sound?
I've been discussing with Chema and Iss about their use of the system, and so far most of the changes have been in the actual loader code, not the FloppyBuilder itself, but for the next evolution of the system the program itself will have to be modified.
One of the first things I'd like to mention is that I'm not planning to be backward compatible with the previous versions, so upgrading to a new version may not work well. That being said, the modifications should be relatively easy to apply, and I plan to add a new instruction to define the format version the description file was created for, and FloppyBuilder will output warnings or errors if it knows that it is not compatible with the version you targeted, so at least it will not silently fail.
So, here is a first list of what I was thinking in doing:
- Add a "FormatVersion" instruction, followed by the FloppyBuilder version. DONE
If you have in your script "FormatVersion 0.19" and you try to use it in version 0.20 of the FloppyBuilder, it will tell you that you need to fix your script.
- Add a "WriteLoader" instruction. DONE
it will behave as the existing AddFile instruction except it will not add the loader in the list of files, and it will automatically generate the defines with the location of the loader in memory, as well as the sector and track positions.
- Remove the loading address from the "AddFile" instruction. DONE
After having used the system for quite a while now, I realize that the loading code always knew where the file was going to be loaded, so ultimately we are just wasting space in the file directory information for nothing.
- Add new macro magic values. DONE
We have {FileIndex} and {FileSize}, we should probably also have {FileTrack}, {FileSector}, {FileIsCompressed}
- Add some parameter to auto generate defines based on file names. PENDING
If you have a "AddFile MySuperFont.hir" it could automatically generate #define LOADER_MYSUPERFONT_HIR_INDEX 23 using the name of the file to generate the define
- Allow two different formats for the file directory table. PENDING
Right now we have individual arrays for sector, track, size, address, but in some cases it would be more practical to have the data interleaved
- Modify the detection of compressed/uncompressed files. DONE
Right now the loader checks if the compressed size of a file is equal to the uncompressed size and uses that to decide which loading code to use.
I suggest removing one of the two size information, and store the "compressed" flag as the high bit of the Sector number, that will not make the code any more complex, but that's two bytes less per entry of the directory.
- Possibility to add defines at the command line. (from Iss) DONE
This would allow the possibility to generate different DSK files using the same script, by having some defines passed on the command line and exported in the header file (precedence of the command line version if there's already a define with that value in the script)
- Defines should appear *after* the AddFile commands. (from Iss) DONE
For coherence, all the AddDefines should refer to the previous AddFile instead of being before.
- Jasmin support. PENDING
With a bit of work the code can be made compatible to both Jasmin and Microdisc without any size or performance cost.
- Allow the loading of uncompressed files on non page size multiple. DONE
Right now compressed files can be loaded in any buffer that is large enough to contain them, but uncompressed files overwrite memory by multiples of 256 bytes, which is unpractical.
- Loading/Saving indicators support. PENDING
Right now if you want to show an animation while loading (spinning disk, rasters, message), you have to manually edit the api source code. Ideally it should just be a function to call.
How does that sound?