Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for more branching opcodes #133

Closed
Tracked by #182
x87 opened this issue Feb 20, 2021 · 5 comments
Closed
Tracked by #182

Add support for more branching opcodes #133

x87 opened this issue Feb 20, 2021 · 5 comments
Labels
priority:p2 Medium priority scope:compiler type:feature New feature or request

Comments

@x87
Copy link
Collaborator

x87 commented Feb 20, 2021

Reported by @wmysterio.

Currently the compiler only checks for opcode 004d as a condition terminator. But potentially there are more opcodes:

004c: jump_if_true
0AA1: return_if_false
0AA0: gosub_if_false @label

need a custom datatype in opcode definitions to recognize branching opcodes.

@x87 x87 added type:feature New feature or request priority:p2 Medium priority scope:compiler labels Feb 20, 2021
@x87
Copy link
Collaborator Author

x87 commented Feb 20, 2021

{$CLEO}

0000:
while true
    if
        0AB0:   is_key_pressed 9
    004c: jump_if_true @exit
end

:exit
0A93: terminate_this_custom_script

throws error with Condition Check enabled.

As a workaround the conditions check must be disabled and the if command should be given a number argument:

{$CLEO}

0000:
while true
    if 0 // or 1,2,3...21,22,23...
        0AB0:   is_key_pressed 9
    004c: jump_if_true @exit
end

:exit
0A93: terminate_this_custom_script

@MatiDragon-YT
Copy link
Member

A little support could be given to frame_delta_time?
Screenshot_20210310-120935-139
For what can used like this:

0@ += deltaTime * 0.4  // opcode 0079:

The compiler now would also have to check if the keyword (deltatime *) is after the equal sign(=), to know if the XXXX OP should be used.

@x87
Copy link
Collaborator Author

x87 commented Mar 10, 2021

A little support could be given to frame_delta_time?

Yep. See #115

@x87
Copy link
Collaborator Author

x87 commented Aug 6, 2022

Branching information will be provided by Sanny Builder Library (is_branch attribute). As of now all modes but LCS/VCS have corresponding library definitions. For Stories sannybuilder/library#56 needs to be implemented.

@x87
Copy link
Collaborator Author

x87 commented Sep 1, 2022

implemented in 3.8.1

@x87 x87 closed this as completed Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p2 Medium priority scope:compiler type:feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants