~ubuntu-branches/ubuntu/utopic/rlvm/utopic-proposed

« back to all changes in this revision

Viewing changes to src/MachineBase/RLVMInstance.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Ying-Chun Liu (PaulLiu), Ying-Chun Liu (PaulLiu), Elliot Glaysher
  • Date: 2011-05-19 00:28:44 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20110519002844-qszwmj7oiixww0eg
Tags: 0.12-1
[ Ying-Chun Liu (PaulLiu) <paulliu@debian.org> ]
* New upstream release

[ Elliot Glaysher <glaysher@umich.edu> ]
* New GTK+ interface with desktop integration and UI refinements
* Partial Japanese localizations
* Fix graphics corruption in in-game dialogs when a dialog is brought
  up, and then fullscreen mode activated
* Smooth the output of text in rlBabel using games
* Don't play voice samples while fast forwarding

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- Mode: C++; tab-width:2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 
2
// vi:tw=80:et:ts=2:sts=2
 
3
//
 
4
// -----------------------------------------------------------------------
 
5
//
 
6
// This file is part of RLVM, a RealLive virtual machine clone.
 
7
//
 
8
// -----------------------------------------------------------------------
 
9
//
 
10
// Copyright (C) 2011 Elliot Glaysher
 
11
//
 
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.
 
16
//
 
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.
 
21
//
 
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
// -----------------------------------------------------------------------
 
26
 
 
27
#ifndef SRC_MACHINEBASE_RLVMINSTANCE_hpp_
 
28
#define SRC_MACHINEBASE_RLVMINSTANCE_hpp_
 
29
 
 
30
#include <boost/filesystem/operations.hpp>
 
31
 
 
32
class Platform;
 
33
class System;
 
34
 
 
35
// The main, cross platform emulator class. Has template methods for
 
36
// implementing platform specific GUI.
 
37
class RLVMInstance {
 
38
 public:
 
39
  RLVMInstance();
 
40
  virtual ~RLVMInstance();
 
41
 
 
42
  // Runs the main emulation loop.
 
43
  void Run(const boost::filesystem::path& gamepath);
 
44
 
 
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; }
 
51
 
 
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
 
54
  // path.
 
55
  virtual boost::filesystem::path SelectGameDirectory();
 
56
 
 
57
 protected:
 
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);
 
61
 
 
62
 private:
 
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);
 
67
 
 
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);
 
72
 
 
73
  // Whether we should set a custom font.
 
74
  std::string custom_font_;
 
75
 
 
76
  // Which SEEN# we should start execution from (-1 if we shouldn't set this).
 
77
  int seen_start_;
 
78
 
 
79
  // Whether we should force '#MEMORY=1' to enter debug mode.
 
80
  bool memory_;
 
81
 
 
82
  // Whether we should print undefined opcode messages.
 
83
  bool undefined_opcodes_;
 
84
 
 
85
  // Whether we should print out a table of undefined opcodes that the game
 
86
  // used on exit.
 
87
  bool count_undefined_copcodes_;
 
88
 
 
89
  // Loads the specified save file as soon as emulation starts if not -1.
 
90
  int load_save_;
 
91
};
 
92
 
 
93
#endif  // SRC_MACHINEBASE_RLVMINSTANCE_hpp_