about summary refs log tree commit diff stats
path: root/Source/RandomizerCore.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/RandomizerCore.h')
-rw-r--r--Source/RandomizerCore.h155
1 files changed, 155 insertions, 0 deletions
diff --git a/Source/RandomizerCore.h b/Source/RandomizerCore.h new file mode 100644 index 0000000..4002611 --- /dev/null +++ b/Source/RandomizerCore.h
@@ -0,0 +1,155 @@
1#pragma once
2#include "Memory.h"
3
4// #define GLOBALS 0x5B28C0
5#define GLOBALS 0x62A080
6
7__declspec(selectany) int SWAP_NONE = 0x0;
8__declspec(selectany) int SWAP_TARGETS = 0x1;
9__declspec(selectany) int SWAP_LINES = 0x2;
10
11class RandomizerCore
12{
13public:
14 void Randomize(std::vector<int>& panels, int flags);
15 void RandomizeRange(std::vector<int> &panels, int flags, size_t startIndex, size_t endIndex);
16 void SwapPanels(int panel1, int panel2, int flags);
17 void ReassignTargets(const std::vector<int>& panels, const std::vector<int>& order);
18
19 template <class T>
20 std::vector<T> ReadPanelData(int panel, int offset, size_t size) {
21 return _memory.ReadData<T>({GLOBALS, 0x18, panel*8, offset}, size);
22 }
23
24 template <class T>
25 void WritePanelData(int panel, int offset, const std::vector<T>& data) {
26 _memory.WriteData<T>({GLOBALS, 0x18, panel*8, offset}, data);
27 }
28
29private:
30 Memory _memory = Memory("witness64_d3d11.exe");
31};
32
33#if GLOBALS == 0x5B28C0
34#define PATH_COLOR 0xC8
35#define REFLECTION_PATH_COLOR 0xD8
36#define DOT_COLOR 0xF8
37#define ACTIVE_COLOR 0x108
38#define BACKGROUND_REGION_COLOR 0x118
39#define SUCCESS_COLOR_A 0x128
40#define SUCCESS_COLOR_B 0x138
41#define STROBE_COLOR_A 0x148
42#define STROBE_COLOR_B 0x158
43#define ERROR_COLOR 0x168
44#define PATTERN_POINT_COLOR 0x188
45#define PATTERN_POINT_COLOR_A 0x198
46#define PATTERN_POINT_COLOR_B 0x1A8
47#define SYMBOL_A 0x1B8
48#define SYMBOL_B 0x1C8
49#define SYMBOL_C 0x1D8
50#define SYMBOL_D 0x1E8
51#define SYMBOL_E 0x1F8
52#define PUSH_SYMBOL_COLORS 0x208
53#define OUTER_BACKGROUND 0x20C
54#define OUTER_BACKGROUND_MODE 0x21C
55#define TRACED_EDGES 0x230
56#define AUDIO_PREFIX 0x278
57#define POWER 0x2A8
58#define TARGET 0x2BC
59#define IS_CYLINDER 0x2FC
60#define CYLINDER_Z0 0x300
61#define CYLINDER_Z1 0x304
62#define CYLINDER_RADIUS 0x308
63#define CURSOR_SPEED_SCALE 0x358
64#define SPECULAR_ADD 0x398
65#define SPECULAR_POWER 0x39C
66#define PATH_WIDTH_SCALE 0x3A4
67#define STARTPOINT_SCALE 0x3A8
68#define NUM_DOTS 0x3B8
69#define NUM_CONNECTIONS 0x3BC
70#define MAX_BROADCAST_DISTANCE 0x3C0
71#define DOT_POSITIONS 0x3C8
72#define DOT_FLAGS 0x3D0
73#define DOT_CONNECTION_A 0x3D8
74#define DOT_CONNECTION_B 0x3E0
75#define DECORATIONS 0x420
76#define DECORATION_FLAGS 0x428
77#define DECORATION_COLORS 0x430
78#define NUM_DECORATIONS 0x438
79#define REFLECTION_DATA 0x440
80#define GRID_SIZE_X 0x448
81#define GRID_SIZE_Y 0x44C
82#define STYLE_FLAGS 0x450
83#define SEQUENCE_LEN 0x45C
84#define SEQUENCE 0x460
85#define DOT_SEQUENCE_LEN 0x468
86#define DOT_SEQUENCE 0x470
87#define DOT_SEQUENCE_LEN_REFLECTION 0x478
88#define DOT_SEQUENCE_REFLECTION 0x480
89#define NUM_COLORED_REGIONS 0x4A0
90#define COLORED_REGIONS 0x4A8
91#define PANEL_TARGET 0x4B0
92#define SPECULAR_TEXTURE 0x4D8
93#define CABLE_TARGET_2 0xD8
94#elif GLOBALS == 0x62A080
95#define PATH_COLOR 0xC0
96#define REFLECTION_PATH_COLOR 0xD0
97#define DOT_COLOR 0xF0
98#define ACTIVE_COLOR 0x100
99#define BACKGROUND_REGION_COLOR 0x110
100#define SUCCESS_COLOR_A 0x120
101#define SUCCESS_COLOR_B 0x130
102#define STROBE_COLOR_A 0x140
103#define STROBE_COLOR_B 0x150
104#define ERROR_COLOR 0x160
105#define PATTERN_POINT_COLOR 0x180
106#define PATTERN_POINT_COLOR_A 0x190
107#define PATTERN_POINT_COLOR_B 0x1A0
108#define SYMBOL_A 0x1B0
109#define SYMBOL_B 0x1C0
110#define SYMBOL_C 0x1D0
111#define SYMBOL_D 0x1E0
112#define SYMBOL_E 0x1F0
113#define PUSH_SYMBOL_COLORS 0x200
114#define OUTER_BACKGROUND 0x204
115#define OUTER_BACKGROUND_MODE 0x214
116#define TRACED_EDGES 0x228
117#define AUDIO_PREFIX 0x270
118#define POWER 0x2A0
119#define TARGET 0x2B4
120#define IS_CYLINDER 0x2F4
121#define CYLINDER_Z0 0x2F8
122#define CYLINDER_Z1 0x2FC
123#define CYLINDER_RADIUS 0x300
124#define CURSOR_SPEED_SCALE 0x350
125#define SPECULAR_ADD 0x38C
126#define SPECULAR_POWER 0x390
127#define PATH_WIDTH_SCALE 0x39C
128#define STARTPOINT_SCALE 0x3A0
129#define NUM_DOTS 0x3B4
130#define NUM_CONNECTIONS 0x3B8
131#define MAX_BROADCAST_DISTANCE 0x3BC
132#define DOT_POSITIONS 0x3C0
133#define DOT_FLAGS 0x3C8
134#define DOT_CONNECTION_A 0x3D0
135#define DOT_CONNECTION_B 0x3D8
136#define DECORATIONS 0x418
137#define DECORATION_FLAGS 0x420
138#define DECORATION_COLORS 0x428
139#define NUM_DECORATIONS 0x430
140#define REFLECTION_DATA 0x438
141#define GRID_SIZE_X 0x440
142#define GRID_SIZE_Y 0x444
143#define STYLE_FLAGS 0x448
144#define SEQUENCE_LEN 0x454
145#define SEQUENCE 0x458
146#define DOT_SEQUENCE_LEN 0x460
147#define DOT_SEQUENCE 0x468
148#define DOT_SEQUENCE_LEN_REFLECTION 0x470
149#define DOT_SEQUENCE_REFLECTION 0x478
150#define NUM_COLORED_REGIONS 0x498
151#define COLORED_REGIONS 0x4A0
152#define PANEL_TARGET 0x4A8
153#define SPECULAR_TEXTURE 0x4D0
154#define CABLE_TARGET_2 0xD0
155#endif \ No newline at end of file