MCPcopy Create free account
hub / github.com/N64Recomp/N64Recomp / do_ldr

Function do_ldr

include/recomp.h:206–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206static inline gpr do_ldr(uint8_t* rdram, gpr initial_value, gpr offset, gpr reg) {
207 // Calculate the overall address
208 gpr address = (offset + reg);
209
210 // Load the aligned dword
211 gpr dword_address = address & ~0x7;
212 uint64_t loaded_value = load_doubleword(rdram, 0, dword_address);
213
214 // Mask the existing value and shift the loaded value appropriately
215 gpr misalignment = address & 0x7;
216 gpr masked_value = initial_value & ~(0xFFFFFFFFFFFFFFFFu >> (56 - misalignment * 8));
217 loaded_value >>= (56 - misalignment * 8);
218
219 return masked_value | loaded_value;
220}
221
222static inline void do_sdl(uint8_t* rdram, gpr offset, gpr reg, gpr val) {
223 // Calculate the overall address

Callers

nothing calls this directly

Calls 1

load_doublewordFunction · 0.85

Tested by

no test coverage detected