1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-08 10:52:58 +00:00

Starts to add Qt target; resolves many build warnings.

This commit is contained in:
Thomas Harte 2020-05-30 00:37:06 -04:00
parent 743353a0ed
commit 267006782f
92 changed files with 395 additions and 179 deletions

View File

@ -24,13 +24,13 @@ namespace Activity {
class Observer {
public:
/// Announces to the receiver that there is an LED of name @c name.
virtual void register_led(const std::string &name) {}
virtual void register_led([[maybe_unused]] const std::string &name) {}
/// Announces to the receiver that there is a drive of name @c name.
virtual void register_drive(const std::string &name) {}
virtual void register_drive([[maybe_unused]] const std::string &name) {}
/// Informs the receiver of the new state of the LED with name @c name.
virtual void set_led_status(const std::string &name, bool lit) {}
virtual void set_led_status([[maybe_unused]] const std::string &name, [[maybe_unused]] bool lit) {}
enum class DriveEvent {
StepNormal,
@ -39,10 +39,10 @@ class Observer {
};
/// Informs the receiver that the named event just occurred for the drive with name @c name.
virtual void announce_drive_event(const std::string &name, DriveEvent event) {}
virtual void announce_drive_event([[maybe_unused]] const std::string &name, [[maybe_unused]] DriveEvent event) {}
/// Informs the receiver of the motor-on status of the drive with name @c name.
virtual void set_drive_motor_status(const std::string &name, bool is_on) {}
virtual void set_drive_motor_status([[maybe_unused]] const std::string &name, [[maybe_unused]] bool is_on) {}
};
}

View File

@ -69,7 +69,7 @@ class MultiTimedMachine: public MultiInterface<MachineTypes::TimedMachine>, publ
void run_for(Time::Seconds duration) final;
private:
void run_for(const Cycles cycles) final {}
void run_for(const Cycles) final {}
Delegate *delegate_ = nullptr;
};

View File

@ -9,7 +9,7 @@
#include "StaticAnalyser.hpp"
#include "Target.hpp"
Analyser::Static::TargetList Analyser::Static::AtariST::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) {
Analyser::Static::TargetList Analyser::Static::AtariST::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) {
// This analyser can comprehend disks and mass-storage devices only.
if(media.disks.empty()) return {};

View File

@ -145,7 +145,7 @@ bool is_bd500(Storage::Encodings::MFM::Parser &parser) {
}
Analyser::Static::TargetList Analyser::Static::Oric::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) {
Analyser::Static::TargetList Analyser::Static::Oric::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) {
auto target = std::make_unique<Target>();
target->confidence = 0.5;

View File

@ -498,7 +498,7 @@ void WD1770::posit_event(int new_event_type) {
if(get_crc_generator().get_value()) {
LOG("CRC error; terminating");
update_status([this] (Status &status) {
update_status([] (Status &status) {
status.crc_error = true;
});
goto wait_for_command;
@ -816,8 +816,8 @@ void WD1770::update_status(std::function<void(Status &)> updater) {
if(status_.busy != old_status.busy) update_clocking_observer();
}
void WD1770::set_head_load_request(bool head_load) {}
void WD1770::set_motor_on(bool motor_on) {}
void WD1770::set_head_load_request(bool) {}
void WD1770::set_motor_on(bool) {}
void WD1770::set_head_loaded(bool head_loaded) {
head_is_loaded_ = head_loaded;

View File

@ -31,6 +31,7 @@ class WD1770: public Storage::Disk::MFMController {
@param p The type of controller to emulate.
*/
WD1770(Personality p);
virtual ~WD1770() {}
/// Sets the value of the double-density input; when @c is_double_density is @c true, reads and writes double-density format data.
using Storage::Disk::MFMController::set_is_double_density;

View File

@ -20,7 +20,7 @@ NCR5380::NCR5380(SCSI::Bus &bus, int clock_rate) :
bus_.add_observer(this);
}
void NCR5380::write(int address, uint8_t value, bool dma_acknowledge) {
void NCR5380::write(int address, uint8_t value, bool) {
switch(address & 7) {
case 0:
// LOG("[SCSI 0] Set current SCSI bus state to " << PADHEX(2) << int(value));
@ -128,7 +128,7 @@ void NCR5380::write(int address, uint8_t value, bool dma_acknowledge) {
}
}
uint8_t NCR5380::read(int address, bool dma_acknowledge) {
uint8_t NCR5380::read(int address, bool) {
switch(address & 7) {
case 0:
// LOG("[SCSI 0] Get current SCSI bus state: " << PADHEX(2) << (bus_.get_state() & 0xff));

View File

@ -37,22 +37,22 @@ enum Line {
class PortHandler {
public:
/// Requests the current input value of @c port from the port handler.
uint8_t get_port_input(Port port) { return 0xff; }
uint8_t get_port_input([[maybe_unused]] Port port) { return 0xff; }
/// Sets the current output value of @c port and provides @c direction_mask, indicating which pins are marked as output.
void set_port_output(Port port, uint8_t value, uint8_t direction_mask) {}
void set_port_output([[maybe_unused]] Port port, [[maybe_unused]] uint8_t value, [[maybe_unused]] uint8_t direction_mask) {}
/// Sets the current logical output level for line @c line on port @c port.
void set_control_line_output(Port port, Line line, bool value) {}
void set_control_line_output([[maybe_unused]] Port port, [[maybe_unused]] Line line, [[maybe_unused]] bool value) {}
/// Sets the current logical value of the interrupt line.
void set_interrupt_status(bool status) {}
void set_interrupt_status([[maybe_unused]] bool status) {}
/// Provides a measure of time elapsed between other calls.
void run_for(HalfCycles duration) {}
void run_for([[maybe_unused]] HalfCycles duration) {}
/// Receives passed-on flush() calls from the 6522.
void flush() {}
void flush() {}
};
/*!

View File

@ -14,6 +14,6 @@ void IRQDelegatePortHandler::set_interrupt_delegate(Delegate *delegate) {
delegate_ = delegate;
}
void IRQDelegatePortHandler::set_interrupt_status(bool new_status) {
void IRQDelegatePortHandler::set_interrupt_status(bool) {
if(delegate_) delegate_->mos6522_did_change_interrupt_status(this);
}

View File

@ -173,9 +173,11 @@ template <class T> class MOS6532 {
bool interrupt_line_ = false;
// expected to be overridden
uint8_t get_port_input(int port) { return 0xff; }
void set_port_output(int port, uint8_t value, uint8_t output_mask) {}
void set_irq_line(bool new_value) {}
void set_port_output([[maybe_unused]] int port, [[maybe_unused]] uint8_t value, [[maybe_unused]] uint8_t output_mask) {}
uint8_t get_port_input([[maybe_unused]] int port) {
return 0xff;
}
void set_irq_line(bool) {}
inline void evaluate_interrupts() {
interrupt_line_ =

View File

@ -43,7 +43,7 @@ class AudioGenerator: public ::Outputs::Speaker::SampleSource {
};
struct BusHandler {
void perform_read(uint16_t address, uint8_t *pixel_data, uint8_t *colour_data) {
void perform_read([[maybe_unused]] uint16_t address, [[maybe_unused]] uint8_t *pixel_data, [[maybe_unused]] uint8_t *colour_data) {
*pixel_data = 0xff;
*colour_data = 0xff;
}

View File

@ -9,13 +9,15 @@
#ifndef i8255_hpp
#define i8255_hpp
#include <cstdint>
namespace Intel {
namespace i8255 {
class PortHandler {
public:
void set_value(int port, uint8_t value) {}
uint8_t get_value(int port) { return 0xff; }
void set_value([[maybe_unused]] int port, [[maybe_unused]] uint8_t value) {}
uint8_t get_value([[maybe_unused]] int port) { return 0xff; }
};
// TODO: Modes 1 and 2.

View File

@ -880,13 +880,13 @@ bool i8272::seek_is_satisfied(int drive) {
(drives_[drive].target_head_position == -1 && get_drive().get_is_track_zero());
}
void i8272::set_dma_acknowledge(bool dack) {
void i8272::set_dma_acknowledge(bool) {
}
void i8272::set_terminal_count(bool tc) {
void i8272::set_terminal_count(bool) {
}
void i8272::set_data_input(uint8_t value) {
void i8272::set_data_input(uint8_t) {
}
uint8_t i8272::get_data_output() {

View File

@ -20,8 +20,9 @@ namespace i8272 {
class BusHandler {
public:
virtual void set_dma_data_request(bool drq) {}
virtual void set_interrupt(bool irq) {}
virtual ~BusHandler() {}
virtual void set_dma_data_request([[maybe_unused]] bool drq) {}
virtual void set_interrupt([[maybe_unused]] bool irq) {}
};
class i8272 : public Storage::Disk::MFMController {

View File

@ -40,7 +40,7 @@ enum class TVStandard {
class Base {
public:
static const uint32_t palette_pack(uint8_t r, uint8_t g, uint8_t b) {
static uint32_t palette_pack(uint8_t r, uint8_t g, uint8_t b) {
uint32_t result = 0;
uint8_t *const result_ptr = reinterpret_cast<uint8_t *>(&result);
result_ptr[0] = r;
@ -449,7 +449,7 @@ class Base {
/***********************************************
TMS9918 Fetching Code
TMS9918 Fetching Code
************************************************/
template<bool use_end> void fetch_tms_refresh(int start, int end) {
@ -693,7 +693,7 @@ class Base {
/***********************************************
Master System Fetching Code
Master System Fetching Code
************************************************/
template<bool use_end> void fetch_sms(int start, int end) {

View File

@ -30,7 +30,7 @@ class PortHandler {
@param port_b @c true if the input being queried is Port B. @c false if it is Port A.
*/
virtual uint8_t get_port_input(bool port_b) {
virtual uint8_t get_port_input([[maybe_unused]] bool port_b) {
return 0xff;
}
@ -40,7 +40,7 @@ class PortHandler {
@param port_b @c true if the output being posted is Port B. @c false if it is Port A.
@param value the value now being output.
*/
virtual void set_port_output(bool port_b, uint8_t value) {}
virtual void set_port_output([[maybe_unused]] bool port_b, [[maybe_unused]] uint8_t value) {}
};
/*!

View File

@ -23,7 +23,7 @@ void Toggle::set_sample_volume_range(std::int16_t range) {
volume_ = range;
}
void Toggle::skip_samples(const std::size_t number_of_samples) {}
void Toggle::skip_samples(std::size_t) {}
void Toggle::set_output(bool enabled) {
if(is_enabled_ == enabled) return;

View File

@ -219,7 +219,7 @@ void DiskII::process_event(const Storage::Disk::Drive::Event &event) {
}
}
void DiskII::set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference preference) {
void DiskII::set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) {
drive_is_sleeping_[0] = drives_[0].preferred_clocking() == ClockingHint::Preference::None;
drive_is_sleeping_[1] = drives_[1].preferred_clocking() == ClockingHint::Preference::None;
decide_clocking_preference();

View File

@ -24,7 +24,7 @@ namespace Apple {
Defines the drive interface used by the IWM, derived from the external pinout as
per e.g. https://old.pinouts.ru/HD/MacExtDrive_pinout.shtml
These are subclassed of Storage::Disk::Drive, so accept any disk the emulator supports,
These are subclasses of Storage::Disk::Drive, so accept any disk the emulator supports,
and provide the usual read/write interface for on-disk data.
*/
struct IWMDrive: public Storage::Disk::Drive {

View File

@ -61,7 +61,6 @@ class SCC: public ::Outputs::Speaker::SampleSource {
} waves_[4];
std::uint8_t channel_enable_ = 0;
std::uint8_t test_register_ = 0;
void evaluate_output_volume();

View File

@ -216,11 +216,8 @@ class ConcreteJoystick: public Joystick {
}
protected:
virtual void did_set_input(const Input &input, float value) {
}
virtual void did_set_input(const Input &input, bool value) {
}
virtual void did_set_input([[maybe_unused]] const Input &input, [[maybe_unused]] float value) {}
virtual void did_set_input([[maybe_unused]] const Input &input, [[maybe_unused]] bool value) {}
private:
const std::vector<Input> inputs_;

View File

@ -20,7 +20,7 @@ class Mouse {
/*!
Indicates a movement of the mouse.
*/
virtual void move(int x, int y) {}
virtual void move([[maybe_unused]] int x, [[maybe_unused]] int y) {}
/*!
@returns the number of buttons on this mouse.
@ -34,7 +34,7 @@ class Mouse {
The intention is that @c index be semantic, not positional:
0 for the primary button, 1 for the secondary, 2 for the tertiary, etc.
*/
virtual void set_button_pressed(int index, bool is_pressed) {}
virtual void set_button_pressed([[maybe_unused]] int index, [[maybe_unused]] bool is_pressed) {}
/*!
Releases all depressed buttons.

View File

@ -691,11 +691,11 @@ class FDC: public Intel::i8272::i8272 {
get_drive().set_motor_on(on);
}
void select_drive(int c) {
// TODO: support more than one drive.
void select_drive(int) {
// TODO: support more than one drive. (and in set_disk)
}
void set_disk(std::shared_ptr<Storage::Disk::Disk> disk, int drive) {
void set_disk(std::shared_ptr<Storage::Disk::Disk> disk, int) {
get_drive().set_disk(disk);
}
@ -1075,7 +1075,7 @@ template <bool has_fdc> class ConcreteMachine:
return !media.tapes.empty() || (!media.disks.empty() && has_fdc);
}
void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference clocking) final {
void set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) final {
fdc_is_sleeping_ = fdc_.preferred_clocking() == ClockingHint::Preference::None;
tape_player_is_sleeping_ = tape_player_.preferred_clocking() == ClockingHint::Preference::None;
}

View File

@ -32,7 +32,7 @@ class Machine {
class Options: public Reflection::StructImpl<Options>, public Configurable::DisplayOption<Options> {
friend Configurable::DisplayOption<Options>;
public:
Options(Configurable::OptionsType type) : Configurable::DisplayOption<Options>(Configurable::Display::RGB) {
Options(Configurable::OptionsType) : Configurable::DisplayOption<Options>(Configurable::Display::RGB) {
if(needs_declare()) {
declare_display_option();
limit_enum(&output, Configurable::Display::RGB, Configurable::Display::CompositeColour, -1);

View File

@ -30,7 +30,7 @@ class Machine {
class Options: public Reflection::StructImpl<Options>, public Configurable::DisplayOption<Options> {
friend Configurable::DisplayOption<Options>;
public:
Options(Configurable::OptionsType type) : Configurable::DisplayOption<Options>(Configurable::Display::CompositeColour) {
Options(Configurable::OptionsType) : Configurable::DisplayOption<Options>(Configurable::Display::CompositeColour) {
if(needs_declare()) {
declare_display_option();
limit_enum(&output, Configurable::Display::CompositeMonochrome, Configurable::Display::CompositeColour, -1);

View File

@ -54,7 +54,7 @@ class Card {
no constraints, that want to be informed of every machine cycle, will receive
a call to perform_bus_operation every cycle and should use that for time keeping.
*/
virtual void run_for(Cycles half_cycles, int stretches) {}
virtual void run_for([[maybe_unused]] Cycles half_cycles, [[maybe_unused]] int stretches) {}
/// Requests a flush of any pending audio or video output.
virtual void flush() {}
@ -89,7 +89,7 @@ class Card {
}
/*! Cards may supply a target for activity observation if desired. */
virtual void set_activity_observer(Activity::Observer *observer) {}
virtual void set_activity_observer([[maybe_unused]] Activity::Observer *observer) {}
struct Delegate {
virtual void card_did_change_select_constraints(Card *card) = 0;

View File

@ -50,7 +50,7 @@ void DiskIICard::perform_bus_operation(Select select, bool is_read, uint16_t add
}
}
void DiskIICard::run_for(Cycles cycles, int stretches) {
void DiskIICard::run_for(Cycles cycles, int) {
if(diskii_clocking_preference_ == ClockingHint::Preference::None) return;
diskii_.run_for(Cycles(cycles.as_integral() * 2));
}
@ -63,7 +63,7 @@ void DiskIICard::set_activity_observer(Activity::Observer *observer) {
diskii_.set_activity_observer(observer);
}
void DiskIICard::set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference preference) {
void DiskIICard::set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference preference) {
diskii_clocking_preference_ = preference;
set_select_constraints((preference != ClockingHint::Preference::RealTime) ? (IO | Device) : None);
}

View File

@ -29,7 +29,7 @@ class BusHandler {
from auxiliary memory to @c auxiliary_target. If the machine has no axiliary memory,
it needn't write anything to auxiliary_target.
*/
void perform_read(uint16_t address, size_t count, uint8_t *base_target, uint8_t *auxiliary_target) {
void perform_read([[maybe_unused]] uint16_t address, [[maybe_unused]] size_t count, [[maybe_unused]] uint8_t *base_target, [[maybe_unused]] uint8_t *auxiliary_target) {
}
};

View File

@ -135,7 +135,7 @@ class Keyboard {
/*!
The keyboard expects ~10 µs-frequency ticks, i.e. a clock rate of just around 100 kHz.
*/
void run_for(HalfCycles cycle) {
void run_for(HalfCycles) { // TODO: honour the HalfCycles argument.
switch(mode_) {
default:
case Mode::Waiting: return;

View File

@ -183,7 +183,7 @@ template <Analyser::Static::Macintosh::Target::Model model> class ConcreteMachin
using Microcycle = CPU::MC68000::Microcycle;
forceinline HalfCycles perform_bus_operation(const Microcycle &cycle, int is_supervisor) {
forceinline HalfCycles perform_bus_operation(const Microcycle &cycle, int) {
// Advance time.
advance_time(cycle.length);
@ -490,7 +490,7 @@ template <Analyser::Static::Macintosh::Target::Model model> class ConcreteMachin
// MARK: Interrupt updates.
void did_change_interrupt_status(Zilog::SCC::z8530 *sender, bool new_status) final {
void did_change_interrupt_status(Zilog::SCC::z8530 *, bool) final {
update_interrupt_input();
}
@ -541,7 +541,7 @@ template <Analyser::Static::Macintosh::Target::Model model> class ConcreteMachin
private:
bool quickboot_ = false;
void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference clocking) final {
void set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) final {
scsi_bus_is_clocked_ = scsi_bus_.preferred_clocking() != ClockingHint::Preference::None;
}
@ -654,7 +654,7 @@ template <Analyser::Static::Macintosh::Target::Model model> class ConcreteMachin
using Port = MOS::MOS6522::Port;
using Line = MOS::MOS6522::Line;
void set_port_output(Port port, uint8_t value, uint8_t direction_mask) {
void set_port_output(Port port, uint8_t value, uint8_t) {
/*
Peripheral lines: keyboard data, interrupt configuration.
(See p176 [/215])
@ -745,7 +745,7 @@ template <Analyser::Static::Macintosh::Target::Model model> class ConcreteMachin
audio_.flush();
}
void set_interrupt_status(bool status) {
void set_interrupt_status(bool) {
machine_.update_interrupt_input();
}

View File

@ -212,7 +212,7 @@ class ConcreteMachine:
using namespace Atari2600;
Machine *Machine::Atari2600(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher) {
Machine *Machine::Atari2600(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &) {
const Target *const atari_target = dynamic_cast<const Target *>(target);
return new Atari2600::ConcreteMachine(*atari_target);
}

View File

@ -19,7 +19,7 @@ class BusExtender: public CPU::MOS6502::BusHandler {
public:
BusExtender(uint8_t *rom_base, std::size_t rom_size) : rom_base_(rom_base), rom_size_(rom_size) {}
void advance_cycles(int cycles) {}
void advance_cycles(int) {}
protected:
uint8_t *rom_base_;

View File

@ -117,7 +117,6 @@ class Pitfall2: public BusExtender {
uint16_t featcher_address_[8] = {0, 0, 0, 0, 0, 0, 0, 0};
uint8_t top_[8], bottom_[8], mask_[8] = {0, 0, 0, 0, 0, 0, 0, 0};
uint8_t music_mode_[3];
uint8_t random_number_generator_ = 0;
uint8_t *rom_ptr_;
uint8_t audio_channel_[3];

View File

@ -586,7 +586,7 @@ template<class T> void TIA::perform_motion_step(T &object) {
}
}
template<class T> void TIA::perform_border_motion(T &object, int start, int end) {
template<class T> void TIA::perform_border_motion(T &object, int, int end) {
while(object.is_moving && object.motion_time < end)
perform_motion_step<T>(object);
}

View File

@ -239,15 +239,15 @@ class TIA {
int size = 1;
const bool enqueues = false;
inline void skip_pixels(const int count, int from_horizontal_counter) {
inline void skip_pixels(const int count, int) {
pixel_position = std::max(0, pixel_position - count);
}
inline void reset_pixels(int copy) {
inline void reset_pixels(int) {
pixel_position = size;
}
inline void output_pixels(uint8_t *const target, const int count, const uint8_t collision_identity, int from_horizontal_counter) {
inline void output_pixels(uint8_t *const target, const int count, const uint8_t collision_identity, [[maybe_unused]] int from_horizontal_counter) {
int output_cursor = 0;
while(pixel_position && output_cursor < count)
{
@ -257,8 +257,8 @@ class TIA {
}
}
void dequeue_pixels(uint8_t *const target, const uint8_t collision_identity, const int time_now) {}
void enqueue_pixels(const int start, const int end, int from_horizontal_counter) {}
void dequeue_pixels([[maybe_unused]] uint8_t *const target, [[maybe_unused]] uint8_t collision_identity, [[maybe_unused]] int time_now) {}
void enqueue_pixels([[maybe_unused]] int start, [[maybe_unused]] int end, [[maybe_unused]] int from_horizontal_counter) {}
};
// missile state

View File

@ -529,7 +529,7 @@ class ConcreteMachine:
bool keyboard_needs_clock_ = false;
bool mfp_is_realtime_ = false;
ClockingHint::Preference dma_clocking_preference_ = ClockingHint::Preference::None;
void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference clocking) final {
void set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) final {
// This is being called by one of the components; avoid any time flushing here as that's
// already dealt with (and, just to be absolutely sure, to avoid recursive mania).
may_defer_acias_ =
@ -580,7 +580,7 @@ class ConcreteMachine:
}
// MARK - MFP input.
void mfp68901_did_change_interrupt_status(Motorola::MFP68901::MFP68901 *mfp) final {
void mfp68901_did_change_interrupt_status(Motorola::MFP68901::MFP68901 *) final {
update_interrupt_input();
}

View File

@ -39,7 +39,7 @@ namespace C1540 {
/*!
Provides an emulation of the C1540.
*/
class Machine: public MachineBase {
class Machine final: public MachineBase {
public:
Machine(Personality personality, const ROMMachine::ROMFetcher &rom_fetcher);

View File

@ -122,7 +122,7 @@ void MachineBase::set_activity_observer(Activity::Observer *observer) {
// MARK: - 6522 delegate
void MachineBase::mos6522_did_change_interrupt_status(void *mos6522) {
void MachineBase::mos6522_did_change_interrupt_status(void *) {
// both VIAs are connected to the IRQ line
m6502_.set_irq_line(serial_port_VIA_.get_interrupt_line() || drive_VIA_.get_interrupt_line());
}
@ -153,11 +153,11 @@ void MachineBase::process_index_hole() {}
// MARK: - Drive VIA delegate
void MachineBase::drive_via_did_step_head(void *driveVIA, int direction) {
void MachineBase::drive_via_did_step_head(void *, int direction) {
get_drive().step(Storage::Disk::HeadPosition(direction, 2));
}
void MachineBase::drive_via_did_set_data_density(void *driveVIA, int density) {
void MachineBase::drive_via_did_set_data_density(void *, int density) {
set_expected_bit_length(Storage::Encodings::CommodoreGCR::length_of_a_bit_in_time_zone(unsigned(density)));
}
@ -170,7 +170,7 @@ uint8_t SerialPortVIA::get_port_input(MOS::MOS6522::Port port) {
return 0xff;
}
void SerialPortVIA::set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t mask) {
void SerialPortVIA::set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t) {
if(port) {
std::shared_ptr<::Commodore::Serial::Port> serialPort = serial_port_.lock();
if(serialPort) {
@ -243,7 +243,7 @@ void DriveVIA::set_control_line_output(MOS::MOS6522::Port port, MOS::MOS6522::Li
}
}
void DriveVIA::set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t direction_mask) {
void DriveVIA::set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t) {
if(port) {
if(previous_port_b_output_ != value) {
// record drive motor state

View File

@ -75,6 +75,7 @@ namespace Serial {
class Port {
public:
Port() : line_levels_{High, High, High, High, High} {}
virtual ~Port() {}
/*!
Sets the current level of an output line on this serial port.

View File

@ -99,7 +99,7 @@ class UserPortVIA: public MOS::MOS6522::IRQDelegatePortHandler {
}
/// Receives announcements from the 6522 of user-port output, which might affect what's currently being presented onto the serial bus.
void set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t mask) {
void set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t) {
// Line 7 of port A is inverted and output as serial ATN.
if(!port) {
std::shared_ptr<::Commodore::Serial::Port> serialPort = serial_port_.lock();
@ -654,7 +654,7 @@ class ConcreteMachine:
return mos6560_.get_speaker();
}
void mos6522_did_change_interrupt_status(void *mos6522) final {
void mos6522_did_change_interrupt_status(void *) final {
m6502_.set_nmi_line(user_port_via_.get_interrupt_line());
m6502_.set_irq_line(keyboard_via_.get_interrupt_line());
}
@ -691,7 +691,7 @@ class ConcreteMachine:
set_use_fast_tape();
}
void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference clocking) final {
void set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference clocking) final {
tape_is_sleeping_ = clocking == ClockingHint::Preference::None;
set_use_fast_tape();
}

View File

@ -421,7 +421,7 @@ class ConcreteMachine:
m6502_.run_for(cycles);
}
void tape_did_change_interrupt_status(Tape *tape) final {
void tape_did_change_interrupt_status(Tape *) final {
interrupt_status_ = (interrupt_status_ & ~(Interrupt::TransmitDataEmpty | Interrupt::ReceiveDataFull | Interrupt::HighToneDetect)) | tape_.get_interrupt_status();
evaluate_interrupts();
}

View File

@ -14,7 +14,7 @@
namespace Electron {
class Plus3 : public WD::WD1770 {
class Plus3 final : public WD::WD1770 {
public:
Plus3();
@ -26,7 +26,7 @@ class Plus3 : public WD::WD1770 {
void set_control_register(uint8_t control, uint8_t changes);
uint8_t last_control_ = 0;
void set_motor_on(bool on);
void set_motor_on(bool on) override;
std::string drive_name(size_t drive);
};

View File

@ -26,7 +26,7 @@ struct KeyActions {
Indicates that the key @c key has been either pressed or released, according to
the state of @c isPressed.
*/
virtual void set_key_state(uint16_t key, bool is_pressed) {}
virtual void set_key_state([[maybe_unused]] uint16_t key, [[maybe_unused]] bool is_pressed) {}
/*!
Instructs that all keys should now be treated as released.
@ -49,7 +49,7 @@ class KeyboardMachine: public KeyActions {
/*!
@returns @c true if this machine can type the character @c c as part of a @c type_string; @c false otherwise.
*/
virtual bool can_type(char c) const { return false; }
virtual bool can_type([[maybe_unused]] char c) const { return false; }
/*!
Provides a destination for keyboard input.

View File

@ -17,14 +17,14 @@ DiskROM::DiskROM(const std::vector<uint8_t> &rom) :
set_is_double_density(true);
}
void DiskROM::write(uint16_t address, uint8_t value, bool pc_is_outside_bios) {
void DiskROM::write(uint16_t address, uint8_t value, bool) {
switch(address) {
case 0x7ff8: case 0x7ff9: case 0x7ffa: case 0x7ffb:
WD::WD1770::write(address, value);
break;
case 0x7ffc: {
const int selected_head = value & 1;
for_all_drives([selected_head] (Storage::Disk::Drive &drive, size_t index) {
for_all_drives([selected_head] (Storage::Disk::Drive &drive, size_t) {
drive.set_head(selected_head);
});
} break;
@ -32,7 +32,7 @@ void DiskROM::write(uint16_t address, uint8_t value, bool pc_is_outside_bios) {
set_drive(1 << (value & 1));
const bool drive_motor = value & 0x80;
for_all_drives([drive_motor] (Storage::Disk::Drive &drive, size_t index) {
for_all_drives([drive_motor] (Storage::Disk::Drive &drive, size_t) {
drive.set_motor_on(drive_motor);
});
} break;

View File

@ -662,7 +662,7 @@ class ConcreteMachine:
}
// MARK: - Sleeper
void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference clocking) final {
void set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) final {
tape_player_is_sleeping_ = tape_player_.preferred_clocking() == ClockingHint::Preference::None;
set_use_fast_tape();
}

View File

@ -47,13 +47,13 @@ class ROMSlotHandler {
virtual ~ROMSlotHandler() {}
/*! Advances time by @c half_cycles. */
virtual void run_for(HalfCycles half_cycles) {}
virtual void run_for([[maybe_unused]] HalfCycles half_cycles) {}
/*! Announces an attempt to write @c value to @c address. */
virtual void write(uint16_t address, uint8_t value, bool pc_is_outside_bios) = 0;
/*! Seeks the result of a read at @c address; this is used only if the area is unmapped. */
virtual uint8_t read(uint16_t address) { return 0xff; }
virtual uint8_t read([[maybe_unused]] uint16_t address) { return 0xff; }
enum class WrappingStrategy {
/// Repeat causes all accesses to be modulo the size of the ROM.

View File

@ -155,7 +155,7 @@ class VIAPortHandler: public MOS::MOS6522::IRQDelegatePortHandler {
Reponds to changes in the 6522's port output. On an Oric port B sets the tape motor control
and the keyboard's active row. Port A is connected to the AY's data bus.
*/
void set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t direction_mask) {
void set_port_output(MOS::MOS6522::Port port, uint8_t value, uint8_t) {
if(port) {
keyboard_.set_active_row(value);
tape_player_.set_motor_control(value & 0x40);
@ -568,7 +568,7 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
}
// to satisfy MOS::MOS6522IRQDelegate::Delegate
void mos6522_did_change_interrupt_status(void *mos6522) final {
void mos6522_did_change_interrupt_status(void *) final {
set_interrupt_line();
}
@ -608,7 +608,7 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
}
// WD::WD1770::Delegate
void wd1770_did_change_output(WD::WD1770 *wd1770) final {
void wd1770_did_change_output(WD::WD1770 *) final {
set_interrupt_line();
}
@ -648,7 +648,7 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
}
}
void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference preference) final {
void set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) final {
diskii_clocking_preference_ = diskii_.preferred_clocking();
}

View File

@ -91,7 +91,7 @@ class ScanProducer {
/*!
Sets the display type.
*/
virtual void set_display_type(Outputs::Display::DisplayType display_type) {}
virtual void set_display_type(Outputs::Display::DisplayType) {}
/*!
Gets the display type.

View File

@ -38,7 +38,7 @@ class CharacterMapper {
/// that may not be necessary — it'll often depends on whether the machine needs time to
/// observe a modifier like shift before it sees the actual keypress.
/// @returns @c true if the typer should pause after forwarding @c key; @c false otherwise.
virtual bool needs_pause_after_key(uint16_t key) const { return true; }
virtual bool needs_pause_after_key([[maybe_unused]] uint16_t key) const { return true; }
protected:
typedef uint16_t KeySequence[16];
@ -127,7 +127,7 @@ class TypeRecipient: public Typer::Delegate {
Provided in order to conform to that part of the Typer::Delegate interface that goes above and
beyond KeyboardMachine::Machine; responds to the end of typing by clearing all keys.
*/
void typer_reset(Typer *typer) {
void typer_reset(Typer *) override {
clear_all_keys();
// It's unsafe to deallocate typer right now, since it is the caller, but also it has a small

View File

@ -31,6 +31,7 @@ class Video {
/// Advances time by @c half-cycles.
void run_for(const HalfCycles);
/// Forces output to catch up to the current output position.
void flush();

View File

@ -8,12 +8,10 @@
#import "NSData+CRC32.h"
#include <zlib.h>
@implementation NSData (StdVector)
- (NSNumber *)crc32 {
return @(crc32(crc32(0, Z_NULL, 0), self.bytes, (uInt)self.length));
return @(crc32(crc32(0, Z_NULL, 0), self.bytes, (uInt)self.length));
}
@end

View File

@ -23,7 +23,7 @@
}
- (void)setUp {
_machine = std::make_unique<RAM68000>();
_machine = std::make_unique<RAM68000>();
}
- (void)tearDown {
@ -1137,7 +1137,7 @@
- (void)testMULU_Imm {
self.machine->set_program({
0xc4fc, 0xffff // MULU.W #$ffff, D2
0xc4fc, 0xffff // MULU.W #$ffff, D2
});
auto state = self.machine->get_processor_state();
state.data[2] = 0xffff;

View File

@ -19,7 +19,7 @@
}
- (void)setUp {
_machine = std::make_unique<RAM68000>();
_machine = std::make_unique<RAM68000>();
}
- (void)tearDown {

View File

@ -19,7 +19,7 @@
}
- (void)setUp {
_machine = std::make_unique<RAM68000>();
_machine = std::make_unique<RAM68000>();
}
- (void)tearDown {

View File

@ -20,7 +20,7 @@
}
- (void)setUp {
_machine = std::make_unique<RAM68000>();
_machine = std::make_unique<RAM68000>();
}
- (void)tearDown {

View File

@ -19,7 +19,7 @@
}
- (void)setUp {
_machine = std::make_unique<RAM68000>();
_machine = std::make_unique<RAM68000>();
}
- (void)tearDown {

View File

@ -20,7 +20,7 @@
}
- (void)setUp {
_machine = std::make_unique<RAM68000>();
_machine = std::make_unique<RAM68000>();
}
- (void)tearDown {

View File

@ -110,7 +110,7 @@ class CPU::MC68000::ProcessorStorageTests {
}
- (void)setUp {
_machine = std::make_unique<RAM68000>();
_machine = std::make_unique<RAM68000>();
}
- (void)tearDown {

View File

@ -105,15 +105,15 @@ class EmuTOS: public ComparativeBusHandler {
- (void)testImage:(NSString *)image trace:(NSString *)trace length:(int)length {
const std::vector<ROMMachine::ROM> rom_names = {{"AtariST", "", image.UTF8String, 0, 0 }};
const auto roms = CSROMFetcher()(rom_names);
const auto roms = CSROMFetcher()(rom_names);
NSString *const traceLocation = [[NSBundle bundleForClass:[self class]] pathForResource:trace ofType:@"trace.txt.gz"];
_machine = std::make_unique<EmuTOS>(*roms[0], traceLocation.UTF8String);
_machine->run_for(HalfCycles(length));
_machine = std::make_unique<EmuTOS>(*roms[0], traceLocation.UTF8String);
_machine->run_for(HalfCycles(length));
}
- (void)testEmuTOSStartup {
[self testImage:@"etos192uk.img" trace:@"etos192uk" length:313490];
// TODO: assert that machine is now STOPped.
// TODO: assert that machine is now STOPped.
}
- (void)testTOSStartup {

View File

@ -0,0 +1,143 @@
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++17
# Permit multiple source files in different directories to have the same file name.
CONFIG += object_parallel_to_source
# Ensure ZLib is linked against.
INCLUDEPATH += $$[QT_INSTALL_PREFIX]/src/3rdparty/zlib
LIBS += -lz
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
../../Analyser/Dynamic/*.cpp \
../../Analyser/Dynamic/MultiMachine/*.cpp \
../../Analyser/Dynamic/MultiMachine/Implementation/*.cpp \
\
../../Analyser/Static/*.cpp \
../../Analyser/Static/Acorn/*.cpp \
../../Analyser/Static/AmstradCPC/*.cpp \
../../Analyser/Static/AppleII/*.cpp \
../../Analyser/Static/Atari2600/*.cpp \
../../Analyser/Static/AtariST/*.cpp \
../../Analyser/Static/Coleco/*.cpp \
../../Analyser/Static/Commodore/*.cpp \
../../Analyser/Static/Disassembler/*.cpp \
../../Analyser/Static/DiskII/*.cpp \
../../Analyser/Static/Macintosh/*.cpp \
../../Analyser/Static/MSX/*.cpp \
../../Analyser/Static/Oric/*.cpp \
../../Analyser/Static/Sega/*.cpp \
../../Analyser/Static/ZX8081/*.cpp \
\
../../Components/1770/*.cpp \
../../Components/5380/*.cpp \
../../Components/6522/Implementation/*.cpp \
../../Components/6560/*.cpp \
../../Components/6850/*.cpp \
../../Components/68901/*.cpp \
../../Components/8272/*.cpp \
../../Components/8530/*.cpp \
../../Components/9918/*.cpp \
../../Components/AudioToggle/*.cpp \
../../Components/AY38910/*.cpp \
../../Components/DiskII/*.cpp \
../../Components/KonamiSCC/*.cpp \
../../Components/OPx/*.cpp \
../../Components/SN76489/*.cpp \
../../Components/Serial/*.cpp \
\
../../Concurrency/*.cpp \
\
../../Inputs/*.cpp \
\
../../Machines/*.cpp \
../../Machines/AmstradCPC/*.cpp \
../../Machines/Apple/AppleII/*.cpp \
../../Machines/Apple/Macintosh/*.cpp \
../../Machines/Atari/2600/*.cpp \
../../Machines/Atari/ST/*.cpp \
../../Machines/ColecoVision/*.cpp \
../../Machines/Commodore/*.cpp \
../../Machines/Commodore/1540/Implementation/*.cpp \
../../Machines/Commodore/Vic-20/*.cpp \
../../Machines/Electron/*.cpp \
../../Machines/MasterSystem/*.cpp \
../../Machines/MSX/*.cpp \
../../Machines/Oric/*.cpp \
../../Machines/Utility/*.cpp \
../../Machines/ZX8081/*.cpp \
\
../../Outputs/*.cpp \
../../Outputs/CRT/*.cpp \
../../Outputs/OpenGL/*.cpp \
../../Outputs/OpenGL/Primitives/*.cpp \
\
../../Processors/6502/Implementation/*.cpp \
../../Processors/6502/State/*.cpp \
../../Processors/68000/Implementation/*.cpp \
../../Processors/68000/State/*.cpp \
../../Processors/Z80/Implementation/*.cpp \
../../Processors/Z80/State/*.cpp \
\
../../Reflection/*.cpp \
\
../../SignalProcessing/*.cpp \
\
../../Storage/*.cpp \
../../Storage/Cartridge/*.cpp \
../../Storage/Cartridge/Encodings/*.cpp \
../../Storage/Cartridge/Formats/*.cpp \
../../Storage/Data/*.cpp \
../../Storage/Disk/*.cpp \
../../Storage/Disk/Controller/*.cpp \
../../Storage/Disk/DiskImage/Formats/*.cpp \
../../Storage/Disk/DiskImage/Formats/Utility/*.cpp \
../../Storage/Disk/Encodings/*.cpp \
../../Storage/Disk/Encodings/AppleGCR/*.cpp \
../../Storage/Disk/Encodings/MFM/*.cpp \
../../Storage/Disk/Parsers/*.cpp \
../../Storage/Disk/Track/*.cpp \
../../Storage/MassStorage/*.cpp \
../../Storage/MassStorage/Encodings/*.cpp \
../../Storage/MassStorage/Formats/*.cpp \
../../Storage/MassStorage/SCSI/*.cpp \
../../Storage/Tape/*.cpp \
../../Storage/Tape/Formats/*.cpp \
../../Storage/Tape/Parsers/*.cpp \
\
main.cpp \
mainwindow.cpp
HEADERS += \
../../Activity/*.hpp \
../../Analyser/*.hpp \
../../Analyser/Dynamic/*.hpp \
../../Analyser/Dynamic/MultiMachine/*.hpp \
../../Analyser/Dynamic/MultiMachine/Implementation/*.hpp \
../../ClockReceiver/*.hpp \
mainwindow.h
FORMS += \
mainwindow.ui
TRANSLATIONS += \
ClockSignal_en_GB.ts
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ClockSignal_en_GB"></TS>

11
OSBindings/Qt/main.cpp Normal file
View File

@ -0,0 +1,11 @@
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}

View File

@ -0,0 +1,15 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}

View File

@ -0,0 +1,21 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget"/>
<widget class="QMenuBar" name="menubar"/>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -123,7 +123,7 @@ class CRT {
bool should_alternate,
Outputs::Display::InputDataType data_type);
/*! Constructs a monitor-style CRT — one that will take only an RGB or monochrome signal, and therefore has
/*! Constructs a monitor-style CRT — one that will take only an RGB or monochrome signal, and therefore has
no colour space or colour subcarrier frequency. This monitor will automatically map colour bursts to the black level.
*/
CRT(int cycles_per_line,
@ -319,7 +319,7 @@ template <typename Receiver> class CRTFrequencyMismatchWarner: public Outputs::C
public:
CRTFrequencyMismatchWarner(Receiver &receiver) : receiver_(receiver) {}
void crt_did_end_batch_of_frames(Outputs::CRT::CRT *crt, int number_of_frames, int number_of_unexpected_vertical_syncs) final {
void crt_did_end_batch_of_frames(Outputs::CRT::CRT *, int number_of_frames, int number_of_unexpected_vertical_syncs) final {
frame_records_[frame_record_pointer_ % frame_records_.size()].number_of_frames = number_of_frames;
frame_records_[frame_record_pointer_ % frame_records_.size()].number_of_unexpected_vertical_syncs = number_of_unexpected_vertical_syncs;
++frame_record_pointer_;

View File

@ -45,7 +45,7 @@ constexpr GLenum AccumulationTextureUnit = GL_TEXTURE3;
#define TextureAddressGetX(v) uint16_t((v) & 0x7ff)
#define TextureSub(a, b) (((a) - (b)) & 0x3fffff)
const GLint internalFormatForDepth(std::size_t depth) {
constexpr GLint internalFormatForDepth(std::size_t depth) {
switch(depth) {
default: return GL_FALSE;
case 1: return GL_R8UI;
@ -55,7 +55,7 @@ const GLint internalFormatForDepth(std::size_t depth) {
}
}
const GLenum formatForDepth(std::size_t depth) {
constexpr GLenum formatForDepth(std::size_t depth) {
switch(depth) {
default: return GL_FALSE;
case 1: return GL_RED_INTEGER;
@ -408,7 +408,7 @@ bool ScanTarget::is_soft_display_type() {
return modals_.display_type == DisplayType::CompositeColour || modals_.display_type == DisplayType::CompositeMonochrome;
}
void ScanTarget::update(int output_width, int output_height) {
void ScanTarget::update(int, int output_height) {
if(fence_ != nullptr) {
// if the GPU is still busy, don't wait; we'll catch it next time
if(glClientWaitSync(fence_, GL_SYNC_FLUSH_COMMANDS_BIT, 0) == GL_TIMEOUT_EXPIRED) {

View File

@ -56,7 +56,7 @@ void ScanTarget::set_uniforms(ShaderType type, Shader &target) const {
}
}
void ScanTarget::set_sampling_window(int output_width, int output_height, Shader &target) {
void ScanTarget::set_sampling_window(int output_width, int, Shader &target) {
if(modals_.display_type != DisplayType::CompositeColour) {
const float one_pixel_width = float(modals_.cycles_per_line) * modals_.visible_area.size.width / float(output_width);
const float clocks_per_angle = float(modals_.cycles_per_line) * float(modals_.colour_cycle_denominator) / float(modals_.colour_cycle_numerator);

View File

@ -267,7 +267,7 @@ struct ScanTarget {
/// and indicates that its actual final size was @c actual_length.
///
/// It is required that every call to begin_data be paired with a call to end_data.
virtual void end_data(size_t actual_length) {}
virtual void end_data([[maybe_unused]] size_t actual_length) {}
/// Tells the scan target that its owner is about to change; this is a hint that existing
/// data and scan allocations should be invalidated.
@ -318,7 +318,7 @@ struct ScanTarget {
@param location The location of the event.
@param composite_amplitude The amplitude of the colour burst on this line (0, if no colour burst was found).
*/
virtual void announce(Event event, bool is_visible, const Scan::EndPoint &location, uint8_t composite_amplitude) {}
virtual void announce([[maybe_unused]] Event event, [[maybe_unused]] bool is_visible, [[maybe_unused]] const Scan::EndPoint &location, [[maybe_unused]] uint8_t composite_amplitude) {}
};
struct ScanStatus {
@ -373,10 +373,10 @@ struct ScanStatus {
Provides a null target for scans.
*/
struct NullScanTarget: public ScanTarget {
void set_modals(Modals) {}
Scan *begin_scan() { return nullptr; }
uint8_t *begin_data(size_t required_length, size_t required_alignment = 1) { return nullptr; }
void submit() {}
void set_modals(Modals) override {}
Scan *begin_scan() override { return nullptr; }
uint8_t *begin_data(size_t, size_t) override { return nullptr; }
void submit() override {}
static NullScanTarget singleton;
};

View File

@ -86,7 +86,7 @@ template <typename... T> class CompoundSource:
std::memset(target, 0, sizeof(std::int16_t) * number_of_samples);
}
void set_scaled_volume_range(int16_t range, double *volumes, double scale) {}
void set_scaled_volume_range(int16_t, double *, double) {}
static constexpr std::size_t size() {
return 0;

View File

@ -65,7 +65,7 @@ template <typename SampleSource> class LowpassSpeaker: public Speaker {
}
// Implemented as per Speaker.
void set_computed_output_rate(float cycles_per_second, int buffer_size, bool stereo) final {
void set_computed_output_rate(float cycles_per_second, int buffer_size, bool) final {
std::lock_guard<std::mutex> lock_guard(filter_parameters_mutex_);
if(filter_parameters_.output_cycles_per_second == cycles_per_second && size_t(buffer_size) == output_buffer_.size()) {
return;

View File

@ -25,7 +25,7 @@ class SampleSource {
/*!
Should write the next @c number_of_samples to @c target.
*/
void get_samples(std::size_t number_of_samples, std::int16_t *target) {}
void get_samples([[maybe_unused]] std::size_t number_of_samples, [[maybe_unused]] std::int16_t *target) {}
/*!
Should skip the next @c number_of_samples. Subclasses of this SampleSource
@ -51,7 +51,7 @@ class SampleSource {
Sets the proper output range for this sample source; it should write values
between 0 and volume.
*/
void set_sample_volume_range(std::int16_t volume) {}
void set_sample_volume_range([[maybe_unused]] std::int16_t volume) {}
/*!
Indicates whether this component will write stereo samples.

View File

@ -76,7 +76,7 @@ class Speaker {
Provides the delegate with a hint that the input clock rate has changed, which provides an opportunity to
renegotiate the ideal clock rate, if desired.
*/
virtual void speaker_did_change_input_clock(Speaker *speaker) {}
virtual void speaker_did_change_input_clock([[maybe_unused]] Speaker *speaker) {}
};
virtual void set_delegate(Delegate *delegate) {
delegate_ = delegate;
@ -87,7 +87,7 @@ class Speaker {
virtual void set_computed_output_rate(float cycles_per_second, int buffer_size, bool stereo) = 0;
protected:
void did_complete_samples(Speaker *speaker, const std::vector<int16_t> &buffer, bool is_stereo) {
void did_complete_samples(Speaker *, const std::vector<int16_t> &buffer, bool is_stereo) {
// Test the delegate for existence again, as it may have changed.
const auto delegate = delegate_.load();
if(!delegate) return;

View File

@ -107,7 +107,7 @@ class BusHandler {
during some periods; one way to simulate that is to have the bus handler return a number other than
Cycles(1) to describe lengthened bus cycles.
*/
Cycles perform_bus_operation(CPU::MOS6502::BusOperation operation, uint16_t address, uint8_t *value) {
Cycles perform_bus_operation([[maybe_unused]] CPU::MOS6502::BusOperation operation, [[maybe_unused]] uint16_t address, [[maybe_unused]] uint8_t *value) {
return Cycles(1);
}

View File

@ -99,7 +99,7 @@ struct Microcycle {
HalfCycles length = HalfCycles(4);
/*!
For expediency, this provides a full 32-bit byte-resolution address  e.g.
For expediency, this provides a full 32-bit byte-resolution address e.g.
if reading indirectly via an address register, this will indicate the full
value of the address register.
@ -334,7 +334,7 @@ class BusHandler {
FC0 and FC1 are provided inside the microcycle as the IsData and IsProgram
flags; FC2 is provided here as is_supervisor it'll be either 0 or 1.
*/
HalfCycles perform_bus_operation(const Microcycle &cycle, int is_supervisor) {
HalfCycles perform_bus_operation([[maybe_unused]] const Microcycle &cycle, [[maybe_unused]] int is_supervisor) {
return HalfCycles(0);
}
@ -343,7 +343,7 @@ class BusHandler {
/*!
Provides information about the path of execution if enabled via the template.
*/
void will_perform(uint32_t address, uint16_t opcode) {}
void will_perform([[maybe_unused]] uint32_t address, [[maybe_unused]] uint16_t opcode) {}
};
#include "Implementation/68000Storage.hpp"

View File

@ -369,11 +369,11 @@ class ProcessorStorage {
/// b4-b6 = destination address register.
uint8_t source_dest = 0;
void set_source_address(ProcessorStorage &storage, int index) {
void set_source_address([[maybe_unused]] ProcessorStorage &storage, int index) {
source_dest = uint8_t((source_dest & 0x0f) | (index << 4));
}
void set_destination_address(ProcessorStorage &storage, int index) {
void set_destination_address([[maybe_unused]] ProcessorStorage &storage, int index) {
source_dest = uint8_t((source_dest & 0xf0) | index);
}

View File

@ -110,10 +110,10 @@ class ProcessorStorage {
/// Resets: IFF1, IFF2, interrupt mode, the PC, I and R; sets all flags, the SP to 0xffff and a_ to 0xff.
Reset
};
Type type;
Type type = Type::Reset;
void *source = nullptr;
void *destination = nullptr;
PartialMachineCycle machine_cycle;
PartialMachineCycle machine_cycle{};
};
struct InstructionPage {
@ -121,10 +121,8 @@ class ProcessorStorage {
std::vector<MicroOp> all_operations;
std::vector<MicroOp> fetch_decode_execute;
MicroOp *fetch_decode_execute_data = nullptr;
uint8_t r_step;
bool is_indexed;
InstructionPage() : r_step(1), is_indexed(false) {}
uint8_t r_step = 1;
bool is_indexed = false;
};
ProcessorStorage();
@ -230,6 +228,6 @@ class ProcessorStorage {
void assemble_cb_page(InstructionPage &target, RegisterPair16 &index, bool add_offsets);
void assemble_base_page(InstructionPage &target, RegisterPair16 &index, bool add_offsets, InstructionPage &cb_page);
// Allos state objects to capture and apply state.
friend class State;
// Allow state objects to capture and apply state.
friend struct State;
};

View File

@ -94,15 +94,15 @@ struct PartialMachineCycle {
InterruptStart,
};
/// The operation being carried out by the Z80. See the various getters below for better classification.
const Operation operation;
const Operation operation = Operation::Internal;
/// The length of this operation.
const HalfCycles length;
/// The current value of the address bus.
const uint16_t *const address;
const uint16_t *const address = nullptr;
/// If the Z80 is outputting to the data bus, a pointer to that value. Otherwise, a pointer to the location where the current data bus value should be placed.
uint8_t *const value;
uint8_t *const value = nullptr;
/// @c true if this operation is occurring only because of an external request; @c false otherwise.
const bool was_requested;
const bool was_requested = false;
/*!
@returns @c true if the processor believes that the bus handler should actually do something with
@ -145,7 +145,7 @@ class BusHandler {
during some periods or may impose wait states so predictably that it's more efficient just to add them
via this mechanism.
*/
HalfCycles perform_machine_cycle(const PartialMachineCycle &cycle) {
HalfCycles perform_machine_cycle([[maybe_unused]] const PartialMachineCycle &cycle) {
return HalfCycles(0);
}

View File

@ -99,7 +99,7 @@ template <> bool Reflection::set(Struct &target, const std::string &name, double
}
template <> bool Reflection::set(Struct &target, const std::string &name, int value, size_t offset) {
return set<int64_t>(target, name, value);
return set<int64_t>(target, name, value, offset);
}
template <> bool Reflection::set(Struct &target, const std::string &name, int64_t value, size_t offset) {
@ -153,7 +153,7 @@ template <> bool Reflection::set(Struct &target, const std::string &name, const
template <> bool Reflection::set(Struct &target, const std::string &name, const char *value, size_t offset) {
const std::string string(value);
return set<const std::string &>(target, name, string);
return set<const std::string &>(target, name, string, offset);
}
template <> bool Reflection::set(Struct &target, const std::string &name, bool value, size_t offset) {
@ -529,10 +529,10 @@ struct ArrayReceiver: public Reflection::Struct {
target_(target), type_(type), key_(key), count_(count) {}
std::vector<std::string> all_keys() const final { return {}; }
const std::type_info *type_of(const std::string &name) const final { return type_; }
size_t count_of(const std::string &name) const final { return 0; }
const std::type_info *type_of(const std::string &) const final { return type_; }
size_t count_of(const std::string &) const final { return 0; }
void set(const std::string &name, const void *value, size_t offset) final {
void set(const std::string &name, const void *value, size_t) final {
const auto index = size_t(std::stoi(name));
if(index >= count_) {
return;
@ -540,11 +540,11 @@ struct ArrayReceiver: public Reflection::Struct {
target_->set(key_, value, index);
}
virtual std::vector<std::string> values_for(const std::string &name) const final {
virtual std::vector<std::string> values_for(const std::string &) const final {
return {};
}
void *get(const std::string &name) final {
void *get(const std::string &) final {
return nullptr;
}

View File

@ -71,7 +71,7 @@ struct Struct {
/*!
Called to determine whether @c key should be included in the serialisation of this struct.
*/
virtual bool should_serialise(const std::string &key) const { return true; }
virtual bool should_serialise([[maybe_unused]] const std::string &key) const { return true; }
private:
void append(std::ostringstream &stream, const std::string &key, const std::type_info *type, size_t offset) const;

View File

@ -9,7 +9,10 @@
#ifndef FIRFilter_hpp
#define FIRFilter_hpp
#ifdef __APPLE__
// Use the Accelerate framework to vectorise, unless this is a Qt build.
// Primarily that avoids gymnastics in the QMake file; it also eliminates
// a difference in the Qt build across platforms.
#if defined(__APPLE__) && !defined(QT_VERSION)
#include <Accelerate/Accelerate.h>
#define USE_ACCELERATE
#endif

View File

@ -20,7 +20,7 @@ Controller::Controller(Cycles clock_rate) :
set_expected_bit_length(Time(1));
}
void Controller::set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference clocking) {
void Controller::set_component_prefers_clocking(ClockingHint::Source *, ClockingHint::Preference) {
update_clocking_observer();
}

View File

@ -56,7 +56,7 @@ class DiskImage {
/*!
Replaces the Tracks indicated by the map, that maps from physical address to track content.
*/
virtual void set_tracks(const std::map<Track::Address, std::shared_ptr<Track>> &tracks) {}
virtual void set_tracks(const std::map<Track::Address, std::shared_ptr<Track>> &) {}
/*!
Communicates that it is likely to be a while before any more tracks are written.

View File

@ -35,7 +35,7 @@ class Drive: public ClockingHint::Source, public TimedEventLoop {
Drive(int input_clock_rate, int revolutions_per_minute, int number_of_heads, ReadyType rdy_type = ReadyType::ShugartRDY);
Drive(int input_clock_rate, int number_of_heads, ReadyType rdy_type = ReadyType::ShugartRDY);
~Drive();
virtual ~Drive();
/*!
Replaces whatever is in the drive with @c disk. Supply @c nullptr to eject any current disk and leave none inserted.
@ -145,7 +145,7 @@ class Drive: public ClockingHint::Source, public TimedEventLoop {
virtual void process_write_completed() {}
/// Informs the delegate of the passing of @c cycles.
virtual void advance(const Cycles cycles) {}
virtual void advance([[maybe_unused]] Cycles cycles) {}
};
/// Sets the current event delegate.
@ -183,7 +183,7 @@ class Drive: public ClockingHint::Source, public TimedEventLoop {
/*!
Announces the result of a step.
*/
virtual void did_step(HeadPosition to_position) {}
virtual void did_step([[maybe_unused]] HeadPosition to_position) {}
/*!
Announces new media installation.

View File

@ -52,7 +52,7 @@ class MassStorageDevice {
/*!
Sets new contents for the block at @c address.
*/
virtual void set_block(size_t address, const std::vector<uint8_t> &) {}
virtual void set_block([[maybe_unused]] size_t address, const std::vector<uint8_t> &) {}
};
}

View File

@ -135,8 +135,8 @@ struct Responder {
Terminates a SCSI command, sending the proper sequence of status and message phases.
*/
void terminate_command(Status status) {
send_status(status, [] (const Target::CommandState &state, Target::Responder &responder) {
responder.send_message(Target::Responder::Message::CommandComplete, [] (const Target::CommandState &state, Target::Responder &responder) {
send_status(status, [] (const Target::CommandState &, Target::Responder &responder) {
responder.send_message(Target::Responder::Message::CommandComplete, [] (const Target::CommandState &, Target::Responder &responder) {
responder.end_command();
});
});
@ -191,7 +191,7 @@ struct Executor {
if(specs.allocated_bytes < response.size()) {
response.resize(specs.allocated_bytes);
}
responder.send_data(std::move(response), [] (const Target::CommandState &state, Target::Responder &responder) {
responder.send_data(std::move(response), [] (const Target::CommandState &, Target::Responder &responder) {
responder.terminate_command(Target::Responder::Status::Good);
});
@ -201,7 +201,7 @@ struct Executor {
bool mode_select(const CommandState &state, Responder &responder) {
const auto specs = state.mode_select_specs();
responder.receive_data(specs.parameter_list_length, [] (const Target::CommandState &state, Target::Responder &responder) {
responder.receive_data(specs.parameter_list_length, [] (const Target::CommandState &, Target::Responder &responder) {
// TODO: parse data according to current sense mode.
responder.terminate_command(Target::Responder::Status::Good);
});
@ -295,7 +295,7 @@ struct Executor {
response.resize(allocated_bytes);
}
responder.send_data(std::move(response), [] (const Target::CommandState &state, Target::Responder &responder) {
responder.send_data(std::move(response), [] (const Target::CommandState &, Target::Responder &responder) {
responder.terminate_command(Target::Responder::Status::Good);
});

View File

@ -86,7 +86,7 @@ CSW::CSW(const std::string &file_name) :
invert_pulse();
}
CSW::CSW(const std::vector<uint8_t> &&data, CompressionType compression_type, bool initial_level, uint32_t sampling_rate) {
CSW::CSW(const std::vector<uint8_t> &&data, CompressionType compression_type, bool initial_level, uint32_t sampling_rate) : compression_type_(compression_type) {
pulse_.length.clock_rate = sampling_rate;
pulse_.type = initial_level ? Pulse::High : Pulse::Low;
source_data_ = std::move(data);

View File

@ -69,7 +69,6 @@ Shifter::Shifter() :
pll_(PLLClockRate / 4800, *this),
was_high_(false),
input_pattern_(0),
input_bit_counter_(0),
delegate_(nullptr) {}
void Shifter::process_pulse(const Storage::Tape::Tape::Pulse &pulse) {

View File

@ -38,7 +38,6 @@ class Shifter {
bool was_high_;
unsigned int input_pattern_;
unsigned int input_bit_counter_;
Delegate *delegate_;
};

View File

@ -134,7 +134,7 @@ bool BinaryTapePlayer::get_motor_control() const {
return motor_is_running_;
}
void BinaryTapePlayer::set_tape_output(bool set) {
void BinaryTapePlayer::set_tape_output(bool) {
// TODO
}

View File

@ -98,6 +98,7 @@ class Tape {
class TapePlayer: public TimedEventLoop, public ClockingHint::Source {
public:
TapePlayer(int input_clock_rate);
virtual ~TapePlayer() {}
void set_tape(std::shared_ptr<Storage::Tape::Tape> tape);
bool has_tape();

View File

@ -79,7 +79,7 @@ namespace Storage {
forward between calls into run_for; a subclass can receive arbitrarily many instructions to
advance before receiving a process_next_event.
*/
virtual void advance(const Cycles cycles) {};
virtual void advance([[maybe_unused]] const Cycles cycles) {};
/*!
Resets timing, throwing away any current internal state. So clears any fractional ticks