1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-09-13 08:24:36 +00:00

Compare commits

...

1 Commits

Author SHA1 Message Date
Thomas Harte
60fbb067c5 Resolve some dangling indentation style divergences. 2025-09-05 14:32:19 -04:00
4 changed files with 434 additions and 433 deletions

View File

@@ -24,7 +24,7 @@ namespace Sinclair::ZX8081 {
and the black level.
*/
class Video {
public:
public:
/// Constructs an instance of the video feed.
Video();
@@ -46,7 +46,7 @@ class Video {
/// Gets the current scan status.
Outputs::Display::ScanStatus get_scaled_scan_status() const;
private:
private:
bool sync_ = false;
uint8_t *line_data_ = nullptr;
uint8_t *line_data_pointer_ = nullptr;

View File

@@ -48,7 +48,7 @@ enum class Timing {
*/
template <Timing timing> class Video {
private:
private:
struct Timings {
// Number of cycles per line. Will be 224 or 228.
int half_cycles_per_line;
@@ -113,7 +113,7 @@ template <Timing timing> class Video {
// Interrupt should be held for 32 cycles.
static constexpr int interrupt_duration = 64;
public:
public:
void run_for(HalfCycles duration) {
static constexpr auto timings = get_timings();
@@ -178,7 +178,7 @@ template <Timing timing> class Video {
constexpr uint8_t masks[] = {0, 0xff};
#define Output(n) \
{ \
{ \
const uint8_t pixels = \
uint8_t(last_fetches_[n] ^ masks[flash_mask_ & (last_fetches_[n+1] >> 7)]); \
\
@@ -196,7 +196,7 @@ template <Timing timing> class Video {
pixel_target_[6] = colours[(pixels >> 1) & 1]; \
pixel_target_[7] = colours[(pixels >> 0) & 1]; \
pixel_target_ += 8; \
}
}
Output(0);
Output(2);
@@ -255,7 +255,7 @@ template <Timing timing> class Video {
}
}
private:
private:
static constexpr int half_cycles_per_line() {
if constexpr (timing == Timing::FortyEightK) {
// TODO: determine real figure here, if one exists.
@@ -301,7 +301,7 @@ template <Timing timing> class Video {
run_for(frame_duration() - now + time);
}
public:
public:
Video() :
crt_(half_cycles_per_line(), 2, Outputs::Display::Type::PAL50, Outputs::Display::InputDataType::Red2Green2Blue2)
{
@@ -434,7 +434,7 @@ template <Timing timing> class Video {
return crt_.get_display_type();
}
private:
private:
int time_into_frame_ = 0;
Outputs::CRT::CRT crt_;
const uint8_t *memory_ = nullptr;
@@ -454,14 +454,15 @@ template <Timing timing> class Video {
friend struct State;
#define RGB(r, g, b) (r << 4) | (g << 2) | b
static constexpr uint8_t RGB(const uint8_t r, const uint8_t g, const uint8_t b) {
return uint8_t((r << 4) | (g << 2) | b);
}
static constexpr uint8_t palette[] = {
RGB(0, 0, 0), RGB(0, 0, 2), RGB(2, 0, 0), RGB(2, 0, 2),
RGB(0, 2, 0), RGB(0, 2, 2), RGB(2, 2, 0), RGB(2, 2, 2),
RGB(0, 0, 0), RGB(0, 0, 3), RGB(3, 0, 0), RGB(3, 0, 3),
RGB(0, 3, 0), RGB(0, 3, 3), RGB(3, 3, 0), RGB(3, 3, 3),
};
#undef RGB
};
struct State: public Reflection::StructImpl<State> {

View File

@@ -22,7 +22,7 @@ namespace Utility {
necessary to type that character on a given machine.
*/
class CharacterMapper {
public:
public:
virtual ~CharacterMapper() = default;
/// @returns The EndSequence-terminated sequence of keys that would cause @c character to be typed.
@@ -40,7 +40,7 @@ class CharacterMapper {
/// @returns @c true if the typer should pause after forwarding @c key; @c false otherwise.
virtual bool needs_pause_after_key([[maybe_unused]] uint16_t key) const { return true; }
protected:
protected:
using KeySequence = std::array<uint16_t, 16>;
/*!

View File

@@ -56,7 +56,7 @@ template <Action action, typename IteratorT, typename SampleT> void fill(Iterato
*/
template <typename SourceT, bool stereo>
class BufferSource {
public:
public:
/*!
Indicates whether this component will write stereo samples.
*/