Add a new KILLDSKIO environment variable #98
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If an environment variable named
KILLDSKIO
exists with a value ofON
(case insensitive) when the BASIC environment is started, the 512 byte buffer that is normally allocated as a sector buffer for theDSKI$
andDSKO$
commands won't be allocated, thus these 512 bytes will be gained back for BASIC programs. This implies that theDSKI$
andDSKO$
commands will be unavailable (they will throw "syntax error").This may be useful to load memory-intensive BASIC programs, and compensates for the fact that Nextor allocates about 230 extra bytes in page 3 than MSX-DOS 2.
When this mechanism is used to disable
DSKI$
andDSKO$
theDIRBUF
variable (&HF351), which holds the address of the 512 byte buffer where these commands read and write sectors, will have the same value asSECBUF
(&HF34D), which is a generic sector buffer used internally by Nextor; and the same goes forPATHNAM
(&HF33B), a buffer used by BASIC to parse pathnames for commands likeFILES
. This shouldn't be a problem in most cases, but for robustness it's recommended to use this feature only when that extra memory is absolutely necessary.