Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

CTROLLER for Android 3DS: Difference between revisions

From GameBrew
m (Text replacement - "image = https://dlhb.gamebrew.org/3dshomebrew/" to "image = ")
m (Text replacement - "Category:Homebrew utility applications on 3DS" to "")
 
(31 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Infobox-3DS-Homebrews
{{Infobox 3DS Homebrews
| title = CTROLLER for Android
|title=CTROLLER for Android
| image = CTROLLER-for-Android.png|250px
|image=Ctrollerandroid2.png
| type = Other Apps
|description=Use your Nindendo 3DS as a game controller for Android.
| version=v0.1.3
|author=superl2
| lastupdated = 2018/01/29
|lastupdated=2018/01/29
| licence = Mixed
|type=Utilities
| author = superl2
|version=0.1.3 alpha
| website = https://labs.xda-developers.com/store/app/tk.superl2.ctroller
|license=Mixed
| download = https://dlhb.gamebrew.org/3dshomebrew/CTROLLER-for-Android.rar
|download=https://dlhb.gamebrew.org/3dshomebrews/ctrollerandroid.7z?k33p0fil35 Binary+APK
| source = https://github.com/hacker1024/ctroller-android
|website=https://labs.xda-developers.com/store/app/tk.superl2.ctroller
|source=https://github.com/hacker1024/ctroller-android
}}
}}
''Ctroller-android'' lets you use your 3DS as an input device for your <s>Linux</s> Android system via the uinput kernel module. It consists of a client that runs on your 3DS, continously streaming the 3DS input data to a server on your Android device. The server exposes a virtual device to your system, interpretes the data it receives and writes it to a event node under <code>/dev/input/event*</code> or similar. The kernel gamepad input documentation can be found here: https://www.kernel.org/doc/Documentation/input/gamepad.txt
Ctroller-android is a program that lets you use your 3DS as an input device for your Android system via the uinput kernel module.  


