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

(WIP) make per-level segment loading not suck #783

Closed someone2639 closed 2 months ago

someone2639 commented 4 months ago

(NEEDS TESTING)

Example Usage would look something like this (only have to write that one command instead of 3) image

gheskett commented 4 months ago

I wouldn't call it completely 100% obsolete given the use cases of custom level scripts and the fact that idk if fast64 really even touches that stuff. I'm admittedly not huge on those scripts.h defines btw but I don't have a great alternative suggestion.

someone2639 commented 4 months ago

the scripts.h changes are necessary otherwise fast64 would actually cause compilation errors lol

gheskett commented 4 months ago

Figured that might be the case...unforch.

gheskett commented 4 months ago

In that case, I'd just ditch the A and B macros tbh

someone2639 commented 4 months ago

macros are consolidated except for LOAD_COMMON0 and LOAD_COMMON0_FULL because floombas break if you load every model from common0 for some reason

gheskett commented 4 months ago

That sounds like a bug, how is that even possible

someone2639 commented 4 months ago

it does a jump to null and crashes, I think it's because the scripts segment is not loaded yet so you can't jump to the data formerly known as script_func_global_1

someone2639 commented 4 months ago

I think there's water in my theory from above, as copying the contents of common0_load_geolayouts into the intro script works fine but the jump link doesnt

gheskett commented 4 months ago

Also just a forewarning, there's a strong chance a new fast64 version will handle placing geo loads for you. In other words, common1 and group0 are probably not going to work with jump scripts.

gheskett commented 2 months ago

Gonna close this for now; i don't see a good way to do this cleanly (and safely) that's worth the change atm, especially when fast64 might handle object banks in the future and/or we ditch object banks completely.