mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-17 10:06:21 +00:00
49 lines
1.0 KiB
C++
49 lines
1.0 KiB
C++
//
|
|
// PersonalityTraits.hpp
|
|
// Clock Signal
|
|
//
|
|
// Created by Thomas Harte on 06/01/2023.
|
|
// Copyright © 2023 Thomas Harte. All rights reserved.
|
|
//
|
|
|
|
#pragma once
|
|
|
|
namespace TI::TMS {
|
|
|
|
// Genus determinants for the various personalityes.
|
|
constexpr bool is_sega_vdp(Personality p) {
|
|
return p >= Personality::SMSVDP;
|
|
}
|
|
|
|
constexpr bool is_yamaha_vdp(Personality p) {
|
|
return p == Personality::V9938 || p == Personality::V9958;
|
|
}
|
|
|
|
// i.e. one with the original internal timings.
|
|
constexpr bool is_classic_vdp(Personality p) {
|
|
return
|
|
p == Personality::TMS9918A ||
|
|
p == Personality::SMSVDP ||
|
|
p == Personality::SMS2VDP ||
|
|
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;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
constexpr size_t memory_mask(Personality p) {
|
|
return memory_size(p) - 1;
|
|
}
|
|
|
|
}
|