mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-23 00:29:47 +00:00
Memory locking is dependent on the GB hardware, not the size of the program, so allow lock ranges to be manually specified.
Signed-off-by: Adrian.Conlon <adrian.conlon@gmail.com>
This commit is contained in:
parent
974c3353cc
commit
99e3454527
@ -98,6 +98,10 @@ namespace EightBit {
|
||||
void loadRom(const std::string& path, uint16_t offset);
|
||||
void loadRam(const std::string& path, uint16_t offset);
|
||||
|
||||
void lock(int address, int size) {
|
||||
std::fill(m_locked.begin() + address, m_locked.begin() + address + size, true);
|
||||
}
|
||||
|
||||
protected:
|
||||
std::array<uint8_t, 0x10000> m_bus;
|
||||
std::array<bool, 0x10000> m_locked;
|
||||
|
@ -35,7 +35,7 @@ void EightBit::Memory::clear() {
|
||||
|
||||
void EightBit::Memory::loadRom(const std::string& path, uint16_t offset) {
|
||||
auto size = loadMemory(path, offset);
|
||||
std::fill(m_locked.begin() + offset, m_locked.begin() + offset + size, true);
|
||||
lock(offset, size);
|
||||
}
|
||||
|
||||
void EightBit::Memory::loadRam(const std::string& path, uint16_t offset) {
|
||||
|
Loading…
Reference in New Issue
Block a user