mirror of
https://github.com/lefticus/6502-cpp.git
synced 2025-05-20 11:38:20 +00:00
21 lines
457 B
C++
21 lines
457 B
C++
#ifndef INC_6502_C_6502_HPP
|
|
#define INC_6502_C_6502_HPP
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
namespace mos6502 {
|
|
|
|
static volatile std::uint8_t &memory_loc(const std::uint16_t loc)
|
|
{
|
|
return *reinterpret_cast<volatile std::uint8_t *>(loc);
|
|
}
|
|
|
|
static void poke(const std::uint16_t loc, const std::uint8_t value) { memory_loc(loc) = value; }
|
|
|
|
static std::uint8_t peek(const std::uint16_t loc) { return memory_loc(loc); }
|
|
|
|
}// namespace mos6502
|
|
|
|
#endif// INC_6502_C_6502_HPP
|