Successfully read in file

This commit is contained in:
Jaby 2023-03-27 20:43:18 +02:00
parent 2582d6ea21
commit 0add2f5794
3 changed files with 9 additions and 2 deletions

View File

@ -5,6 +5,8 @@
namespace JabyEngine { namespace JabyEngine {
namespace bit { namespace bit {
template<typename T>
static constexpr T set(T raw_value, size_t bit);
namespace value { namespace value {
template<typename T> template<typename T>
static constexpr T set_normalized(T raw_value, T value, size_t start_bit, size_t length); static constexpr T set_normalized(T raw_value, T value, size_t start_bit, size_t length);
@ -27,6 +29,11 @@ namespace JabyEngine {
constexpr ClearBit operator!() const { constexpr ClearBit operator!() const {
return ClearBit(this->pos); return ClearBit(this->pos);
} }
template<typename T>
constexpr explicit operator T() const {
return bit::set(0, this->pos);
}
}; };
struct BitRange { struct BitRange {

View File

@ -54,7 +54,7 @@ namespace JabyEngine {
static constexpr auto WantData = Bit(7); static constexpr auto WantData = Bit(7);
void want_data() { void want_data() {
this->raw_value = Self::set(Self::WantData); this->raw_value = static_cast<uint8_t>(Self::WantData);
} }
void reset() { void reset() {

View File

@ -74,7 +74,7 @@ namespace JabyEngine {
auto* sector = sector_allocator.allocate_sector(); auto* sector = sector_allocator.allocate_sector();
if(sector) { if(sector) {
//Now obtain sector //Now obtain sector
//read_sector_to(*sector); read_sector_to(*sector);
sectors_left--; sectors_left--;
if(sectors_left == 0) { if(sectors_left == 0) {