-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGpuMenu.cpp
113 lines (94 loc) · 2.21 KB
/
GpuMenu.cpp
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
#include "GpuMenu.hpp"
#include "Psx.hpp"
#include "Gpu.hpp"
#include <sstream>
#include <iomanip>
void GpuMenu::draw_in_category(menubar_category category)
{
if (category == menubar_category::VIEW)
{
ImGui::Checkbox("Show Gpu", &is_visible);
}
}
void GpuMenu::draw_menu()
{
if (is_visible == false) return;
Gpu * gpu = Gpu::get_instance();
ImGui::Begin("GPU");
{
std::stringstream status_text;
status_text << "Status Register: 0x" << std::hex << std::setfill('0') << std::setw(8) << gpu->gpu_status.int_value;
ImGui::Text(status_text.str().c_str());
{
std::stringstream text;
text << "Drawing offsets: " << gpu->x_offset << " " << gpu->y_offset;
ImGui::Text(text.str().c_str());
}
{
std::stringstream text;
text << "Video Mode: " << (gpu->gpu_status.video_mode == 0 ? "NTSC" : "PAL");
ImGui::Text(text.str().c_str());
}
{
std::stringstream text;
text << "Vertical Interface: " << gpu->gpu_status.v_interlace;
ImGui::Text(text.str().c_str());
}
{
std::stringstream text;
// 0 = Enabled
text << "Display Enable: " << (gpu->gpu_status.display_enable == 0);
ImGui::Text(text.str().c_str());
}
{
std::stringstream text;
text << "Interrupt Request: " << gpu->gpu_status.irq_request;
ImGui::Text(text.str().c_str());
}
{
std::stringstream text;
text << "Ready DMA block: " << gpu->gpu_status.ready_dma;
ImGui::Text(text.str().c_str());
}
{
std::stringstream text;
text << "Ready CMD Word: " << gpu->gpu_status.ready_cmd_word;
ImGui::Text(text.str().c_str());
}
{
std::stringstream text;
text << "Ready VRAM to CPU: " << gpu->gpu_status.ready_vram_to_cpu;
ImGui::Text(text.str().c_str());
}
{
std::stringstream text;
text << "DMA Direction: ";
switch (gpu->gpu_status.dma_direction)
{
case 0:
text << "Off";
break;
case 1:
text << "?";
break;
case 2:
text << "CPUtoGP0";
break;
case 3:
text << "GPUREADtoCPU";
break;
}
ImGui::Text(text.str().c_str());
}
{
std::stringstream text;
text << "Drawing: " << (gpu->gpu_status.even_odd ? "Odd" : "Even/Vblank");
ImGui::Text(text.str().c_str());
}
// todo add more
}
ImGui::End();
}
void GpuMenu::tick()
{
}