1
// -*- Mode: C++; tab-width:2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
// vi:tw=80:et:ts=2:sts=2
4
// -----------------------------------------------------------------------
6
// This file is part of RLVM, a RealLive virtual machine clone.
8
// -----------------------------------------------------------------------
10
// Copyright (C) 2011 Elliot Glaysher
12
// This program is free software; you can redistribute it and/or modify
13
// it under the terms of the GNU General Public License as published by
14
// the Free Software Foundation; either version 3 of the License, or
15
// (at your option) any later version.
17
// This program is distributed in the hope that it will be useful,
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
// GNU General Public License for more details.
22
// You should have received a copy of the GNU General Public License
23
// along with this program; if not, write to the Free Software
24
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
25
// -----------------------------------------------------------------------
27
#ifndef SRC_MACHINEBASE_RLVMINSTANCE_hpp_
28
#define SRC_MACHINEBASE_RLVMINSTANCE_hpp_
30
#include <boost/filesystem/operations.hpp>
35
// The main, cross platform emulator class. Has template methods for
36
// implementing platform specific GUI.
40
virtual ~RLVMInstance();
42
// Runs the main emulation loop.
43
void Run(const boost::filesystem::path& gamepath);
45
void set_seen_start(int in) { seen_start_ = in; }
46
void set_memory() { memory_ = true; }
47
void set_undefined_opcodes() { undefined_opcodes_ = true; }
48
void set_count_undefined() { count_undefined_copcodes_ = true; }
49
void set_load_save(int in) { load_save_ = in; }
50
void set_custom_font(const std::string& font) { custom_font_ = font; }
52
// Optionally brings up a file selection dialog to get the game directory. In
53
// case this isn't implemented or the user clicks cancel, returns an empty
55
virtual boost::filesystem::path SelectGameDirectory();
58
// Should bring up a platform native dialog box to report the message.
59
virtual void ReportFatalError(const std::string& message_text,
60
const std::string& informative_text);
63
// Finds a game file, causing an error if not found.
64
boost::filesystem::path FindGameFile(
65
const boost::filesystem::path& gamerootPath,
66
const std::string& filename);
68
// Checks for AVG32/Siglus engine games, which people may be confused about.
69
void CheckBadEngine(const boost::filesystem::path& gamerootPath,
70
const char** filenames,
71
const std::string& message_text);
73
// Whether we should set a custom font.
74
std::string custom_font_;
76
// Which SEEN# we should start execution from (-1 if we shouldn't set this).
79
// Whether we should force '#MEMORY=1' to enter debug mode.
82
// Whether we should print undefined opcode messages.
83
bool undefined_opcodes_;
85
// Whether we should print out a table of undefined opcodes that the game
87
bool count_undefined_copcodes_;
89
// Loads the specified save file as soon as emulation starts if not -1.
93
#endif // SRC_MACHINEBASE_RLVMINSTANCE_hpp_