2023-01-06 22:39:46 -05:00
|
|
|
//
|
|
|
|
// PersonalityTraits.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 06/01/2023.
|
|
|
|
// Copyright © 2023 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef PersonalityTraits_hpp
|
|
|
|
#define PersonalityTraits_hpp
|
|
|
|
|
2023-04-23 12:08:07 -04:00
|
|
|
namespace TI::TMS {
|
2023-01-06 22:39:46 -05:00
|
|
|
|
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
2023-01-07 12:48:43 -05:00
|
|
|
// i.e. one with the original internal timings.
|
2023-01-06 22:39:46 -05:00
|
|
|
constexpr bool is_classic_vdp(Personality p) {
|
|
|
|
return
|
|
|
|
p == Personality::TMS9918A ||
|
|
|
|
p == Personality::SMSVDP ||
|
|
|
|
p == Personality::SMS2VDP ||
|
|
|
|
p == Personality::GGVDP;
|
|
|
|
}
|
|
|
|
|
2023-01-08 21:37:20 -05:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-05 22:51:16 -05:00
|
|
|
constexpr size_t memory_mask(Personality p) {
|
|
|
|
return memory_size(p) - 1;
|
2023-01-10 12:38:19 -05:00
|
|
|
}
|
|
|
|
|
2023-01-06 22:39:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* PersonalityTraits_hpp */
|