Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/UI/JitCompareScreen.h
5656 views
1
#pragma once
2
#include "Common/UI/UIScreen.h"
3
#include "Common/UI/PopupScreens.h"
4
#include "UI/BaseScreens.h"
5
#include "UI/TabbedDialogScreen.h"
6
7
class JitCompareScreen : public UITabbedBaseDialogScreen {
8
public:
9
JitCompareScreen();
10
void CreateTabs() override;
11
12
const char *tag() const override { return "JitCompare"; }
13
14
private:
15
bool ShowSearchControls() const override { return false; }
16
void UpdateDisasm();
17
18
// Uses the current ListType
19
void FillBlockList();
20
21
UI::LinearLayout *comparisonView_ = nullptr;
22
UI::LinearLayout *leftDisasm_ = nullptr;
23
UI::LinearLayout *rightDisasm_ = nullptr;
24
25
UI::LinearLayout *blockListView_ = nullptr;
26
UI::LinearLayout *blockListContainer_ = nullptr;
27
28
void OnSelectBlock(UI::EventParams &e);
29
void OnBlockAddress(UI::EventParams &e);
30
void OnAddressChange(UI::EventParams &e);
31
void OnBlockClick(UI::EventParams &e);
32
33
enum class ListType {
34
ALL_BLOCKS,
35
FPU_BLOCKS,
36
VFPU_BLOCKS,
37
};
38
enum class ListSort {
39
BLOCK_NUM,
40
BLOCK_LENGTH_DESC,
41
BLOCK_LENGTH_ASC,
42
TIME_SPENT,
43
EXECUTIONS,
44
MAX
45
};
46
ListType listType_ = ListType::ALL_BLOCKS;
47
ListSort listSort_ = ListSort::TIME_SPENT;
48
49
int currentBlock_ = -1; // For DISASM mode
50
int64_t sumTotalNanos_ = 0;
51
int64_t sumExecutions_ = 0;
52
std::vector<int> blockList_; // for BLOCK_LIST mode
53
54
UI::TextView *blockName_ = nullptr;
55
UI::TextEdit *blockAddr_ = nullptr;
56
UI::TextView *blockStats_ = nullptr;
57
58
UI::TextView *globalStats_ = nullptr;
59
};
60
61
class AddressPromptScreen : public UI::PopupScreen {
62
public:
63
AddressPromptScreen(std::string_view title) : PopupScreen(title, "OK", "Cancel") {}
64
65
const char *tag() const override { return "AddressPrompt"; }
66
67
bool key(const KeyInput &key) override;
68
69
UI::Event OnChoice;
70
71
protected:
72
void CreatePopupContents(UI::ViewGroup *parent) override;
73
void OnCompleted(DialogResult result) override;
74
void OnDigitButton(UI::EventParams &e);
75
void OnBackspace(UI::EventParams &e);
76
77
private:
78
void AddDigit(int n);
79
void BackspaceDigit();
80
void UpdatePreviewDigits();
81
82
UI::TextView *addrView_ = nullptr;
83
UI::Button *buttons_[16]{};
84
unsigned int addr_ = 0;
85
};
86
87