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

Function do_swl

include/recomp.h:160–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160static inline void do_swl(uint8_t* rdram, gpr offset, gpr reg, gpr val) {
161 // Calculate the overall address
162 gpr address = (offset + reg);
163
164 // Get the initial value of the aligned word
165 gpr word_address = address & ~0x3;
166 uint32_t initial_value = MEM_W(0, word_address);
167
168 // Mask the initial value and shift the input value appropriately
169 gpr misalignment = address & 0x3;
170 uint32_t masked_initial_value = initial_value & ~(0xFFFFFFFFu >> (misalignment * 8));
171 uint32_t shifted_input_value = ((uint32_t)val) >> (misalignment * 8);
172 MEM_W(0, word_address) = masked_initial_value | shifted_input_value;
173}
174
175static inline void do_swr(uint8_t* rdram, gpr offset, gpr reg, gpr val) {
176 // Calculate the overall address

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected