2020-11-01 01:00:15 +00:00
|
|
|
//
|
|
|
|
// ADB.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 31/10/2020.
|
|
|
|
// Copyright © 2020 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Apple_IIgs_ADB_hpp
|
|
|
|
#define Apple_IIgs_ADB_hpp
|
|
|
|
|
|
|
|
#include <cstdint>
|
2020-11-10 00:05:48 +00:00
|
|
|
#include <vector>
|
2020-11-01 01:00:15 +00:00
|
|
|
|
|
|
|
namespace Apple {
|
|
|
|
namespace IIgs {
|
|
|
|
namespace ADB {
|
|
|
|
|
|
|
|
class GLU {
|
|
|
|
public:
|
2020-11-10 00:05:48 +00:00
|
|
|
// Behaviour varies slightly between the controller shipped with ROM01 machines
|
|
|
|
// and that shipped with ROM03 machines; use this to set the desired behaviour.
|
|
|
|
void set_is_rom03(bool);
|
|
|
|
|
2020-11-01 01:00:15 +00:00
|
|
|
uint8_t get_keyboard_data();
|
|
|
|
uint8_t get_mouse_data();
|
|
|
|
uint8_t get_modifier_status();
|
2020-11-05 02:35:11 +00:00
|
|
|
uint8_t get_any_key_down();
|
2020-11-01 01:00:15 +00:00
|
|
|
|
|
|
|
uint8_t get_data();
|
|
|
|
uint8_t get_status();
|
|
|
|
|
|
|
|
void set_command(uint8_t);
|
|
|
|
void set_status(uint8_t);
|
2020-11-05 02:35:11 +00:00
|
|
|
void clear_key_strobe();
|
2020-11-10 00:05:48 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool is_rom03_ = false;
|
|
|
|
std::vector<uint8_t> next_command_;
|
|
|
|
std::vector<uint8_t> pending_response_;
|
|
|
|
|
|
|
|
void abort();
|
|
|
|
void reset_microcontroller();
|
|
|
|
void flush_keyboard_buffer();
|
|
|
|
|
|
|
|
void set_modes(uint8_t modes);
|
|
|
|
uint8_t modes_ = 0;
|
|
|
|
|
|
|
|
void set_device_srq(int mask);
|
|
|
|
int device_srq_ = 0;
|
|
|
|
|
|
|
|
void set_configuration_bytes(uint8_t *);
|
2020-11-10 02:20:53 +00:00
|
|
|
|
|
|
|
uint8_t read_microcontroller_address(uint16_t);
|
2020-11-01 01:00:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Apple_IIgs_ADB_hpp */
|