diff options
| author | 2015-08-22 18:42:47 -0400 | |
|---|---|---|
| committer | 2015-08-22 18:42:47 -0400 | |
| commit | 250d474280c94976792ea87c8f4fbb86426321b4 (patch) | |
| tree | 6c1e9d2c1a55e9c9af4445c33291c3ce20d1aaa9 /src/common/x64/emitter.cpp | |
| parent | Fix broken boot introduced by last-minute change in #1025 (diff) | |
| parent | emitter: Remove pointer casts (diff) | |
| download | yuzu-250d474280c94976792ea87c8f4fbb86426321b4.tar.gz yuzu-250d474280c94976792ea87c8f4fbb86426321b4.tar.xz yuzu-250d474280c94976792ea87c8f4fbb86426321b4.zip | |
Merge pull request #1058 from lioncash/ptr
emitter: Remove pointer casts
Diffstat (limited to 'src/common/x64/emitter.cpp')
| -rw-r--r-- | src/common/x64/emitter.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/common/x64/emitter.cpp b/src/common/x64/emitter.cpp index cf31f8d69..749a75b72 100644 --- a/src/common/x64/emitter.cpp +++ b/src/common/x64/emitter.cpp | |||
| @@ -109,6 +109,29 @@ u8 *XEmitter::GetWritableCodePtr() | |||
| 109 | return code; | 109 | return code; |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | void XEmitter::Write8(u8 value) | ||
| 113 | { | ||
| 114 | *code++ = value; | ||
| 115 | } | ||
| 116 | |||
| 117 | void XEmitter::Write16(u16 value) | ||
| 118 | { | ||
| 119 | std::memcpy(code, &value, sizeof(u16)); | ||
| 120 | code += sizeof(u16); | ||
| 121 | } | ||
| 122 | |||
| 123 | void XEmitter::Write32(u32 value) | ||
| 124 | { | ||
| 125 | std::memcpy(code, &value, sizeof(u32)); | ||
| 126 | code += sizeof(u32); | ||
| 127 | } | ||
| 128 | |||
| 129 | void XEmitter::Write64(u64 value) | ||
| 130 | { | ||
| 131 | std::memcpy(code, &value, sizeof(u64)); | ||
| 132 | code += sizeof(u64); | ||
| 133 | } | ||
| 134 | |||
| 112 | void XEmitter::ReserveCodeSpace(int bytes) | 135 | void XEmitter::ReserveCodeSpace(int bytes) |
| 113 | { | 136 | { |
| 114 | for (int i = 0; i < bytes; i++) | 137 | for (int i = 0; i < bytes; i++) |