chore: stage bunch of size_t to uint32_t
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
@@ -8,14 +8,14 @@ class Bus {
|
||||
public:
|
||||
Bus(const Memory& memory);
|
||||
|
||||
uint8_t read_byte(size_t address);
|
||||
void write_byte(size_t address, uint8_t byte);
|
||||
uint8_t read_byte(uint32_t address);
|
||||
void write_byte(uint32_t address, uint8_t byte);
|
||||
|
||||
uint16_t read_halfword(size_t address);
|
||||
void write_halfword(size_t address, uint16_t halfword);
|
||||
uint16_t read_halfword(uint32_t address);
|
||||
void write_halfword(uint32_t address, uint16_t halfword);
|
||||
|
||||
uint32_t read_word(size_t address);
|
||||
void write_word(size_t address, uint32_t word);
|
||||
uint32_t read_word(uint32_t address);
|
||||
void write_word(uint32_t address, uint32_t word);
|
||||
|
||||
private:
|
||||
std::shared_ptr<Memory> memory;
|
||||
|
@@ -10,15 +10,16 @@
|
||||
namespace matar {
|
||||
class Memory {
|
||||
public:
|
||||
static constexpr size_t BIOS_SIZE = 1024 * 16;
|
||||
static constexpr uint32_t BIOS_SIZE = 1024 * 16;
|
||||
|
||||
Memory(std::array<uint8_t, BIOS_SIZE>&& bios, std::vector<uint8_t>&& rom);
|
||||
|
||||
uint8_t read(size_t address) const;
|
||||
void write(size_t address, uint8_t byte);
|
||||
uint8_t read(uint32_t address) const;
|
||||
void write(uint32_t address, uint8_t byte);
|
||||
|
||||
private:
|
||||
#define MEMORY_REGION(name, start) static constexpr size_t name##_START = start;
|
||||
#define MEMORY_REGION(name, start) \
|
||||
static constexpr uint32_t name##_START = start;
|
||||
|
||||
#define DECL_MEMORY(name, ident, start, end) \
|
||||
MEMORY_REGION(name, start) \
|
||||
@@ -50,7 +51,7 @@ class Memory {
|
||||
|
||||
#undef MEMORY_REGION
|
||||
|
||||
std::unordered_map<size_t, uint8_t> invalid_mem;
|
||||
std::unordered_map<uint32_t, uint8_t> invalid_mem;
|
||||
std::vector<uint8_t> rom;
|
||||
Header header;
|
||||
void parse_header();
|
||||
|
Reference in New Issue
Block a user