1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Increased documentation.

This commit is contained in:
Thomas Harte 2017-07-22 17:39:51 -04:00
parent d46da6ac9d
commit 1bbb4cb478
4 changed files with 24 additions and 0 deletions

View File

@ -13,7 +13,15 @@ namespace KeyboardMachine {
class Machine {
public:
/*!
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 isPressed) = 0;
/*!
Instructs that all keys should now be treated as released.
*/
virtual void clear_all_keys() = 0;
};

View File

@ -15,7 +15,10 @@
namespace Memory {
/// Stores @c size random bytes from @c buffer onwards.
void Fuzz(uint8_t *buffer, size_t size);
// Replaces all existing vector contents with random bytes.
void Fuzz(std::vector<uint8_t> &buffer);
}

View File

@ -13,8 +13,13 @@
namespace NumberTheory {
/*! Provides a class capable of accumulating a CRC16 from source data. */
class CRC16 {
public:
/*!
Instantiates a CRC16 that will compute the CRC16 specified by the supplied
@c polynomial and @c reset_value.
*/
CRC16(uint16_t polynomial, uint16_t reset_value) :
reset_value_(reset_value), value_(reset_value) {
for(int c = 0; c < 256; c++) {
@ -27,11 +32,18 @@ class CRC16 {
}
}
/// Resets the CRC to the reset value.
inline void reset() { value_ = reset_value_; }
/// Updates the CRC to include @c byte.
inline void add(uint8_t byte) {
value_ = (uint16_t)((value_ << 8) ^ xor_table[(value_ >> 8) ^ byte]);
}
/// @returns The current value of the CRC.
inline uint16_t get_value() const { return value_; }
/// Sets the current value of the CRC.
inline void set_value(uint16_t value) { value_ = value; }
private:

View File

@ -15,6 +15,7 @@
namespace StaticAnalyser {
namespace Acorn {
/// Describes a DFS- or ADFS-format catalogue(/directory) — the list of files available and the catalogue's boot option.
struct Catalogue {
std::string name;
std::list<File> files;