[ox/preloader] Remove GbaPlatSpec

This commit is contained in:
Gary Talent 2022-11-30 02:26:24 -06:00
parent 090fe28b44
commit 04c882388e

View File

@ -39,81 +39,6 @@ struct NativePlatSpec {
} }
}; };
struct GbaPlatSpec {
using PtrType = uint32_t;
using size_t = uint32_t;
static constexpr auto PtrAlign = 4;
static constexpr PtrType RomStart = 0x08000000;
[[nodiscard]]
static constexpr std::size_t alignOf(const bool) noexcept {
return 1;
}
[[nodiscard]]
static constexpr std::size_t alignOf(const uint8_t) noexcept {
return 1;
}
[[nodiscard]]
static constexpr std::size_t alignOf(const uint16_t) noexcept {
return 2;
}
[[nodiscard]]
static constexpr std::size_t alignOf(const uint32_t) noexcept {
return 4;
}
[[nodiscard]]
static constexpr std::size_t alignOf(const uint64_t) noexcept {
return 8;
}
[[nodiscard]]
static constexpr std::size_t alignOf(const int8_t) noexcept {
return 1;
}
[[nodiscard]]
static constexpr std::size_t alignOf(const int16_t) noexcept {
return 2;
}
[[nodiscard]]
static constexpr std::size_t alignOf(const int32_t) noexcept {
return 4;
}
[[nodiscard]]
static constexpr std::size_t alignOf(const int64_t) noexcept {
return 8;
}
[[nodiscard]]
static constexpr std::size_t alignOf(auto*) noexcept {
return 4;
}
[[nodiscard]]
static constexpr std::size_t alignOf(const auto*) noexcept {
return 4;
}
[[nodiscard]]
static constexpr std::size_t alignOf(const auto &v) noexcept {
AlignmentCatcher<GbaPlatSpec> c;
oxAssert(model(c.interface(), &v), "Could not get alignment for type");
return c.biggestAlignment;
}
[[nodiscard]]
static constexpr auto correctEndianness(auto v) noexcept {
return ox::toLittleEndian(v);
}
};
template<typename PlatSpec, typename T> template<typename PlatSpec, typename T>
[[nodiscard]] [[nodiscard]]
constexpr std::size_t alignOf(const T &t) noexcept { constexpr std::size_t alignOf(const T &t) noexcept {