Skip to content

Add support for more branching opcodes #133

Closed

Description

@x87

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.

Activity

  1. added
    type:feature
    priority:p2
    on Feb 20, 2021
  2. x87 commented on Feb 20, 2021

    @x87
    CollaboratorAuthor
    {$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
    
  3. MatiDragon-YT commented on Mar 10, 2021

    @MatiDragon-YT
    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.

  4. x87 commented on Mar 10, 2021

    @x87
    CollaboratorAuthor

    A little support could be given to frame_delta_time?

    Yep. See #115

  5. x87 commented on Aug 6, 2022

    @x87
    CollaboratorAuthor

    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.

  6. x87 commented on Sep 1, 2022

    @x87
    CollaboratorAuthor

    implemented in 3.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:p2scope:compilertype:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions