mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-04-21 02:37:15 +00:00
Some visibility refactoring.
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
This commit is contained in:
parent
9e9c15e289
commit
04a9ffdcda
@ -164,7 +164,6 @@
|
||||
<ClCompile Include="opcode_test_suite_t.cpp" />
|
||||
<ClCompile Include="parser_t.cpp" />
|
||||
<ClCompile Include="processor_test_suite_t.cpp" />
|
||||
<ClCompile Include="ram_t.cpp" />
|
||||
<ClCompile Include="simdjson\simdjson.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
|
@ -41,9 +41,6 @@
|
||||
<ClCompile Include="cycles_t.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ram_t.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="byte_t.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
@ -7,16 +7,17 @@ private:
|
||||
const simdjson::dom::array m_raw;
|
||||
|
||||
protected:
|
||||
array_t(simdjson::dom::array input) noexcept;
|
||||
|
||||
[[nodiscard]] auto raw() const noexcept { return m_raw; }
|
||||
|
||||
[[nodiscard]] auto at(size_t idx) const noexcept { return raw().at(idx); }
|
||||
[[nodiscard]] auto integer_at(size_t idx) const noexcept { return at(idx).get_int64(); }
|
||||
|
||||
public:
|
||||
array_t(simdjson::dom::array input) noexcept;
|
||||
|
||||
[[nodiscard]] auto begin() const noexcept { return m_raw.begin(); }
|
||||
[[nodiscard]] auto end() const noexcept { return m_raw.end(); }
|
||||
[[nodiscard]] auto size() const noexcept { return m_raw.size(); }
|
||||
|
||||
[[nodiscard]] auto at(size_t idx) const noexcept { return raw().at(idx); }
|
||||
[[nodiscard]] auto operator[](size_t idx) const noexcept { return at(idx); }
|
||||
|
||||
[[nodiscard]] auto integer_at(size_t idx) const noexcept { return at(idx).get_int64(); }
|
||||
};
|
||||
|
@ -7,13 +7,12 @@
|
||||
#include "array_t.h"
|
||||
|
||||
class byte_t : public array_t {
|
||||
protected:
|
||||
[[nodiscard]] auto address_at(size_t idx) const noexcept { return (uint16_t)integer_at(idx); }
|
||||
[[nodiscard]] auto byte_at(size_t idx) const noexcept { return (uint8_t)integer_at(idx); }
|
||||
|
||||
public:
|
||||
byte_t(simdjson::dom::array input) noexcept;
|
||||
|
||||
[[nodiscard]] auto address_at(size_t idx) const noexcept { return (uint16_t)integer_at(idx); }
|
||||
[[nodiscard]] auto byte_at(size_t idx) const noexcept { return (uint8_t)integer_at(idx); }
|
||||
|
||||
[[nodiscard]] auto address() const noexcept { return address_at(0); }
|
||||
[[nodiscard]] auto value() const noexcept { return byte_at(1); }
|
||||
};
|
||||
|
@ -9,11 +9,12 @@ private:
|
||||
simdjson::dom::element m_raw;
|
||||
|
||||
protected:
|
||||
[[nodiscard]] auto raw() const noexcept { return m_raw; }
|
||||
|
||||
public:
|
||||
element_t() noexcept;
|
||||
element_t(simdjson::dom::element input) noexcept;
|
||||
|
||||
[[nodiscard]] auto raw() const noexcept { return m_raw; }
|
||||
|
||||
[[nodiscard]] auto at(std::string_view key) const noexcept { return raw()[key]; }
|
||||
[[nodiscard]] auto operator[](std::string_view key) const noexcept { return at(key); }
|
||||
[[nodiscard]] auto array_at(std::string_view key) const noexcept { return at(key).get_array(); }
|
||||
|
@ -17,4 +17,3 @@ public:
|
||||
|
||||
co_generator_t<opcode_test_suite_t> generator();
|
||||
};
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "ram_t.h"
|
||||
|
||||
ram_t::ram_t(const simdjson::dom::array input) noexcept
|
||||
: array_t(input) {}
|
@ -1,10 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "simdjson/simdjson.h"
|
||||
|
||||
#include "array_t.h"
|
||||
|
||||
class ram_t final : public array_t {
|
||||
public:
|
||||
ram_t(simdjson::dom::array input) noexcept;
|
||||
};
|
||||
typedef array_t ram_t;
|
||||
|
@ -9,13 +9,12 @@
|
||||
#include "ram_t.h"
|
||||
|
||||
class state_t final : public element_t {
|
||||
private:
|
||||
[[nodiscard]] auto address_at(std::string_view key) const noexcept { return (uint16_t)integer_at(key); }
|
||||
[[nodiscard]] auto byte_at(std::string_view key) const noexcept { return (uint8_t)integer_at(key); }
|
||||
|
||||
public:
|
||||
state_t(simdjson::dom::element input) noexcept;
|
||||
|
||||
[[nodiscard]] auto address_at(std::string_view key) const noexcept { return (uint16_t)integer_at(key); }
|
||||
[[nodiscard]] auto byte_at(std::string_view key) const noexcept { return (uint8_t)integer_at(key); }
|
||||
|
||||
[[nodiscard]] auto pc() const noexcept { return address_at("pc"); }
|
||||
[[nodiscard]] auto s() const noexcept { return byte_at("s"); }
|
||||
[[nodiscard]] auto a() const noexcept { return byte_at("a"); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user