summaryrefslogtreecommitdiff
path: root/music/pokeredmusicdisasm/UnkEB.cpp
blob: 39007f309a15615ff67a0bf53fbdcccce3b0b930 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <sstream>
#include "UnkEB.h"

using namespace std;

UnkEB::UnkEB()
{
	param = 0;
}

UnkEB::UnkEB(unsigned char* byte)
{
	param = 0;
	Parse(byte);
}

UnkEB::UnkEB(unsigned char code, bool)
{
	SetParam(code);
}

// Getters / Setters
unsigned char UnkEB::GetParam()
{
	return param;
}

void UnkEB::SetParam(unsigned char value)
{
	param = value;
}

// Re-implemented
string UnkEB::GenAsm()
{
	stringstream tmpAsmOut;
	tmpAsmOut << hex << "db $" << (short)0xEB << ", $" << (short)param;
	return tmpAsmOut.str();
}

bool UnkEB::Parse(unsigned char* byte)
{
	param = byte[1];
	return true;
}

bool UnkEB::IsValid(unsigned char* byte)
{
	if(byte[0] == 0xEB) return true;
	else return false;
}

unsigned int UnkEB::Arguments()
{
	// 1 1-Byte param
	return 1;
}