Allow setting stream gain
[lsnes.git] / include / library / patch.hpp
blob7065c58677e61654ef9db5e886edff5dcb122fb3
1 #ifndef _library__patch__hpp__included__
2 #define _library__patch__hpp__included__
4 #include <vector>
5 #include <string>
6 #include <cstdint>
7 #include <cstdlib>
8 #include <stdexcept>
10 std::vector<char> do_patch_file(const std::vector<char>& original, const std::vector<char>& patch,
11 int32_t offset) throw(std::bad_alloc, std::runtime_error);
13 /**
14 * ROM patcher.
16 struct rom_patcher
18 /**
19 * Constructor.
21 rom_patcher() throw(std::bad_alloc);
22 /**
23 * Destructor.
25 virtual ~rom_patcher() throw();
26 /**
27 * Identify patch.
29 * Parameter patch: The patch.
30 * Returns: True if my format, false if not.
32 virtual bool identify(const std::vector<char>& patch) throw() = 0;
33 /**
34 * Do the patch.
36 virtual void dopatch(std::vector<char>& out, const std::vector<char>& original,
37 const std::vector<char>& patch, int32_t offset) throw(std::bad_alloc, std::runtime_error) = 0;
40 #endif