== Prerequisites ==
It consists of a client that runs on your 3DS, continously streaming the 3DS input data to a server on your Android device. The server exposes a virtual device to your system, interpretes the data it receives and writes it to a event node under <code>/dev/input/event*</code> or similar. The kernel gamepad input documentation can be found [https://www.kernel.org/doc/Documentation/input/gamepad.txt here].


You will need [https://sourceforge.net/projects/devkitpro/files/devkitARM/ DevkitARM] and the [https://github.com/smealum/ctrulib ctrulib] to build the 3DS component.
This is a port of phijor's [[Ctroller_3DS|ctroller]] application to Android.


Building the 3DS CIA requires [https://github.com/Steveice10/bannertool bannertool] and [https://github.com/profi200/Project_CTR/tree/master/makerom makerom] to be in your <code>$PATH</code>.
'''Note:''' To use this your phone must be rooted with a uinput enabled kernel. ARM(64) only.
 
==Installation==
===Prerequisites===
ctroller-3ds, you can use the [https://github.com/phijor/ctroller/releases/latest pre-built binaries] by phijor (3DSX or CIA).
 
ctroller-android, you can use either the ELF binary, or the Android app.  


To run the server, the <code>uinput</code> kernel module needs to be loaded:
To run the server, the <code>uinput</code> kernel module needs to be loaded:
$ modprobe uinput


<source lang="bash">$ modprobe uinput</source>
===Installing===
== Building ==
Create a directory <code>ctroller</code> in the root of your SD card.


To build the 3DS app, run <code>make</code> in the “3DS” directory.
Place <code>ctroller.cfg</code> in there and replace the IP with the one of your PC (the config file should now be at <code>sdmc:/ctroller/ctroller.cfg</code>).


To build the android binary, run <code>CC=path/to/th/android/cross/compiler make</code>. replace the path with the patch to your android cross compiler (the gcc binary).
Install ctroller-3DS using either one of the following:
* CIA - Install <code>.cia</code> with the CIA-manager of your choice.
* 3DSX - Copy <code>.3dsx</code> and <code>.smdh</code> to <code>/3ds/ctroller/</code> on your SD card.


== Installation ==
Install ctroller-android using either one of the following:
* APK - With a simple UI.
* ARM64 - Run ELF binary manually.


<ol style="list-style-type: decimal;">
==User guide==
<li><p>Download and run the ELF binary manually or use my android app: https://github.com/hacker1024/ctroller-android-app</p></li>
===App version===
<li><p>Download the [https://github.com/phijor/ctroller/releases/latest latest release of the 3DS binaries].</p>
Run the application and press start.
<p>Or you can build them yourself:</p>
<source lang="bash">$ cd 3DS
$ make release</source></li>
<li><p>Install <code>ctroller.cia</code> with the CIA-manager of your choice.</p>
<p>If you want to install the 3DSX-executable:</p>
<p>Copy <code>ctroller.{3dsx,smdh}</code> to <code>/3ds/ctroller/</code> on your SD card. You can also directly upload the application to your 3DS using [[./3DS/upload.sh|upload.sh]] (do not blindly execute unknown scrips, I’m not responsible if this accidentally deletes your SD card or unfreezes your fridge). To do so, start a FTP server (such as [https://github.com/mtheall/ftpd ftpd]) on your 3DS on port 5000, then run:</p>
<source lang="bash">$ cd 3DS
$ make upload DSIP=<IP of your 3DS here></source>
<p>This requires <code>ftp</code> to be installed on your system.</p></li>
<li><p>Create a directory <code>ctroller</code> in the root of your SD card</p></li>
<li><p>'''Place [[./3DS/ctroller.cfg|3DS/ctroller.cfg]] in there and replace the IP with the one of your PC.''' (The config file should now be at <code>sdmc:/ctroller/ctroller.cfg</code>)</p></li></ol>


== Running ==
Launch the <code>ctroller.3dsx</code> or <code>ctroller.cia</code> application on your 3DS using a homebrew launcher of your choice.
 
Run the ELF binary manually or use my android app: https://github.com/hacker1024/ctroller-android-app


===ELF binary===
Start the ELF binary manually by copying to a executable location (like /data/local/tmp/) and running:
Start the ELF binary manually by copying to a executable location (like /data/local/tmp/) and running:
$ ./ctroller


<source lang="bash">$ ./ctroller</source>
Flags if you manually run the binary:
Flags if you manually run the binary:
  -d  --daemonize              execute in background
  -h  --help                  print this help text
  -p  --port=<num>            listen on port 'num' (defaults to 15708)
  -u  --uinput-device=<path>  uinput character device (defaults to /dev/uinput)
  -k  --keymap                use a keymap file (if not set, ctroller will use the default keymap)


<pre> -d  --daemonize              execute in background
Then launch the <code>ctroller.3dsx</code> or <code>ctroller.cia</code> application on your 3DS using a homebrew launcher of your choice.
  -h  --help                  print this help text
  -p  --port=&lt;num&gt;            listen on port 'num' (defaults to 15708)
  -u  --uinput-device=&lt;path&gt;  uinput character device (defaults to /dev/uinput)
  -k  --keymap                use a keymap file (if not set, ctroller will use the default keymap)</pre>
Then launch the ''ctroller.3dsx'' or ''ctroller.cia'' application on your 3DS using a homebrew launcher of your choice.


For development purposes, the 3DS-Makefile includes a <code>run</code> target that uses <code>3dslink</code> to upload and run the application using the Homebrew Menu NetLoader.
For development purposes, the 3DS-Makefile includes a <code>run</code> target that uses <code>3dslink</code> to upload and run the application using the Homebrew Menu NetLoader.


== Creating your own keymap file ==
===Custom keymap file===
To remap the buttons in a way you want, you need to create a file with a button label on each line. The default mapping is this:
A
B
X
Y
START
SELECT
L
R
ZL
ZR


To remap the buttons in a way you want, you need to create a file with a button label on each line. The default mapping is this:
To modify it, copy the above into a file, and swap keys around. The order is very important; any key in your custom keymap will override the default one on the same line.
 
To use this keymap with ctroller-android, use the -k option (see above).


* A
For example, to change the layout to be more like an xbox, you can swap <code>A</code> and <code>B</code>; <code>X</code> and <code>Y</code>; <code>R</code> and <code>ZR</code>; and <code>L</code> and <code>ZL</code>. The keymap file will look like this:
* B
B
* X
A
* Y
Y
* START
X
* SELECT
START
* L
SELECT
* R
ZL
* ZL
ZR
* ZR
L
R


To modify it, copy the above into a file, and swap keys around. The order is very important; any key in your custom keymap will override the default one on the same line.
===Notes===
This program is intended to be used in a private network.  


To use this keymap with ctroller-android, use the -k option (see above).
For simplicity, the server right now accepts any connection on it's port, which might pose a security risk if others can send data to it.  


For example, I prefer my layout to be more like an xbox, for better compatibility with games. To do this, I swap <code>A</code> and <code>B</code>; <code>X</code> and <code>Y</code>; <code>R</code> and <code>ZR</code>; and <code>L</code> and <code>ZL</code>. Here’s my keymap file:
This will be changed in future releases. For now, you probably shouldn't be using this in a public network.


* B
==Screenshots==
* A
https://dlhb.gamebrew.org/3dshomebrews/ctrollerandroid3.png
* Y
* X
* START
* SELECT
* ZL
* ZR
* L
* R


== Notes ==
==Known issues==
C-stick and D-Pad may not work.


This program is intended to be used in a private network. For simplicity, the server right now accepts any connection on it’s port, which might pose a security risk if others can send data to it. This will be changed in future releases. For now, you probably shouldn’t be using this in a public network.
==Changelog==
'''APK v0.1.3 2017/12/27'''
* Add about page - Check if the native binary is already running on app launch, and if so, give an option to stop it.
* Update native binary to release android-0.1.2 (buttons are now mapped like an xbox controller, fixed error logging).


==changelogs==
'''ARM64 v0.1.2 2017/12/27'''
Version 0.1.3 on 12.27.2017 Alpha 3.1 MB
* The buttons now map like an xbox controller.
Changes:
* Add about page - Check if the native binary is already running on app launch, and if so, give an option to stop it
* Update native binary to release android-0.1.2 (buttons are now mapped like an xbox controller, fixed error logging) Known bugs (same as old releases):
* C-stick may not work, please tell me
* DPAD may not work, please tell me I need feedback! Please tell me if the app works for you or not. I especially need feedback from people with 32-bit devices.


==External Links==
==External Links==
* Source code is here: https://github.com/hacker1024/ctroller-android-app
* GitHub (ctroller-android app) - https://github.com/hacker1024/ctroller-android-app
* and here: https://github.com/hacker1024/ctroller-android
* GitHub (ctroller-android binary) - https://github.com/hacker1024/ctroller-android
* XDA - https://forum.xda-developers.com/t/use-your-nintendo-3ds-as-an-android-game-controller.3712796
* Reddit - https://www.reddit.com/r/3dshacks/comments/7gmvec/use_your_3ds_as_a_android_game_controller_port_of

Latest revision as of 05:34, 6 Mayıs 2024

CTROLLER for Android
Ctrollerandroid2.png
General
Authorsuperl2
TypeUtilities
Version0.1.3 alpha
LicenseMixed
Last Updated2018/01/29
Links
Binary+APK Download
Website
Source

Ctroller-android is a program that lets you use your 3DS as an input device for your Android system via the uinput kernel module.

It consists of a client that runs on your 3DS, continously streaming the 3DS input data to a server on your Android device. The server exposes a virtual device to your system, interpretes the data it receives and writes it to a event node under /dev/input/event* or similar. The kernel gamepad input documentation can be found here.

This is a port of phijor's ctroller application to Android.

Note: To use this your phone must be rooted with a uinput enabled kernel. ARM(64) only.

Installation

Prerequisites

ctroller-3ds, you can use the pre-built binaries by phijor (3DSX or CIA).

ctroller-android, you can use either the ELF binary, or the Android app.

To run the server, the uinput kernel module needs to be loaded:

$ modprobe uinput

Installing

Create a directory ctroller in the root of your SD card.

Place ctroller.cfg in there and replace the IP with the one of your PC (the config file should now be at sdmc:/ctroller/ctroller.cfg).

Install ctroller-3DS using either one of the following:

  • CIA - Install .cia with the CIA-manager of your choice.
  • 3DSX - Copy .3dsx and .smdh to /3ds/ctroller/ on your SD card.

Install ctroller-android using either one of the following:

  • APK - With a simple UI.
  • ARM64 - Run ELF binary manually.

User guide

App version

Run the application and press start.

Launch the ctroller.3dsx or ctroller.cia application on your 3DS using a homebrew launcher of your choice.

ELF binary

Start the ELF binary manually by copying to a executable location (like /data/local/tmp/) and running:

$ ./ctroller

Flags if you manually run the binary:

 -d  --daemonize              execute in background
 -h  --help                   print this help text
 -p  --port=<num>             listen on port 'num' (defaults to 15708)
 -u  --uinput-device=<path>   uinput character device (defaults to /dev/uinput)
 -k  --keymap                 use a keymap file (if not set, ctroller will use the default keymap)

Then launch the ctroller.3dsx or ctroller.cia application on your 3DS using a homebrew launcher of your choice.

For development purposes, the 3DS-Makefile includes a run target that uses 3dslink to upload and run the application using the Homebrew Menu NetLoader.

Custom keymap file

To remap the buttons in a way you want, you need to create a file with a button label on each line. The default mapping is this:

A
B
X
Y
START
SELECT
L
R
ZL
ZR

To modify it, copy the above into a file, and swap keys around. The order is very important; any key in your custom keymap will override the default one on the same line.

To use this keymap with ctroller-android, use the -k option (see above).

For example, to change the layout to be more like an xbox, you can swap A and B; X and Y; R and ZR; and L and ZL. The keymap file will look like this:

B
A
Y
X
START
SELECT
ZL
ZR
L
R

Notes

This program is intended to be used in a private network.

For simplicity, the server right now accepts any connection on it's port, which might pose a security risk if others can send data to it.

This will be changed in future releases. For now, you probably shouldn't be using this in a public network.

Screenshots

ctrollerandroid3.png

Known issues

C-stick and D-Pad may not work.

Changelog

APK v0.1.3 2017/12/27

  • Add about page - Check if the native binary is already running on app launch, and if so, give an option to stop it.
  • Update native binary to release android-0.1.2 (buttons are now mapped like an xbox controller, fixed error logging).

ARM64 v0.1.2 2017/12/27

  • The buttons now map like an xbox controller.

External Links

Advertising: