Automate rpi_mono_setup creation

This commit is contained in:
Lorenzooone 2024-09-15 10:18:29 +02:00
parent 34f240a576
commit 93044066e5
31 changed files with 265 additions and 26 deletions

View File

@ -66,10 +66,33 @@ jobs:
name: cc3dsfs_zip
path: build/cc3dsfs*.zip
create_pi_setup:
name: Create Pi Mono Setup
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download a single artifact
uses: actions/download-artifact@v3
with:
name: cc3dsfs_zip
- name: Execute pi_setup
shell: bash
run: setup_scripts/rpi_mono_setup_setup.sh
- name: Archive resulting artifact
uses: actions/upload-artifact@v3
with:
name: cc3dsfs_zip
path: cc3dsfs_rpi_mono_setup.zip
publish:
name: Publishing
runs-on: ubuntu-latest
needs: build
needs: create_pi_setup
permissions:
contents: write
steps:
@ -77,6 +100,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: cc3dsfs_zip
- name: Auto-Release the zips
uses: IsaacShelton/update-existing-release@v1.3.2
with:
@ -96,3 +120,4 @@ jobs:
cc3dsfs_linux_pi32.zip
cc3dsfs_linux_pi64.zip
cc3dsfs_macos.zip
cc3dsfs_rpi_mono_setup.zip

View File

@ -60,3 +60,26 @@ jobs:
with:
name: cc3dsfs_zip
path: build/cc3dsfs*.zip
create_pi_setup:
name: Create Pi Mono Setup
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download a single artifact
uses: actions/download-artifact@v3
with:
name: cc3dsfs_zip
- name: Execute pi_setup
shell: bash
run: setup_scripts/rpi_mono_setup_setup.sh
- name: Archive resulting artifact
uses: actions/upload-artifact@v3
with:
name: cc3dsfs_zip
path: cc3dsfs_rpi_mono_setup.zip

View File

