From c7c78ad2d89fee77238d003d572b3edd4249637c Mon Sep 17 00:00:00 2001 From: TGE Date: Thu, 28 Nov 2024 19:59:13 +0100 Subject: [PATCH] Unsigned fixes & add instruction tests --- .../Compiler/FlowScriptCompiler.cs | 101 +- .../Compiler/Parser/CompilationUnitParser.cs | 43 +- .../Compiler/ScopeContext.cs | 9 +- .../Decompiler/CompilationUnitWriter.cs | 31 +- .../Decompiler/EvaluatedScope.cs | 4 + .../Decompiler/Evaluator.cs | 85 +- .../Decompiler/FlowScriptDecompiler.cs | 28 +- .../FlowScriptLanguage/Syntax/IStatement.cs | 3 + .../FlowScriptLanguage/Syntax/ISyntaxNode.cs | 9 + .../FlowScriptLanguage/Syntax/Parameter.cs | 4 +- .../FlowScriptLanguage/Syntax/Statement.cs | 4 +- .../Declarations/ProcedureDeclaration.cs | 4 +- .../Declarations/VariableDeclaration.cs | 4 +- .../Syntax/Statements/Expression.cs | 2 +- .../Expressions/Literals/IIntLiteral.cs | 6 + .../Expressions/Literals/IntLiteral.cs | 4 +- .../Expressions/Literals/UIntLiteral.cs | 7 +- .../Syntax/Statements/IExpression.cs | 8 + .../FlowScriptLanguage/Syntax/SyntaxNode.cs | 2 +- .../Syntax/SyntaxNodeCollector.cs | 8 + .../Syntax/SyntaxNodeVisitor.cs | 4 + .../Syntax/VariableModifier.cs | 4 +- .../AtlusScriptLibraryTests.csproj | 6 + .../Decompiler/FlowScriptDecompilerTests.cs | 27 +- .../TestResources/Complex.BF | Bin 0 -> 28128 bytes .../JumpInstruction.bf.flowasm.h | 16 - .../TestResources/JumpInstruction.bf.msg | 46 - .../TestResources/JumpInstruction.bf.msg.h | 16 - .../TestResources/JumpInstruction2.bf | Bin 0 -> 27863 bytes .../TestResources/JumpInstruction2.bf.flow | 1531 +++++++++++++++++ .../TestResources/JumpInstruction2.bf.flow.bf | Bin 0 -> 28439 bytes .../TestResources/JumpInstruction2.bf.msg | 204 +++ .../TestResources/JumpInstruction2.bf.msg.h | 60 + .../TestResources/POPREG.bf | Bin 0 -> 15648 bytes 34 files changed, 2063 insertions(+), 217 deletions(-) create mode 100644 Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/IStatement.cs create mode 100644 Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/ISyntaxNode.cs create mode 100644 Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expressions/Literals/IIntLiteral.cs create mode 100644 Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/IExpression.cs create mode 100644 Source/AtlusScriptLibraryTests/TestResources/Complex.BF delete mode 100644 Source/AtlusScriptLibraryTests/TestResources/JumpInstruction.bf.flowasm.h delete mode 100644 Source/AtlusScriptLibraryTests/TestResources/JumpInstruction.bf.msg delete mode 100644 Source/AtlusScriptLibraryTests/TestResources/JumpInstruction.bf.msg.h create mode 100644 Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf create mode 100644 Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf.flow create mode 100644 Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf.flow.bf create mode 100644 Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf.msg create mode 100644 Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf.msg.h create mode 100644 Source/AtlusScriptLibraryTests/TestResources/POPREG.bf diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Compiler/FlowScriptCompiler.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Compiler/FlowScriptCompiler.cs index 17ce5d99..acbb563d 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Compiler/FlowScriptCompiler.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Compiler/FlowScriptCompiler.cs @@ -319,7 +319,7 @@ private void ReorderProcedures(CompilationUnit compilationUnit) var nameParts = declaration.Identifier.Text.Split('_'); if (nameParts.Length < 2) continue; if (!nameParts[nameParts.Length - 2].Equals("index", StringComparison.OrdinalIgnoreCase)) continue; - if (!int.TryParse(nameParts[nameParts.Length - 1], out var index)) + if (!uint.TryParse(nameParts[nameParts.Length - 1], out var index)) { Error($"Unable to parse procedure index {nameParts[nameParts.Length - 1]}. Index will not be changed"); continue; @@ -340,7 +340,7 @@ private void AddMissingProcedures(CompilationUnit compilationUnit) if (!Scope.Procedures.Any(x => x.Value.Index == i)) { // Add dummy procedure - var procedure = new ProcedureDeclaration(i, TypeIdentifier.Void, new Identifier($"procedure_{i}"), new List(), new CompoundStatement()); + var procedure = new ProcedureDeclaration((uint)i, TypeIdentifier.Void, new Identifier($"procedure_{i}"), new List(), new CompoundStatement()); compilationUnit.Declarations.Add(procedure); Scope.TryDeclareProcedure(procedure, out _); } @@ -588,7 +588,7 @@ private bool TryProcessCompiledFlowScriptImport(FlowScript compiledFlowScript) { // Add a declaration for the imported procedure var procedure = compiledFlowScript.Procedures[i]; - var procedureDecl = new ProcedureDeclaration(new IntLiteral(i), TypeIdentifier.Void, + var procedureDecl = new ProcedureDeclaration(new UIntLiteral((uint)i), TypeIdentifier.Void, new Identifier(procedure.Name), new List(), null); @@ -657,7 +657,7 @@ private bool TryProcessCompiledFlowScriptImport(FlowScript compiledFlowScript) } // Add variable declaration to script - var decl = new VariableDeclaration(new VariableModifier(modifier, new IntLiteral(index)), + var decl = new VariableDeclaration(new VariableModifier(modifier, new UIntLiteral((uint)index)), new TypeIdentifier(valueKind), new Identifier(valueKind, NameFormatter.GenerateVariableName(modifier, valueKind, (ushort)index, true)), null); @@ -946,7 +946,7 @@ private bool TryEvaluateCompilationUnitBeforeCompilation(CompilationUnit compila new VariableModifier(VariableModifierKind.Constant), new TypeIdentifier(ValueKind.Int), new Identifier(ValueKind.Int, dialog.Name), - new IntLiteral(i) + new UIntLiteral((uint)i) ); if (!Scope.TryDeclareVariable(declaration)) @@ -1006,14 +1006,14 @@ private bool TryEvaluateCompilationUnitBeforeCompilation(CompilationUnit compila } // Count parameter by type. - short intParameterCount = 0; - short floatParameterCount = 0; + ushort intParameterCount = 0; + ushort floatParameterCount = 0; foreach (var parameter in procedureDeclaration.Parameters) { - short count = 1; + ushort count = 1; if (parameter.IsArray) - count = (short)(((ArrayParameter)parameter).Size); + count = (ushort)(((ArrayParameter)parameter).Size); if (!Library.UsePOPREG || parameter.Modifier == ParameterModifier.Out) { @@ -1317,7 +1317,7 @@ private bool TryEmitProcedureParameters(List parameters) // Create declaration VariableDeclaration declaration; - int count = 1; + uint count = 1; if (!parameter.IsArray) { @@ -1720,9 +1720,9 @@ private bool TryRegisterVariableDeclaration(VariableDeclaration declaration, out } // Declare variable in scope - short size = 1; + ushort size = 1; if (declaration.IsArray) - size = (short)(((ArrayVariableDeclaration)declaration).Size); + size = (ushort)(((ArrayVariableDeclaration)declaration).Size); if (!Scope.TryDeclareVariable(declaration, index, size)) { @@ -1846,7 +1846,7 @@ private bool TryEmitExpression(Expression expression, bool isStatement) EmitPushBoolLiteral(boolLiteral); break; - case IntLiteral intLiteral: + case IIntLiteral intLiteral: if (isStatement) { Error(intLiteral, "A integer literal is an invalid statement"); @@ -1855,15 +1855,6 @@ private bool TryEmitExpression(Expression expression, bool isStatement) EmitPushIntLiteral(intLiteral); break; - case UIntLiteral uintLiteral: - if (isStatement) - { - Error(uintLiteral, "A integer literal is an invalid statement"); - return false; - } - - EmitPushUIntLiteral(uintLiteral); - break; case FloatLiteral floatLiteral: if (isStatement) { @@ -1908,15 +1899,15 @@ private bool TryEmitSubscriptOperator(SubscriptOperator subscriptOperator) InitializerList arrayInitializer = variable.Declaration.Initializer as InitializerList; - if (subscriptOperator.Index is IntLiteral intLiteral) + if (subscriptOperator.Index is IIntLiteral intLiteral) { // Known index Expression initializer = null; if (arrayInitializer != null) - initializer = arrayInitializer.Expressions[intLiteral]; + initializer = arrayInitializer.Expressions[(int)intLiteral.Value]; if (!TryEmitPushVariableValue(variable.Declaration.Modifier, variable.Declaration.Type.ValueKind, - variable.GetArrayElementIndex(intLiteral), + variable.GetArrayElementIndex((int)intLiteral.Value), initializer)) { return false; @@ -1932,7 +1923,7 @@ private bool TryEmitSubscriptOperator(SubscriptOperator subscriptOperator) var falseLabel = CreateLabel($"SubscriptIfNot{i}"); // Emit current index - EmitPushIntLiteral(i); + EmitPushIntLiteral(new UIntLiteral((uint)i)); // Emit index expression if (!TryEmitExpression(subscriptOperator.Index, false)) @@ -2053,13 +2044,11 @@ private bool TryEmitCall(CallOperator callExpression, bool isStatement) continue; var arg = callExpression.Arguments[i]; - if (!(arg.Expression is IntLiteral argInt)) - { - // only check constants for now - // TODO: evaluate expressions - continue; - } + // only check constants for now + // TODO: evaluate expressions + if (!(arg is IIntLiteral argInt)) + continue; var index = argInt.Value; if (index < 0 || index >= mScript.MessageScript.Dialogs.Count) { @@ -2071,7 +2060,7 @@ private bool TryEmitCall(CallOperator callExpression, bool isStatement) ? DialogKind.Message : DialogKind.Selection; - var dialog = mScript.MessageScript.Dialogs[index]; + var dialog = mScript.MessageScript.Dialogs[(int)index]; if (dialog.Kind != expectedDialogKind) { Error($"Function call to {callExpression.Identifier.Text} doesn't reference a {expectedDialogKind} dialog, got dialog of type: {dialog.Kind} index: {index}"); @@ -2181,42 +2170,42 @@ private void AddCompiledProcedure(ProcedureInfo procedure, Procedure compiledPro private bool TryEmitIntrinsicCall(CallOperator callExpression, bool isStatement) { - bool TryGetProcedureIndexArgument(CallOperator callExpression, out short index) + bool TryGetProcedureIndexArgument(CallOperator callExpression, out ushort index) { - index = short.MinValue; + index = ushort.MaxValue; if (callExpression.Arguments.Count == 1) { - if (callExpression.Arguments[0].Expression is IntLiteral intArg) + if (callExpression.Arguments[0].Expression is IIntLiteral intArg) { - index = (short)intArg.Value; + index = (ushort)intArg.Value; return true; } else if (callExpression.Arguments[0].Expression is Identifier identifierArg) { if (!Scope.TryGetProcedure(identifierArg.Text, out var proc)) { - index = (short)proc.Index; + index = (ushort)proc.Index; return true; } } } return false; } - bool TryGetLabelIndexArgument(CallOperator callExpression, out short index) + bool TryGetLabelIndexArgument(CallOperator callExpression, out ushort index) { - index = short.MinValue; + index = ushort.MaxValue; if (callExpression.Arguments.Count == 1) { - if (callExpression.Arguments[0].Expression is IntLiteral intArg) + if (callExpression.Arguments[0].Expression is IIntLiteral intArg) { - index = (short)intArg.Value; + index = (ushort)intArg.Value; return true; } else if (callExpression.Arguments[0].Expression is Identifier identifierArg) { if (!mLabels.TryGetValue(identifierArg.Text, out var label)) { - index = (short)label.Index; + index = (ushort)label.Index; return true; } } @@ -2228,7 +2217,7 @@ bool TryGetVariableIndexArgument(CallOperator callExpression, out ushort index) index = ushort.MaxValue; if (callExpression.Arguments.Count == 1) { - if (callExpression.Arguments[0].Expression is IntLiteral intArg) + if (callExpression.Arguments[0].Expression is IIntLiteral intArg) { index = (ushort)intArg.Value; return true; @@ -2249,7 +2238,7 @@ bool TryGetCommIndexArgument(CallOperator callExpression, out ushort index) index = ushort.MaxValue; if (callExpression.Arguments.Count == 1) { - if (callExpression.Arguments[0].Expression is IntLiteral intArg) + if (callExpression.Arguments[0].Expression is IIntLiteral intArg) { index = (ushort)intArg.Value; return true; @@ -2270,10 +2259,8 @@ bool TryGetCommIndexArgument(CallOperator callExpression, out ushort index) case "__PUSHI": if (callExpression.Arguments.Count == 1) { - if (callExpression.Arguments[0].Expression is UIntLiteral pushiArg) - Emit(Instruction.PUSHI(pushiArg.Value)); - else if (callExpression.Arguments[0].Expression is IntLiteral pushiArg2) - Emit(Instruction.PUSHI((uint)pushiArg2.Value)); + if (callExpression.Arguments[0].Expression is IIntLiteral pushiArg) + Emit(Instruction.PUSHI((uint)pushiArg.Value)); else { Error(callExpression, "__PUSHI requires exactly one integer argument."); @@ -3273,10 +3260,10 @@ private bool TryEmitSubscriptAssignment(AssignmentOperatorBase assignmentOperato return false; } - if (subscriptOperator.Index is IntLiteral intLiteral) + if (subscriptOperator.Index is IIntLiteral intLiteral) { // Known index - if (!TryEmitVariableAssignment(variable.Declaration, variable.GetArrayElementIndex(intLiteral))) + if (!TryEmitVariableAssignment(variable.Declaration, variable.GetArrayElementIndex((int)intLiteral.Value))) return false; } else @@ -3289,7 +3276,7 @@ private bool TryEmitSubscriptAssignment(AssignmentOperatorBase assignmentOperato var falseLabel = CreateLabel($"SubscriptAssignmentIfNot{i}"); // Emit current index - EmitPushIntLiteral(i); + EmitPushIntLiteral(new UIntLiteral((uint)i)); // Emit index expression if (!TryEmitExpression(subscriptOperator.Index, false)) @@ -3584,7 +3571,7 @@ private void EmitPushBoolLiteral(BoolLiteral boolLiteral) Emit(Instruction.PUSHIS(0)); } - private void EmitPushIntLiteral(IntLiteral intLiteral) + private void EmitPushIntLiteral(IIntLiteral intLiteral) { Trace(intLiteral, $"Pushing int literal: {intLiteral}"); @@ -4477,7 +4464,7 @@ private void PopScope() // // Logging // - private void Trace(SyntaxNode node, string message) + private void Trace(ISyntaxNode node, string message) { if (node.SourceInfo != null) Trace($"({node.SourceInfo.Line:D4}:{node.SourceInfo.Column:D4}) {message}"); @@ -4490,7 +4477,7 @@ private void Trace(string message) mLogger.Trace($"{message}"); } - private void Info(SyntaxNode node, string message) + private void Info(ISyntaxNode node, string message) { if (node.SourceInfo != null) Info($"({node.SourceInfo.Line:D4}:{node.SourceInfo.Column:D4}) {message}"); @@ -4503,7 +4490,7 @@ private void Info(string message) mLogger.Info($"{message}"); } - private void Error(SyntaxNode node, string message) + private void Error(ISyntaxNode node, string message) { if (node.SourceInfo != null) Error($"({node.SourceInfo.Line:D4}:{node.SourceInfo.Column:D4}) {message}"); @@ -4522,7 +4509,7 @@ private void Error(string message) // Debugger.Break(); } - private void Warning(SyntaxNode node, string message) + private void Warning(ISyntaxNode node, string message) { if (node.SourceInfo != null) Warning($"({node.SourceInfo.Line:D4}:{node.SourceInfo.Column:D4}) {message}"); diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Compiler/Parser/CompilationUnitParser.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Compiler/Parser/CompilationUnitParser.cs index 564ab51c..b5420ba6 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Compiler/Parser/CompilationUnitParser.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Compiler/Parser/CompilationUnitParser.cs @@ -424,8 +424,8 @@ private bool TryParseFunctionDeclaration(FlowScriptParser.FunctionDeclarationSta if (!TryGet(context, "Expected function index", context.IntLiteral, out var indexNode)) return false; - IntLiteral indexIntLiteral = null; - if (!TryFunc(indexNode, "Failed to parse function index", () => TryParseIntLiteral(indexNode, out indexIntLiteral))) + UIntLiteral indexIntLiteral = null; + if (!TryFunc(indexNode, "Failed to parse function index", () => TryParseUIntLiteral(indexNode, out indexIntLiteral))) return false; functionDeclaration.Index = indexIntLiteral; @@ -584,7 +584,7 @@ private bool TryParseVariableDeclaration(FlowScriptParser.VariableDeclarationSta { // Parse size var sizeLiteral = context.arraySignifier().IntLiteral(); - if (!(sizeLiteral != null && TryParseIntLiteral(sizeLiteral, out var size))) + if (!(sizeLiteral != null && TryParseUIntLiteral(sizeLiteral, out var size))) { var arrayInitializer = variableDeclaration.Initializer as InitializerList; if (arrayInitializer == null) @@ -593,7 +593,7 @@ private bool TryParseVariableDeclaration(FlowScriptParser.VariableDeclarationSta return false; } - size = arrayInitializer.Expressions.Count; + size = (uint)arrayInitializer.Expressions.Count; } ((ArrayVariableDeclaration)variableDeclaration).Size = size; @@ -653,7 +653,7 @@ private bool TryParseVariableModifierIndex(FlowScriptParser.VariableModifierCont { if (TryGet(context, context.IntLiteral, out var indexNode)) { - if (!TryParseIntLiteral(indexNode, out var index)) + if (!TryParseUIntLiteral(indexNode, out var index)) { LogError(indexNode.Symbol, "Invalid variable index"); return false; @@ -1480,6 +1480,37 @@ private bool TryParseIntLiteral(ITerminalNode node, out IntLiteral literal) return true; } + private bool TryParseUIntLiteral(ITerminalNode node, out UIntLiteral literal) + { + literal = CreateAstNode(node); + + uint value = 0; + string intString = node.Symbol.Text; + + if (intString.StartsWith("0x", StringComparison.InvariantCultureIgnoreCase)) + { + // hex number + if (!uint.TryParse(intString.Substring(2), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out value)) + { + LogError(node.Symbol, "Invalid hexidecimal integer value"); + return false; + } + } + else + { + // assume decimal + if (!uint.TryParse(intString, out value)) + { + LogError(node.Symbol, "Invalid decimal integer value"); + return false; + } + } + + literal.Value = value; + + return true; + } + private bool TryParseFloatLiteral(ITerminalNode node, out FloatLiteral literal) { literal = CreateAstNode(node); @@ -1579,7 +1610,7 @@ private bool TryParseParameter(FlowScriptParser.ParameterContext context, out Pa else { var sizeLiteral = context.arraySignifier().IntLiteral(); - if (!(sizeLiteral != null && TryParseIntLiteral(sizeLiteral, out var size))) + if (!(sizeLiteral != null && TryParseUIntLiteral(sizeLiteral, out var size))) { LogError(context, "Array parameter must have array size specified"); return false; diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Compiler/ScopeContext.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Compiler/ScopeContext.cs index b188b9be..f34f8c39 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Compiler/ScopeContext.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Compiler/ScopeContext.cs @@ -227,7 +227,7 @@ public bool TryDeclareEnum(EnumDeclaration declaration) Members = declaration.Values.ToDictionary(x => x.Identifier.Text, y => y.Value) }; - int nextMemberValue = 0; + long nextMemberValue = 0; bool anyImplicitValues = false; for (int i = 0; i < enumType.Members.Count; i++) @@ -237,7 +237,8 @@ public bool TryDeclareEnum(EnumDeclaration declaration) if (value == null) { - enumType.Members[key] = new IntLiteral(nextMemberValue++); + enumType.Members[key] = nextMemberValue < 0 ? new IntLiteral((int)nextMemberValue) : new UIntLiteral((uint)nextMemberValue); + nextMemberValue++; anyImplicitValues = true; } else @@ -256,9 +257,9 @@ public bool TryDeclareEnum(EnumDeclaration declaration) return true; } - private bool TryGetNextMemberValue(Dictionary members, Expression enumValue, out int nextMemberValue) + private bool TryGetNextMemberValue(Dictionary members, Expression enumValue, out long nextMemberValue) { - if (enumValue is IntLiteral intLiteral) + if (enumValue is IIntLiteral intLiteral) { nextMemberValue = intLiteral.Value + 1; return true; diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/CompilationUnitWriter.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/CompilationUnitWriter.cs index 86825222..122385c1 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/CompilationUnitWriter.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/CompilationUnitWriter.cs @@ -202,7 +202,7 @@ public override void Visit(FunctionDeclaration functionDeclaration) { Write("function"); WriteOpenParenthesis(); - WriteHexIntegerLiteral((int)functionDeclaration.Index.Value); + WriteHexIntegerLiteral((uint)functionDeclaration.Index.Value); WriteCloseParenthesis(); Write(" "); Visit(functionDeclaration.ReturnType); @@ -219,7 +219,7 @@ public override void Visit(VariableDeclaration variableDeclaration) if (variableDeclaration.Modifier.Index != null) { WriteOpenParenthesis(); - WriteIntegerLiteral(variableDeclaration.Modifier.Index); + WriteUnsignedIntegerLiteral(variableDeclaration.Modifier.Index); WriteCloseParenthesis(); } @@ -569,6 +569,11 @@ public override void Visit(IntLiteral literal) WriteIntegerLiteral(literal); } + public override void Visit(UIntLiteral literal) + { + WriteUnsignedIntegerLiteral(literal); + } + public override void Visit(StringLiteral literal) { WriteStringLiteral(literal); @@ -740,7 +745,7 @@ private void WriteParameters(List parameters) // Literals // Integer literal - private void WriteIntegerLiteral(IntLiteral intLiteral) + private void WriteUnsignedIntegerLiteral(UIntLiteral intLiteral) { if (IsPowerOfTwo(intLiteral.Value) && (intLiteral.Value & 0xF) == 0) { @@ -752,7 +757,19 @@ private void WriteIntegerLiteral(IntLiteral intLiteral) } } - private void WriteHexIntegerLiteral(int value) + private void WriteIntegerLiteral(IntLiteral intLiteral) + { + if (intLiteral.Value >= 0 && IsPowerOfTwo((uint)intLiteral.Value) && (intLiteral.Value & 0xF) == 0) + { + WriteHexIntegerLiteral((uint)intLiteral.Value); + } + else + { + Write(intLiteral.Value.ToString()); + } + } + + private void WriteHexIntegerLiteral(uint value) { if (FitsInByte(value)) Write($"0x{value:X2}"); @@ -762,17 +779,17 @@ private void WriteHexIntegerLiteral(int value) Write($"0x{value:X8}"); } - private bool IsPowerOfTwo(int x) + private bool IsPowerOfTwo(uint x) { return (x != 0) && ((x & (x - 1)) == 0); } - private bool FitsInShort(int value) + private bool FitsInShort(uint value) { return (((value & 0xffff8000) + 0x8000) & 0xffff7fff) == 0; } - private bool FitsInByte(int value) + private bool FitsInByte(uint value) { // doesn't catch negative values but that doesn't matter in this context return (value & ~0xFF) == 0; diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/EvaluatedScope.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/EvaluatedScope.cs index ca7f8bc0..6d986067 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/EvaluatedScope.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/EvaluatedScope.cs @@ -1,5 +1,7 @@ using AtlusScriptLibrary.FlowScriptLanguage.Syntax; +using System; using System.Collections.Generic; +using System.Diagnostics; namespace AtlusScriptLibrary.FlowScriptLanguage.Decompiler; @@ -19,6 +21,8 @@ public class EvaluatedScope public EvaluatedScope(EvaluatedScope parent) { + if (parent == this) + throw new ArgumentException(nameof(parent)); Parent = parent; StaticIntVariables = new Dictionary(); StaticFloatVariables = new Dictionary(); diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/Evaluator.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/Evaluator.cs index 677ed364..378a2add 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/Evaluator.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/Evaluator.cs @@ -1,6 +1,7 @@ using AtlusScriptLibrary.Common.Libraries; using AtlusScriptLibrary.Common.Logging; using AtlusScriptLibrary.FlowScriptLanguage.Syntax; +using MoreLinq; using System; using System.Collections.Generic; using System.Diagnostics; @@ -174,7 +175,7 @@ private bool TryDeclareVariable(VariableModifierKind modifierKind, ValueKind val { var modifier = indexKind == VariableIndexKind.Implicit ? new VariableModifier(modifierKind) - : new VariableModifier(modifierKind, new IntLiteral(index)); + : new VariableModifier(modifierKind, new UIntLiteral(index)); var type = new TypeIdentifier(valueKind); var identifier = new Identifier(valueKind, NameFormatter.GenerateVariableName(modifierKind, valueKind, index, Scope.Parent == null)); @@ -455,6 +456,10 @@ StackValueType PopStackValue(params StackValueType[] expectedTypes) return type; } + bool CanPopStackValue() + { + return stack.Count != 0 && stack.Peek() != StackValueType.Return; + } switch (instruction.Opcode) { @@ -471,30 +476,10 @@ StackValueType PopStackValue(params StackValueType[] expectedTypes) stack.Push(StackValueType.Float); break; case Opcode.PUSHREG: - { - if (lastFunction != null) - { - // Assume the REG was set through a COMM function - switch (lastFunction.ReturnType.ValueKind) - { - case ValueKind.Bool: - case ValueKind.Int: - stack.Push(StackValueType.Int); - break; - case ValueKind.Float: - stack.Push(StackValueType.Float); - break; - } - } - else - { - // Assume the REG was set by the callee - stack.Push(regValueType); - } - } + stack.Push(regValueType); break; case Opcode.POPIX: - if (stack.Count != 0) + if (CanPopStackValue()) { PopStackValue(StackValueType.Int); } @@ -504,7 +489,7 @@ StackValueType PopStackValue(params StackValueType[] expectedTypes) } break; case Opcode.POPFX: - if (stack.Count != 0) + if (CanPopStackValue()) { PopStackValue(StackValueType.Float); } @@ -520,7 +505,7 @@ StackValueType PopStackValue(params StackValueType[] expectedTypes) ushort index = instruction.Operand.UInt16Value; foreach (var parameter in mFunctions[index].Parameters) { - if (stack.Count != 0) + if (CanPopStackValue()) { switch (parameter.Type.ValueKind) { @@ -531,6 +516,9 @@ StackValueType PopStackValue(params StackValueType[] expectedTypes) case ValueKind.Float: PopStackValue(StackValueType.Float); break; + case ValueKind.String: + PopStackValue(StackValueType.String); + break; default: throw new NotImplementedException(); } @@ -546,6 +534,9 @@ StackValueType PopStackValue(params StackValueType[] expectedTypes) case ValueKind.Float: parameterTypes.Add(StackValueType.Float); break; + case ValueKind.String: + parameterTypes.Add(StackValueType.String); + break; default: throw new NotImplementedException(); } @@ -553,6 +544,16 @@ StackValueType PopStackValue(params StackValueType[] expectedTypes) } lastFunction = mFunctions[index]; + switch (lastFunction.ReturnType.ValueKind) + { + case ValueKind.Bool: + case ValueKind.Int: + regValueType = StackValueType.Int; + break; + case ValueKind.Float: + regValueType = StackValueType.Float; + break; + } } break; case Opcode.END: @@ -570,10 +571,10 @@ StackValueType PopStackValue(params StackValueType[] expectedTypes) case Opcode.MUL: case Opcode.DIV: { - if (stack.Count != 0) + if (CanPopStackValue()) { var typeA = PopStackValue(StackValueType.Int, StackValueType.Float); - if (stack.Count != 0) + if (CanPopStackValue()) { var typeB = PopStackValue(StackValueType.Int, StackValueType.Float); if (typeA == StackValueType.Float || typeB == StackValueType.Float) @@ -608,10 +609,10 @@ StackValueType PopStackValue(params StackValueType[] expectedTypes) case Opcode.SE: case Opcode.LE: { - if (stack.Count != 0) + if (CanPopStackValue()) { var typeA = PopStackValue(StackValueType.Int, StackValueType.Float); - if (stack.Count != 0) + if (CanPopStackValue()) { var typeB = PopStackValue(StackValueType.Int, StackValueType.Float); if (typeA == StackValueType.Float || typeB == StackValueType.Float) @@ -636,7 +637,7 @@ StackValueType PopStackValue(params StackValueType[] expectedTypes) break; case Opcode.IF: { - if (stack.Count != 0) + if (CanPopStackValue()) { PopStackValue(StackValueType.Int, StackValueType.Float); } @@ -656,7 +657,7 @@ StackValueType PopStackValue(params StackValueType[] expectedTypes) stack.Push(StackValueType.Float); break; case Opcode.POPLIX: - if (stack.Count != 0) + if (CanPopStackValue()) { PopStackValue(StackValueType.Int); } @@ -666,7 +667,7 @@ StackValueType PopStackValue(params StackValueType[] expectedTypes) } break; case Opcode.POPLFX: - if (stack.Count != 0) + if (CanPopStackValue()) { PopStackValue(StackValueType.Float); } @@ -688,7 +689,6 @@ StackValueType PopStackValue(params StackValueType[] expectedTypes) parameterTypes.Add(StackValueType.Any); regValueType = StackValueType.Any; } - lastFunction = null; break; } @@ -796,10 +796,14 @@ private bool TryEvaluateInstructions() // Evaluate each instruction foreach (var instruction in mProcedure.Instructions) { + LogDebug($"Evaluating instruction {instruction} at index {mEvaluatedInstructionIndex}"); if (!TryEvaluateInstruction(instruction)) { LogError($"Failed to evaluate instruction: {instruction}"); - return false; + if (StrictMode) + return false; + else + mEvaluationStatementStack.Push(new EvaluatedStatement(new StringLiteral($"Failed to evaluate instruction {instruction} at index {mEvaluatedInstructionIndex}"), mEvaluatedInstructionIndex, null)); } ++mEvaluatedInstructionIndex; @@ -1234,7 +1238,7 @@ private bool TryEvaluateInstruction(Instruction instruction) // Push short case Opcode.PUSHIS: - PushExpression(new IntLiteral(instruction.Operand.UInt16Value)); + PushExpression(new UIntLiteral(instruction.Operand.UInt16Value)); ++mRealStackCount; break; @@ -1433,7 +1437,7 @@ private bool TryPopExpression(out Expression expression) // Check if the left expression is already returns a boolean value, and if so // omit the x == 0 or x == 1 expression - if (left.ExpressionValueKind == ValueKind.Bool && right is IntLiteral intLiteral) + if (left.ExpressionValueKind == ValueKind.Bool && right is IIntLiteral intLiteral) { if (typeof(T) == typeof(NonEqualityOperator)) { @@ -1505,6 +1509,15 @@ private void LogWarning(string message) } } + private void LogDebug(string message) + { + mLogger.Debug($"{message}"); + + if (Debugger.IsAttached) + { + //Debugger.Break(); + } + } private void LogError(string message) { diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/FlowScriptDecompiler.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/FlowScriptDecompiler.cs index c7b9a2f7..0e41dc3c 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/FlowScriptDecompiler.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Decompiler/FlowScriptDecompiler.cs @@ -53,6 +53,8 @@ public class FlowScriptDecompiler /// public bool SumBits { get; set; } + public bool StrictMode { get; set; } + /// /// Initializes a FlowScript decompiler. /// @@ -154,6 +156,7 @@ private bool TryEvaluateScript(FlowScript flowScript, out EvaluationResult evalu { var evaluator = new Evaluator(); evaluator.Library = Library; + evaluator.StrictMode = StrictMode; evaluator.AddListener(new LoggerPassthroughListener(mLogger)); if (!evaluator.TryEvaluateScript(flowScript, out evaluationResult)) { @@ -251,7 +254,7 @@ private bool TryDecompileProcedure(EvaluatedProcedure evaluatedProcedure, out Pr } declaration = new ProcedureDeclaration( - new IntLiteral(mEvaluatedScript.Procedures.IndexOf(evaluatedProcedure)), + new UIntLiteral((uint)mEvaluatedScript.Procedures.IndexOf(evaluatedProcedure)), new TypeIdentifier(evaluatedProcedure.ReturnKind), new Identifier(ValueKind.Procedure, evaluatedProcedure.Procedure.Name), evaluatedProcedure.Parameters, @@ -361,8 +364,9 @@ private void AnnotateBitArgs() continue; // sum literals - var literals = SyntaxNodeCollector.Collect(arg.Expression); - var sum = 0; + var literals = SyntaxNodeCollector.Collect(arg.Expression).Select(x => (IIntLiteral)x) + .Concat(SyntaxNodeCollector.Collect(arg.Expression).Select(x => (IIntLiteral)x)); + long sum = 0; foreach (var literal in literals) sum += literal.Value; @@ -371,7 +375,7 @@ private void AnnotateBitArgs() if (SumBits) { // Replace expression with sum of the expression - arg.Expression = new IntLiteral(sum); + arg.Expression = new UIntLiteral((uint)sum); } else { @@ -410,8 +414,8 @@ private void RemoveDefaultParameterValues() var arg = call.Arguments[argIndex]; var defaultValue = Expression.FromText(libFunc.Parameters[i].DefaultValue); - if (arg.Expression is IntLiteral argLiteral && - defaultValue is IntLiteral defaultValueLiteral && + if (arg.Expression is IIntLiteral argLiteral && + defaultValue is IIntLiteral defaultValueLiteral && argLiteral.Equals(defaultValueLiteral)) { call.Arguments.RemoveAt(argIndex); @@ -452,14 +456,14 @@ private void ReplaceUnnamedMessageScriptConstants() } var arg = call.Arguments[i]; - if (!(arg.Expression is IntLiteral dialogIndex)) + if (!(arg.Expression is IIntLiteral dialogIndex)) { // only handle literals for now // TODO: name constants in compound expressions used to initialize msg variables continue; } - if (dialogIndex >= mEvaluatedScript.FlowScript.MessageScript.Dialogs.Count) + if (dialogIndex.Value >= mEvaluatedScript.FlowScript.MessageScript.Dialogs.Count) { // out of bounds index... weird continue; @@ -468,7 +472,7 @@ private void ReplaceUnnamedMessageScriptConstants() // rewrite expression to be a reference to the dialog name arg.Expression = new Identifier( ValueKind.Int, - mEvaluatedScript.FlowScript.MessageScript.Dialogs[dialogIndex.Value].Name); + mEvaluatedScript.FlowScript.MessageScript.Dialogs[(int)dialogIndex.Value].Name); } } } @@ -556,7 +560,7 @@ private void InsertFunctionCallEnumParameterValues() continue; } - if (!(argument is IntLiteral argumentValue)) + if (!(argument is IIntLiteral argumentValue)) continue; var libraryEnum = Library.FlowScriptModules @@ -978,7 +982,7 @@ private void CoagulateVariableDeclarationAssignmentsRecursively(List true; @@ -40,7 +40,7 @@ public ArrayParameter() } - public ArrayParameter(ParameterModifier modifier, TypeIdentifier type, Identifier identifier, IntLiteral size) : base(modifier, type, identifier, null) + public ArrayParameter(ParameterModifier modifier, TypeIdentifier type, Identifier identifier, UIntLiteral size) : base(modifier, type, identifier, null) { Size = size; } diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statement.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statement.cs index 58c7b2cc..9ec25aa2 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statement.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statement.cs @@ -1,5 +1,5 @@ namespace AtlusScriptLibrary.FlowScriptLanguage.Syntax; -public abstract class Statement : SyntaxNode +public abstract class Statement : SyntaxNode, IStatement { -} \ No newline at end of file +} diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Declarations/ProcedureDeclaration.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Declarations/ProcedureDeclaration.cs index 6992b811..f93bd513 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Declarations/ProcedureDeclaration.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Declarations/ProcedureDeclaration.cs @@ -5,7 +5,7 @@ namespace AtlusScriptLibrary.FlowScriptLanguage.Syntax; public class ProcedureDeclaration : Declaration { - public IntLiteral Index { get; set; } + public UIntLiteral Index { get; set; } public TypeIdentifier ReturnType { get; set; } @@ -25,7 +25,7 @@ public ProcedureDeclaration(TypeIdentifier returnType, Identifier identifier, Li Body = body; } - public ProcedureDeclaration(IntLiteral index, TypeIdentifier returnType, Identifier identifier, List parameters, CompoundStatement body) : base(DeclarationType.Procedure, identifier) + public ProcedureDeclaration(UIntLiteral index, TypeIdentifier returnType, Identifier identifier, List parameters, CompoundStatement body) : base(DeclarationType.Procedure, identifier) { Index = index; ReturnType = returnType; diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Declarations/VariableDeclaration.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Declarations/VariableDeclaration.cs index f9691669..8c042b1d 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Declarations/VariableDeclaration.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Declarations/VariableDeclaration.cs @@ -55,7 +55,7 @@ public static VariableDeclaration FromLibraryConstant(FlowScriptModuleConstant l public class ArrayVariableDeclaration : VariableDeclaration { - public IntLiteral Size { get; set; } + public UIntLiteral Size { get; set; } public override bool IsArray => true; @@ -63,7 +63,7 @@ public ArrayVariableDeclaration() { } - public ArrayVariableDeclaration(VariableModifier modifier, TypeIdentifier type, Identifier identifier, IntLiteral size, Expression initializer) + public ArrayVariableDeclaration(VariableModifier modifier, TypeIdentifier type, Identifier identifier, UIntLiteral size, Expression initializer) : base(modifier, type, identifier, initializer) { Size = size; diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expression.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expression.cs index abf88cc6..83bf85fb 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expression.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expression.cs @@ -5,7 +5,7 @@ namespace AtlusScriptLibrary.FlowScriptLanguage.Syntax; -public abstract class Expression : Statement +public abstract class Expression : Statement, IExpression { public ValueKind ExpressionValueKind { get; set; } diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expressions/Literals/IIntLiteral.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expressions/Literals/IIntLiteral.cs new file mode 100644 index 00000000..3b368434 --- /dev/null +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expressions/Literals/IIntLiteral.cs @@ -0,0 +1,6 @@ +namespace AtlusScriptLibrary.FlowScriptLanguage.Syntax; + +public interface IIntLiteral : IExpression +{ + long Value { get; } +} diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expressions/Literals/IntLiteral.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expressions/Literals/IntLiteral.cs index e3fe27e9..feb2c9cd 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expressions/Literals/IntLiteral.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expressions/Literals/IntLiteral.cs @@ -2,7 +2,7 @@ namespace AtlusScriptLibrary.FlowScriptLanguage.Syntax; -public class IntLiteral : Literal, IEquatable +public class IntLiteral : Literal, IEquatable, IIntLiteral { public IntLiteral() : base(ValueKind.Int) { @@ -12,6 +12,8 @@ public IntLiteral(int value) : base(ValueKind.Int, value) { } + long IIntLiteral.Value => Value; + public bool Equals(IntLiteral other) { return Value == other?.Value; diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expressions/Literals/UIntLiteral.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expressions/Literals/UIntLiteral.cs index b4c75c3f..3df2eec1 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expressions/Literals/UIntLiteral.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/Expressions/Literals/UIntLiteral.cs @@ -2,9 +2,9 @@ namespace AtlusScriptLibrary.FlowScriptLanguage.Syntax; -public class UIntLiteral : Literal, IEquatable +public class UIntLiteral : Literal, IEquatable, IIntLiteral { - public UIntLiteral() : base(ValueKind.Int) + public UIntLiteral() : base(ValueKind.UInt) { } @@ -12,11 +12,12 @@ public UIntLiteral(uint value) : base(ValueKind.UInt, value) { } + long IIntLiteral.Value => Value; + public bool Equals(UIntLiteral other) { return Value == other?.Value; } public static implicit operator UIntLiteral(uint value) => new UIntLiteral(value); - public static implicit operator UIntLiteral(IntLiteral _intLiteral) => new UIntLiteral((uint)_intLiteral.Value); } diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/IExpression.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/IExpression.cs new file mode 100644 index 00000000..897cfed0 --- /dev/null +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/Statements/IExpression.cs @@ -0,0 +1,8 @@ +namespace AtlusScriptLibrary.FlowScriptLanguage.Syntax; + +public interface IExpression : IStatement +{ + ValueKind ExpressionValueKind { get; set; } + + int GetDepth(); +} \ No newline at end of file diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/SyntaxNode.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/SyntaxNode.cs index 0f3c2fd4..d2fe83c9 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/SyntaxNode.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/SyntaxNode.cs @@ -1,6 +1,6 @@ namespace AtlusScriptLibrary.FlowScriptLanguage.Syntax; -public abstract class SyntaxNode +public abstract class SyntaxNode : ISyntaxNode { public SourceInfo SourceInfo { get; internal set; } diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/SyntaxNodeCollector.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/SyntaxNodeCollector.cs index 2de25abe..7ec0b4f8 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/SyntaxNodeCollector.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/SyntaxNodeCollector.cs @@ -410,6 +410,14 @@ public override void Visit(IntLiteral literal) base.Visit(literal); } + public override void Visit(UIntLiteral literal) + { + if (typeof(T) == typeof(UIntLiteral)) + mCollectedNodes.Add(literal as T); + + base.Visit(literal); + } + public override void Visit(StringLiteral literal) { if (typeof(T) == typeof(StringLiteral)) diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/SyntaxNodeVisitor.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/SyntaxNodeVisitor.cs index d65cf13a..b363d03f 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/SyntaxNodeVisitor.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/SyntaxNodeVisitor.cs @@ -321,6 +321,10 @@ public virtual void Visit(IntLiteral literal) { } + public virtual void Visit(UIntLiteral literal) + { + } + public virtual void Visit(StringLiteral literal) { } diff --git a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/VariableModifier.cs b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/VariableModifier.cs index c8f7bdef..042142d7 100644 --- a/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/VariableModifier.cs +++ b/Source/AtlusScriptLibrary/FlowScriptLanguage/Syntax/VariableModifier.cs @@ -4,7 +4,7 @@ public class VariableModifier : SyntaxNode { public VariableModifierKind Kind { get; set; } - public IntLiteral Index { get; set; } + public UIntLiteral Index { get; set; } public VariableModifier() { @@ -18,7 +18,7 @@ public VariableModifier(VariableModifierKind kind) Index = null; } - public VariableModifier(VariableModifierKind kind, IntLiteral index) + public VariableModifier(VariableModifierKind kind, UIntLiteral index) { Kind = kind; Index = index; diff --git a/Source/AtlusScriptLibraryTests/AtlusScriptLibraryTests.csproj b/Source/AtlusScriptLibraryTests/AtlusScriptLibraryTests.csproj index de1d938e..4bacca6a 100644 --- a/Source/AtlusScriptLibraryTests/AtlusScriptLibraryTests.csproj +++ b/Source/AtlusScriptLibraryTests/AtlusScriptLibraryTests.csproj @@ -24,4 +24,10 @@ + + + + + + diff --git a/Source/AtlusScriptLibraryTests/FlowScriptLanguage/Decompiler/FlowScriptDecompilerTests.cs b/Source/AtlusScriptLibraryTests/FlowScriptLanguage/Decompiler/FlowScriptDecompilerTests.cs index ec32e1ca..e8c6ec9e 100644 --- a/Source/AtlusScriptLibraryTests/FlowScriptLanguage/Decompiler/FlowScriptDecompilerTests.cs +++ b/Source/AtlusScriptLibraryTests/FlowScriptLanguage/Decompiler/FlowScriptDecompilerTests.cs @@ -4,6 +4,7 @@ using AtlusScriptLibrary.FlowScriptLanguage.Decompiler; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -19,12 +20,36 @@ private void DecompileScript(string path, string libraryName) var decompiler = new FlowScriptDecompiler { Library = LibraryLookup.GetLibrary(libraryName), + DecompileMessageScript = false, + StrictMode = true }; decompiler.AddListener(new DebugLogListener()); - Assert.IsTrue(decompiler.TryDecompile(script, out var compilationUnit)); + var result = decompiler.TryDecompile(script, out var compilationUnit); + if (!result) + { + decompiler.StrictMode = false; + decompiler.TryDecompile(script, out compilationUnit); + } + var writer = new CompilationUnitWriter(); + writer.Write(compilationUnit, Console.Out); + Assert.IsTrue(result); } [TestMethod] + public void can_decompile_script_with_popreg_instruction() + => DecompileScript("TestResources/POPREG.bf", "p3re"); + + [TestMethod] + [Ignore] // this script seems to have more issues than just jump public void can_decompile_script_with_jump_instruction() => DecompileScript("TestResources/JumpInstruction.bf", "p5r"); + + + [TestMethod] + public void can_decompile_script_with_jump_instruction_2() + => DecompileScript("TestResources/JumpInstruction2.bf", "p5"); + + [TestMethod] + public void can_decompile_script_complex() + => DecompileScript("TestResources/Complex.bf", "p5r"); } diff --git a/Source/AtlusScriptLibraryTests/TestResources/Complex.BF b/Source/AtlusScriptLibraryTests/TestResources/Complex.BF new file mode 100644 index 0000000000000000000000000000000000000000..5e59b11bc8bc73f1a142b8abf9bf73546f46ea42 GIT binary patch literal 28128 zcmb7M2bdhyk?zT1wMr;!wCWW}fWl7LBt(!v2}uZ$$YB^sgIFZ3@M=Xe#+VE?Hqqp4 zFt*9T7;LaH&W8i$&S!!#(Z*+N-*I4{&*AQ`SJgXj-}KHD^L@QN{pzoJ^;f<3x?cB4 zo=2apuPe^&JO4fa*G^qtilx|}S*^r@A>!RkPNdFep4 zq0(Cp{=mxC%BGPuA}>1lwUyJVYY(Bu&`;Euviu?Z@&@<^$;_ey)|Hp^Z(IxxTdL(n z>sE%^rpDMr`b+qgeOtCH>91}*v%G9aKQ)GaVngf2Bcl$Q7%E`HJA z<`K~trmqgeukGvKw58ghi$q%pzCjlW6F%a5SoN$1egvY#Cj(!^(Ez`=vT^NTWpL!7&-Pyq@CR1c?>OnCnx*h>NwWqJ-=%$LR5yl$tkz^Z zT@e0&lPd$8s>^m%1{!H4djtHA{>}Z{PVX;c&J2t^Op`~|@Y@F~>oL6sD;oy;Hf*Q% z`cLv2YFoR6=S%sJfxc}6eS>F~mmXG+rIzH=^!I=@t5>f%*i6ZWv)A)7#}J(5|i zb9LKk)d6E>#6Q_DkjTuJO8>@fTbo6x<%s~l{nY9P+%qs98U=M!hVbP){Z)Nh2vshs zuml=Uf686-SM`}jsB*UoOCa2Tf$yQes?VN;DtD@|1S-&H8xzB)kXGu|vi^tIXNRsxg@>UiF5@OgED&HcJuP!H()*q;)e zG@r)_R4%CF^9hbwk#%tqgZjV?`w0t9`*e(~f zd?TZ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SdJp(6MV3)4RF7Bgs{!*K3m)gSY(!P>pfnB;L zyQm%N>{6R+m)gSYjuRV!UAiW_nB#SJsm--ZZDDrDi;ci8U6WnZTy=J-&9zHyVRm;C z8-ZQACcE_B!5zQU=GvvUFuN1PMqrn&>Ha%f-u2M;vF5w^4M9YnThjRUR}9Su_T{6D zZ+f;%_@H09CO*h@o!yTzUM8`PA-nh;t?}8znii}j?WV6`?`tCT?2pE8@cyJ1*R*c+ znl+ew&q%xV-ZC;1?GM8iszyI*&cpjLzpwp&uB1m# literal 0 HcmV?d00001 diff --git a/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction.bf.flowasm.h b/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction.bf.flowasm.h deleted file mode 100644 index ab298422..00000000 --- a/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction.bf.flowasm.h +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled by Atlus Script Tools (2017-2021) © TGE -const int DUMMY_MSG = 0; -const int TBOX_EMPTY = 1; -const int TBOX_GET_ITEM = 2; -const int TBOX_GET_MONEY = 3; -const int TBOX_GET_ITEM_MONEY = 4; -const int TEST_KEY_GIMMICK01 = 5; -const int TEST_KEY_GIMMICK02 = 6; -const int ESCAPE_GET_TBOX_REIJI = 7; -const int ESCAPE_GET_TBOX_ANNE = 8; -const int ESCAPE_GET_TBOX_NEKO = 9; -const int ESCAPE_EMPTY_TBOX_REIJI = 10; -const int ESCAPE_EMPTY_TBOX_ANNE = 11; -const int ESCAPE_EMPTY_TBOX_NEKO = 12; -const int ENTER_THE_TBOX = 13; -const int ENTER_SEL = 14; diff --git a/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction.bf.msg b/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction.bf.msg deleted file mode 100644 index 713b41c7..00000000 --- a/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction.bf.msg +++ /dev/null @@ -1,46 +0,0 @@ -[msg DUMMY_MSG] -[s][x 0x82 0x9D][n][w][e] - -[msg TBOX_EMPTY] -[s][x 0x80 0x9E][f 2 5 3 65535 0][x 0x81 0xB0][var 1][x 0x89 0xD9][x 0x8C 0xF7][x 0x81 0x89][x 0x94 0xB7][x 0x81 0xAA][x 0x80 0xFD][x 0x82 0x89][n][w][e] - -[msg TBOX_GET_ITEM] -[s][x 0x80 0x9E][f 2 5 3 65535 0][x 0x81 0xB0][var 1][x 0x89 0xD9][x 0x8C 0xF7][x 0x81 0x89][x 0x94 0xB7][x 0x81 0xAA][x 0x80 0xFD][x 0x82 0x89][n][w][e] - -[msg TBOX_GET_MONEY] -[s][x 0x80 0x9E][var 2][x 0x84 0xE2][x 0x81 0xB0][x 0x8C 0xF7][x 0x81 0x89][x 0x94 0xB7][x 0x81 0xAA][x 0x80 0xFD][x 0x82 0x89][n][w][e] - -[msg TBOX_GET_ITEM_MONEY] -[s][x 0x80 0x9E][f 2 5 3 65535 0][x 0x81 0xB0][var 1][x 0x89 0xD9][x 0x81 0x86][n][x 0x80 0x80][var 2][x 0x84 0xE2][x 0x81 0xB0][x 0x8C 0xF7][x 0x81 0x89][x 0x94 0xB7][x 0x81 0xAA][x 0x80 0xFD][x 0x82 0x89][n][w][e] - -[msg TEST_KEY_GIMMICK01] -[s]TEST[n][x 0x81 0xBC][x 0x81 0xBF][x 0x81 0xB0][x 0x95 0xA4][x 0x89 0xC0][x 0x80 0xF5][x 0x80 0xFD][x 0x82 0x89][n][w][e] - -[msg TEST_KEY_GIMMICK02] -[s]TEST[n][x 0x80 0x9E][x 0x97 0xA6][x 0x95 0x97][x 0x81 0x8C][x 0x92 0x85][x 0x81 0x8D][x 0x81 0xBC][x 0x81 0xFA][x 0x80 0xFE][x 0x81 0x81][x 0x80 0xFD][x 0x82 0x9D][x 0x82 0x89][n][w][e] - -[msg ESCAPE_GET_TBOX_REIJI [[x 0x91 0xA8][x 0x93 0xF5] [x 0x9A 0x96][x 0x8C 0xAE]]] -[s][bup 3 10 7 0 65535][x 0x81 0xA6][x 0x81 0x81][x 0x80 0xF5][x 0x81 0xA1][x 0x82 0x88][x 0x80 0xE8][x 0x97 0xA6][x 0x81 0xC3][x 0x81 0xD4][x 0x81 0xD9][x 0x80 0xFE][x 0x80 0xFA][x 0x80 0x81][n][x 0x82 0x9D][x 0x81 0x81][x 0x81 0x84][x 0x82 0x88][x 0x80 0xFB][x 0x81 0xB1][x 0x81 0x88][x 0x8E 0xB5][x 0x8A 0xDA][x 0x80 0xF6][x 0x81 0xA1][x 0x81 0x8B][x 0x80 0xE6][x 0x81 0xA6][x 0x82 0x88][x 0x80 0xF1][x 0x80 0xF1][x 0x81 0x89][x 0x84 0xA6][x 0x81 0xAA][x 0x81 0xA9][x 0x80 0xFC][x 0x80 0x81][n][w][e] - -[msg ESCAPE_GET_TBOX_ANNE [[x 0x8A 0xD5][x 0x86 0xC9] [x 0x83 0xEE]]] -[s][bup 2 1 7 0 65535][x 0x80 0xE8][x 0x82 0x88][x 0x80 0xE2][x 0x80 0xE2][x 0x81 0x8B][x 0x80 0x81][n][x 0x81 0x81][x 0x81 0x84][x 0x82 0x88][x 0x80 0xFB][x 0x81 0xB1][x 0x81 0x88][x 0x8E 0xB5][x 0x8A 0xDA][x 0x80 0xF6][x 0x81 0xA1][x 0x81 0x88][x 0x80 0xE2][x 0x81 0xA6][x 0x82 0x88][x 0x84 0xA6][x 0x81 0xAA][x 0x81 0xA9][x 0x81 0xA6][x 0x80 0x81][n][w][e] - -[msg ESCAPE_GET_TBOX_NEKO [[x 0x81 0xF3][x 0x81 0xFC][x 0x81 0xBD][x 0x81 0xDB]]] -[s][bup 3 10 7 0 65535][x 0x81 0x8B][x 0x80 0xE6][x 0x82 0x88][x 0x85 0xA0][x 0x80 0xEA][x 0x80 0xE2][x 0x80 0xE2][x 0x81 0xA0][x 0x81 0x8C][x 0x89 0xC0][x 0x81 0x82][x 0x80 0xEF][x 0x80 0xFD][x 0x80 0x9F][n][x 0x82 0x9D][x 0x81 0x81][x 0x81 0x84][x 0x89 0xD5][x 0x81 0x81][x 0x81 0x84][x 0x81 0xA9][x 0x81 0xA6][x 0x81 0xA8][x 0x81 0xA0][x 0x82 0x88][x 0x8A 0xF4][x 0x81 0x8D][x 0x84 0xA6][x 0x81 0xAA][x 0x81 0xA9][x 0x81 0x8C][x 0x80 0xEA][x 0x8F 0xED][x 0x89 0x9F][x 0x80 0x81][n][w][e] - -[msg ESCAPE_EMPTY_TBOX_REIJI [[x 0x91 0xA8][x 0x93 0xF5] [x 0x9A 0x96][x 0x8C 0xAE]]] -[s][bup 3 10 7 0 65535][x 0x80 0xE8][x 0x81 0x81][x 0x82 0x88][x 0x80 0xF1][x 0x81 0xAA][x 0x81 0x89][x 0x94 0xB7][x 0x81 0x81][x 0x81 0x84][x 0x81 0xA2][x 0x81 0xA8][x 0x85 0xC2][x 0x80 0xF2][x 0x80 0xF7][x 0x80 0xE9][x 0x80 0x81][n][w][e] - -[msg ESCAPE_EMPTY_TBOX_ANNE [[x 0x8A 0xD5][x 0x86 0xC9] [x 0x83 0xEE]]] -[s][bup 2 1 7 0 65535][x 0x81 0xF5][x 0x81 0xD4][x 0x81 0xD0][x 0x82 0x88][x 0x94 0xB7][x 0x81 0x81][x 0x81 0x84][x 0x80 0x81][n][x 0x81 0xEC][x 0x81 0xFA][x 0x82 0x88][x 0x90 0xC4][x 0x80 0xED][x 0x80 0x81][n][w][e] - -[msg ESCAPE_EMPTY_TBOX_NEKO [[x 0x81 0xF3][x 0x81 0xFC][x 0x81 0xBD][x 0x81 0xDB]]] -[s][bup 3 10 7 0 65535][x 0x81 0xDB][x 0x81 0xB5][x 0x81 0xCA][x 0x80 0x81][n][x 0x80 0xF1][x 0x80 0xF1][x 0x82 0x88][x 0x84 0xA6][x 0x81 0xAA][x 0x81 0xA7][x 0x81 0xAA][x 0x81 0xA9][x 0x80 0x81][n][w][e] - -[msg ENTER_THE_TBOX] -[s][x 0x80 0x9E][x 0x8F 0x9B][x 0x8E 0xF4][x 0x80 0xEE][x 0x81 0xA7][x 0x80 0xE2][x 0x81 0x8D][x 0x94 0xB7][x 0x81 0xAA][x 0x80 0xFB][x 0x80 0xE4][x 0x81 0x88][x 0x81 0xC6][x 0x81 0xB5][x 0x81 0xCB][x 0x80 0xFE][x 0x82 0x9D][n][w][e] - -[sel ENTER_SEL top] -[s][x 0x94 0xB7][x 0x81 0x81][x 0x81 0x84][x 0x81 0x9D][x 0x81 0xA9][e] -[s][x 0x94 0xB7][x 0x81 0xA7][x 0x81 0x88][x 0x80 0xE2][e] - diff --git a/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction.bf.msg.h b/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction.bf.msg.h deleted file mode 100644 index ab298422..00000000 --- a/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction.bf.msg.h +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled by Atlus Script Tools (2017-2021) © TGE -const int DUMMY_MSG = 0; -const int TBOX_EMPTY = 1; -const int TBOX_GET_ITEM = 2; -const int TBOX_GET_MONEY = 3; -const int TBOX_GET_ITEM_MONEY = 4; -const int TEST_KEY_GIMMICK01 = 5; -const int TEST_KEY_GIMMICK02 = 6; -const int ESCAPE_GET_TBOX_REIJI = 7; -const int ESCAPE_GET_TBOX_ANNE = 8; -const int ESCAPE_GET_TBOX_NEKO = 9; -const int ESCAPE_EMPTY_TBOX_REIJI = 10; -const int ESCAPE_EMPTY_TBOX_ANNE = 11; -const int ESCAPE_EMPTY_TBOX_NEKO = 12; -const int ENTER_THE_TBOX = 13; -const int ENTER_SEL = 14; diff --git a/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf b/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf new file mode 100644 index 0000000000000000000000000000000000000000..5964ccda091d6eccac4c4ea98f1b1236926fc1c1 GIT binary patch literal 27863 zcmdsAdvIJ=dB3}Q?%ImwM{FmSZ&|`s6?&H83(VmZGMrM~S>%i#}LW(cA0NR}Bz76+mA{ zNzrlA_x1ND#>Z0wiQ&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ibraryTests/TestResources/JumpInstruction2.bf.flow new file mode 100644 index 00000000..77e37e1e --- /dev/null +++ b/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf.flow @@ -0,0 +1,1531 @@ + +// +// FlowScript decompiled using Atlus Script Tools by TGE (2017-2021) +// In the unfortunate case of any bugs, please report them back to me. +// + + +// +// Imports +// + +import( "JumpInstruction2.bf.msg" ); + +// +// Script-level variable definitions +// + +int sVar73; +int sVar74; +int sVar75; + +// +// Procedure declarations +// + +// Procedure Index: 0 +void TRAIN_SYS_STOP() +{ + int var0; + + if ( FLD_LOCAL_FLAG_CHK( ( 49152 + 10 ) ) == 1 ) + { + return; + } + + var0 = FLD_OBJ_CNV_RESHND( 18 ); + FLD_CROWD_PATH_VISIBLE( 1, 1 ); + FLD_CROWD_PATH_VISIBLE( 8, 1 ); + FLD_CROWD_PATH_VISIBLE( 17, 1 ); + FLD_CROWD_PATH_VISIBLE( 19, 1 ); + FLD_CROWD_PATH_VISIBLE( 68, 1 ); + FLD_CROWD_PATH_VISIBLE( 82, 1 ); + FLD_CROWD_PATH_VISIBLE( 87, 1 ); + FLD_CROWD_PATH_VISIBLE( 103, 1 ); + FLD_CROWD_PATH_VISIBLE( 106, 1 ); + // bit id (0) + (96) = 96 + + if ( !BIT_CHK( ( 0 + 96 ) ) ) + { + FLD_CROWD_PATH_VISIBLE( 0x10, 1 ); + } + + MDL_ANIM( var0, 2, 0, 0, 1.00f ); + BGENV_LINE_SE_PLAY( 4 ); + BGENV_SE_PLAY( 22 ); + // bit id (((0) + (2048)) + (2048)) + (4048) = 8144 + BIT_OFF( ( ( ( 0 + 0x0800 ) + 0x0800 ) + 4048 ) ); + // bit id (((0) + (2048)) + (2048)) + (4049) = 8145 + BIT_ON( ( ( ( 0 + 0x0800 ) + 0x0800 ) + 4049 ) ); + FLD_CROWD_PATH_WAIT( 1, 0 ); + FLD_CROWD_PATH_WAIT( 8, 0 ); + FLD_CROWD_PATH_WAIT( 17, 0 ); + FLD_CROWD_PATH_WAIT( 19, 0 ); + FLD_CROWD_PATH_WAIT( 68, 0 ); + FLD_CROWD_PATH_WAIT( 82, 0 ); + FLD_CROWD_PATH_WAIT( 87, 0 ); + FLD_CROWD_PATH_WAIT( 103, 0 ); + FLD_CROWD_PATH_WAIT( 106, 0 ); + // bit id (0) + (96) = 96 + + if ( !BIT_CHK( ( 0 + 96 ) ) ) + { + FLD_CROWD_PATH_WAIT( 0x10, 0 ); + } + + FLD_BGMNG_LINKPROC_ANIMEND( 0, 1, 18, 2 ); +} + + +// Procedure Index: 1 +void TRAIN_SYS_OPEN() +{ + int var1; + + if ( FLD_LOCAL_FLAG_CHK( ( 49152 + 10 ) ) == 1 ) + { + return; + } + + var1 = FLD_OBJ_CNV_RESHND( 18 ); + MDL_ANIM( var1, 3, 0, 0, 1.00f ); + FLD_CROWD_PATH_WAIT( 4, 0 ); + FLD_CROWD_PATH_WAIT( 7, 0 ); + FLD_CROWD_PATH_WAIT( 9, 0 ); + FLD_CROWD_PATH_WAIT( 73, 0 ); + FLD_CROWD_PATH_WAIT( 79, 0 ); + FLD_CROWD_PATH_WAIT( 81, 0 ); + FLD_CROWD_PATH_WAIT( 86, 0 ); + FLD_CROWD_PATH_WAIT( 88, 0 ); + FLD_CROWD_PATH_WAIT( 104, 0 ); + FLD_CROWD_PATH_WAIT( 105, 0 ); + FLD_CROWD_PATH_WAIT( 107, 0 ); + // bit id (0) + (96) = 96 + + if ( BIT_CHK( ( 0 + 96 ) ) ) + { + FLD_CROWD_PATH_WAIT( 0x10, 0 ); + } + + BGENV_SE_PLAY( 3 ); + FLD_CROWD_PATH_WAIT_UNIT( 4 ); + FLD_CROWD_PATH_WAIT_UNIT( 7 ); + FLD_CROWD_PATH_WAIT_UNIT( 9 ); + FLD_CROWD_PATH_WAIT_UNIT( 73 ); + FLD_CROWD_PATH_WAIT_UNIT( 79 ); + FLD_CROWD_PATH_WAIT_UNIT( 81 ); + FLD_CROWD_PATH_WAIT_UNIT( 86 ); + FLD_CROWD_PATH_WAIT_UNIT( 88 ); + FLD_CROWD_PATH_WAIT_UNIT( 104 ); + FLD_CROWD_PATH_WAIT_UNIT( 105 ); + FLD_CROWD_PATH_WAIT_UNIT( 107 ); + // bit id (0) + (96) = 96 + + if ( BIT_CHK( ( 0 + 96 ) ) ) + { + FLD_CROWD_PATH_WAIT_UNIT( 0x10 ); + } + + __JUMP( TRAIN_SYS_CLOSE ); +} + + +// Procedure Index: 2 +void TRAIN_SYS_CLOSE() +{ + int var2; + + if ( FLD_LOCAL_FLAG_CHK( ( 49152 + 10 ) ) == 1 ) + { + return; + } + + var2 = FLD_OBJ_CNV_RESHND( 18 ); + BGENV_SE_PLAY( 23 ); + MDL_ANIM( var2, 4, 0, 0, 1.00f ); + BGENV_LINE_SE_FADEOUT( 4, 30 ); + BGENV_LINE_SE_PLAY( 5 ); + // bit id (((0) + (2048)) + (2048)) + (4049) = 8145 + BIT_OFF( ( ( ( 0 + 0x0800 ) + 0x0800 ) + 4049 ) ); + // bit id (((0) + (2048)) + (2048)) + (4048) = 8144 + BIT_ON( ( ( ( 0 + 0x0800 ) + 0x0800 ) + 4048 ) ); + FLD_BGMNG_LINKPROC_ANIMEND( 0, 3, 18, 4 ); +} + + +// Procedure Index: 3 +void TRAIN_SYS_CLOSE_WAIT() +{ + int var3; + + if ( FLD_LOCAL_FLAG_CHK( ( 49152 + 10 ) ) == 1 ) + { + return; + } + + var3 = FLD_OBJ_CNV_RESHND( 18 ); + MDL_ANIM( var3, 5, 0, 0, 1.00f ); + FLD_BGMNG_LINKPROC_TIME( 0, 4, 1 ); +} + + +// Procedure Index: 4 +void TRAIN_SYS_GO() +{ + int var4; + + if ( FLD_LOCAL_FLAG_CHK( ( 49152 + 10 ) ) == 1 ) + { + return; + } + + var4 = FLD_OBJ_CNV_RESHND( 18 ); + // bit id (((0) + (2048)) + (2048)) + (4048) = 8144 + BIT_ON( ( ( ( 0 + 0x0800 ) + 0x0800 ) + 4048 ) ); + MDL_ANIM( var4, 6, 0, 0, 1.00f ); + FLD_BGMNG_LINKPROC_ANIMEND( 0, 5, 18, 6 ); +} + + +// Procedure Index: 5 +void TRAIN_SYS_GO_AFTER_WAIT() +{ + int var5; + + if ( FLD_LOCAL_FLAG_CHK( ( 49152 + 10 ) ) == 1 ) + { + return; + } + + var5 = FLD_OBJ_CNV_RESHND( 18 ); + MDL_ANIM( var5, 0, 0, 0, 1.00f ); + FLD_CROWD_PATH_REPOP_UNIT( 4 ); + FLD_CROWD_PATH_REPOP_UNIT( 7 ); + FLD_CROWD_PATH_REPOP_UNIT( 9 ); + FLD_CROWD_PATH_REPOP_UNIT( 73 ); + FLD_CROWD_PATH_REPOP_UNIT( 79 ); + FLD_CROWD_PATH_REPOP_UNIT( 81 ); + FLD_CROWD_PATH_REPOP_UNIT( 86 ); + FLD_CROWD_PATH_REPOP_UNIT( 88 ); + FLD_CROWD_PATH_REPOP_UNIT( 104 ); + FLD_CROWD_PATH_REPOP_UNIT( 105 ); + FLD_CROWD_PATH_REPOP_UNIT( 107 ); + // bit id (0) + (96) = 96 + + if ( BIT_CHK( ( 0 + 96 ) ) ) + { + FLD_CROWD_PATH_REPOP_UNIT( 0x10 ); + } + + FLD_BGMNG_LINKPROC_TIME( 0, 6, 10 ); +} + + +// Procedure Index: 6 +void TRAIN_SYS_RETURN() +{ + int var6; + + if ( FLD_LOCAL_FLAG_CHK( ( 49152 + 10 ) ) == 1 ) + { + return; + } + + var6 = FLD_OBJ_CNV_RESHND( 18 ); + BGENV_LINE_SE_PLAY( 6 ); + MDL_ANIM( var6, 1, 0, 0, 1.00f ); + FLD_CROWD_PATH_REPOP_UNIT( 1 ); + FLD_CROWD_PATH_REPOP_UNIT( 8 ); + FLD_CROWD_PATH_REPOP_UNIT( 17 ); + FLD_CROWD_PATH_REPOP_UNIT( 19 ); + FLD_CROWD_PATH_REPOP_UNIT( 68 ); + FLD_CROWD_PATH_REPOP_UNIT( 82 ); + FLD_CROWD_PATH_REPOP_UNIT( 87 ); + FLD_CROWD_PATH_REPOP_UNIT( 103 ); + FLD_CROWD_PATH_REPOP_UNIT( 106 ); + // bit id (0) + (96) = 96 + + if ( !BIT_CHK( ( 0 + 96 ) ) ) + { + FLD_CROWD_PATH_REPOP_UNIT( 0x10 ); + } + + FLD_CROWD_PATH_VISIBLE( 1, 0 ); + FLD_CROWD_PATH_VISIBLE( 8, 0 ); + FLD_CROWD_PATH_VISIBLE( 17, 0 ); + FLD_CROWD_PATH_VISIBLE( 19, 0 ); + FLD_CROWD_PATH_VISIBLE( 68, 0 ); + FLD_CROWD_PATH_VISIBLE( 82, 0 ); + FLD_CROWD_PATH_VISIBLE( 87, 0 ); + FLD_CROWD_PATH_VISIBLE( 103, 0 ); + FLD_CROWD_PATH_VISIBLE( 106, 0 ); + // bit id (0) + (96) = 96 + + if ( !BIT_CHK( ( 0 + 96 ) ) ) + { + FLD_CROWD_PATH_VISIBLE( 0x10, 0 ); + } + + FLD_BGMNG_LINKPROC_ANIMEND( 0, 0, 18, 1 ); +} + + +// Procedure Index: 7 +void TRAIN_SYS_RIDE_DOOR_OPEN_WAIT() +{ + int var7; + var7 = FLD_OBJ_CNV_RESHND( 18 ); + FLD_CROWD_PATH_WAIT_UNIT( 4 ); + FLD_CROWD_PATH_WAIT_UNIT( 7 ); + FLD_CROWD_PATH_WAIT_UNIT( 9 ); + FLD_CROWD_PATH_WAIT_UNIT( 73 ); + FLD_CROWD_PATH_WAIT_UNIT( 79 ); + FLD_CROWD_PATH_WAIT_UNIT( 81 ); + FLD_CROWD_PATH_WAIT_UNIT( 86 ); + FLD_CROWD_PATH_WAIT_UNIT( 88 ); + FLD_CROWD_PATH_WAIT_UNIT( 104 ); + FLD_CROWD_PATH_WAIT_UNIT( 105 ); + FLD_CROWD_PATH_WAIT_UNIT( 107 ); + // bit id (0) + (96) = 96 + + if ( BIT_CHK( ( 0 + 96 ) ) ) + { + FLD_CROWD_PATH_WAIT_UNIT( 0x10 ); + } + + BGENV_SE_PLAY( 3 ); + WAIT( 0 ); + __JUMP( TRAIN_SYS_RIDE_DOOR_CLOSE ); +} + + +// Procedure Index: 8 +void TRAIN_SYS_RIDE_DOOR_CLOSE() +{ + int var8; + var8 = FLD_OBJ_CNV_RESHND( 18 ); + BGENV_SE_PLAY( 23 ); + MDL_ANIM( var8, 4, 0, 0, 1.00f ); + BGENV_LINE_SE_FADEOUT( 4, 30 ); + BGENV_LINE_SE_PLAY( 5 ); + FLD_BGMNG_LINKPROC_ANIMEND( 0, 9, 18, 4 ); +} + + +// Procedure Index: 9 +void TRAIN_SYS_RIDE_DOOR_CLOSE_WAIT() +{ + int var9; + var9 = FLD_OBJ_CNV_RESHND( 18 ); + MDL_ANIM( var9, 5, 0, 0, 1.00f ); + FLD_BGMNG_LINKPROC_TIME( 0, 10, 1 ); +} + + +// Procedure Index: 10 +void TRAIN_SYS_RIDE_GO() +{ + int var10; + var10 = FLD_OBJ_CNV_RESHND( 18 ); + MDL_ANIM( var10, 6, 0, 0, 1.00f ); + // bit id (((0) + (2048)) + (2048)) + (4049) = 8145 + BIT_OFF( ( ( ( 0 + 0x0800 ) + 0x0800 ) + 4049 ) ); + // bit id (((0) + (2048)) + (2048)) + (4048) = 8144 + BIT_ON( ( ( ( 0 + 0x0800 ) + 0x0800 ) + 4048 ) ); + FLD_BGMNG_LINKPROC_ANIMEND( 0, 5, 18, 6 ); +} + + +// Procedure Index: 11 +void ACCESS_DENENTOSI_01() +{ + int var11; + var11 = FLD_PC_GET_RESHND( 0 ); + // bit id (0) + (96) = 96 + + if ( BIT_CHK( ( 0 + 96 ) ) ) + { + SUB_KFEVT_ACCESS_DENENTOSI_01(); + } + else + { + FLD_UNIT_SET_WALK( var11 ); + FLD_MODEL_POINT_ROTATE( var11, 7853.391f, 0.00f, -14.8684f, 5 ); + FLD_MODEL_SET_TRANSLATE( var11, 7853.391f, 0.00f, -14.8684f, 10 ); + FLD_MODEL_SYNC_TRANSLATE( var11 ); + FLD_MODEL_SET_ROTATE( var11, 0, 0, 0, 5 ); + FLD_MODEL_SET_TRANSLATE( var11, 7827.36f, -0.00f, 125.6125f, 20 ); + FLD_MODEL_SYNC_TRANSLATE( var11 ); + FLD_UNIT_SET_WAIT( var11 ); + Fld_FadeOut_Subway(); + CALL_FIELD( 11, 6, 2, 0 ); + } + +} + + +// Procedure Index: 12 +void ACCESS_DENENTOSI_02() +{ + int var12; + var12 = FLD_PC_GET_RESHND( 0 ); + // bit id (0) + (96) = 96 + + if ( BIT_CHK( ( 0 + 96 ) ) ) + { + SUB_KFEVT_ACCESS_DENENTOSI_02(); + } + else + { + FLD_UNIT_SET_WALK( var12 ); + FLD_MODEL_POINT_ROTATE( var12, 13244.22f, 0.00f, -113.854f, 5 ); + FLD_MODEL_SET_TRANSLATE( var12, 13244.22f, 0.00f, -113.854f, 10 ); + FLD_MODEL_SYNC_TRANSLATE( var12 ); + FLD_MODEL_SET_ROTATE( var12, 0, 0, 0, 5 ); + FLD_MODEL_SET_TRANSLATE( var12, 13207.24f, 0.00f, 128.5401f, 20 ); + FLD_MODEL_SYNC_TRANSLATE( var12 ); + FLD_UNIT_SET_WAIT( var12 ); + Fld_FadeOut_Subway(); + CALL_FIELD( 11, 6, 2, 0 ); + } + +} + + +// Procedure Index: 13 +void ACCESS_DENENTOSI_01_CALL() +{ + int var13; + int var14; + var13 = FLD_OBJ_CNV_RESHND( 18 ); + var14 = FLD_PC_GET_RESHND( 0 ); + // bit id (0) + (96) = 96 + // bit id (0) + (96) = 96 + // bit id (0) + (96) = 96 + // bit id (0) + (96) = 96 + // bit id (0) + (96) = 96 + + if ( BIT_CHK( ( 0 + 96 ) ) ) + { + SUB_KFEVT_ACCESS_DENENTOSI_01_CALL(); + } + else + { + FLD_LOCAL_FLAG_ON( ( 49152 + 10 ) ); + FADEOUT( 5, 10 ); + FADE_SYNC(); + FLD_CROWD_PATH_VISIBLE( 4, 1 ); + FLD_CROWD_PATH_VISIBLE( 7, 1 ); + FLD_CROWD_PATH_VISIBLE( 9, 1 ); + FLD_CROWD_PATH_VISIBLE( 73, 1 ); + FLD_CROWD_PATH_VISIBLE( 79, 1 ); + FLD_CROWD_PATH_VISIBLE( 81, 1 ); + FLD_CROWD_PATH_VISIBLE( 86, 1 ); + FLD_CROWD_PATH_VISIBLE( 88, 1 ); + + if ( BIT_CHK( ( 0 + 96 ) ) ) + { + FLD_CROWD_PATH_VISIBLE( 0x10, 1 ); + } + + BGENV_LINE_SE_STOP( 3 ); + BGENV_LINE_SE_STOP( 4 ); + BGENV_LINE_SE_STOP( 5 ); + BGENV_LINE_SE_STOP( 6 ); + MDL_ANIM( var13, 5, 0, 0, 1.00f ); + MDL_ANIM( var13, 1, 0, 0, 1.00f ); + BGENV_LINE_SE_PLAY( 6 ); + + if ( FLD_MODEL_GET_X_TRANSLATE( var14 ) >= 7628.00f ) + { + FLD_MODEL_SET_POS( var14, 8 ); + } + else + { + FLD_MODEL_SET_POS( var14, 23 ); + } + + FLD_MODEL_SET_ROTATE( var14, 0, 0, 0, 5 ); + FADEIN( 5, 20 ); + FADE_SYNC(); + MDL_ANIM_SYNC( var13 ); + FLD_CROWD_PATH_VISIBLE( 1, 1 ); + FLD_CROWD_PATH_VISIBLE( 8, 1 ); + FLD_CROWD_PATH_VISIBLE( 17, 1 ); + FLD_CROWD_PATH_VISIBLE( 19, 1 ); + FLD_CROWD_PATH_VISIBLE( 68, 1 ); + FLD_CROWD_PATH_VISIBLE( 82, 1 ); + FLD_CROWD_PATH_VISIBLE( 87, 1 ); + + if ( !BIT_CHK( ( 0 + 96 ) ) ) + { + FLD_CROWD_PATH_VISIBLE( 0x10, 1 ); + } + + MDL_ANIM( var13, 2, 0, 0, 1.00f ); + MDL_ANIM_SYNC( var13 ); + FLD_CROWD_PATH_WAIT( 1, 0 ); + FLD_CROWD_PATH_WAIT( 8, 0 ); + FLD_CROWD_PATH_WAIT( 17, 0 ); + FLD_CROWD_PATH_WAIT( 19, 0 ); + FLD_CROWD_PATH_WAIT( 68, 0 ); + FLD_CROWD_PATH_WAIT( 82, 0 ); + FLD_CROWD_PATH_WAIT( 87, 0 ); + + if ( !BIT_CHK( ( 0 + 96 ) ) ) + { + FLD_CROWD_PATH_WAIT( 0x10, 0 ); + } + + FLD_CROWD_PATH_WAIT( 4, 0 ); + FLD_CROWD_PATH_WAIT( 7, 0 ); + FLD_CROWD_PATH_WAIT( 9, 0 ); + FLD_CROWD_PATH_WAIT( 73, 0 ); + FLD_CROWD_PATH_WAIT( 79, 0 ); + FLD_CROWD_PATH_WAIT( 81, 0 ); + FLD_CROWD_PATH_WAIT( 86, 0 ); + FLD_CROWD_PATH_WAIT( 88, 0 ); + + if ( BIT_CHK( ( 0 + 96 ) ) ) + { + FLD_CROWD_PATH_WAIT( 0x10, 0 ); + } + + FLD_UNIT_SET_WALK( var14 ); + FLD_MODEL_ADD_TRANSLATE( var14, 0, 0, 300, 30 ); + FLD_MODEL_SYNC_TRANSLATE( var14 ); + FLD_UNIT_SET_WAIT( var14 ); + Fld_FadeOut_Subway(); + CALL_FIELD( 11, 6, 2, 0 ); + } + +} + + +// Procedure Index: 14 +void ACCESS_DENENTOSI_02_CALL() +{ + int var15; + int var16; + var15 = FLD_OBJ_CNV_RESHND( 18 ); + var16 = FLD_PC_GET_RESHND( 0 ); + // bit id (0) + (96) = 96 + + if ( BIT_CHK( ( 0 + 96 ) ) ) + { + SUB_KFEVT_ACCESS_DENENTOSI_02_CALL(); + } + else + { + FADEOUT( 5, 10 ); + FADE_SYNC(); + FLD_CROWD_PATH_VISIBLE( 1, 1 ); + FLD_CROWD_PATH_VISIBLE( 8, 1 ); + FLD_CROWD_PATH_VISIBLE( 17, 1 ); + FLD_CROWD_PATH_VISIBLE( 19, 1 ); + FLD_CROWD_PATH_VISIBLE( 0x10, 1 ); + FLD_CROWD_PATH_VISIBLE( 68, 1 ); + FLD_CROWD_PATH_VISIBLE( 82, 1 ); + FLD_CROWD_PATH_VISIBLE( 87, 1 ); + FLD_CROWD_PATH_VISIBLE( 4, 1 ); + FLD_CROWD_PATH_VISIBLE( 7, 1 ); + FLD_CROWD_PATH_VISIBLE( 9, 1 ); + FLD_CROWD_PATH_VISIBLE( 73, 1 ); + FLD_CROWD_PATH_VISIBLE( 79, 1 ); + FLD_CROWD_PATH_VISIBLE( 81, 1 ); + FLD_CROWD_PATH_VISIBLE( 86, 1 ); + FLD_CROWD_PATH_VISIBLE( 88, 1 ); + BGENV_LINE_SE_STOP( 3 ); + BGENV_LINE_SE_STOP( 4 ); + BGENV_LINE_SE_STOP( 5 ); + BGENV_LINE_SE_STOP( 6 ); + MDL_ANIM( var15, 5, 0, 0, 1.00f ); + MDL_ANIM( var15, 1, 0, 0, 1.00f ); + MDL_ANIM_SEEK( var15, 120 ); + BGENV_LINE_SE_PLAY( 3 ); + FLD_MODEL_SET_POS( var16, 3 ); + FLD_MODEL_SET_ROTATE( var16, 0, 0, 0, 5 ); + FADEIN( 5, 20 ); + FADE_SYNC(); + MDL_ANIM_SYNC( var15 ); + MDL_ANIM( var15, 2, 0, 0, 1.00f ); + MDL_ANIM_SYNC( var15 ); + FLD_CROWD_PATH_WAIT( 1, 0 ); + FLD_CROWD_PATH_WAIT( 8, 0 ); + FLD_CROWD_PATH_WAIT( 17, 0 ); + FLD_CROWD_PATH_WAIT( 19, 0 ); + FLD_CROWD_PATH_WAIT( 0x10, 0 ); + FLD_CROWD_PATH_WAIT( 68, 0 ); + FLD_CROWD_PATH_WAIT( 82, 0 ); + FLD_CROWD_PATH_WAIT( 87, 0 ); + FLD_CROWD_PATH_WAIT( 4, 0 ); + FLD_CROWD_PATH_WAIT( 7, 0 ); + FLD_CROWD_PATH_WAIT( 9, 0 ); + FLD_CROWD_PATH_WAIT( 73, 0 ); + FLD_CROWD_PATH_WAIT( 79, 0 ); + FLD_CROWD_PATH_WAIT( 81, 0 ); + FLD_CROWD_PATH_WAIT( 86, 0 ); + FLD_CROWD_PATH_WAIT( 88, 0 ); + FLD_UNIT_SET_WALK( var16 ); + FLD_MODEL_ADD_TRANSLATE( var16, 0, 0, 300, 30 ); + FLD_MODEL_SYNC_TRANSLATE( var16 ); + FLD_UNIT_SET_WAIT( var16 ); + Fld_FadeOut_Subway(); + CALL_FIELD( 11, 6, 2, 0 ); + } + +} + + +// Procedure Index: 15 +void MAIN_GOTO_STATION_HIKA() +{ + FLD_PANEL_HIDE_DISABLE(); + // bit id (0) + (96) = 96 + + if ( BIT_CHK( ( 0 + 96 ) ) ) + { + SUB_KFEVT_GOTO_STATION_HIKA(); + } + else + { + BGENV_LINE_SE_STOP( 3 ); + BGENV_LINE_SE_STOP( 4 ); + BGENV_LINE_SE_STOP( 5 ); + BGENV_LINE_SE_STOP( 6 ); + FLD_REQ_SCN_CHANGE( 11 ); + CALL_FIELD( 1, 2, 24, 0 ); + } + +} + + +// Procedure Index: 16 +void MAIN_GOTO_STATION_INO() +{ + FLD_PANEL_HIDE_DISABLE(); + // bit id (0) + (96) = 96 + + if ( BIT_CHK( ( 0 + 96 ) ) ) + { + SUB_KFEVT_GOTO_STATION_INO(); + } + else + { + BGENV_LINE_SE_STOP( 3 ); + BGENV_LINE_SE_STOP( 4 ); + BGENV_LINE_SE_STOP( 5 ); + BGENV_LINE_SE_STOP( 6 ); + FLD_REQ_SCN_CHANGE( 11 ); + CALL_FIELD( 1, 2, 25, 0 ); + } + +} + + +// Procedure Index: 17 +void MAIN_TrainDoor_East02() +{ + int var17; + var17 = FLD_PC_GET_RESHND( 0 ); + // bit id (0) + (96) = 96 + + if ( BIT_CHK( ( 0 + 96 ) ) ) + { + SUB_KFEVT_ACCESS_DENENTOSI_01(); + } + else + { + FLD_UNIT_SET_WALK( var17 ); + FLD_MODEL_POINT_ROTATE( var17, 7238.407f, 0.00f, -114.2696f, 5 ); + FLD_MODEL_SET_TRANSLATE( var17, 7238.407f, 0.00f, -114.2696f, 10 ); + FLD_MODEL_SYNC_TRANSLATE( var17 ); + FLD_MODEL_SET_ROTATE( var17, 0, 0, 0, 5 ); + FLD_MODEL_SET_TRANSLATE( var17, 7255.646f, 0.00f, 32.6111f, 20 ); + FLD_MODEL_SYNC_TRANSLATE( var17 ); + FLD_UNIT_SET_WAIT( var17 ); + Fld_FadeOut_Subway(); + CALL_FIELD( 11, 6, 2, 0 ); + } + +} + + +// Procedure Index: 18 +void SUB_GATE_OUT_1STDAY() +{ + int var18; + var18 = FLD_PC_GET_RESHND( 0 ); + FLD_REQ_SCN_CHANGE( 11 ); + FLD_CAMERA_LOCK(); + FLD_PLACENAME_TEX( 1, 2, 0, 80 ); + FADEOUT( 0, 10 ); + FADE_SYNC(); + FLD_MODEL_SET_TRANSLATE( var18, 9010.592f, 499.9966f, 471.6445f, 0 ); + FLD_UNIT_SET_COLLIS( var18, 1 ); + FADEIN( 0, 10 ); + FLD_MODEL_UNIT_TRANSLATE( var18, 8750.559f, 499.9872f, 476.4548f, 0 ); + FLD_MODEL_SYNC_TRANSLATE( var18 ); + FADE_SYNC(); + FLD_UNIT_SET_WAIT( var18 ); + FLD_CAMERA_BEHIND_LOCK(); + FLD_CAMERA_INTERP( 20 ); + FLD_CAMERA_SYNC_INTERP(); + FLD_UNIT_SET_COLLIS( var18, 1 ); + FLD_CAMERA_BEHIND_UNLOCK(); + FLD_CAMERA_UNLOCK(); +} + + +// Procedure Index: 19 +void SUB_KFEVT_ACCESS_DENENTOSI_01() +{ + int var26; + int var22; + int var23; + int var24; + int var25; + int var19; + int var20; + int var21; + var26 = FLD_PC_GET_RESHND( 0 ); + var22 = 0; + var23 = 0; + var24 = 0; + var25 = 0; + var19 = GET_COUNT( 0x10 ); + var20 = ( var19 / 100 ); + var21 = REM( var19, 1000 ); + // bit id (((0) + (2048)) + (2048)) + (4049) = 8145 + + if ( var20 == 1092 ) + { + MSG_WND_DSP(); + MSG_MIND( MND_E10920100_NG_DENENTO, 0 ); + MSG_WND_CLS(); + } + else if ( var20 == 1271 ) + { + MSG_WND_DSP(); + MSG_MIND( MND_E12710100_NG_DENENTO, 0 ); + MSG_WND_CLS(); + } + else if ( var20 == 2431 ) + { + SUB_MoruShowFace(); + MSG_WND_DSP(); + MSG( MSG_E24310100_DENENTOSI_ ); + MSG_WND_CLS(); + SUB_MoruReturnBag(); + } + else if ( var20 == 2433 ) + { + SUB_MoruShowFace(); + MSG_WND_DSP(); + MSG( MSG_E24330100_DENENTOSI_ ); + MSG_WND_CLS(); + SUB_MoruReturnBag(); + } + else + { + + if ( var20 == 1801 ) + { + var22 = 180; + var23 = 102; + var24 = 0; + var25 = 2; + } + + + if ( var22 != 0 ) + { + BIT_OFF( ( ( ( 0 + 0x0800 ) + 0x0800 ) + 4049 ) ); + FLD_UNIT_SET_WALK( var26 ); + FLD_MODEL_POINT_ROTATE( var26, 7853.391f, 0.00f, -14.8684f, 5 ); + FLD_MODEL_SET_TRANSLATE( var26, 7853.391f, 0.00f, -14.8684f, 10 ); + FLD_MODEL_SYNC_TRANSLATE( var26 ); + FLD_MODEL_SET_ROTATE( var26, 0, 0, 0, 5 ); + FLD_MODEL_SET_TRANSLATE( var26, 7827.36f, -0.00f, 125.6125f, 20 ); + FLD_MODEL_SYNC_TRANSLATE( var26 ); + FLD_UNIT_SET_WAIT( var26 ); + Fld_FadeOut_Subway(); + CALL_KF_EVENT( var22, var23, var24, var25 ); + DBG_PUTS( "->kfevt:Yongenjaya_Platform" ); + } + + } + +} + + +// Procedure Index: 20 +void SUB_KFEVT_ACCESS_DENENTOSI_02() +{ + int var34; + int var30; + int var31; + int var32; + int var33; + int var27; + int var28; + int var29; + var34 = FLD_PC_GET_RESHND( 0 ); + var30 = 0; + var31 = 0; + var32 = 0; + var33 = 0; + var27 = GET_COUNT( 0x10 ); + var28 = ( var27 / 100 ); + var29 = REM( var27, 1000 ); + // bit id (((0) + (2048)) + (2048)) + (4049) = 8145 + + if ( var28 == 1092 ) + { + MSG_WND_DSP(); + MSG_MIND( MND_E10920100_NG_DENENTO, 0 ); + MSG_WND_CLS(); + } + else if ( var28 == 1271 ) + { + MSG_WND_DSP(); + MSG_MIND( MND_E12710100_NG_DENENTO, 0 ); + MSG_WND_CLS(); + } + else if ( var28 == 2431 ) + { + SUB_MoruShowFace(); + MSG_WND_DSP(); + MSG( MSG_E24310100_DENENTOSI_ ); + MSG_WND_CLS(); + SUB_MoruReturnBag(); + } + else if ( var28 == 2433 ) + { + SUB_MoruShowFace(); + MSG_WND_DSP(); + MSG( MSG_E24330100_DENENTOSI_ ); + MSG_WND_CLS(); + SUB_MoruReturnBag(); + } + else + { + + if ( var28 == 1801 ) + { + var30 = 180; + var31 = 102; + var32 = 0; + var33 = 2; + } + + + if ( var30 != 0 ) + { + BIT_OFF( ( ( ( 0 + 0x0800 ) + 0x0800 ) + 4049 ) ); + FLD_UNIT_SET_WALK( var34 ); + FLD_MODEL_POINT_ROTATE( var34, 13244.22f, 0.00f, -113.854f, 5 ); + FLD_MODEL_SET_TRANSLATE( var34, 13244.22f, 0.00f, -113.854f, 10 ); + FLD_MODEL_SYNC_TRANSLATE( var34 ); + FLD_MODEL_SET_ROTATE( var34, 0, 0, 0, 5 ); + FLD_MODEL_SET_TRANSLATE( var34, 13207.24f, 0.00f, 128.5401f, 20 ); + FLD_MODEL_SYNC_TRANSLATE( var34 ); + FLD_UNIT_SET_WAIT( var34 ); + Fld_FadeOut_Subway(); + CALL_KF_EVENT( var30, var31, var32, var33 ); + DBG_PUTS( "->kfevt:Yongenjaya_Platform" ); + } + + } + +} + + +// Procedure Index: 21 +void SUB_KFEVT_ACCESS_DENENTOSI_01_CALL() +{ + int var35; + int var36; + int var40; + int var41; + int var42; + int var43; + int var37; + int var38; + int var39; + var35 = FLD_OBJ_CNV_RESHND( 18 ); + var36 = FLD_PC_GET_RESHND( 0 ); + var40 = 0; + var41 = 0; + var42 = 0; + var43 = 0; + var37 = GET_COUNT( 0x10 ); + var38 = ( var37 / 100 ); + var39 = REM( var37, 1000 ); + + if ( var38 == 1092 ) + { + MSG_WND_DSP(); + MSG_MIND( MND_E10920100_NG_DENENTO, 0 ); + MSG_WND_CLS(); + } + else if ( var38 == 1271 ) + { + MSG_WND_DSP(); + MSG_MIND( MND_E12710100_NG_DENENTO, 0 ); + MSG_WND_CLS(); + } + else if ( var38 == 2431 ) + { + SUB_MoruShowFace(); + MSG_WND_DSP(); + MSG( MSG_E24310100_DENENTOSI_ ); + MSG_WND_CLS(); + SUB_MoruReturnBag(); + } + else if ( var38 == 2433 ) + { + SUB_MoruShowFace(); + MSG_WND_DSP(); + MSG( MSG_E24330100_DENENTOSI_ ); + MSG_WND_CLS(); + SUB_MoruReturnBag(); + } + else + { + + if ( var38 == 1801 ) + { + var40 = 180; + var41 = 102; + var42 = 0; + var43 = 2; + } + + + if ( var40 != 0 ) + { + FLD_LOCAL_FLAG_ON( ( 49152 + 10 ) ); + Fld_FadeOut_CutChange(); + FLD_CROWD_PATH_VISIBLE( 4, 1 ); + FLD_CROWD_PATH_VISIBLE( 7, 1 ); + FLD_CROWD_PATH_VISIBLE( 9, 1 ); + FLD_CROWD_PATH_VISIBLE( 73, 1 ); + FLD_CROWD_PATH_VISIBLE( 79, 1 ); + FLD_CROWD_PATH_VISIBLE( 81, 1 ); + FLD_CROWD_PATH_VISIBLE( 86, 1 ); + FLD_CROWD_PATH_VISIBLE( 88, 1 ); + BGENV_LINE_SE_STOP( 3 ); + BGENV_LINE_SE_STOP( 4 ); + BGENV_LINE_SE_STOP( 5 ); + BGENV_LINE_SE_STOP( 6 ); + MDL_ANIM( var35, 5, 0, 0, 1.00f ); + MDL_ANIM( var35, 1, 0, 0, 1.00f ); + BGENV_LINE_SE_PLAY( 6 ); + + if ( FLD_MODEL_GET_X_TRANSLATE( var36 ) >= 7628.00f ) + { + FLD_MODEL_SET_POS( var36, 8 ); + } + else + { + FLD_MODEL_SET_POS( var36, 23 ); + } + + FLD_MODEL_SET_ROTATE( var36, 0, 0, 0, 5 ); + Fld_FadeIn_Default(); + MDL_ANIM_SYNC( var35 ); + FLD_CROWD_PATH_VISIBLE( 1, 1 ); + FLD_CROWD_PATH_VISIBLE( 8, 1 ); + FLD_CROWD_PATH_VISIBLE( 17, 1 ); + FLD_CROWD_PATH_VISIBLE( 19, 1 ); + FLD_CROWD_PATH_VISIBLE( 0x10, 1 ); + FLD_CROWD_PATH_VISIBLE( 68, 1 ); + FLD_CROWD_PATH_VISIBLE( 82, 1 ); + FLD_CROWD_PATH_VISIBLE( 87, 1 ); + MDL_ANIM( var35, 2, 0, 0, 1.00f ); + MDL_ANIM_SYNC( var35 ); + FLD_CROWD_PATH_WAIT( 1, 0 ); + FLD_CROWD_PATH_WAIT( 8, 0 ); + FLD_CROWD_PATH_WAIT( 17, 0 ); + FLD_CROWD_PATH_WAIT( 19, 0 ); + FLD_CROWD_PATH_WAIT( 0x10, 0 ); + FLD_CROWD_PATH_WAIT( 68, 0 ); + FLD_CROWD_PATH_WAIT( 82, 0 ); + FLD_CROWD_PATH_WAIT( 87, 0 ); + FLD_CROWD_PATH_WAIT( 4, 0 ); + FLD_CROWD_PATH_WAIT( 7, 0 ); + FLD_CROWD_PATH_WAIT( 9, 0 ); + FLD_CROWD_PATH_WAIT( 73, 0 ); + FLD_CROWD_PATH_WAIT( 79, 0 ); + FLD_CROWD_PATH_WAIT( 81, 0 ); + FLD_CROWD_PATH_WAIT( 86, 0 ); + FLD_CROWD_PATH_WAIT( 88, 0 ); + FLD_UNIT_SET_WALK( var36 ); + FLD_MODEL_ADD_TRANSLATE( var36, 0, 0, 300, 30 ); + FLD_MODEL_SYNC_TRANSLATE( var36 ); + FLD_UNIT_SET_WAIT( var36 ); + Fld_FadeOut_Subway(); + CALL_KF_EVENT( var40, var41, var42, var43 ); + DBG_PUTS( "->kfevt:Yongenjaya_Platform" ); + } + + } + +} + + +// Procedure Index: 22 +void SUB_KFEVT_ACCESS_DENENTOSI_02_CALL() +{ + int var44; + int var45; + int var49; + int var50; + int var51; + int var52; + int var46; + int var47; + int var48; + var44 = FLD_OBJ_CNV_RESHND( 18 ); + var45 = FLD_PC_GET_RESHND( 0 ); + var49 = 0; + var50 = 0; + var51 = 0; + var52 = 0; + var46 = GET_COUNT( 0x10 ); + var47 = ( var46 / 100 ); + var48 = REM( var46, 1000 ); + + if ( var47 == 1092 ) + { + MSG_WND_DSP(); + MSG_MIND( MND_E10920100_NG_DENENTO, 0 ); + MSG_WND_CLS(); + } + else if ( var47 == 1271 ) + { + MSG_WND_DSP(); + MSG_MIND( MND_E12710100_NG_DENENTO, 0 ); + MSG_WND_CLS(); + } + else if ( var47 == 2431 ) + { + SUB_MoruShowFace(); + MSG_WND_DSP(); + MSG( MSG_E24310100_DENENTOSI_ ); + MSG_WND_CLS(); + SUB_MoruReturnBag(); + } + else if ( var47 == 2433 ) + { + SUB_MoruShowFace(); + MSG_WND_DSP(); + MSG( MSG_E24330100_DENENTOSI_ ); + MSG_WND_CLS(); + SUB_MoruReturnBag(); + } + else + { + + if ( var47 == 1801 ) + { + var49 = 180; + var50 = 102; + var51 = 0; + var52 = 2; + } + + + if ( var49 != 0 ) + { + Fld_FadeOut_CutChange(); + FLD_CROWD_PATH_VISIBLE( 1, 1 ); + FLD_CROWD_PATH_VISIBLE( 8, 1 ); + FLD_CROWD_PATH_VISIBLE( 17, 1 ); + FLD_CROWD_PATH_VISIBLE( 19, 1 ); + FLD_CROWD_PATH_VISIBLE( 0x10, 1 ); + FLD_CROWD_PATH_VISIBLE( 68, 1 ); + FLD_CROWD_PATH_VISIBLE( 82, 1 ); + FLD_CROWD_PATH_VISIBLE( 87, 1 ); + FLD_CROWD_PATH_VISIBLE( 4, 1 ); + FLD_CROWD_PATH_VISIBLE( 7, 1 ); + FLD_CROWD_PATH_VISIBLE( 9, 1 ); + FLD_CROWD_PATH_VISIBLE( 73, 1 ); + FLD_CROWD_PATH_VISIBLE( 79, 1 ); + FLD_CROWD_PATH_VISIBLE( 81, 1 ); + FLD_CROWD_PATH_VISIBLE( 86, 1 ); + FLD_CROWD_PATH_VISIBLE( 88, 1 ); + BGENV_LINE_SE_STOP( 3 ); + BGENV_LINE_SE_STOP( 4 ); + BGENV_LINE_SE_STOP( 5 ); + BGENV_LINE_SE_STOP( 6 ); + MDL_ANIM( var44, 5, 0, 0, 1.00f ); + MDL_ANIM( var44, 1, 0, 0, 1.00f ); + MDL_ANIM_SEEK( var44, 120 ); + BGENV_LINE_SE_PLAY( 3 ); + FLD_MODEL_SET_POS( var45, 3 ); + FLD_MODEL_SET_ROTATE( var45, 0, 0, 0, 5 ); + Fld_FadeIn_Default(); + MDL_ANIM_SYNC( var44 ); + MDL_ANIM( var44, 2, 0, 0, 1.00f ); + MDL_ANIM_SYNC( var44 ); + FLD_CROWD_PATH_WAIT( 1, 0 ); + FLD_CROWD_PATH_WAIT( 8, 0 ); + FLD_CROWD_PATH_WAIT( 17, 0 ); + FLD_CROWD_PATH_WAIT( 19, 0 ); + FLD_CROWD_PATH_WAIT( 0x10, 0 ); + FLD_CROWD_PATH_WAIT( 68, 0 ); + FLD_CROWD_PATH_WAIT( 82, 0 ); + FLD_CROWD_PATH_WAIT( 87, 0 ); + FLD_CROWD_PATH_WAIT( 4, 0 ); + FLD_CROWD_PATH_WAIT( 7, 0 ); + FLD_CROWD_PATH_WAIT( 9, 0 ); + FLD_CROWD_PATH_WAIT( 73, 0 ); + FLD_CROWD_PATH_WAIT( 79, 0 ); + FLD_CROWD_PATH_WAIT( 81, 0 ); + FLD_CROWD_PATH_WAIT( 86, 0 ); + FLD_CROWD_PATH_WAIT( 88, 0 ); + FLD_UNIT_SET_WALK( var45 ); + FLD_MODEL_ADD_TRANSLATE( var45, 0, 0, 300, 30 ); + FLD_MODEL_SYNC_TRANSLATE( var45 ); + FLD_UNIT_SET_WAIT( var45 ); + Fld_FadeOut_Subway(); + CALL_KF_EVENT( var49, var50, var51, var52 ); + DBG_PUTS( "->kfevt:Yongenjaya_Platform" ); + } + + } + +} + + +// Procedure Index: 23 +void SUB_KFEVT_GOTO_STATION_HIKA() +{ + int var56; + int var57; + int var58; + int var59; + int var53; + int var54; + int var55; + var56 = 0; + var57 = 0; + var58 = 0; + var59 = 0; + var53 = GET_COUNT( 0x10 ); + var54 = ( var53 / 100 ); + var55 = REM( var53, 1000 ); + + if ( var54 == 1092 ) + { + var56 = 109; + var57 = 206; + var58 = 0; + var59 = 24; + } + else if ( var54 == 1271 ) + { + var56 = 127; + var57 = 105; + var58 = 0; + var59 = 24; + } + else if ( var54 == 1801 ) + { + var56 = 180; + var57 = 103; + var58 = 0; + var59 = 24; + } + else if ( var54 == 2431 ) + { + var56 = 243; + var57 = 102; + var58 = 0; + var59 = 24; + } + else if ( var54 == 2433 ) + { + var56 = 243; + var57 = 302; + var58 = 0; + var59 = 24; + } + + + if ( var56 != 0 ) + { + BGENV_LINE_SE_STOP( 3 ); + BGENV_LINE_SE_STOP( 4 ); + BGENV_LINE_SE_STOP( 5 ); + BGENV_LINE_SE_STOP( 6 ); + FLD_REQ_SCN_CHANGE( 11 ); + CALL_KF_EVENT( var56, var57, var58, var59 ); + DBG_PUTS( "->kfevt:Shibuya_Passage" ); + } + +} + + +// Procedure Index: 24 +void SUB_KFEVT_GOTO_STATION_INO() +{ + int var63; + int var64; + int var65; + int var66; + int var60; + int var61; + int var62; + var63 = 0; + var64 = 0; + var65 = 0; + var66 = 0; + var60 = GET_COUNT( 0x10 ); + var61 = ( var60 / 100 ); + var62 = REM( var60, 1000 ); + + if ( var61 == 1092 ) + { + var63 = 109; + var64 = 206; + var65 = 0; + var66 = 25; + } + else if ( var61 == 1271 ) + { + var63 = 127; + var64 = 105; + var65 = 0; + var66 = 25; + } + else if ( var61 == 1801 ) + { + var63 = 180; + var64 = 103; + var65 = 0; + var66 = 25; + } + else if ( var61 == 2431 ) + { + var63 = 243; + var64 = 102; + var65 = 0; + var66 = 25; + } + else if ( var61 == 2433 ) + { + var63 = 243; + var64 = 302; + var65 = 0; + var66 = 25; + } + + + if ( var63 != 0 ) + { + BGENV_LINE_SE_STOP( 3 ); + BGENV_LINE_SE_STOP( 4 ); + BGENV_LINE_SE_STOP( 5 ); + BGENV_LINE_SE_STOP( 6 ); + FLD_REQ_SCN_CHANGE( 11 ); + CALL_KF_EVENT( var63, var64, var65, var66 ); + DBG_PUTS( "->kfevt:Shibuya_Passage" ); + } + +} + + +// Procedure Index: 25 +void Fld_FadeOut_CallField() +{ + FADEOUT( 27, 10 ); + FADE_SYNC(); +} + + +// Procedure Index: 26 +void Fld_FadeOut_Crowd() +{ + FLD_REQ_SCN_CHANGE( 0 ); +} + + +// Procedure Index: 27 +void Fld_FadeOut_CallEvent() +{ + FADEOUT( 15, 10 ); + FADE_SYNC(); +} + + +// Procedure Index: 28 +void Fld_FadeOut_CallCalendar() +{ + FADEOUT( 15, 10 ); + FADE_SYNC(); +} + + +// Procedure Index: 29 +void Fld_FadeOut_Default() +{ + FADEOUT( 0, 10 ); + FADE_SYNC(); +} + + +// Procedure Index: 30 +void Fld_FadeOut_Wait10() +{ + FADEOUT( 0, 10 ); + FADE_SYNC(); + WAIT( 10 ); +} + + +// Procedure Index: 31 +void Fld_FadeIn_Default() +{ + FADEIN( 0, 20 ); + FADE_SYNC(); +} + + +// Procedure Index: 32 +void Fld_FadeOut_Subway() +{ + FADEOUT( 8, 10 ); + FADE_SYNC(); +} + + +// Procedure Index: 33 +void Fld_FadeOut_Symbol() +{ + FADEOUT( 15, 10 ); + FADE_SYNC(); +} + + +// Procedure Index: 34 +void Fld_FadeOut_Rain() +{ + FADEOUT( 11, 10 ); + FADE_SYNC(); +} + + +// Procedure Index: 35 +void Fld_FadeOut_Cross() +{ + FADEOUT( 13, 10 ); + FADE_SYNC(); +} + + +// Procedure Index: 36 +void Fld_FadeOut_Parallel() +{ + FADEOUT( 14, 10 ); + FADE_SYNC(); +} + + +// Procedure Index: 37 +void Fld_FadeOut_CutChange() +{ + FADEOUT( 5, 10 ); + FADE_SYNC(); +} + + +// Procedure Index: 38 +void Fld_FadeOut_Velvet() +{ + FADEOUT( 19, 10 ); + FADE_SYNC(); +} + + +// Procedure Index: 39 +void SUB_MoruShowFace() +{ + int var67; + int var68; + + if ( FLD_CHECK_MORGANA_BAG() == 1 ) + { + var67 = FLD_PC_GET_CURRENT_RESHND( 0 ); + var68 = MDL_GET_ITEM_RESHND( var67, 2 ); + MDL_ANIM( var68, 50, 0, 0, 1.00f ); + MDL_ANIM_NEXT( var68, 51, 1, 0, 1.00f ); + } + +} + + +// Procedure Index: 40 +void SUB_MoruReturnBag() +{ + int var69; + int var70; + + if ( FLD_CHECK_MORGANA_BAG() == 1 ) + { + var69 = FLD_PC_GET_CURRENT_RESHND( 0 ); + var70 = MDL_GET_ITEM_RESHND( var69, 2 ); + MDL_ANIM( var70, 52, 0, 5, 1.00f ); + MDL_ANIM_NEXT( var70, 0, 1, 0, 1.00f ); + } + +} + + +// Procedure Index: 41 +void position_rotate() +{ + float fVar0; + float fVar3; + float fVar7; + float fVar1; + float fVar4; + float fVar8; + float fVar2; + float fVar5; + float fVar9; + float fVar6; + float fVar10; + float fVar11; + fVar7 = ( fVar3 - fVar0 ); + fVar8 = ( fVar4 - fVar1 ); + fVar9 = ( fVar5 - fVar2 ); + fVar10 = SIN( fVar6 ); + fVar11 = COS( fVar6 ); + fVar3 = ( ( fVar7 * fVar11 ) + ( fVar9 * fVar10 ) ); + fVar4 = fVar8; + fVar5 = ( ( fVar9 * fVar11 ) - ( fVar7 * fVar10 ) ); + fVar3 = ( fVar3 + fVar0 ); + fVar4 = ( fVar4 + fVar1 ); + fVar5 = ( fVar5 + fVar2 ); +} + + +// Procedure Index: 42 +void Position_TurnBack() +{ + int var72; + int var71; + var72 = FLD_PC_GET_RESHND( 0 ); + FLD_MODEL_DIR_TRANSLATE( var72, var71, 200, 0 ); + FLD_MODEL_SYNC_TRANSLATE( var72 ); + FLD_UNIT_SET_WAIT( var72 ); +} + + +// Procedure Index: 43 +void SUB_PhoneRing() +{ + int var76; + var76 = FLD_PC_GET_RESHND( 0 ); + MDL_ICON( var76, 15 ); + COMSE_PLAY( 1048 ); + WAIT( 10 ); + RUMBLE_START_S( 6, 12, 2, 30 ); + WAIT( 30 ); +} + + +// Procedure Index: 44 +void SUB_PhoneRumble() +{ + int var77; + var77 = FLD_PC_GET_RESHND( 0 ); + MDL_ICON( var77, 18 ); + COMSE_PLAY( 1047 ); + WAIT( 10 ); + RUMBLE_START_S( 6, 12, 2, 30 ); + WAIT( 30 ); +} + + +// Procedure Index: 45 +void SUB_PhonePickup() +{ + sVar73 = 0; + FLD_SET_CELLPHONE( 1 ); + WAIT( 15 ); + sVar73 = 1; +} + + +// Procedure Index: 46 +void SUB_PhoneCall() +{ + sVar74 = FLD_PC_GET_RESHND( 0 ); + + if ( ( ( ( GET_WEATHER_DETAIL() == 1 ) || ( GET_WEATHER_DETAIL() == 4 ) ) || ( GET_WEATHER_DETAIL() == 5 ) ) || ( GET_WEATHER_DETAIL() == 8 ) ) + { + sVar75 = FLD_MODEL_ADDMOTION_LOAD( sVar74, 101 ); + } + else + { + sVar75 = FLD_MODEL_ADDMOTION_LOAD( sVar74, 1 ); + } + + FLD_MODEL_LOADSYNC( sVar75 ); + FLD_MODEL_COPY_POSE_ANIM( sVar75, sVar74 ); + FLD_MODEL_SET_VISIBLE( sVar74, 0, 0 ); + FLD_MODEL_SET_VISIBLE( sVar75, 1, 0 ); + FLD_CELLPHONE_MODEL_VISIBLE( sVar75, 1 ); + MDL_ANIM( sVar75, ( 60 + 0 ), 0, 5, 1.00f ); + MDL_ANIM_NEXT( sVar75, ( 60 + 1 ), 1, 0, 1.00f ); + sVar73 = 2; + WAIT( 30 ); +} + + +// Procedure Index: 47 +void SUB_PhoneTalk() +{ + SUB_PhonePickup(); + SUB_PhoneCall(); +} + + +// Procedure Index: 48 +void SUB_PhoneEnd() +{ + + if ( sVar73 == 0 ) + { + return; + } + + + if ( sVar73 != 2 ) + { + FLD_SET_CELLPHONE( 0 ); + } + else + { + FLD_MODEL_SET_VISIBLE( sVar74, 0, 0 ); + FLD_MODEL_SET_VISIBLE( sVar75, 1, 0 ); + MDL_ANIM( sVar75, ( 60 + 2 ), 0, 10, 1.00f ); + WAIT( 65 ); + FLD_CELLPHONE_MODEL_VISIBLE( sVar75, 0 ); + MDL_ANIM_SYNC( sVar75 ); + MDL_ANIM( sVar75, 0, 1, 0, 1.00f ); + MDL_ANIM_BLENDSYNC( sVar75 ); + FLD_MODEL_COPY_POSE_ANIM( sVar74, sVar75 ); + FLD_MODEL_SET_VISIBLE( sVar74, 1, 0 ); + FLD_MODEL_SET_VISIBLE( sVar75, 0, 0 ); + FLD_MODEL_FREE( sVar75 ); + FLD_SET_CELLPHONE( 0 ); + } + + sVar73 = 0; +} + diff --git a/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf.flow.bf b/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf.flow.bf new file mode 100644 index 0000000000000000000000000000000000000000..57acdba37e218ba1d200043d722d082bb3d6cc4e GIT binary patch literal 28439 zcmdU2dvIJ=dB0k{cGq?+IgTHRBws&>lVCfR?8J{aab!L0we^a$j^i|BeI;E>@Hn;OYXoSw)`q({f_ zbeXG4KRPxr5=s0Ud|IXN8ycM$h-&bB2z};MZz>($s9{|#{n62II$hh)W7B7P2h#)N z^@eCTRZBlUkUlvcG2@2EE&5ddK&F3mbUZ^z1xIQ4aXtEQNyR!N=>r4AZVjQ25K`3jS71|}vl{R1NdBk9qJRAx6}7Iww5tPRo&F^4pWeI%T|JJZ)YG!$$Q`(8MGPaXQk zuakb5a6USk9tECz)2Y#s%(2vo-eB)oBJT>PPmP2Fsp-!v^yz|^&GqN=h0K6gEbR`T zannDNe&Xbj%+cQTKxXu0I@3Lo?(aR#>X55B!AjDf7#z4eoe4^|Ruj!)R#Eh|d^LY# z+5T%J+w#D2^tGC3{q0)%<&+Try$JdcCB$DQ{owp`X3(4VN6V#5pEo~0nDytU`5e#4$!0jf%AT@#0P;ZvBavH{y`6({M@ux2#`C8x7hUk{)|_i5APlP z2zi?QpYpP$Zd&@#DYD}et>A_a*!0l~ZukeAK3c&IKd|Ye6&zcy=;w>R1ax<#hGSxVnevHN zaO}f@{v$OUd&cHJTEVgJ2KtZGaO{7r{(GVqaO1z(^wIile1pwTPo#nykJ$h>p zrjO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*!4Yk#Kwk>^~5G)lY3)lV`qB~#-?M_J+b>@_Z^Jg8@sosCzg(-d-jeD z9UO|y^~COv-M>FJCjOxb+Kr6#jKp%WT+e)E#Rj&n2q`O?AD*vI<0v)+=I8B<3o Vj((=zkY~ocVi8srQn_-k{|AYs{5b#s literal 0 HcmV?d00001 diff --git a/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf.msg b/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf.msg new file mode 100644 index 00000000..9c678a2d --- /dev/null +++ b/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf.msg @@ -0,0 +1,204 @@ +[msg MSG_DUMMY] +[s]......[n][w][e] + +[sel YESNO_SEL top] +[s]Yes[e] +[s]No[e] + +[msg MSG_SCHOOL_1STDAY] +[s]If I remember correctly, the[n][clr 2]Ginza Line[clr 27] should take me to[n]Aoyama-Itchome, where school is...[n][w][e] + +[msg MSG_TRAIN_WAIT] +[s]Let's wait for the next train...[n][w][e] + +[msg MND_E14410100_NG_HIROBA_] +[s][vp 8 2 65535 0 0 0]For now, I better [n]hurry and get to Ann...[n][w][e] + +[msg MND_E10920100_NG_DENENTO] +[s][vp 8 2 65535 0 0 0]I was supposed to transfer[n]to the [clr 2]Ginza Line[clr 27] at Shibuya...[n][w][e] + +[msg MND_E12710100_NG_DENENTO] +[s][vp 8 2 65535 0 0 0]If I get on this train[n]right now, I'll be late...[n][w][e] +[s][vp 8 2 65535 0 0 0]I better hurry[n]and get to school...[n][w][e] + +[msg MSG_E24310100_DENENTOSI_ [Morgana]] +[s][bup 0 3 0 0 0][f 4 10 65535 0 0][vp 8 2 65535 0 0 0]Hey, where are you going?[n]Weren't you going to try[n]to find more information?[n][w][e] + +[msg MSG_E24330100_DENENTOSI_ [Morgana]] +[s][bup 0 3 0 0 0][f 4 10 65535 0 0][vp 8 2 65535 0 0 0]Where are you going?[n]Weren't you planning[n]to explore Shibuya today?[n][w][e] + +[msg MND_E14410100_NG_YAMANOT] +[s][vp 8 2 65535 0 0 0]For now, I better[n]hurry and get to Ann...[n][w][e] + +[msg MND_E10920100_CHK_KIOSUK] +[s][vp 8 2 65535 0 0 0]There's a wide variety[n]of goods all lined up...[n][w][e] +[s][vp 8 2 65535 0 0 0]I don't have the time[n]to choose anything I'd[n]want from here right now...[n][w][e] + +[msg MND_E12710100_CHK_KIOSUK] +[s][vp 8 2 65535 0 0 0]There's a wide variety[n]of goods all lined up...[n][w][e] +[s][vp 8 2 65535 0 0 0]I don't have the time[n]to choose anything I'd[n]want from here right now...[n][w][e] + +[msg MND_COMMON_CHK_KIOSUKU_0] +[s][vp 8 2 65535 0 0 0]I don't have time to[n]go shopping right now...[n][w][e] + +[msg MND_E10920100_CHK_BAITO_] +[s][vp 8 2 65535 0 0 0]There's all these magazines[n]here that are full of[n]part-time job listings.[n][w][e] +[s][vp 8 2 65535 0 0 0]I wonder what kinds of jobs are[n]available for me around here...[n][w][e] + +[msg MND_E12710100_CHK_BAITO_] +[s][vp 8 2 65535 0 0 0]There's all these magazines[n]here that are full of[n]part-time job listings.[n][w][e] +[s][vp 8 2 65535 0 0 0]I wonder what kinds of jobs are[n]available for me around here...[n][w][e] + +[msg MND_E14410100_CHK_BAITO_] +[s][vp 8 2 65535 0 0 0]Right now, I need[n]to hurry and find Ann...[n][w][e] + +[msg MND_COMMON_CHK_BAITO_MAG] +[s][vp 8 2 65535 0 0 0]I don't have time to look[n]for part-time jobs right now...[n][w][e] + +[msg MND_E10920100_NG_SIBUTIK] +[s][vp 8 2 65535 0 0 0]It looks like there's[n]an underground shopping[n]district just up ahead.[n][w][e] +[s][vp 8 2 65535 0 0 0]For now, I better head[n]toward the [clr 2]Ginza Line[clr 27]...[n][w][e] + +[msg MND_E12710100_NG_SIBUTIK] +[s][vp 8 2 65535 0 0 0]It looks like there's[n]an underground shopping[n]district just up ahead.[n][w][e] +[s][vp 8 2 65535 0 0 0]For now, I should hurry[n]and head straight to school...[n][w][e] + +[msg MND_E14410100_NG_SIBUTIK] +[s][vp 8 2 65535 0 0 0]For now, I better[n]hurry and get to Ann...[n][w][e] + +[msg MND_E10920100_NG_CENTER_] +[s][vp 8 2 65535 0 0 0]The way ahead looks like it[n]connects to Central Street.[n][w][e] +[s][vp 8 2 65535 0 0 0]I better hurry to[n]the [clr 2]Ginza Line[clr 27] for now...[n][w][e] + +[msg MND_E12710100_NG_CENTER_] +[s][vp 8 2 65535 0 0 0]The way ahead looks like it[n]connects to Central Street.[n][w][e] +[s][vp 8 2 65535 0 0 0]For now, I should hurry[n]and head straight to school...[n][w][e] + +[msg MND_E14410100_NG_CENTER_] +[s][vp 8 2 65535 0 0 0]She can't be far from here.[n]I'll try searching this area...[n][w][e] + +[msg MND_E10920100_CHK_JUICEB] +[s][vp 8 2 65535 0 0 0]It looks like this store[n]serves freshly squeezed juice.[n][w][e] +[s][vp 8 2 65535 0 0 0]I'll give this place a try[n]when I have the time...[n][w][e] + +[msg MND_E12710100_CHK_JUICEB] +[s][vp 8 2 65535 0 0 0]It looks like this store[n]serves freshly squeezed juice.[n][w][e] +[s][vp 8 2 65535 0 0 0]I'll give this place a try[n]when I have the time...[n][w][e] + +[msg MND_E14410100_CHK_JUICEB] +[s][vp 8 2 65535 0 0 0]Right now, I need[n]to hurry and find Ann...[n][w][e] + +[msg MND_COMMON_CHK_JUICEBAR_] +[s][vp 8 2 65535 0 0 0]I don't have time to[n]buy juice right now...[n][w][e] + +[msg MND_E10920100_CHK_OMIYAG] +[s][vp 8 2 65535 0 0 0]This looks like a manjuu shop.[n][w][e] +[s][vp 8 2 65535 0 0 0]It seems they sell a variety[n]of manjuus and daifukus here...[n][w][e] + +[msg MND_E12710100_CHK_OMIYAG] +[s][vp 8 2 65535 0 0 0]This looks like a manjuu shop.[n][w][e] +[s][vp 8 2 65535 0 0 0]It seems they sell a variety[n]of manjuus and daifukus here...[n][w][e] + +[msg MND_E14410100_CHK_OMIYAG] +[s][vp 8 2 65535 0 0 0]Right now, I need to[n]hurry and get to Ann...[n][w][e] + +[msg MND_COMMON_CHK_OMIYAGE_S] +[s][vp 8 2 65535 0 0 0]I don't have time to[n]go shopping right now...[n][w][e] + +[msg MND_E10920100_NG_GATE_HI] +[s][vp 8 2 65535 0 0 0]I was supposed to transfer[n]to the [clr 2]Ginza Line[clr 27] at Shibuya.[n]I better hurry to the platform...[n][w][e] + +[msg MND_E12710100_NG_GATE_HI] +[s][vp 8 2 65535 0 0 0]I don't have time to go[n]back. I better transfer to the[n][clr 2]Ginza Line[clr 27] and head to school...[n][w][e] + +[msg MND_E14410100_NG_DENENTO] +[s][vp 8 2 65535 0 0 0]She can't be far from here.[n]I'll try searching this area...[n][w][e] + +[msg MND_E12710100_NG_GATE_IN] +[s][vp 8 2 65535 0 0 0]I don't have time to go[n]back. I better transfer to the[n][clr 2]Ginza Line[clr 27] and head to school...[n][w][e] + +[msg MND_E10920100_NG_GATEOUT] +[s][vp 8 2 65535 0 0 0]The sign above me says Inogami Line.[n][w][e] +[s][vp 8 2 65535 0 0 0]I was supposed to transfer to[n]the [clr 2]Ginza Line[clr 27], but it looks[n]like I'm on the wrong side.[n][w][e] + +[msg MND_E14410100_NG_TOKYU_0] +[s][vp 8 2 65535 0 0 0]For now, I better[n]hurry and get to Ann...[n][w][e] + +[msg MND_E10920100_GOTO_INOKA] +[s][vp 8 2 65535 0 0 0]The ticket gate for the[n]Inogami Line seems to be up ahead.[n][w][e] +[s][vp 8 2 65535 0 0 0]For now, I better head[n]toward the [clr 2]Ginza Line[clr 27]...[n][w][e] + +[msg MND_E12710100_GOTO_INOKA] +[s][vp 8 2 65535 0 0 0]The ticket gate for the[n]Inogami Line seems to be up ahead.[n][w][e] +[s][vp 8 2 65535 0 0 0]For now, I better head[n]toward the [clr 2]Ginza Line[clr 27]...[n][w][e] + +[msg MND_COMMON_GOTO_INOKASIR] +[s][vp 8 2 65535 0 0 0]I don't have any reason[n]to get on the Inogami Line...[n][w][e] + +[msg MND_E10920100_CHK_ADJUST] +[s][vp 8 2 65535 0 0 0]It's a machine for[n]adjusting ticket fares.[n][w][e] +[s][vp 8 2 65535 0 0 0]I don't need to use it[n]right now, though...[n][w][e] + +[msg MND_E12710100_CHK_ADJUST] +[s][vp 8 2 65535 0 0 0]It's a machine for[n]adjusting ticket fares.[n][w][e] +[s][vp 8 2 65535 0 0 0]I don't need to use it[n]right now, though...[n][w][e] + +[msg MND_COMMON_CHK_ADJUSTMEN] +[s][vp 8 2 65535 0 0 0]It's a machine for[n]adjusting ticket fares.[n][w][e] +[s][vp 8 2 65535 0 0 0]I don't need to use it[n]right now, though...[n][w][e] + +[msg MND_E10920100_CHK_PHOTO_] +[s][vp 8 2 65535 0 0 0]It's a certification[n]photo machine.[n][w][e] +[s][vp 8 2 65535 0 0 0]It seems to have different[n]functions like make-up mode[n]or one that slims your face...[n][w][e] + +[msg MND_E12710100_CHK_PHOTO_] +[s][vp 8 2 65535 0 0 0]It's a certification[n]photo machine.[n][w][e] +[s][vp 8 2 65535 0 0 0]It seems to have different[n]functions like make-up mode[n]or one that slims your face...[n][w][e] + +[msg MND_E14410100_CHK_PHOTO_] +[s][vp 8 2 65535 0 0 0]Right now, I need[n]to hurry and find Ann...[n][w][e] + +[msg MND_COMMON_CHK_PHOTO_MAC] +[s][vp 8 2 65535 0 0 0]It's a certification[n]photo machine.[n][w][e] +[s][vp 8 2 65535 0 0 0]It seems to have different[n]functions like make-up mode[n]or one that slims your face...[n][w][e] + +[msg MND_E10920100_CHK_COIN_L] +[s][vp 8 2 65535 0 0 0]There are barely any keys left[n]in the coin lockers. Many of them[n]are being used by other people...[n][w][e] + +[msg MND_E12710100_CHK_COIN_L] +[s][vp 8 2 65535 0 0 0]There are barely any keys left[n]in the coin lockers. Many of them[n]are being used by other people...[n][w][e] + +[msg MND_E14410100_CHK_COIN_L] +[s][vp 8 2 65535 0 0 0]Right now, I need[n]to hurry and find Ann...[n][w][e] + +[msg MND_COMMON_CHK_COIN_LOCK] +[s][vp 8 2 65535 0 0 0]There are barely any keys left[n]in the coin lockers. Many of them[n]are being used by other people...[n][w][e] + +[msg MND_E10920100_CHK_NEXT_J] +[s][vp 8 2 65535 0 0 0]There's an image[n]of a product shown[n]on the display.[n][w][e] +[s][vp 8 2 65535 0 0 0]It looks like a touch screen[n]where you can touch the displayed[n]products to purchase them...[n][w][e] + +[msg MND_E12710100_CHK_NEXT_J] +[s][vp 8 2 65535 0 0 0]There's an image[n]of a product shown[n]on the display.[n][w][e] +[s][vp 8 2 65535 0 0 0]It looks like a touch screen[n]where you can touch the displayed[n]products to purchase them...[n][w][e] + +[msg MND_E14410100_CHK_NEXT_J] +[s][vp 8 2 65535 0 0 0]Right now, I need[n]to hurry and find Ann...[n][w][e] + +[msg MND_COMMON_CHK_NEXT_JUIC] +[s][vp 8 2 65535 0 0 0]I don't have time to take[n]a break and buy drinks now...[n][w][e] + +[msg MND_E10920100_CHK_FRUIT_] +[s][vp 8 2 65535 0 0 0]It looks like this[n]vending machine sells fruit.[n][w][e] +[s][vp 8 2 65535 0 0 0]There's a variety of different[n]fruits, packed in rows of bags...[n][w][e] + +[msg MND_E12710100_CHK_FRUIT_] +[s][vp 8 2 65535 0 0 0]It looks like this[n]vending machine sells fruit.[n][w][e] +[s][vp 8 2 65535 0 0 0]There's a variety of different[n]fruits, packed in rows of bags...[n][w][e] + +[msg MND_E14410100_CHK_FRUIT_] +[s][vp 8 2 65535 0 0 0]Right now, I need[n]to hurry and find Ann...[n][w][e] + +[msg MND_COMMON_CHK_FRUIT_MAC] +[s][vp 8 2 65535 0 0 0]I think I'll buy some[n]fruit another time...[n][w][e] + diff --git a/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf.msg.h b/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf.msg.h new file mode 100644 index 00000000..6a7aab19 --- /dev/null +++ b/Source/AtlusScriptLibraryTests/TestResources/JumpInstruction2.bf.msg.h @@ -0,0 +1,60 @@ +// Decompiled by Atlus Script Tools (2017-2021) © TGE +const int MSG_DUMMY = 0; +const int YESNO_SEL = 1; +const int MSG_SCHOOL_1STDAY = 2; +const int MSG_TRAIN_WAIT = 3; +const int MND_E14410100_NG_HIROBA_ = 4; +const int MND_E10920100_NG_DENENTO = 5; +const int MND_E12710100_NG_DENENTO = 6; +const int MSG_E24310100_DENENTOSI_ = 7; +const int MSG_E24330100_DENENTOSI_ = 8; +const int MND_E14410100_NG_YAMANOT = 9; +const int MND_E10920100_CHK_KIOSUK = 10; +const int MND_E12710100_CHK_KIOSUK = 11; +const int MND_COMMON_CHK_KIOSUKU_0 = 12; +const int MND_E10920100_CHK_BAITO_ = 13; +const int MND_E12710100_CHK_BAITO_ = 14; +const int MND_E14410100_CHK_BAITO_ = 15; +const int MND_COMMON_CHK_BAITO_MAG = 16; +const int MND_E10920100_NG_SIBUTIK = 17; +const int MND_E12710100_NG_SIBUTIK = 18; +const int MND_E14410100_NG_SIBUTIK = 19; +const int MND_E10920100_NG_CENTER_ = 20; +const int MND_E12710100_NG_CENTER_ = 21; +const int MND_E14410100_NG_CENTER_ = 22; +const int MND_E10920100_CHK_JUICEB = 23; +const int MND_E12710100_CHK_JUICEB = 24; +const int MND_E14410100_CHK_JUICEB = 25; +const int MND_COMMON_CHK_JUICEBAR_ = 26; +const int MND_E10920100_CHK_OMIYAG = 27; +const int MND_E12710100_CHK_OMIYAG = 28; +const int MND_E14410100_CHK_OMIYAG = 29; +const int MND_COMMON_CHK_OMIYAGE_S = 30; +const int MND_E10920100_NG_GATE_HI = 31; +const int MND_E12710100_NG_GATE_HI = 32; +const int MND_E14410100_NG_DENENTO = 33; +const int MND_E12710100_NG_GATE_IN = 34; +const int MND_E10920100_NG_GATEOUT = 35; +const int MND_E14410100_NG_TOKYU_0 = 36; +const int MND_E10920100_GOTO_INOKA = 37; +const int MND_E12710100_GOTO_INOKA = 38; +const int MND_COMMON_GOTO_INOKASIR = 39; +const int MND_E10920100_CHK_ADJUST = 40; +const int MND_E12710100_CHK_ADJUST = 41; +const int MND_COMMON_CHK_ADJUSTMEN = 42; +const int MND_E10920100_CHK_PHOTO_ = 43; +const int MND_E12710100_CHK_PHOTO_ = 44; +const int MND_E14410100_CHK_PHOTO_ = 45; +const int MND_COMMON_CHK_PHOTO_MAC = 46; +const int MND_E10920100_CHK_COIN_L = 47; +const int MND_E12710100_CHK_COIN_L = 48; +const int MND_E14410100_CHK_COIN_L = 49; +const int MND_COMMON_CHK_COIN_LOCK = 50; +const int MND_E10920100_CHK_NEXT_J = 51; +const int MND_E12710100_CHK_NEXT_J = 52; +const int MND_E14410100_CHK_NEXT_J = 53; +const int MND_COMMON_CHK_NEXT_JUIC = 54; +const int MND_E10920100_CHK_FRUIT_ = 55; +const int MND_E12710100_CHK_FRUIT_ = 56; +const int MND_E14410100_CHK_FRUIT_ = 57; +const int MND_COMMON_CHK_FRUIT_MAC = 58; diff --git a/Source/AtlusScriptLibraryTests/TestResources/POPREG.bf b/Source/AtlusScriptLibraryTests/TestResources/POPREG.bf new file mode 100644 index 0000000000000000000000000000000000000000..aa1933cf779ab58c8041dcceec56fcd8025f6acc GIT binary patch literal 15648 zcmb80ZE%#;702(sB}cno zELBlE9j&F>V%xEdc1Fh!6`jtM`k`VwTKmC{A8e)eLmgW?I@7oFKj&Weu$4*9I?wJt z&+q*2J@@|4z0YP@ox@{k)r!>{8~LqsDL2o*E4;MP+YB9pbj0Yu`D4x{y6H7eN7A{H zCC<&NrS}Os5JQipcp}Eq0NwlVK@9xn=WX10gqx)OCXDpKwpAB8-&c30(kmi_18D9w< zO-X0pK))z)Vbn)_D?%jCb=2t%`QiM~hS4V{{@|DDM(^)9LRRL7SLbiZ574}hs*r#L z)`IJ88e@1NY!2%d6)ueN-PNq)>K>y)!tP*Qt4V|4ds)|R);-C(CiBF+D7uB#4qq3Y zc|t!FU5mB9Peo@o;xpDQw9ZScOLU8kdB!%2&YEZJE26W`OKeDV);VM!F0>YCjP75gThxdb!y|SS!M%&j{yopSh1U9vy(0aYegC!S%>BK|x+d#>CZZ!@vQV`-3R0KqO;a#e1_y{-X~6r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