HackerN64 / HackerSM64

A Super Mario 64 decompilation repo based on CrashOveride95/ultrasm64 that aims to provide a flexible, easy-to-use base for creating romhacks.
328 stars 146 forks source link

Save up to 130KB of RAM at literally zero cost #786

Closed arthurtilly closed 4 months ago

arthurtilly commented 4 months ago

Lol

gheskett commented 4 months ago

Actually wait, I'm not 100% convinced this is safe. What happens if your cell doesn't have any surfaces in it? Normally this would mean that your next entry is null, but is it actually possible for the head pointer to be null in this case?

arthurtilly commented 4 months ago

why would it not be possible for the head pointer to be null. (*cells)[SPATIAL_PARTITION_FLOORS] = NULL;

gheskett commented 4 months ago

Okay I looked at it a bit more and I don't actually see anywhere where the surface partition lists are even being written to to begin with (apart from the NULL cases). Did you actually test this?

arthurtilly commented 4 months ago

?? ofc i tested it it works fine lol, theyre written in the same places they usually are

gheskett commented 4 months ago

Maybe I'm just blind but I don't see how those pointers could be set to any value other than NULL

gheskett commented 4 months ago

I'm just gonna merge this, I doubt anybody else is gonna review it and if it really is broken, I'd rather find that out sooner than later