diff --git a/libs/UIX.DecompXml/Decompiler.Script.cs b/libs/UIX.DecompXml/Decompiler.Script.cs index a8ac477..6e6d6b6 100644 --- a/libs/UIX.DecompXml/Decompiler.Script.cs +++ b/libs/UIX.DecompXml/Decompiler.Script.cs @@ -55,8 +55,6 @@ partial class Decompiler // End of function if (i + 1 != methodBody.Length) throw new InvalidOperationException("Expected end of function!"); - - break; } } @@ -186,6 +184,11 @@ partial class Decompiler ); break; + case OpCode.ReturnValue: + var returnStatement = ReturnStatement(IrisExpression.ToSyntax(stack.Pop(), _context)); + blockStack.Peek().Statements.Add(returnStatement); + break; + case not OpCode.ReturnVoid: if (!TryDecompileExpression(instruction, stack, blockStack)) { diff --git a/test/STYLES_decomp.uix b/test/STYLES_decomp.uix index e196635..d7c4cbe 100644 --- a/test/STYLES_decomp.uix +++ b/test/STYLES_decomp.uix @@ -850,12 +850,14 @@ { // Unsupported instruction: CSYM 63 ; + return source; } // TODO: JMP 170 }// Unsupported instruction: VTC 960 ; source = FrameBackgrounds.get_Item(DefaultBackgroundIndex).Value; // Unsupported instruction: CSYM 63 ; + return source; }