| e8555c89 Andy McCall |
1 |
#ifndef V9990DISPLAYTIMING_HH |
| 2 |
#define V9990DISPLAYTIMING_HH |
| 3 |
|
| 4 |
namespace openmsx { |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
struct V9990DisplayPeriod |
| 12 |
{ |
| 13 |
int cycle; |
| 14 |
int blank; |
| 15 |
int border1; |
| 16 |
int display; |
| 17 |
int border2; |
| 18 |
}; |
| 19 |
|
| 20 |
class V9990DisplayTiming |
| 21 |
{ |
| 22 |
public: |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
static constexpr int UC_TICKS_PER_SECOND = 3579545 * 12; |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
static constexpr int UC_TICKS_PER_LINE = 2736; |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
static constexpr auto lineMCLK = V9990DisplayPeriod{ |
| 42 |
.cycle = V9990DisplayTiming::UC_TICKS_PER_LINE, .blank = 400, .border1 = 112, .display = 2048, .border2 = 112}; |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
static constexpr auto lineXTAL = V9990DisplayPeriod{ |
| 48 |
.cycle = V9990DisplayTiming::UC_TICKS_PER_LINE, .blank = 372, .border1 = 0, .display = 2304, .border2 = 0}; |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
static constexpr auto displayNTSC_MCLK = V9990DisplayPeriod{ |
| 54 |
.cycle = 262, .blank = 15, .border1 = 14, .display = 212, .border2 = 14}; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
static constexpr auto displayNTSC_XTAL = V9990DisplayPeriod{ |
| 60 |
.cycle = 262, .blank = 15, .border1 = 0, .display = 240, .border2 = 0}; |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
static constexpr auto displayPAL_MCLK = V9990DisplayPeriod{ |
| 66 |
.cycle = 313, .blank = 15, .border1 = 41, .display = 212, .border2 = 37}; |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
static constexpr auto displayPAL_XTAL = V9990DisplayPeriod{ |
| 72 |
.cycle = 313, .blank = 15, .border1 = 0, .display = 290, .border2 = 0}; |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
[[nodiscard]] static constexpr int getUCTicksPerFrame(bool palTiming) { |
| 80 |
return palTiming ? (displayPAL_MCLK.cycle * UC_TICKS_PER_LINE) |
| 81 |
: (displayNTSC_MCLK.cycle * UC_TICKS_PER_LINE); |
| 82 |
} |
| 83 |
}; |
| 84 |
|
| 85 |
} |
| 86 |
|
| 87 |
#endif |