New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable large disk image support #2301
Conversation
The results are in MB or sectors, and a uint32_t is large enough
Also add a 'cross_' prefix to the defines.
As suggested by @kcgen I have moved the fstream wrappers to |
looks great, @shermp - only minor comments (and many repeating, so hopefully not too tedious). Another thing I wanted to mention for the casts is that @FeralChild64 added some really nice clamp-to-type include/math_utils.h:constexpr int8_t clamp_to_int8(const T val)
include/math_utils.h:constexpr uint8_t clamp_to_uint8(const T val)
include/math_utils.h:constexpr int16_t clamp_to_int16(const T val)
include/math_utils.h:constexpr uint16_t clamp_to_uint16(const T val)
include/math_utils.h:constexpr int32_t clamp_to_int32(const T val)
include/math_utils.h:constexpr uint32_t clamp_to_uint32(const T val) They're especially useful to prevent value wrap-around (if clamping is acceptable). If both clamping and wrap-around are unacceptable, then |
I've made some changes @kcgen , see what you think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor bits and a a question.
Should be done after this round.
This is a big improvement @shermp , and provides very useful functions that can be used in many more places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can squash down the intermediate commits, that would tidy it up a bit.
Feel free to merge once you're happy w/ the last round (it should let you merge once it gets through CI and all discussions set to "resolved")
Add stdio file size functions Use stdio file size functions Use const auto Rename fstream_ functions to stdio_ Add missing return statement Remove divisor variables only used once The function names should be enough to explain the values Switch cast to int64_t Restore file position after finding size
55355d9
to
bf855bc
Compare
This PR enables large HDD disk images to be used with Dosbox-staging. It is similar to the large disk support in the fat32 testing branches, but I have taken a slightly different approach.
This PR does not implement IDE support for hard disks, nor does it enable FAT 32 support. It is sufficient to mount and boot large disk images using the
-fs none
option inimgmount
.@ThomasEricB you might be interested in testing this.