Skip to content

Pack Booleans #4

Description

@leo60228

With this type, it packs the buttons compound type into 10 bytes instead of the preferable 2 bytes, or even 1.25 (though this would probably be much slower). Could you change this? I didn't see any plans for backwards-compatibility in the spec.

const Format = new Type({
  version: 'uint',
  frames: [{
    buttons: {
      A: 'boolean',
      B: 'boolean',
      X: 'boolean',
      Y: 'boolean',
      L: 'boolean',
      R: 'boolean',
      ZL: 'boolean',
      ZR: 'boolean',
      plus: 'boolean',
      minus: 'boolean',
    },
    sticks: {
      L: {
        x: 'uint',
        y: 'uint'
      },
      R: {
        x: 'uint',
        y: 'uint'
      }
    }
  }]
});

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions