mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-27 00:30:26 +00:00
Merge pull request #1450 from TomHarte/LatestWarnings
Resolve GCC ubuntu-latest build warnings.
This commit is contained in:
commit
79c89af6ea
@ -87,7 +87,7 @@ std::optional<BASICAnalysis> analyse(const File &file) {
|
||||
}
|
||||
|
||||
uint16_t line_address = file.starting_address;
|
||||
int previous_line_number = -1;
|
||||
// int previous_line_number = -1;
|
||||
|
||||
const auto byte = [&](uint16_t address) {
|
||||
return file.data[address - file.starting_address];
|
||||
@ -115,7 +115,7 @@ std::optional<BASICAnalysis> analyse(const File &file) {
|
||||
}
|
||||
|
||||
const auto next_line_address = word(line_address);
|
||||
const auto line_number = word(line_address + 2);
|
||||
// const auto line_number = word(line_address + 2);
|
||||
|
||||
uint16_t code = line_address + 4;
|
||||
const auto next = [&]() -> uint8_t {
|
||||
@ -153,7 +153,7 @@ std::optional<BASICAnalysis> analyse(const File &file) {
|
||||
break;
|
||||
}
|
||||
|
||||
previous_line_number = line_number;
|
||||
// previous_line_number = line_number;
|
||||
line_address = next_line_address;
|
||||
}
|
||||
|
||||
|
@ -33,11 +33,10 @@ ROM::Request Machine::rom_request(Personality personality) {
|
||||
MachineBase::MachineBase(Personality personality, const ROM::Map &roms) :
|
||||
Storage::Disk::Controller(1000000),
|
||||
m6502_(*this),
|
||||
serial_port_VIA_port_handler_(serial_port_VIA_),
|
||||
drive_VIA_(drive_VIA_port_handler_),
|
||||
serial_port_VIA_(serial_port_VIA_port_handler_) {
|
||||
// Attach the serial port to its VIA and vice versa.
|
||||
serial_port_.set_serial_port_via(serial_port_VIA_port_handler_);
|
||||
serial_port_.connect(serial_port_VIA_port_handler_, serial_port_VIA_);
|
||||
serial_port_VIA_port_handler_.set_serial_port(serial_port_);
|
||||
|
||||
// Set this instance as the delegate to receive interrupt requests from both VIAs.
|
||||
@ -163,8 +162,6 @@ void MachineBase::drive_via_did_set_data_density(void *, const int density) {
|
||||
|
||||
// MARK: - SerialPortVIA
|
||||
|
||||
SerialPortVIA::SerialPortVIA(MOS::MOS6522::MOS6522<SerialPortVIA> &via) : via_(via) {}
|
||||
|
||||
uint8_t SerialPortVIA::get_port_input(MOS::MOS6522::Port port) {
|
||||
if(port) return port_b_;
|
||||
return 0xff;
|
||||
@ -180,7 +177,11 @@ void SerialPortVIA::set_port_output(MOS::MOS6522::Port port, uint8_t value, uint
|
||||
}
|
||||
}
|
||||
|
||||
void SerialPortVIA::set_serial_line_state(::Commodore::Serial::Line line, bool value) {
|
||||
void SerialPortVIA::set_serial_line_state(
|
||||
::Commodore::Serial::Line line,
|
||||
bool value,
|
||||
MOS::MOS6522::MOS6522<SerialPortVIA> &via
|
||||
) {
|
||||
switch(line) {
|
||||
default: break;
|
||||
case ::Commodore::Serial::Line::Data: port_b_ = (port_b_ & ~0x01) | (value ? 0x00 : 0x01); break;
|
||||
@ -188,7 +189,7 @@ void SerialPortVIA::set_serial_line_state(::Commodore::Serial::Line line, bool v
|
||||
case ::Commodore::Serial::Line::Attention:
|
||||
attention_level_input_ = !value;
|
||||
port_b_ = (port_b_ & ~0x80) | (value ? 0x00 : 0x80);
|
||||
via_.set_control_line_input(MOS::MOS6522::Port::A, MOS::MOS6522::Line::One, !value);
|
||||
via.set_control_line_input(MOS::MOS6522::Port::A, MOS::MOS6522::Line::One, !value);
|
||||
update_data_line();
|
||||
break;
|
||||
}
|
||||
@ -274,9 +275,10 @@ void DriveVIA::set_activity_observer(Activity::Observer *observer) {
|
||||
// MARK: - SerialPort
|
||||
|
||||
void SerialPort::set_input(Serial::Line line, Serial::LineLevel level) {
|
||||
serial_port_VIA_->set_serial_line_state(line, bool(level));
|
||||
serial_port_via_->set_serial_line_state(line, bool(level), *via_);
|
||||
}
|
||||
|
||||
void SerialPort::set_serial_port_via(SerialPortVIA &serialPortVIA) {
|
||||
serial_port_VIA_ = &serialPortVIA;
|
||||
void SerialPort::connect(SerialPortVIA &serial_port_via, MOS::MOS6522::MOS6522<SerialPortVIA> &via) {
|
||||
serial_port_via_ = &serial_port_via;
|
||||
via_ = &via;
|
||||
}
|
||||
|
@ -39,17 +39,14 @@ namespace Commodore::C1540 {
|
||||
*/
|
||||
class SerialPortVIA: public MOS::MOS6522::IRQDelegatePortHandler {
|
||||
public:
|
||||
SerialPortVIA(MOS::MOS6522::MOS6522<SerialPortVIA> &via);
|
||||
|
||||
uint8_t get_port_input(MOS::MOS6522::Port);
|
||||
|
||||
void set_port_output(MOS::MOS6522::Port, uint8_t value, uint8_t mask);
|
||||
void set_serial_line_state(::Commodore::Serial::Line, bool);
|
||||
void set_serial_line_state(::Commodore::Serial::Line, bool, MOS::MOS6522::MOS6522<SerialPortVIA> &);
|
||||
|
||||
void set_serial_port(Commodore::Serial::Port &);
|
||||
|
||||
private:
|
||||
MOS::MOS6522::MOS6522<SerialPortVIA> &via_;
|
||||
uint8_t port_b_ = 0x0;
|
||||
Commodore::Serial::Port *serial_port_ = nullptr;
|
||||
bool attention_acknowledge_level_ = false;
|
||||
@ -111,11 +108,12 @@ private:
|
||||
*/
|
||||
class SerialPort : public ::Commodore::Serial::Port {
|
||||
public:
|
||||
void set_input(Commodore::Serial::Line, Commodore::Serial::LineLevel);
|
||||
void set_serial_port_via(SerialPortVIA &);
|
||||
void set_input(Commodore::Serial::Line, Commodore::Serial::LineLevel) override;
|
||||
void connect(SerialPortVIA &, MOS::MOS6522::MOS6522<SerialPortVIA>&);
|
||||
|
||||
private:
|
||||
SerialPortVIA *serial_port_VIA_ = nullptr;
|
||||
SerialPortVIA *serial_port_via_ = nullptr;
|
||||
MOS::MOS6522::MOS6522<SerialPortVIA> *via_ = nullptr;
|
||||
};
|
||||
|
||||
class MachineBase:
|
||||
|
@ -43,6 +43,7 @@ CommodoreTAP::Serialiser::Serialiser(const std::string &file_name) :
|
||||
current_pulse_.length.clock_rate = static_cast<unsigned int>(
|
||||
[&] {
|
||||
switch(platform_) {
|
||||
default:
|
||||
case Platform::Vic20: // It empirically seems like Vic-20 waves are counted with C64 timings?
|
||||
case Platform::C64: return video_ == VideoStandard::PAL ? 985'248 : 1'022'727;
|
||||
case Platform::C16: return video_ == VideoStandard::PAL ? 886'722 : 894'886;
|
||||
|
Loading…
x
Reference in New Issue
Block a user