mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-27 10:29:30 +00:00
22 lines
411 B
C++
22 lines
411 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include "Chip.h"
|
|
|
|
namespace EightBit {
|
|
|
|
class Memory;
|
|
|
|
struct MemoryMapping final {
|
|
|
|
enum class AccessLevel { Unknown, ReadOnly, WriteOnly, ReadWrite };
|
|
|
|
constexpr auto offset(uint16_t address) const noexcept { return (address - begin) & mask; }
|
|
|
|
Memory& memory;
|
|
uint16_t begin = Chip::Mask16;
|
|
uint16_t mask = 0U;
|
|
AccessLevel access = AccessLevel::Unknown;
|
|
};
|
|
}
|