summaryrefslogtreecommitdiffstats
path: root/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/input/model/NpadStyleIndex.kt
blob: e2a3d7aff0838dc2826a340158148d273827d7f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// SPDX-FileCopyrightText: 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

package org.yuzu.yuzu_emu.features.input.model

import androidx.annotation.StringRes
import org.yuzu.yuzu_emu.R

// Must match enum in src/core/hid/hid_types.h
enum class NpadStyleIndex(val int: Int, @StringRes val nameId: Int = 0) {
    None(0),
    Fullkey(3, R.string.pro_controller),
    Handheld(4, R.string.handheld),
    HandheldNES(4),
    JoyconDual(5, R.string.dual_joycons),
    JoyconLeft(6, R.string.left_joycon),
    JoyconRight(7, R.string.right_joycon),
    GameCube(8, R.string.gamecube_controller),
    Pokeball(9),
    NES(10),
    SNES(12),
    N64(13),
    SegaGenesis(14),
    SystemExt(32),
    System(33);

    companion object {
        fun from(int: Int): NpadStyleIndex = entries.firstOrNull { it.int == int } ?: None
    }
}