Newer
Older
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
#include <unordered_map>
#include <vector>
#include "movie.h"
#include "zipfile.h"
namespace Retro {
class MovieBK2 final : public Movie {
public:
MovieBK2(std::unique_ptr<Zip>);
MovieBK2(const std::string& path, bool write = false);
~MovieBK2();
virtual std::string getGameName() const override;
void loadKeymap(const std::string& platform);
void setGameName(const std::string& name);
void writeHeader();
static std::unique_ptr<Movie> load(const std::string& path);
virtual bool step() override;
virtual void close() override;
virtual bool getState(std::vector<uint8_t>*) const override;
virtual void setState(const uint8_t*, size_t) override;
private:
void loadState();
std::unique_ptr<Zip> m_zip;
Zip::File* m_log;
std::vector<uint8_t> m_state;
std::unordered_map<char, int> m_keymap;
std::unordered_map<int, char> m_buttonmap;
bool m_write = false;
bool m_headerWritten = false;
std::string m_coreName;
std::string m_platform;
std::string m_gameName{ "?" };
};
}