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

Function do_swr

include/recomp.h:175–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175static inline void do_swr(uint8_t* rdram, gpr offset, gpr reg, gpr val) {
176 // Calculate the overall address
177 gpr address = (offset + reg);
178
179 // Get the initial value of the aligned word
180 gpr word_address = address & ~0x3;
181 uint32_t initial_value = MEM_W(0, word_address);
182
183 // Mask the initial value and shift the input value appropriately
184 gpr misalignment = address & 0x3;
185 uint32_t masked_initial_value = initial_value & ~(0xFFFFFFFFu << (24 - misalignment * 8));
186 uint32_t shifted_input_value = ((uint32_t)val) << (24 - misalignment * 8);
187 MEM_W(0, word_address) = masked_initial_value | shifted_input_value;
188}
189
190static inline gpr do_ldl(uint8_t* rdram, gpr initial_value, gpr offset, gpr reg) {
191 // Calculate the overall address

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected