Skip to content

Commit 040dc67

Browse files
committed
Shortcut for reading pointers
1 parent 2e2ceac commit 040dc67

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Library/Includes/Framework/ProcessPlus.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ namespace CTRPluginFramework {
137137
* \return The value of the address
138138
*/
139139
static u16 Read16(u32 address);
140+
static u16 Read16(u32 pointer, u32 offset);
140141

141142
/**
142143
* \brief Safely read 32 bits

Library/Sources/Framework/ProcessPlus.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ namespace CTRPluginFramework {
203203
return *(volatile unsigned short*)(address);
204204
}
205205

206+
u16 ProcessPlus::Read16(u32 pointer, u32 offset) {
207+
u16 data;
208+
Process::Read16(pointer, data);
209+
return *(volatile unsigned short*)(data + offset);
210+
}
211+
206212
u32 ProcessPlus::Read32(u32 address) {
207213
return *(volatile unsigned int*)(address);
208214
}

0 commit comments

Comments
 (0)