1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-11-24 13:17:41 +00:00

Further address type conversions.

This commit is contained in:
Thomas Harte
2025-11-21 22:07:30 -05:00
parent 5ef5478861
commit 411b96128c
2 changed files with 4 additions and 4 deletions

View File

@@ -629,7 +629,7 @@ private:
const auto ram_floor = (0x100 << 14) - ram_.size(); const auto ram_floor = (0x100 << 14) - ram_.size();
// Each segment is 2^14 bytes long and there are 256 of them. So the Enterprise has a 22-bit address space. // Each segment is 2^14 bytes long and there are 256 of them. So the Enterprise has a 22-bit address space.
// RAM is at the end of that range; `ram_floor` is the 22-bit address at which RAM starts. // RAM is at the end of that range; `ram_floor` is the 22-bit address at which RAM starts.
return &ram_[size_t((page << 14) - ram_floor)]; return &ram_[size_t((page << 14)) - ram_floor];
} }
const uint8_t *read_pointers_[4] = {nullptr, nullptr, nullptr, nullptr}; const uint8_t *read_pointers_[4] = {nullptr, nullptr, nullptr, nullptr};
@@ -831,7 +831,7 @@ private:
// per 5.4 System Segment Usage those pages are stored in memory from // per 5.4 System Segment Usage those pages are stored in memory from
// 0xbffc, so grab from there. // 0xbffc, so grab from there.
const auto page_id = address >> 14; const auto page_id = address >> 14;
const auto page = read_pointers_[0xbffc >> 14] ? read_pointers_[0xbffc >> 14][0xbffc + page_id] : 0xff; const uint8_t page = read_pointers_[0xbffc >> 14] ? read_pointers_[0xbffc >> 14][0xbffc + page_id] : 0xff;
const auto offset = address & 0x3fff; const auto offset = address & 0x3fff;
ram_segment(page)[offset] = value; ram_segment(page)[offset] = value;
} }
@@ -853,7 +853,7 @@ private:
} }
const auto offset = begin - host_fs_rom_.begin() + 0xc000; // ROM will be paged in slot 3, i.e. at $c000. const auto offset = begin - host_fs_rom_.begin() + 0xc000; // ROM will be paged in slot 3, i.e. at $c000.
host_fs_traps_.insert(offset); host_fs_traps_.insert(uint16_t(offset));
// Move function code up to where this trap was, and NOP out the tail. // Move function code up to where this trap was, and NOP out the tail.
begin[0] = begin[3]; begin[0] = begin[3];

View File

@@ -24,6 +24,6 @@ std::optional<std::string> LocalFSFileBundle::key_file() {
return key_file_; return key_file_;
} }
Storage::FileHolder LocalFSFileBundle::open(const std::string &name, Storage::FileMode mode) { Storage::FileHolder LocalFSFileBundle::open(const std::string &name, const Storage::FileMode mode) {
return Storage::FileHolder(base_path_ + name, mode); return Storage::FileHolder(base_path_ + name, mode);
} }