openMSX
IPSPatch.hh
Go to the documentation of this file.
1 #ifndef IPSPATCH_HH
2 #define IPSPATCH_HH
3 
4 #include "PatchInterface.hh"
5 #include "Filename.hh"
6 #include <utility>
7 #include <vector>
8 #include <memory>
9 
10 namespace openmsx {
11 
12 class IPSPatch final : public PatchInterface
13 {
14 public:
15  using PatchMap = std::vector<std::pair<size_t, std::vector<byte>>>;
16 
17  IPSPatch(Filename filename,
18  std::unique_ptr<const PatchInterface> parent);
19 
20  void copyBlock(size_t src, byte* dst, size_t num) const override;
21  size_t getSize() const override;
22  std::vector<Filename> getFilenames() const override;
23 
24 private:
25  const Filename filename;
26  const std::unique_ptr<const PatchInterface> parent;
27  PatchMap patchMap;
28  size_t size;
29 };
30 
31 } // namespace openmsx
32 
33 #endif
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
std::vector< std::pair< size_t, std::vector< byte > >> PatchMap
Definition: IPSPatch.hh:15
This class represents a filename.
Definition: Filename.hh:17
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
void copyBlock(size_t src, byte *dst, size_t num) const override
Definition: IPSPatch.cc:84
IPSPatch(Filename filename, std::unique_ptr< const PatchInterface > parent)
Definition: IPSPatch.cc:19
size_t getSize() const override
Definition: IPSPatch.cc:125
std::vector< Filename > getFilenames() const override
Definition: IPSPatch.cc:130