openMSX
SC3000PPI.hh
Go to the documentation of this file.
1#ifndef SC3000PPI_HH
2#define SC3000PPI_HH
3
4#include "MSXDevice.hh"
5#include "I8255Interface.hh"
6#include "I8255.hh"
7#include "Keyboard.hh"
8#include <array>
9
10namespace openmsx {
11
12class CassettePortInterface;
13class JoystickPortIf;
14
17class SC3000PPI final : public MSXDevice, public I8255Interface
18{
19public:
20 explicit SC3000PPI(const DeviceConfig& config);
21
22 void reset(EmuTime::param time) override;
23 byte readIO(word port, EmuTime::param time) override;
24 byte peekIO(word port, EmuTime::param time) const override;
25 void writeIO(word port, byte value, EmuTime::param time) override;
26
27 template<typename Archive>
28 void serialize(Archive& ar, unsigned version);
29
30private:
31 // I8255Interface
32 byte readA(EmuTime::param time) override;
33 byte readB(EmuTime::param time) override;
34 nibble readC0(EmuTime::param time) override;
35 nibble readC1(EmuTime::param time) override;
36 byte peekA(EmuTime::param time) const override;
37 byte peekB(EmuTime::param time) const override;
38 nibble peekC0(EmuTime::param time) const override;
39 nibble peekC1(EmuTime::param time) const override;
40 void writeA(byte value, EmuTime::param time) override;
41 void writeB(byte value, EmuTime::param time) override;
42 void writeC0(nibble value, EmuTime::param time) override;
43 void writeC1(nibble value, EmuTime::param time) override;
44
45 CassettePortInterface& cassettePort;
46 I8255 i8255;
47 Keyboard keyboard;
48 std::array<JoystickPortIf*, 2> ports;
49 nibble prevBits = 15;
50 nibble selectedRow = 0;
51};
52
53} // namespace openmsx
54
55#endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition MSXDevice.hh:36
Connects SC-3000 peripherals to the PPI (8255).
Definition SC3000PPI.hh:18
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition SC3000PPI.cc:45
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition SC3000PPI.cc:50
void reset(EmuTime::param time) override
This method is called on reset.
Definition SC3000PPI.cc:40
void serialize(Archive &ar, unsigned version)
Definition SC3000PPI.cc:159
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port at a certain time to this device.
Definition SC3000PPI.cc:55
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint8_t nibble
4 bit integer
Definition openmsx.hh:23
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29