-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebugging.h
More file actions
105 lines (92 loc) · 1.95 KB
/
debugging.h
File metadata and controls
105 lines (92 loc) · 1.95 KB
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
#pragma once
void dump_ram()
{
ofstream fp;
fp.open(path + "ramdump.bin", ios::out | ios::binary);
fp.write((char*)RAM, sizeof(RAM));
fp.close();
cout << red << "[ASM] RAM has been dumped to ramdump.bin" << white << endl;
}
bool pressed_hide = false;
bool pressed_diag = false;
bool pressed_drawl1 = false;
bool pressed_bg = false;
bool pressed_drawsprites = false;
bool pressed_dumpram = false;
bool pressed_dumplevel = false;
void dump_level_data()
{
ofstream out(path + "level_data_dump.txt");
out << "[level_data]" << endl;
for (uint_fast16_t x = 0; x < mapWidth; x++)
{
for (uint_fast16_t y = 0; y < mapHeight; y++)
{
if (map16_handler.get_tile(x, y) != 0x25)
{
out << int_to_hex(map16_handler.get_tile(x, y)) << "," << x << "," << y << endl;
}
}
}
out.close();
cout << green << "[Level Manager] Level dumped to level_data_dump.txt" << white << endl;
}
void debugging_functions()
{
/*
Debug input checks
*/
bool stat = false;
if (!Chatting)
{
stat = state[input_settings[11]];
if (stat != pressed_hide) {
pressed_hide = stat;
if (stat) {
drawHud = !drawHud;
}
}
stat = state[input_settings[12]];
if (stat != pressed_diag) {
pressed_diag = stat;
if (stat) {
drawDiag = !drawDiag;
}
}
stat = state[input_settings[13]];
if (stat != pressed_drawl1) {
pressed_drawl1 = stat;
if (stat) {
drawL1 = !drawL1;
}
}
stat = state[input_settings[14]];
if (stat != pressed_bg) {
pressed_bg = stat;
if (stat) {
drawBg = !drawBg;
}
}
stat = state[input_settings[15]];
if (stat != pressed_drawsprites) {
pressed_drawsprites = stat;
if (stat) {
drawSprites = !drawSprites;
}
}
stat = state[input_settings[16]];
if (stat != pressed_dumpram) {
pressed_dumpram = stat;
if (stat) {
dump_ram();
}
}
stat = state[input_settings[17]];
if (stat != pressed_dumplevel) {
pressed_dumplevel = stat;
if (stat) {
dump_level_data();
}
}
}
}