mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-21 17:16:44 +00:00
Merge pull request #1617 from TomHarte/NoWarnings
Resolve x86-related build warnings plus various whitespace deficiencies.
This commit is contained in:
@@ -43,8 +43,8 @@ enum class Key: uint16_t {
|
||||
ForwardSlash = 0x68,
|
||||
Bit1 = 0x08,
|
||||
|
||||
Right = 0x79, Left = 0x19, Down = 0x29, Up = 0x39,
|
||||
Return = 0x49, Delete = 0x59, Copy = 0x69, Bit0 = 0x09,
|
||||
Right = 0x79, Left = 0x19, Down = 0x29, Up = 0x39,
|
||||
Return = 0x49, Delete = 0x59, Copy = 0x69, Bit0 = 0x09,
|
||||
|
||||
//
|
||||
// Break; a key, but not on the keyboard matrix.
|
||||
@@ -60,12 +60,12 @@ enum class Key: uint16_t {
|
||||
//
|
||||
// Master only keys.
|
||||
//
|
||||
Keypad4 = 0x7a, Keypad6 = 0x1a, Keypad8 = 0x2a, KeypadPlus = 0x3a,
|
||||
KeypadDivide = 0x4a, KeypadHash = 0x5a, Keypad0 = 0x6a,
|
||||
Keypad5 = 0x7b, Keypad7 = 0x1b, Keypad9 = 0x2b, KeypadMinus = 0x3b,
|
||||
KeypadDeleted = 0x4b, KeypadMultiply = 0x5b, Keypad1 = 0x6b,
|
||||
Keypad2 = 0x7c, F11 = 0x1c, PauseBreak = 0x2c, KeypadReturn = 0x3c,
|
||||
KeypadDot = 0x4c, KeypadComma = 0x5c, Keypad3 = 0x6c,
|
||||
Keypad4 = 0x7a, Keypad6 = 0x1a, Keypad8 = 0x2a, KeypadPlus = 0x3a,
|
||||
KeypadDivide = 0x4a, KeypadHash = 0x5a, Keypad0 = 0x6a,
|
||||
Keypad5 = 0x7b, Keypad7 = 0x1b, Keypad9 = 0x2b, KeypadMinus = 0x3b,
|
||||
KeypadDeleted = 0x4b, KeypadMultiply = 0x5b, Keypad1 = 0x6b,
|
||||
Keypad2 = 0x7c, F11 = 0x1c, PauseBreak = 0x2c, KeypadReturn = 0x3c,
|
||||
KeypadDot = 0x4c, KeypadComma = 0x5c, Keypad3 = 0x6c,
|
||||
|
||||
Alt = 0x02,
|
||||
LeftShift = 0x03,
|
||||
|
||||
@@ -253,7 +253,7 @@ public:
|
||||
void did_set_input(const Input &digital_input, const bool is_active) final {
|
||||
if(const auto mapped_input = [&]() -> std::optional<JoystickInput> {
|
||||
switch(digital_input.type) {
|
||||
default: return std::nullopt;
|
||||
default: return std::nullopt;
|
||||
case Input::Up: return Up;
|
||||
case Input::Down: return Down;
|
||||
case Input::Left: return Left;
|
||||
|
||||
@@ -104,9 +104,9 @@ public:
|
||||
return channels_[channel].address.halves.low;
|
||||
}
|
||||
}
|
||||
}
|
||||
case 0x8: return status();
|
||||
case 0xd: return temporary_register();
|
||||
}
|
||||
case 0x8: return status();
|
||||
case 0xd: return temporary_register();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ public:
|
||||
// Status:
|
||||
// b7 = 1 => parity error on transmission;
|
||||
// b6 = 1 => receive timeout;
|
||||
// b5 = 1 => transmit timeout;
|
||||
// b5 = 1 => transmit timeout;
|
||||
// b4 = 1 => keyboard enabled via physical key;
|
||||
// b3 = 1 = data at 0060 is command, 0 = data;
|
||||
// b2 = 1 = selftest OK; 0 = just powered up or reset;
|
||||
@@ -328,7 +328,7 @@ private:
|
||||
|
||||
switch(command) {
|
||||
case Command::SelfTest: return 15;
|
||||
default: return 0;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,11 +448,11 @@ private:
|
||||
bool has_input_ = false;
|
||||
bool has_command_ = false;
|
||||
|
||||
// bit 7 = 0 keyboard inhibited
|
||||
// bit 6 = 0 CGA, else MDA
|
||||
// bit 5 = 0 manufacturing jumper installed
|
||||
// bit 4 = 0 system RAM 512K, else 640K
|
||||
// bit 3-0 reserved
|
||||
// bit 7 = 0 keyboard inhibited
|
||||
// bit 6 = 0 CGA, else MDA
|
||||
// bit 5 = 0 manufacturing jumper installed
|
||||
// bit 4 = 0 system RAM 512K, else 640K
|
||||
// bit 3-0 reserved
|
||||
uint8_t switches_ = 0b1011'0000;
|
||||
|
||||
int perform_delay_ = 0;
|
||||
|
||||
@@ -540,14 +540,14 @@ private:
|
||||
case 0x0086: return dma_.pages.template page<6>();
|
||||
case 0x0087: return dma_.pages.template page<7>();
|
||||
|
||||
case 0x0088: if(require_at(port)) return dma_.pages.template page<0x8>(); break;
|
||||
case 0x0089: if(require_at(port)) return dma_.pages.template page<0x9>(); break;
|
||||
case 0x008a: if(require_at(port)) return dma_.pages.template page<0xa>(); break;
|
||||
case 0x008b: if(require_at(port)) return dma_.pages.template page<0xb>(); break;
|
||||
case 0x008c: if(require_at(port)) return dma_.pages.template page<0xc>(); break;
|
||||
case 0x008d: if(require_at(port)) return dma_.pages.template page<0xd>(); break;
|
||||
case 0x008e: if(require_at(port)) return dma_.pages.template page<0xe>(); break;
|
||||
case 0x008f: if(require_at(port)) return dma_.pages.template page<0xf>(); break;
|
||||
case 0x0088: if(require_at(port)) return dma_.pages.template page<0x8>(); break;
|
||||
case 0x0089: if(require_at(port)) return dma_.pages.template page<0x9>(); break;
|
||||
case 0x008a: if(require_at(port)) return dma_.pages.template page<0xa>(); break;
|
||||
case 0x008b: if(require_at(port)) return dma_.pages.template page<0xb>(); break;
|
||||
case 0x008c: if(require_at(port)) return dma_.pages.template page<0xc>(); break;
|
||||
case 0x008d: if(require_at(port)) return dma_.pages.template page<0xd>(); break;
|
||||
case 0x008e: if(require_at(port)) return dma_.pages.template page<0xe>(); break;
|
||||
case 0x008f: if(require_at(port)) return dma_.pages.template page<0xf>(); break;
|
||||
|
||||
case 0x03f4: return fdc_.status();
|
||||
case 0x03f5: return fdc_.read();
|
||||
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
void preauthorise_stack_read(const uint32_t size, const uint32_t granularity) {
|
||||
const auto &descriptor = segments_.descriptors[InstructionSet::x86::Source::SS];
|
||||
|
||||
const auto trailing_distance = 65536 - registers_.sp();
|
||||
const uint32_t trailing_distance = 65536 - registers_.sp();
|
||||
if(trailing_distance >= size) {
|
||||
descriptor.template authorise<InstructionSet::x86::AccessType::Read, uint16_t>(
|
||||
uint16_t(registers_.sp()),
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
0 // i.e. 65536
|
||||
);
|
||||
|
||||
const auto remainder = size - trailing_distance;
|
||||
const uint32_t remainder = size - trailing_distance;
|
||||
descriptor.template authorise<InstructionSet::x86::AccessType::Read, uint16_t>(
|
||||
0,
|
||||
uint16_t(remainder)
|
||||
@@ -198,10 +198,12 @@ public:
|
||||
}
|
||||
|
||||
void preauthorise_read(const InstructionSet::x86::Source descriptor, const uint16_t offset, const uint32_t size) {
|
||||
segments_.descriptors[descriptor].template authorise<InstructionSet::x86::AccessType::Read, uint16_t>(offset, offset + size);
|
||||
segments_.descriptors[descriptor]
|
||||
.template authorise<InstructionSet::x86::AccessType::Read, uint16_t>(offset, uint16_t(offset + size));
|
||||
}
|
||||
void preauthorise_write(const InstructionSet::x86::Source descriptor, const uint16_t offset, const uint32_t size) {
|
||||
segments_.descriptors[descriptor].template authorise<InstructionSet::x86::AccessType::Write, uint16_t>(offset, offset + size);
|
||||
segments_.descriptors[descriptor]
|
||||
.template authorise<InstructionSet::x86::AccessType::Write, uint16_t>(offset, uint16_t(offset + size));
|
||||
}
|
||||
|
||||
// TODO: perform authorisation checks.
|
||||
|
||||
@@ -90,7 +90,7 @@ private:
|
||||
delays[6] * 2,
|
||||
delays[7] * 2
|
||||
}
|
||||
{}
|
||||
{}
|
||||
};
|
||||
|
||||
static constexpr Timings get_timings() {
|
||||
|
||||
Reference in New Issue
Block a user