summaryrefslogtreecommitdiff
path: root/emulator.h
blob: c3fcd1f0134f07ac531911de19d05ff69d405a23 (plain)
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

#ifndef EMULATOR_H_
#define EMULATOR_H_

#include <vector>

#include "value.h"

class program_loader;

class emulator {
public:
	emulator(
		program_loader * loader,
		int num_temp_regs,
		int num_const_regs,
		int num_out_regs,
		int num_input_regs);


	bool run();
	void set_constants(float value);
	value * get_value(register_address addr);
	void set_value(
		register_address addr,
		value * val);
	value * get_output_value(unsigned int index);

private:
	program_loader * m_loader;
	std::vector<value *> m_temp_regs;
	std::vector<float_value *> m_const_regs;
	std::vector<value *> m_out_regs;
	std::vector<value *> m_private_regs;
	std::vector<float_value*> m_immediate_regs;
	std::vector<float_value*> m_input_regs;
};

#endif //EMULATOR_H