about summary refs log tree commit diff stats
path: root/Source/Memory.h
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2021-08-21 23:29:29 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2021-08-21 23:29:29 -0400
commitb4328af638852e57ff2d75836266d887700bee1e (patch)
tree32c0e6b596a86da89659645964ac6c674bb938c4 /Source/Memory.h
parent1591ee64b865c0f432ec3a178cfec80dfbae1e86 (diff)
downloadwitness-tutorializer-b4328af638852e57ff2d75836266d887700bee1e.tar.gz
witness-tutorializer-b4328af638852e57ff2d75836266d887700bee1e.tar.bz2
witness-tutorializer-b4328af638852e57ff2d75836266d887700bee1e.zip
Backported some of sigma's stuff
Diffstat (limited to 'Source/Memory.h')
-rw-r--r--Source/Memory.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/Memory.h b/Source/Memory.h index e924bb9..fc67b4f 100644 --- a/Source/Memory.h +++ b/Source/Memory.h
@@ -1,6 +1,6 @@
1#pragma once 1#pragma once
2 2
3extern int GLOBALS, POSITION, ORIENTATION, PATH_COLOR, REFLECTION_PATH_COLOR, DOT_COLOR, ACTIVE_COLOR, BACKGROUND_REGION_COLOR, SUCCESS_COLOR_A, SUCCESS_COLOR_B, STROBE_COLOR_A, STROBE_COLOR_B, ERROR_COLOR, PATTERN_POINT_COLOR, PATTERN_POINT_COLOR_A, PATTERN_POINT_COLOR_B, SYMBOL_A, SYMBOL_B, SYMBOL_C, SYMBOL_D, SYMBOL_E, PUSH_SYMBOL_COLORS, OUTER_BACKGROUND, OUTER_BACKGROUND_MODE, TRACED_EDGES, AUDIO_PREFIX, POWER, TARGET, POWER_OFF_ON_FAIL, IS_CYLINDER, CYLINDER_Z0, CYLINDER_Z1, CYLINDER_RADIUS, CURSOR_SPEED_SCALE, NEEDS_REDRAW, SPECULAR_ADD, SPECULAR_POWER, PATH_WIDTH_SCALE, STARTPOINT_SCALE, NUM_DOTS, NUM_CONNECTIONS, MAX_BROADCAST_DISTANCE, DOT_POSITIONS, DOT_FLAGS, DOT_CONNECTION_A, DOT_CONNECTION_B, DECORATIONS, DECORATION_FLAGS, DECORATION_COLORS, NUM_DECORATIONS, REFLECTION_DATA, GRID_SIZE_X, GRID_SIZE_Y, STYLE_FLAGS, SEQUENCE_LEN, SEQUENCE, DOT_SEQUENCE_LEN, DOT_SEQUENCE, DOT_SEQUENCE_LEN_REFLECTION, DOT_SEQUENCE_REFLECTION, NUM_COLORED_REGIONS, COLORED_REGIONS, PANEL_TARGET, SPECULAR_TEXTURE, CABLE_TARGET_2, AUDIO_LOG_NAME, OPEN_RATE, METADATA, HOTEL_EP_NAME; 3//extern int GLOBALS, POSITION, ORIENTATION, PATH_COLOR, REFLECTION_PATH_COLOR, DOT_COLOR, ACTIVE_COLOR, BACKGROUND_REGION_COLOR, SUCCESS_COLOR_A, SUCCESS_COLOR_B, STROBE_COLOR_A, STROBE_COLOR_B, ERROR_COLOR, PATTERN_POINT_COLOR, PATTERN_POINT_COLOR_A, PATTERN_POINT_COLOR_B, SYMBOL_A, SYMBOL_B, SYMBOL_C, SYMBOL_D, SYMBOL_E, PUSH_SYMBOL_COLORS, OUTER_BACKGROUND, OUTER_BACKGROUND_MODE, TRACED_EDGES, AUDIO_PREFIX, POWER, TARGET, POWER_OFF_ON_FAIL, IS_CYLINDER, CYLINDER_Z0, CYLINDER_Z1, CYLINDER_RADIUS, CURSOR_SPEED_SCALE, NEEDS_REDRAW, SPECULAR_ADD, SPECULAR_POWER, PATH_WIDTH_SCALE, STARTPOINT_SCALE, NUM_DOTS, NUM_CONNECTIONS, MAX_BROADCAST_DISTANCE, DOT_POSITIONS, DOT_FLAGS, DOT_CONNECTION_A, DOT_CONNECTION_B, DECORATIONS, DECORATION_FLAGS, DECORATION_COLORS, NUM_DECORATIONS, REFLECTION_DATA, GRID_SIZE_X, GRID_SIZE_Y, STYLE_FLAGS, SEQUENCE_LEN, SEQUENCE, DOT_SEQUENCE_LEN, DOT_SEQUENCE, DOT_SEQUENCE_LEN_REFLECTION, DOT_SEQUENCE_REFLECTION, NUM_COLORED_REGIONS, COLORED_REGIONS, PANEL_TARGET, SPECULAR_TEXTURE, CABLE_TARGET_2, AUDIO_LOG_NAME, OPEN_RATE, METADATA, HOTEL_EP_NAME;
4 4
5enum class ProcStatus { 5enum class ProcStatus {
6 NotRunning, 6 NotRunning,
@@ -80,6 +80,20 @@ public:
80 WriteData<T>({ GLOBALS, 0x18, panel * 8, offset }, data); 80 WriteData<T>({ GLOBALS, 0x18, panel * 8, offset }, data);
81 } 81 }
82 82
83 template <class T>
84 T ReadPanelData(int panel, int offset) {
85 return ReadData<T>({ GLOBALS, 0x18, panel * 8, offset }, 1)[0];
86 }
87
88 template <class T>
89 std::vector<T> ReadPanelData(int panel, int offset, size_t size) {
90 if (size == 0) return std::vector<T>();
91 return ReadData<T>({ GLOBALS, 0x18, panel * 8, offset }, size);
92 }
93
94 static int GLOBALS;
95 static int globalsTests[3];
96
83private: 97private:
84 template<class T> 98 template<class T>
85 std::vector<T> ReadData(const std::vector<int>& offsets, size_t numItems) { 99 std::vector<T> ReadData(const std::vector<int>& offsets, size_t numItems) {
@@ -103,7 +117,6 @@ private:
103 void Heartbeat(HWND window, WPARAM wParam); 117 void Heartbeat(HWND window, WPARAM wParam);
104 bool Initialize(); 118 bool Initialize();
105 void* ComputeOffset(std::vector<int> offsets); 119 void* ComputeOffset(std::vector<int> offsets);
106 void LoadPanelOffsets();
107 120
108 int _previousFrame = 0; 121 int _previousFrame = 0;
109 bool _threadActive = false; 122 bool _threadActive = false;