Skip to content

Codehandler does not implement inline endifs #12

Description

@coolestto555

The gecko codehandler used by GeckoLoader does not apply an endif before "if" codes with 1 added to their address as expected.

Example:

00408FDF 00000000  // var = 0
204093AC 00000004  // if (Condition == 4) {
00408FDF 00000001  //   var = 1
204093AD 0000000A  // }if (Condition == 10) {
00408FDF 00000001  //   var = 1
204093AD 0000002F  // }if (Condition == 47) {
00408FDF 00000001  //   var = 1
E2000001 00000000  // }

This code works perfectly on Dolphin/Swiss/Nintendont to write var = 1 any time Condition is 4, 10, or 47, and writes var = 0 for any other value of Condition.

When injected into a dol with GeckoLoader, instead the code ONLY writes var = 1 when Condition == 4. The following conditions are never reached, as if nested.

Explicitly stating each endif with an E2 code:

00408FDF 00000000  // var = 0
204093AC 00000004  // if (Condition == 4) {
00408FDF 00000001  //   var = 1
E2000001 00000000  // }
204093AC 0000000A  // if (Condition == 10) {
00408FDF 00000001  //   var = 1
E2000001 00000000  // }
204093AC 0000002F  // if (Condition == 47) {
00408FDF 00000001  //   var = 1
E2000001 00000000  // }

results in the expected behavior.

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions