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