| e8555c89 Andy McCall |
1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
#ifndef MSXPPI_HH |
| 26 |
#define MSXPPI_HH |
| 27 |
|
| 28 |
#include "I8255.hh" |
| 29 |
#include "I8255Interface.hh" |
| 30 |
#include "KeyClick.hh" |
| 31 |
#include "Keyboard.hh" |
| 32 |
#include "MSXDevice.hh" |
| 33 |
|
| 34 |
namespace openmsx { |
| 35 |
|
| 36 |
class CassettePortInterface; |
| 37 |
class RenShaTurbo; |
| 38 |
|
| 39 |
class MSXPPI final : public MSXDevice, public I8255Interface |
| 40 |
{ |
| 41 |
public: |
| 42 |
explicit MSXPPI(const DeviceConfig& config); |
| 43 |
~MSXPPI() override; |
| 44 |
|
| 45 |
void reset(EmuTime time) override; |
| 46 |
void powerDown(EmuTime time) override; |
| 47 |
[[nodiscard]] uint8_t readIO(uint16_t port, EmuTime time) override; |
| 48 |
[[nodiscard]] uint8_t peekIO(uint16_t port, EmuTime time) const override; |
| 49 |
void writeIO(uint16_t port, uint8_t value, EmuTime time) override; |
| 50 |
|
| 51 |
template<typename Archive> |
| 52 |
void serialize(Archive& ar, unsigned version); |
| 53 |
|
| 54 |
private: |
| 55 |
|
| 56 |
[[nodiscard]] uint8_t readA (EmuTime time) override; |
| 57 |
[[nodiscard]] uint8_t readB (EmuTime time) override; |
| 58 |
[[nodiscard]] uint4_t readC0(EmuTime time) override; |
| 59 |
[[nodiscard]] uint4_t readC1(EmuTime time) override; |
| 60 |
[[nodiscard]] uint8_t peekA (EmuTime time) const override; |
| 61 |
[[nodiscard]] uint8_t peekB (EmuTime time) const override; |
| 62 |
[[nodiscard]] uint4_t peekC0(EmuTime time) const override; |
| 63 |
[[nodiscard]] uint4_t peekC1(EmuTime time) const override; |
| 64 |
void writeA (uint8_t value, EmuTime time) override; |
| 65 |
void writeB (uint8_t value, EmuTime time) override; |
| 66 |
void writeC0(uint4_t value, EmuTime time) override; |
| 67 |
void writeC1(uint4_t value, EmuTime time) override; |
| 68 |
|
| 69 |
private: |
| 70 |
CassettePortInterface& cassettePort; |
| 71 |
RenShaTurbo& renshaTurbo; |
| 72 |
I8255 i8255; |
| 73 |
KeyClick click; |
| 74 |
Keyboard keyboard; |
| 75 |
uint4_t prevBits = 15; |
| 76 |
uint4_t selectedRow = 0; |
| 77 |
}; |
| 78 |
|
| 79 |
} |
| 80 |
|
| 81 |
#endif |