File: ucc.h

package info (click to toggle)
exult 1.12.0-2
  • links: PTS, VCS
  • area: contrib
  • in suites: forky
  • size: 43,608 kB
  • sloc: cpp: 169,917; xml: 7,400; yacc: 2,850; makefile: 2,419; java: 1,901; ansic: 1,654; lex: 673; sh: 539; objc: 416
file content (120 lines) | stat: -rw-r--r-- 3,001 bytes parent folder | download | duplicates (3)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
 *  Copyright (C) 2001-2022  The Exult Team
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef UCC_H
#define UCC_H

#include <string>
#include <vector>

class UCc;

class UCc {
public:
	UCc(const unsigned int offset = 0, const unsigned int id = 0,
		const std::vector<unsigned char>& params = std::vector<unsigned char>())
			: _id(id), _offset(offset), _params(params) {}

	UCc(const unsigned int id, const std::string& miscstr)
			: _id(id), _miscstr(miscstr) {}

	UCc(const std::vector<unsigned int>& params_parsed)
			: _params_parsed(params_parsed) {}

	unsigned int               _id = 0;
	std::string                _miscstr;
	unsigned int               _offset = 0;
	std::vector<unsigned char> _params;
	std::vector<unsigned int>  _params_parsed;
	bool                       _tagged = false;
	std::vector<unsigned int>  _jump_offsets;
	unsigned int               _missing_args = 0;

	/* A temporary array to hold the items this opcode theoretically popped
	   from the stack. This should probably go in it's own wrapper class with
	   the current UCc. */
	std::vector<UCc*> _popped;
};

class UCOptions {
public:
	bool game_bg() const {
		return _game == GAME_BG;
	}

	bool game_si() const {
		return _game == GAME_SI;
	}

	bool game_fov() const {
		return _game == GAME_FOV;
	}

	bool game_ss() const {
		return _game == GAME_SS;
	}

	bool game_sib() const {
		return _game == GAME_SIB;
	}

	bool game_u7() const {
		return game_bg() || game_si() || game_fov() || game_ss() || game_sib();
	}

	bool game_u8() const {
		return _game == GAME_U8;
	}

	bool output_extern_header = false;

	bool noconf         = false;
	bool rawops         = false;
	bool autocomment    = false;
	bool uselesscomment = false;
	bool verbose        = false;
	bool very_verbose   = false;
	bool ucdebug        = false;
	bool basic          = false;

	bool output_list        = false;
	bool output_asm         = false;
	bool output_ucs         = false;
	bool output_flag        = false;
	bool output_trans_table = false;

	bool mode_all = false;
	bool mode_dis = false;

	bool force_ext32
			= false;    // force ext32 function format output for all functions

	// private:
	enum {
		GAME_BG  = 1,
		GAME_FOV = 2,
		GAME_SI  = 3,
		GAME_SS  = 4,
		GAME_SIB = 5,
		GAME_U8  = 6
	};

	unsigned int _game = GAME_BG;
};

#endif