mirror of
https://github.com/Mr-Wiseguy/Zelda64Recomp.git
synced 2025-03-04 18:55:21 +01:00
Zero the memory allocated to hold extended actor data
This commit is contained in:
parent
277cb5d7d3
commit
0c78154c2d
@ -137,6 +137,11 @@ extern "C" void recomp_create_actor_data(uint8_t* rdram, recomp_context* ctx) {
|
||||
void* data = recomp::alloc(rdram, alloc_size);
|
||||
alloc_count++;
|
||||
data_ptr = reinterpret_cast<uint8_t*>(data) - rdram + 0xFFFFFFFF80000000U;
|
||||
// Zero the allocated memory.
|
||||
// A memset should be fine here since this data is aligned, but use a byteswapped loop just to be safe.
|
||||
for (size_t i = 0; i < alloc_size; i++) {
|
||||
MEM_B(i, data_ptr) = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the actor's fields to the actor data slotmap.
|
||||
|
Loading…
x
Reference in New Issue
Block a user