mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 23:11:14 +01:00
Android: Add more GameCube controller types
For all your PSO needs.
This commit is contained in:
parent
d6c0f8e749
commit
d811c12196
@ -36,6 +36,9 @@ class EmulatedController private constructor(private val pointer: Long) {
|
|||||||
@JvmStatic
|
@JvmStatic
|
||||||
external fun getGcPad(controllerIndex: Int): EmulatedController
|
external fun getGcPad(controllerIndex: Int): EmulatedController
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
external fun getGcKeyboard(controllerIndex: Int): EmulatedController
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
external fun getWiimote(controllerIndex: Int): EmulatedController
|
external fun getWiimote(controllerIndex: Int): EmulatedController
|
||||||
|
|
||||||
|
@ -2071,34 +2071,49 @@ class SettingsFragmentPresenter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun addGcPadSubSettings(sl: ArrayList<SettingsItem>, gcPadNumber: Int, gcPadType: Int) {
|
private fun addGcPadSubSettings(sl: ArrayList<SettingsItem>, gcPadNumber: Int, gcPadType: Int) {
|
||||||
if (gcPadType == 6) {
|
when (gcPadType) {
|
||||||
// Emulated
|
6, 8, 9, 10 -> {
|
||||||
val gcPad = EmulatedController.getGcPad(gcPadNumber)
|
// Emulated
|
||||||
|
val gcPad = EmulatedController.getGcPad(gcPadNumber)
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(gameId)) {
|
if (!TextUtils.isEmpty(gameId)) {
|
||||||
addControllerPerGameSettings(sl, gcPad, gcPadNumber)
|
addControllerPerGameSettings(sl, gcPad, gcPadNumber)
|
||||||
} else {
|
} else {
|
||||||
addControllerMetaSettings(sl, gcPad)
|
addControllerMetaSettings(sl, gcPad)
|
||||||
addControllerMappingSettings(sl, gcPad, null)
|
addControllerMappingSettings(sl, gcPad, null)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (gcPadType == 12) {
|
7 -> {
|
||||||
// Adapter
|
// Emulated keyboard controller
|
||||||
sl.add(
|
val gcKeyboard = EmulatedController.getGcKeyboard(gcPadNumber)
|
||||||
SwitchSetting(
|
|
||||||
context,
|
if (!TextUtils.isEmpty(gameId)) {
|
||||||
BooleanSetting.getSettingForAdapterRumble(gcPadNumber),
|
addControllerPerGameSettings(sl, gcKeyboard, gcPadNumber)
|
||||||
R.string.gc_adapter_rumble,
|
} else {
|
||||||
R.string.gc_adapter_rumble_description
|
sl.add(HeaderSetting(context, R.string.keyboard_controller_warning, 0))
|
||||||
|
addControllerMetaSettings(sl, gcKeyboard)
|
||||||
|
addControllerMappingSettings(sl, gcKeyboard, null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
12 -> {
|
||||||
|
// Adapter
|
||||||
|
sl.add(
|
||||||
|
SwitchSetting(
|
||||||
|
context,
|
||||||
|
BooleanSetting.getSettingForAdapterRumble(gcPadNumber),
|
||||||
|
R.string.gc_adapter_rumble,
|
||||||
|
R.string.gc_adapter_rumble_description
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
sl.add(
|
||||||
sl.add(
|
SwitchSetting(
|
||||||
SwitchSetting(
|
context,
|
||||||
context,
|
BooleanSetting.getSettingForSimulateKonga(gcPadNumber),
|
||||||
BooleanSetting.getSettingForSimulateKonga(gcPadNumber),
|
R.string.gc_adapter_bongos,
|
||||||
R.string.gc_adapter_bongos,
|
R.string.gc_adapter_bongos_description
|
||||||
R.string.gc_adapter_bongos_description
|
)
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -367,11 +367,19 @@
|
|||||||
<string-array name="gcpadTypeEntries">
|
<string-array name="gcpadTypeEntries">
|
||||||
<item>@string/gcpad_disabled</item>
|
<item>@string/gcpad_disabled</item>
|
||||||
<item>@string/gcpad_emulated</item>
|
<item>@string/gcpad_emulated</item>
|
||||||
|
<item>@string/gcpad_keyboard</item>
|
||||||
|
<item>@string/gcpad_steering_wheel</item>
|
||||||
|
<item>@string/gcpad_dance_mat</item>
|
||||||
|
<item>@string/gcpad_taru_konga</item>
|
||||||
<item>@string/gcpad_gc_adapter</item>
|
<item>@string/gcpad_gc_adapter</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<integer-array name="gcpadTypeValues">
|
<integer-array name="gcpadTypeValues">
|
||||||
<item>0</item>
|
<item>0</item>
|
||||||
<item>6</item>
|
<item>6</item>
|
||||||
|
<item>7</item>
|
||||||
|
<item>8</item>
|
||||||
|
<item>9</item>
|
||||||
|
<item>10</item>
|
||||||
<item>12</item>
|
<item>12</item>
|
||||||
</integer-array>
|
</integer-array>
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
<string name="input_clear">Clear</string>
|
<string name="input_clear">Clear</string>
|
||||||
<string name="input_clear_description">Clear settings for this controller.</string>
|
<string name="input_clear_description">Clear settings for this controller.</string>
|
||||||
<string name="input_reset_warning">Are you sure? Your current controller settings will be deleted.</string>
|
<string name="input_reset_warning">Are you sure? Your current controller settings will be deleted.</string>
|
||||||
|
<string name="keyboard_controller_warning">"You are configuring a \"Keyboard Controller\". This device is exclusively for \"Phantasy Star Online Episode I & II\". If you are unsure, turn back now and configure a \"Standard Controller\".</string>
|
||||||
<string name="old_controller_settings">Your controller settings are from an old version of Dolphin and won\'t work in this version. Press \"Default\" to start over with new settings.</string>
|
<string name="old_controller_settings">Your controller settings are from an old version of Dolphin and won\'t work in this version. Press \"Default\" to start over with new settings.</string>
|
||||||
|
|
||||||
<string name="input_binding">Input Binding</string>
|
<string name="input_binding">Input Binding</string>
|
||||||
@ -772,13 +773,17 @@ It can efficiently compress both junk data and encrypted Wii data.
|
|||||||
<string name="country_unknown">Unknown</string>
|
<string name="country_unknown">Unknown</string>
|
||||||
|
|
||||||
<!-- GameCube Gamepad Types -->
|
<!-- GameCube Gamepad Types -->
|
||||||
<string name="gcpad_disabled">Disabled</string>
|
<string name="gcpad_disabled">None</string>
|
||||||
<string name="gcpad_emulated">Emulated</string>
|
<string name="gcpad_emulated">Standard Controller</string>
|
||||||
|
<string name="gcpad_keyboard">Keyboard Controller</string>
|
||||||
|
<string name="gcpad_steering_wheel">Steering Wheel</string>
|
||||||
|
<string name="gcpad_dance_mat">Dance Mat</string>
|
||||||
|
<string name="gcpad_taru_konga">DK Bongos</string>
|
||||||
<string name="gcpad_gc_adapter">GameCube Adapter</string>
|
<string name="gcpad_gc_adapter">GameCube Adapter</string>
|
||||||
|
|
||||||
<!-- Wiimote Types -->
|
<!-- Wiimote Types -->
|
||||||
<string name="wiimote_disabled">Disabled</string>
|
<string name="wiimote_disabled">None</string>
|
||||||
<string name="wiimote_emulated">Emulated</string>
|
<string name="wiimote_emulated">Emulated Wii Remote</string>
|
||||||
<string name="wiimote_real">Real Wii Remote (DolphinBar required)</string>
|
<string name="wiimote_real">Real Wii Remote (DolphinBar required)</string>
|
||||||
|
|
||||||
<!-- Gamepad Controls -->
|
<!-- Gamepad Controls -->
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "Common/FileUtil.h"
|
#include "Common/FileUtil.h"
|
||||||
#include "Common/IniFile.h"
|
#include "Common/IniFile.h"
|
||||||
|
#include "Core/HW/GCKeyboard.h"
|
||||||
#include "Core/HW/GCPad.h"
|
#include "Core/HW/GCPad.h"
|
||||||
#include "Core/HW/Wiimote.h"
|
#include "Core/HW/Wiimote.h"
|
||||||
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
||||||
@ -138,6 +139,13 @@ Java_org_dolphinemu_dolphinemu_features_input_model_controlleremu_EmulatedContro
|
|||||||
return EmulatedControllerToJava(env, Pad::GetConfig()->GetController(controller_index));
|
return EmulatedControllerToJava(env, Pad::GetConfig()->GetController(controller_index));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT jobject JNICALL
|
||||||
|
Java_org_dolphinemu_dolphinemu_features_input_model_controlleremu_EmulatedController_getGcKeyboard(
|
||||||
|
JNIEnv* env, jclass, jint controller_index)
|
||||||
|
{
|
||||||
|
return EmulatedControllerToJava(env, Keyboard::GetConfig()->GetController(controller_index));
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT jobject JNICALL
|
JNIEXPORT jobject JNICALL
|
||||||
Java_org_dolphinemu_dolphinemu_features_input_model_controlleremu_EmulatedController_getWiimote(
|
Java_org_dolphinemu_dolphinemu_features_input_model_controlleremu_EmulatedController_getWiimote(
|
||||||
JNIEnv* env, jclass, jint controller_index)
|
JNIEnv* env, jclass, jint controller_index)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user