Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2797 from Oendaril/dev
Browse files Browse the repository at this point in the history
Odroidgo3  joystick inversion, Mupen64 optimizations for XU10, XU10 regulator tweaks
  • Loading branch information
fewtarius authored Feb 2, 2024
2 parents 6e167f1 + 1314821 commit c9821c8
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ Kbd Mapping Frame Advance = 47
# SDL keysym for pressing the game shark button
Kbd Mapping Gameshark = 103
# Joystick event string for stopping the emulator
Joy Mapping Stop = "J0B12/B13"
Joy Mapping Stop = "J0B16/B9"
# Joystick event string for switching between fullscreen/windowed modes
Joy Mapping Fullscreen = ""
# Joystick event string for saving the emulator state
Joy Mapping Save State = "J0B12/B5"
Joy Mapping Save State = "J0B16/B5"
# Joystick event string for loading the emulator state
Joy Mapping Load State = "J0B12/B4"
Joy Mapping Load State = "J0B16/B4"
# Joystick event string for advancing the save state slot
Joy Mapping Increment Slot = ""
# Joystick event string for resetting the emulator
Expand All @@ -128,15 +128,15 @@ Joy Mapping Speed Up = ""
# Joystick event string for taking a screenshot
Joy Mapping Screenshot = ""
# Joystick event string for pausing the emulator
Joy Mapping Pause = "J0B12/B0"
Joy Mapping Pause = "J0B16/B0"
# Joystick event string for muting/unmuting the sound
Joy Mapping Mute = ""
# Joystick event string for increasing the volume
Joy Mapping Increase Volume = ""
# Joystick event string for decreasing the volume
Joy Mapping Decrease Volume = ""
# Joystick event string for fast-forward
Joy Mapping Fast Forward = "J0B12/B14"
Joy Mapping Fast Forward = "J0B16/B15"
# Joystick event string for advancing by one frame when paused
Joy Mapping Frame Advance = ""
# Joystick event string for pressing the game shark button
Expand Down Expand Up @@ -196,8 +196,8 @@ DPad D = button(13)
DPad U = button(12)
Start = button(9)
Z Trig = button(7)
B Button = button(1)
A Button = button(2)
B Button = button(0)
A Button = button(1)
C Button R = axis(2+)
C Button L = axis(2-)
C Button D = axis(3+)
Expand Down Expand Up @@ -399,7 +399,7 @@ ScreenHeight = 320
# Use fullscreen mode if True, or windowed mode if False
Fullscreen = True
# If true, activate the SDL_GL_SWAP_CONTROL attribute
VerticalSync = True
VerticalSync = False
# Rotate screen contents: 0=0 degree, 1=90 degree, 2 = 180 degree, 3=270 degree
Rotate = 0

Expand Down Expand Up @@ -605,9 +605,9 @@ ScreenUpdateSetting = 4
# Force to use normal alpha blender
NormalAlphaBlender = False
# Use a faster algorithm to speed up texture loading and CRC computation
FastTextureLoading = False
FastTextureLoading = True
# Use different texture coordinate clamping code
AccurateTextureMapping = True
AccurateTextureMapping = False
# Force emulated frame buffers to be in N64 native resolution
InN64Resolution = False
# Try to reduce Video RAM usage (should never be used)
Expand Down Expand Up @@ -641,7 +641,7 @@ DumpTexturesToFiles = False
# Display On-screen FPS
ShowFPS = False
# Use Mipmapping? 0=no, 1=nearest, 2=bilinear, 3=trilinear
Mipmapping = 2
Mipmapping = 0
# Enable, Disable fog generation (0=Disable, 1=Enable)
FogMethod = 1
# Force to use texture filtering or not (0=auto: n64 choose, 1=force no filtering, 2=force filtering)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ DPad D = button(13)
DPad U = button(12)
Start = button(9)
Z Trig = button(7)
B Button = button(1)
A Button = button(2)
B Button = button(0)
A Button = button(1)
C Button R = axis(2+)
C Button L = axis(2-)
C Button D = axis(3+)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -949,8 +949,8 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3326-gameconsole-r33s.dts l
+};
diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts linux/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts
--- linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts 1969-12-31 19:00:00.000000000 -0500
+++ linux/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts 2024-01-29 18:25:00.758766065 -0500
@@ -0,0 +1,825 @@
+++ linux/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts 2024-02-01 21:39:27.594961980 -0500
@@ -0,0 +1,828 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 Hardkernel Co., Ltd
Expand Down Expand Up @@ -1306,6 +1306,7 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts linux/
+ compatible = "regulator-fixed";
+ regulator-name = "vcc3v8_sys";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <3800000>;
+ regulator-max-microvolt = <3800000>;
+ };
Expand Down Expand Up @@ -1572,6 +1573,8 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts linux/
+ regulator-name = "vcc18_lcd_n";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-boot-on;
+ enable-active-high;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2264,9 +2264,9 @@ diff -rupN linux.orig/drivers/input/joystick/odroidgo2-v11-joypad.c linux/driver
+
+/*----------------------------------------------------------------------------*/
diff -rupN linux.orig/drivers/input/joystick/odroidgo3-joypad.c linux/drivers/input/joystick/odroidgo3-joypad.c
--- linux.orig/drivers/input/joystick/odroidgo3-joypad.c 1970-01-01 00:00:00.000000000 +0000
+++ linux/drivers/input/joystick/odroidgo3-joypad.c 2024-01-29 06:19:30.953540557 +0000
@@ -0,0 +1,1086 @@
--- linux.orig/drivers/input/joystick/odroidgo3-joypad.c 1969-12-31 19:00:00.000000000 -0500
+++ linux/drivers/input/joystick/odroidgo3-joypad.c 2024-02-01 13:43:52.000000000 -0500
@@ -0,0 +1,1108 @@
+/*
+ * SARADC joystick & GPIO Button driver for Linux(Hardkernel ODROIDGO2-Advance)
+ */
Expand Down Expand Up @@ -2391,6 +2391,12 @@ diff -rupN linux.orig/drivers/input/joystick/odroidgo3-joypad.c linux/drivers/in
+ /* analog button */
+ struct bt_adc *adcs;
+
+ /* report reference point */
+ bool invert_absx;
+ bool invert_absy;
+ bool invert_absrx;
+ bool invert_absry;
+
+ /* report interval (ms) */
+ int bt_gpio_count;
+ struct bt_gpio *gpios;
Expand Down Expand Up @@ -2504,7 +2510,7 @@ diff -rupN linux.orig/drivers/input/joystick/odroidgo3-joypad.c linux/drivers/in
+
+ value *= adc->scale;
+
+ return (adc->invert ? (adc->max - value) : value);
+ return value;
+}
+
+/*----------------------------------------------------------------------------*/
Expand Down Expand Up @@ -3009,6 +3015,8 @@ diff -rupN linux.orig/drivers/input/joystick/odroidgo3-joypad.c linux/drivers/in
+
+ switch (nbtn) {
+ case 0:
+ if (joypad->invert_absry)
+ adc->invert = true;
+ adc->report_type = ABS_RY;
+ if (device_property_read_u32(dev,
+ "abs_ry-p-tuning",
Expand All @@ -3020,6 +3028,8 @@ diff -rupN linux.orig/drivers/input/joystick/odroidgo3-joypad.c linux/drivers/in
+ adc->tuning_n = ADC_TUNING_DEFAULT;
+ break;
+ case 1:
+ if (joypad->invert_absrx)
+ adc->invert = true;
+ adc->report_type = ABS_RX;
+ if (device_property_read_u32(dev,
+ "abs_rx-p-tuning",
Expand All @@ -3031,6 +3041,8 @@ diff -rupN linux.orig/drivers/input/joystick/odroidgo3-joypad.c linux/drivers/in
+ adc->tuning_n = ADC_TUNING_DEFAULT;
+ break;
+ case 2:
+ if (joypad->invert_absy)
+ adc->invert = true;
+ adc->report_type = ABS_Y;
+ if (device_property_read_u32(dev,
+ "abs_y-p-tuning",
Expand All @@ -3042,6 +3054,8 @@ diff -rupN linux.orig/drivers/input/joystick/odroidgo3-joypad.c linux/drivers/in
+ adc->tuning_n = ADC_TUNING_DEFAULT;
+ break;
+ case 3:
+ if (joypad->invert_absx)
+ adc->invert = true;
+ adc->report_type = ABS_X;
+ if (device_property_read_u32(dev,
+ "abs_x-p-tuning",
Expand Down Expand Up @@ -3247,6 +3261,14 @@ diff -rupN linux.orig/drivers/input/joystick/odroidgo3-joypad.c linux/drivers/in
+
+ joypad->auto_repeat = device_property_present(dev, "autorepeat");
+
+ /* change the report reference point? (read value * -1) */
+ joypad->invert_absx = device_property_present(dev, "invert-absx");
+ joypad->invert_absy = device_property_present(dev, "invert-absy");
+ joypad->invert_absrx = device_property_present(dev, "invert-absrx");
+ joypad->invert_absry = device_property_present(dev, "invert-absry");
+ dev_info(dev, "%s : invert-absx = %d, inveret-absy = %d, invert-absrx = %d, invert-absry = %d\n",
+ __func__, joypad->invert_absx, joypad->invert_absy, joypad->invert_absrx, joypad->invert_absry);
+
+ joypad->bt_gpio_count = device_get_child_node_count(dev);
+
+ if ((joypad->amux_count == 0) || (joypad->bt_gpio_count == 0)) {
Expand Down

0 comments on commit c9821c8

Please sign in to comment.