1
0
mirror of synced 2024-11-24 06:20:12 +01:00

Implement GET_TIME opcode used by some DDR PS3 files.

This commit is contained in:
Jennifer Taylor 2021-05-09 19:18:48 +00:00
parent 95dc046043
commit da1dba8f2b

View File

@ -489,6 +489,12 @@ class FunctionCall(Expression):
return f"{name}({', '.join(params)})" return f"{name}({', '.join(params)})"
class GetTimeFunctionCall(FunctionCall):
# Call the built-in 'get time' method which returns the current playback position.
def __init__(self) -> None:
super().__init__("builtin_GetCurrentPlaybackPosition", [])
class MethodCall(Expression): class MethodCall(Expression):
# Call a method on an object. # Call a method on an object.
def __init__(self, objectref: Any, name: Union[str, int, Expression], params: List[Any]) -> None: def __init__(self, objectref: Any, name: Union[str, int, Expression], params: List[Any]) -> None:
@ -2895,6 +2901,11 @@ class ByteCodeDecompiler(VerboseOutput):
chunk.actions[i] = NopStatement() chunk.actions[i] = NopStatement()
continue continue
if action.opcode == AP2Action.GET_TIME:
stack.append(GetTimeFunctionCall())
chunk.actions[i] = NopStatement()
continue
if isinstance(action, NullReturnStatement): if isinstance(action, NullReturnStatement):
# We already handled this # We already handled this
continue continue