diff --git a/.vscode/opengoal.code-snippets b/.vscode/opengoal.code-snippets index e7947caaf4..45975a6791 100644 --- a/.vscode/opengoal.code-snippets +++ b/.vscode/opengoal.code-snippets @@ -23,4 +23,10 @@ "body": [";; og:update-with-merge"], "description": "The file will be updated with a git merge-file instead of naive copy-paste" }, + "og:preserve-this": { + "scope": "opengoal", + "prefix": ["og:preserve-this"], + "body": [";; og:preserve-this"], + "description": "When updating GOAL source files from decomp, CI will pick up if this comment is deleted in the diff. Use this to keep track of manually patched sections of code." + }, } diff --git a/decompiler/IR2/Form.h b/decompiler/IR2/Form.h index 87f6c7509d..0ff7f1b72b 100644 --- a/decompiler/IR2/Form.h +++ b/decompiler/IR2/Form.h @@ -1295,6 +1295,7 @@ class DerefElement : public FormElement { private: ConstantTokenElement* try_as_art_const(const Env& env, FormPool& pool); GenericElement* try_as_curtime(FormPool& pool); + GenericElement* try_as_seconds_per_frame(FormPool& pool); Form* m_base = nullptr; bool m_is_addr_of = false; diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 1a45ae9d60..9d80f7a900 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -3846,6 +3846,52 @@ void FunctionCallElement::update_from_stack(const Env& env, } } + // detect launch-particles macro + { + if (unstacked.at(0)->to_form(env).is_symbol("sp-launch-particles-var")) { + auto system = arg_forms.at(0); + auto part = arg_forms.at(1); + auto origin = arg_forms.at(2); + auto launch_state = arg_forms.at(3); + auto launch_control = arg_forms.at(4); + auto rate = arg_forms.at(5); + std::vector