Skip to content

Prevent removing main camera pointer by Play_ClearCamera#2580

Draft
djevangelia wants to merge 2 commits into
OoTRandomizer:Devfrom
djevangelia:subcameras
Draft

Prevent removing main camera pointer by Play_ClearCamera#2580
djevangelia wants to merge 2 commits into
OoTRandomizer:Devfrom
djevangelia:subcameras

Conversation

@djevangelia
Copy link
Copy Markdown

@djevangelia djevangelia commented May 20, 2026

When too many subcam cutscenes, prevent main camera pointer getting set to NULL. Fixes #2003.

See the linked issue and video for more details. In short this fixes crashing in the Spirit Temple mirror room due to too many sun and chest cutscenes at the same time. I've had this fixed in my R&D build for weeks but not pushed it because I have a slight ungrounded fear that removing the main camera pointer could potentially be something that happens normally sometimes - but nothing has happened and I doubt Play_ClearCamera would be the function doing that if it even were to happen during gameplay.

Disassembly

Play_ClearCamera NTSC 1.0 matching disassembly here https://gist.github.com/djevangelia/feab5feb6ba51e4387466df77cb5861d

Testing

Tested on Ares recent nightly build and Project64 3.0.1.
Works like this: https://www.youtube.com/watch?v=ymp2OFTM7Lg

For testing and reproduction, see code here: https://gist.github.com/djevangelia/38b0c0741752be046a1f6447077b6d08

@fenhl fenhl added Type: Bug Something isn't working Component: ASM/C Changes some internals of the ASM/C libraries Status: Needs Review Someone should be looking at it labels May 20, 2026
@djevangelia
Copy link
Copy Markdown
Author

I tested today for the Wallmaster cutscene softlock in randomizer and to my surprise, it actually seems already fixed somehow. So this PR will fix issue #2003 completely.

Wallmaster + cutscene in decomp and randomizer: https://www.youtube.com/watch?v=JDcUn0ScUXQ

@djevangelia djevangelia marked this pull request as draft June 1, 2026 13:01
@djevangelia
Copy link
Copy Markdown
Author

Rewrite is a bit buggy so need to look at it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: ASM/C Changes some internals of the ASM/C libraries Status: Needs Review Someone should be looking at it Type: Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Starting a cutscene whilst the cutscene of lighting a sun is playing can result in a softlock

2 participants