mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 23:52:26 +00:00
Merge pull request #1113 from TomHarte/VDPs
TMS9918 &c: Eliminate hard-coded assumption of 16kb.
This commit is contained in:
commit
3352feb21b
@ -360,10 +360,10 @@ template <Personality personality> struct Base {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ram_[ram_pointer_ & 16383] = read_ahead_buffer_;
|
ram_[ram_pointer_ & memory_mask(personality)] = read_ahead_buffer_;
|
||||||
break;
|
break;
|
||||||
case MemoryAccess::Read:
|
case MemoryAccess::Read:
|
||||||
read_ahead_buffer_ = ram_[ram_pointer_ & 16383];
|
read_ahead_buffer_ = ram_[ram_pointer_ & memory_mask(personality)];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
++ram_pointer_;
|
++ram_pointer_;
|
||||||
|
@ -42,6 +42,10 @@ constexpr size_t memory_size(Personality p) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr uint16_t memory_mask(Personality p) {
|
||||||
|
return (memory_size(p) >= 65536) ? 0xffff : uint16_t(memory_size(p) - 1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user