@ -65,8 +65,8 @@ endif()
include(FetchContent)
FetchContent_Declare(SFML
GIT_REPOSITORY https://github.com/Lorenzooone/SFML.git
GIT_TAG macos_keyboard_fix)
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG master)
if(USB_IS_NITRO_USE OR USB_OLD_DS_3DS_USE)
FetchContent_Declare(libusb1
@ -478,6 +478,8 @@ else()
install(FILES ${USB_RULES_DIR}/51-ftd3xx.rules DESTINATION .)
install(FILES ${USB_RULES_DIR}/95-usb3dscapture.rules DESTINATION .)
install(FILES ${USB_RULES_DIR}/95-usbdscapture.rules DESTINATION .)
install(FILES ${USB_RULES_DIR}/51-isnitro.rules DESTINATION .)
install(FILES ${SETUP_SCRIPTS_DIR}/install_usb_rules${SCRIPT_EXTENSION} DESTINATION .)
endif()

View File

@ -135,7 +135,7 @@ On Linux and MacOS, the profiles can be found at the "${HOME}/.config/cc3dsfs" f
On Windows, the profiles can be found in the ".config/cc3dsfs" folder inside the directory in which the program runs from.
## Notes
- On Linux, you may need to include the udev USB access rules. You can use the .rules files available in the repository's usb\_rules directory, or define your own.
- On Linux, you may need to include the udev USB access rules. You can use the .rules files available in the repository's usb\_rules directory, or define your own. For ease of use, releases come bundled with a script to do it named install\_usb\_rules.sh.
- At startup, the audio may be unstable. It should fix itself, if you give it enough time.
- If, at first, the connection to the 3DS/DS fails, reconnect the 3DS/DS and then try again. If that also doesn't work, try restarting the program. If that also doesn't work, try restarting the computer.
- USB Hubs can be the cause of connection issues. If you're having problems, try checking whether the 3DS/DS connects fine or not without any other devices connected.

View File

@ -13,7 +13,7 @@ LOCATION_AMD="${LOCATION_BASE}/x86_compilers.list"
LOCATION_ARM="${LOCATION_BASE}/arm_compilers.list"
LIST_ARCHITECTURES=("amd64" "i386" "arm64" "armhf")
LIST_PACKAGES_BASE=("libxinerama-dev" "libxi-dev" "libxss-dev" "libxxf86vm-dev" "libxkbfile-dev" "libxv-dev" "libx11-dev" "libxrandr-dev" "libxcursor-dev" "libudev-dev" "libopenal-dev" "libflac-dev" "libvorbis-dev" "libgl1-mesa-dev" "libegl1-mesa-dev" "libdrm-dev" "libgbm-dev" "libfreetype-dev")
LIST_PACKAGES_BASE=("libxinerama-dev" "libxi-dev" "libxss-dev" "libxxf86vm-dev" "libxkbfile-dev" "libxv-dev" "libx11-dev" "libxrandr-dev" "libxcursor-dev" "libudev-dev" "libflac-dev" "libvorbis-dev" "libgl1-mesa-dev" "libegl1-mesa-dev" "libdrm-dev" "libgbm-dev" "libfreetype-dev")
LIST_PACKAGES_NORMAL=("g++-multilib-i686-linux-gnu" "g++-aarch64-linux-gnu" "g++-arm-linux-gnueabihf" "g++:amd64" "g++" "git" "xorg-dev")
LIST_PACKAGES_SPECIAL=("libgpiod-dev")

16
rpi_setup/changelog.txt Normal file
View File

@ -0,0 +1,16 @@
1.1.1
- Improved performance on both capture data conversion, and pixel drawing.
- Switched back to previous MacOS fullscreen setup. Seems compatible with more hardware.
-----------------------------------------
1.1.0
- Added support for older Loopy DS and 3DS Capture Cards.
- Improved audio quality, reduced sound pops and introduced more audio settings.
- Introduced ability to use non-integer scale factors in fullscreen mode, with separate controls for each separate screen.
- Introduced game-specific crops (hidden by default).
- Added extra PAR settings, as well as ones able to make the chosen screen fit a specific aspect ratio.
- Fixed issue with non-integer scale factors having artifacts.
- Fixed issue with macos application bundle signature.
- Fixed issue with fullscreen mode crashing on macos.
-----------------------------------------
1.0.0
- Initial Release

View File

@ -0,0 +1 @@
premade_scripts/cc3dsfs_script_tv_kit_2.sh

View File

@ -0,0 +1,3 @@
#!/bin/sh
wpctl set-volume @DEFAULT_AUDIO_SINK@ 1.0 ; xset s noblank ; xset s off ; xset -dpms ; xrandr --output HDMI-1 --auto ; sleep 5

View File

@ -0,0 +1,3 @@
#!/bin/sh
${HOME}/Desktop/premade_scripts/cc3dsfs_prepare_script.sh ; ${HOME}/Desktop/cc3dsfs --mono_app --pi_enter 27 --pi_select 9 --pi_menu 19 || shutdown now

View File

@ -0,0 +1,3 @@
#!/bin/sh
${HOME}/Desktop/premade_scripts/cc3dsfs_prepare_script.sh ; ${HOME}/Desktop/cc3dsfs --mono_app --pi_power 3 --pi_select 6 --pi_enter 9 --pi_menu 19 || shutdown now

View File

@ -0,0 +1,3 @@
#!/bin/sh
${HOME}/Desktop/premade_scripts/cc3dsfs_prepare_script.sh ; ${HOME}/Desktop/cc3dsfs --mono_app || shutdown now

View File

@ -0,0 +1,59 @@
# For more options and information see
# http://rptl.io/configtxt
# Some settings may impact device functionality. See link above for details
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
# Enable audio (loads snd_bcm2835)
#dtparam=audio=on
# Additional overlays and parameters are documented
# /boot/firmware/overlays/README
# Automatically load overlays for detected cameras
#camera_auto_detect=1
# Force hdmi output
display_auto_detect=0
hdmi_force_hotplug=1
# Automatically load initramfs files, if found
auto_initramfs=1
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=1
# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1
# Run in 64-bit mode
arm_64bit=1
# Disable compensation for displays with overscan
disable_overscan=1
# Run as fast as firmware / board allows
arm_boost=1
# Disable Bluetooth
dtoverlay=disable-bt
# Disable Wi-Fi
#dtoverlay=disable-wifi
[pi4]
hdmi_enable_4kp60=1
[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1
[all]

20
rpi_setup/files/etc/rc.local Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
if [ ! -e /expanded_rootfs ]; then
touch /expanded_rootfs
raspi-config nonint do_expand_rootfs
reboot
fi
exit 0

View File

@ -0,0 +1,23 @@
Use the official Raspberry Pi OS tool to install "Raspberry Pi OS (64-bit)" (or 32 bit if that is not available) (Debian Bookworm, at the time of writing)
for your version of the Pi on an SD card. User name and password are not important.
If you want to save space, use the Lite version of the OS. The setup is compatible with those versions as well.
Turn on the Pi with the SD card and complete the first setup (if any).
Place the cc3dsfs_rpi_mono_setup.zip file in the Pi (either by downloading it, or by using an USB stick).
You will need an active internet connection to complete the setup.
Decompress all the files of the .zip into a folder.
Right Click on setup.sh > Properties > Permissions > Change Execute from "Nobody" to "Owner only".
Double Click on setup.sh and select "Execute in Terminal". Then wait for the script to finish. It will reboot on its own.
(Audio may not work after the first reboot. If that happens, remove the power and try turning the Raspberry Pi on again)
---
By default, the setup will work with a specific GPIO buttons layout. But scripts to account for other button layouts are also included. To change the default, replace the file Desktop/cc3dsfs_script.sh with one of the others included in Desktop/premade_scripts (or make your own).
To launch back the Desktop environment (can be useful to update the software), you can use the "Quit Application" "Extra Setting" (or press Esc on a keyboard). This should show a terminal. Then, type:
startx
By default the setup will try to expand the filesystem during the first reboot after the setup. To avoid that, create a file at "/expanded_rootfs". If you wish for the filesystem expansion to run again, simply delete the "/expanded_rootfs" file and reboot.

46
rpi_setup/setup.sh Executable file
View File

@ -0,0 +1,46 @@
#!/bin/sh
sudo apt update
sudo apt -y install xterm gpiod xserver-xorg xinit libxcursor1 x11-xserver-utils pipewire pipewire-alsa
sudo raspi-config nonint do_boot_behaviour B2
sudo systemctl disable avahi-daemon.service
sudo systemctl disable dphys-swapfile.service
sudo systemctl disable hciuart.service
sudo systemctl disable bluetooth.service
#sudo systemctl disable wpa_supplicant.service
# I know this isn't how you SHOULD do it, however I tried
# various other things (crontab @reboot and rc.local) and they didn't work...
echo "" >> ${HOME}/.bashrc
echo 'if [ -z "${EXECUTED_ONCE}" ]; then' >> ${HOME}/.bashrc
echo " export EXECUTED_ONCE=1 ; startx ${HOME}/Desktop/cc3dsfs_script.sh" >> ${HOME}/.bashrc
echo 'fi' >> ${HOME}/.bashrc
cp -Rf files/Desktop/ ${HOME}/
if [ $(getconf LONG_BIT) -eq 32 ]; then
$(cd ${HOME}/Desktop ; ln -s cc3dsfs_versions/cc3dsfs_32 cc3dsfs)
else
$(cd ${HOME}/Desktop ; ln -s cc3dsfs_versions/cc3dsfs_64 cc3dsfs)
fi
chmod +x -R ${HOME}/Desktop/premade_scripts/
chmod +x -R ${HOME}/Desktop/cc3dsfs_versions/
chmod +x ${HOME}/Desktop/cc3dsfs
chmod +x ${HOME}/Desktop/cc3dsfs_script.sh
if [ -e /boot/firmware/config.txt ]; then
FIRMWARE=/firmware
else
FIRMWARE=
fi
sudo cp -f files/config.txt /boot${FIRMWARE}/config.txt
sudo cp -Rf files/usr/ /
sudo cp -Rf files/etc/ /
sudo chmod +x /etc/rc.local
sleep 5
sudo reboot

View File

@ -0,0 +1 @@
cp *.rules /etc/udev/rules.d/

View File

@ -3,7 +3,6 @@ framework_change_pos() {
}
cp -R ${2} ${3}
framework_change_pos ${1} 'freetype'
framework_change_pos ${1} 'OpenAL'
framework_change_pos ${1} 'vorbisenc'
framework_change_pos ${1} 'vorbisfile'
framework_change_pos ${1} 'FLAC'

View File

@ -0,0 +1,14 @@
unzip -o cc3dsfs_linux_pi32.zip
unzip -o cc3dsfs_linux_pi64.zip
EXTRACTION_FOLDER="cc3dsfs_linux_pi"
RPI_SETUP_FOLDER="rpi_setup"
mkdir -p ${RPI_SETUP_FOLDER}/files/Desktop/cc3dsfs_versions
mkdir -p ${RPI_SETUP_FOLDER}/files/usr/lib/udev/rules.d
cp ${EXTRACTION_FOLDER}32/cc3dsfs ${RPI_SETUP_FOLDER}/files/Desktop/cc3dsfs_versions/cc3dsfs_32
cp ${EXTRACTION_FOLDER}64/cc3dsfs ${RPI_SETUP_FOLDER}/files/Desktop/cc3dsfs_versions/cc3dsfs_64
cp -r "${EXTRACTION_FOLDER}32/other licenses" "${RPI_SETUP_FOLDER}/files/Desktop/other licenses"
cp ${EXTRACTION_FOLDER}32/*.rules ${RPI_SETUP_FOLDER}/files/usr/lib/udev/rules.d
cp ${EXTRACTION_FOLDER}32/LICENSE ${RPI_SETUP_FOLDER}/files/Desktop
cp ${EXTRACTION_FOLDER}32/README.md ${RPI_SETUP_FOLDER}/files/Desktop
$(cd ${RPI_SETUP_FOLDER} ; zip -ry cc3dsfs_rpi_mono_setup.zip ./*)
cp ${RPI_SETUP_FOLDER}/cc3dsfs_rpi_mono_setup.zip .

0
setup_scripts/windows_setup_ftd2xx.sh Normal file → Executable file
View File

0
setup_scripts/windows_setup_ftd2xx_dll.bat Normal file → Executable file
View File

0
setup_scripts/windows_setup_ftd2xx_dll.sh Normal file → Executable file
View File

0
setup_scripts/windows_setup_ftd3xx.sh Normal file → Executable file
View File

0
setup_scripts/windows_setup_ftd3xx_dll.bat Normal file → Executable file
View File

0
setup_scripts/windows_setup_ftd3xx_dll.sh Normal file → Executable file
View File

0
setup_scripts/windows_setup_ftd3xx_winusb.bat Normal file → Executable file
View File

0
setup_scripts/windows_setup_ftd3xx_winusb.sh Normal file → Executable file
View File

0
setup_scripts/windows_setup_ftd3xx_winusb_dll.bat Normal file → Executable file
View File

0
setup_scripts/windows_setup_ftd3xx_winusb_dll.sh Normal file → Executable file
View File

View File

@ -42,6 +42,9 @@ static bool get_is_bad_ftd3xx() {
return false;
#endif
#endif
// For some reason, the version scheme seems broken...
// For now, just return false... :/
return false;
bool is_bad_ftd3xx = false;
DWORD ftd3xx_lib_version;

View File

@ -24,8 +24,18 @@ static const LicenseMenuOptionInfo sfml_license_4_option = {
static const LicenseMenuOptionInfo ftd3xx_license_0_option = {
.base_name = "This software makes use of"};
#if defined(USE_FTD3) && defined(USE_FTD2)
static const LicenseMenuOptionInfo ftd3xx_license_1_option = {
.base_name = "FTD3XX and FTD2XX."};
#else
#ifdef USE_FTD3
static const LicenseMenuOptionInfo ftd3xx_license_1_option = {
.base_name = "FTD3XX."};
#else
static const LicenseMenuOptionInfo ftd3xx_license_1_option = {
.base_name = "FTD2XX."};
#endif
#endif
static const LicenseMenuOptionInfo ftd3xx_license_2_option = {
.base_name = "For its license, check:"};
@ -66,21 +76,6 @@ static const LicenseMenuOptionInfo freetype_license_3_option = {
static const LicenseMenuOptionInfo freetype_license_4_option = {
.base_name = ""};
static const LicenseMenuOptionInfo openal_soft_license_0_option = {
.base_name = "This software makes use of"};
static const LicenseMenuOptionInfo openal_soft_license_1_option = {
.base_name = "OpenAL Soft."};
static const LicenseMenuOptionInfo openal_soft_license_2_option = {
.base_name = "For its license, check:"};
static const LicenseMenuOptionInfo openal_soft_license_3_option = {
.base_name = "www.gnu.org/licenses/"};
static const LicenseMenuOptionInfo openal_soft_license_4_option = {
.base_name = "lgpl-3.0.html"};
static const LicenseMenuOptionInfo font_license_0_option = {
.base_name = "This software uses the font"};
@ -117,26 +112,25 @@ static const LicenseMenuOptionInfo* pollable_options[] = {
&sfml_license_2_option,
&sfml_license_3_option,
&sfml_license_4_option,
#if defined(USE_FTD3) || defined(USE_FTD2)
&ftd3xx_license_0_option,
&ftd3xx_license_1_option,
&ftd3xx_license_2_option,
&ftd3xx_license_3_option,
&ftd3xx_license_4_option,
#endif
#if defined(USE_DS_3DS_USB) || defined(USE_IS_NITRO_USB) || defined(USE_FTD3) || defined(USE_FTD2)
&libusb_license_0_option,
&libusb_license_1_option,
&libusb_license_2_option,
&libusb_license_3_option,
&libusb_license_4_option,
#endif
&freetype_license_0_option,
&freetype_license_1_option,
&freetype_license_2_option,
&freetype_license_3_option,
&freetype_license_4_option,
&openal_soft_license_0_option,
&openal_soft_license_1_option,
&openal_soft_license_2_option,
&openal_soft_license_3_option,
&openal_soft_license_4_option,
&font_license_0_option,
&font_license_1_option,
&font_license_2_option,

View File

@ -1 +1,2 @@
SUBSYSTEM=="usb", ATTRS{idVendor}=="0f6e", ATTRS{idProduct}=="0404", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0f6e", ATTRS{idProduct}=="0403", MODE="0666"