VirtualC64 v5.0 beta
Commodore 64 Emulator
Loading...
Searching...
No Matches
Monitor.h
1// -----------------------------------------------------------------------------
2// This file is part of VirtualC64
3//
4// Copyright (C) Dirk W. Hoffmann. www.dirkwhoffmann.de
5// This FILE is dual-licensed. You are free to choose between:
6//
7// - The GNU General Public License v3 (or any later version)
8// - The Mozilla Public License v2
9//
10// SPDX-License-Identifier: GPL-3.0-or-later OR MPL-2.0
11// -----------------------------------------------------------------------------
12
13#pragma once
14
15#include "MonitorTypes.h"
16#include "C64Types.h"
17#include "SubComponent.h"
18
19namespace vc64 {
20
21class Monitor final : public SubComponent {
22
23 Descriptions descriptions = {
24 {
25 .name = "Monitor",
26 .description = "Computer Monitor"
27 }
28 };
29
30 ConfigOptions options = {
31
55 };
56
57 // Current configuration
58 MonitorConfig config = { };
59
60
61 //
62 // Methods
63 //
64
65public:
66
67 Monitor(C64 &ref) : SubComponent(ref) { }
68
69 Monitor& operator= (const Monitor& other) {
70
71 CLONE(config)
72
73 return *this;
74 }
75
76 //
77 // Methods from Serializable
78 //
79
80public:
81
82 template <class T> void serialize(T& worker) {
83
84 if (isResetter(worker)) return;
85
86 worker
87
88 << config.palette
89 << config.brightness
90 << config.contrast
91 << config.saturation
92
93 << config.hCenter
94 << config.vCenter
95 << config.hZoom
96 << config.vZoom
97
98 << config.upscaler
99
100 << config.blur
101 << config.blurRadius
102
103 << config.bloom
104 << config.bloomRadius
105 << config.bloomBrightness
106 << config.bloomWeight
107
108 << config.dotmask
109 << config.dotMaskBrightness
110
111 << config.scanlines
112 << config.scanlineBrightness
113 << config.scanlineWeight
114
115 << config.disalignment
116 << config.disalignmentH
117 << config.disalignmentV;
118
119
120 } SERIALIZERS(serialize);
121
122
123 //
124 // Methods from CoreComponent
125 //
126
127public:
128
129 const Descriptions &getDescriptions() const override { return descriptions; }
130
131private:
132
133 void _dump(Category category, std::ostream& os) const override;
134
135
136 //
137 // Methods from Configurable
138 //
139
140public:
141
142 const MonitorConfig &getConfig() const { return config; }
143 const ConfigOptions &getOptions() const override { return options; }
144 i64 getOption(Option opt) const override;
145 void checkOption(Option opt, i64 value) override;
146 void setOption(Option opt, i64 value) override;
147
148
149 //
150 // Computing color values
151 //
152
153public:
154
155 // Computes a C64 color in 32 bit big-endian RGBA format
156 u32 getColor(isize nr, Palette palette);
157 u32 getColor(isize nr) { return getColor(nr, config.palette); }
158};
159
160}
VirtualC64 project namespace.
Definition CmdQueue.cpp:16
@ OPT_MON_VCENTER
Vertical centering.
Definition OptionTypes.h:78
@ OPT_MON_SCANLINE_BRIGHTNESS
Scanline brightness.
Definition OptionTypes.h:91
@ OPT_MON_DOTMASK_BRIGHTNESS
Dotmask brightness.
Definition OptionTypes.h:89
@ OPT_MON_SCANLINE_WEIGHT
Scanline weight.
Definition OptionTypes.h:92
@ OPT_MON_UPSCALER
Pixel upscaler.
Definition OptionTypes.h:81
@ OPT_MON_SCANLINES
Scanline mode.
Definition OptionTypes.h:90
@ OPT_MON_DOTMASK
Dotmask pattern.
Definition OptionTypes.h:88
@ OPT_MON_CONTRAST
Contrast.
Definition OptionTypes.h:75
@ OPT_MON_BLOOM_RADIUS
Bloom radius.
Definition OptionTypes.h:85
@ OPT_MON_BLOOM_BRIGHTNESS
Bloom brightness.
Definition OptionTypes.h:86
@ OPT_MON_BLOOM
Bloom enable.
Definition OptionTypes.h:84
@ OPT_MON_DISALIGNMENT
Cathode ray disalignment enable.
Definition OptionTypes.h:93
@ OPT_MON_SATURATION
Color saturation.
Definition OptionTypes.h:76
@ OPT_MON_VZOOM
Vertical centering.
Definition OptionTypes.h:80
@ OPT_MON_DISALIGNMENT_V
Vertical cathode ray disalignment.
Definition OptionTypes.h:95
@ OPT_MON_HCENTER
Horizontal centering.
Definition OptionTypes.h:77
@ OPT_MON_PALETTE
Color palette.
Definition OptionTypes.h:73
@ OPT_MON_BRIGHTNESS
Brightness.
Definition OptionTypes.h:74
@ OPT_MON_HZOOM
Horizontal zoom.
Definition OptionTypes.h:79
@ OPT_MON_BLOOM_WEIGHT
Bloom weight.
Definition OptionTypes.h:87
@ OPT_MON_BLUR_RADIUS
Blur radius.
Definition OptionTypes.h:83
@ OPT_MON_BLUR
Blur enable.
Definition OptionTypes.h:82
@ OPT_MON_DISALIGNMENT_H
Horizontal cathode ray disalignment.
Definition OptionTypes.h:94