From afb5eaa6fba9948ca7794d4fb9942b8fdfc6d53c Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Sat, 15 May 2021 04:23:04 +0000 Subject: [PATCH] Add todo to fix decompiling some Pop'n animation bytecodes. --- bemani/format/afp/decompile.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bemani/format/afp/decompile.py b/bemani/format/afp/decompile.py index d1f8a2b..5991a74 100644 --- a/bemani/format/afp/decompile.py +++ b/bemani/format/afp/decompile.py @@ -2373,6 +2373,12 @@ class ByteCodeDecompiler(VerboseOutput): # Make a copy of the stack so we can safely modify it ourselves. stack = [s for s in stack] + # TODO: Its possible for there to be a function/method call with no subsequent use of the return + # value and no POP to clear the stack. If this is the case, technically the function WAS called, + # just the result was completely ignored. This shows up in a few Pop'n animations. What should + # happen is that we check the stack for any leftover function/method calls and re-insert them + # into the spot where they were called since we know that they aren't used. + def make_if_expr(action: IfAction) -> IfExpr: if action.comparison in [IfAction.IS_UNDEFINED, IfAction.IS_NOT_UNDEFINED]: conditional = stack.pop()