From a0a835cf1083a569f1e3ce27739456fa41bca32c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 8 Jan 2023 21:37:20 -0500 Subject: [PATCH] Export memory size into traits. --- Components/9918/Implementation/9918Base.hpp | 13 ------------- .../9918/Implementation/PersonalityTraits.hpp | 12 ++++++++++++ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Components/9918/Implementation/9918Base.hpp b/Components/9918/Implementation/9918Base.hpp index 355ca85e4..70a31ea30 100644 --- a/Components/9918/Implementation/9918Base.hpp +++ b/Components/9918/Implementation/9918Base.hpp @@ -27,19 +27,6 @@ namespace TI { namespace TMS { -// Additional properties that correlate with personality. -constexpr size_t memory_size(Personality p) { - switch(p) { - case TI::TMS::TMS9918A: - case TI::TMS::SMSVDP: - case TI::TMS::SMS2VDP: - case TI::TMS::GGVDP: return 16 * 1024; - case TI::TMS::MDVDP: return 64 * 1024; - case TI::TMS::V9938: return 128 * 1024; - case TI::TMS::V9958: return 192 * 1024; - } -} - // The screen mode is a necessary predecessor to picking the line mode, // which is the thing latched per line. enum class ScreenMode { diff --git a/Components/9918/Implementation/PersonalityTraits.hpp b/Components/9918/Implementation/PersonalityTraits.hpp index 7ce18f7a7..6a6afdac0 100644 --- a/Components/9918/Implementation/PersonalityTraits.hpp +++ b/Components/9918/Implementation/PersonalityTraits.hpp @@ -30,6 +30,18 @@ constexpr bool is_classic_vdp(Personality p) { p == Personality::GGVDP; } +constexpr size_t memory_size(Personality p) { + switch(p) { + case TI::TMS::TMS9918A: + case TI::TMS::SMSVDP: + case TI::TMS::SMS2VDP: + case TI::TMS::GGVDP: return 16 * 1024; + case TI::TMS::MDVDP: return 64 * 1024; + case TI::TMS::V9938: return 128 * 1024; + case TI::TMS::V9958: return 192 * 1024; + } +} + } }