Skip to content

Instantly share code, notes, and snippets.

View WinterSnowfall's full-sized avatar

WinterSnowfall

View GitHub Profile
@WinterSnowfall
WinterSnowfall / controller_emulation.sh
Last active May 3, 2023 19:25
xboxdrv-based Xbox controller emulation for DualShock (2, 3) controllers - tested on Ubuntu & derivatives
#!/bin/bash
# xboxdrv must be installed
#sudo apt-get install xboxdrv
# use evtest to test and determine controller/event inputs if in doubt (for the mappings below)
#sudo apt-get install evtest
# use fftest (part of joystick) to test rumble settings, if supported by the controller and kernel
#sudo apt-get install joystick
@WinterSnowfall
WinterSnowfall / UE2_3_4_shader_compilation_on_load
Last active May 13, 2025 21:46
Unreal Engine 2/3/4 shader compilation on load (not on demand)
#the following settings will alleviate or outright prevent shader stutter
#with the downside of taking up more GPU memory, hence it may not benefit
#GPUs with insufficient VRAM
#for UE2 engine titles edit the main config ini file
#(e.g. Unreal2.ini) to add/change the below lines:
[D3DDrv.D3DRenderDevice]
UsePrecaching=True
AvoidHitches=True
@WinterSnowfall
WinterSnowfall / midi_emulation.sh
Last active November 8, 2023 14:50
Manage the FluidSynth (MIDI synthesizer) service in non-privileged userspace - tested on Ubuntu & derivatives
#!/bin/bash
#install fluidsynth and fluid-soundfont-gm first using:
#sudo apt-get install fluidsynth fluid-soundfont-gm
#the following line also needs to be added in /etc/default/fluidsynth
#OTHER_OPTS='-a pulseaudio -m alsa_seq -r 48000'
#bash output styles and colors
DEFAULT="\033[0m"
@WinterSnowfall
WinterSnowfall / atari502mame.js
Created December 11, 2022 22:59
An adaptation of https://gist.github.com/cxx/6d1d44ce4a6107ed80e0a6c8c5b887c4 for the Atari 50: The Anniversary Celebration
// atari502mame.js - convert some of the arcade game data in Atari 50: The Anniversary Celebration to older MAME ROM sets
//
// Usage:
// node atari502mame.js [ROM directory]
//
// Requirements:
// - Node.js v6 or later
// - [Microsoft Windows] .NET Framework 4.5 or later (included in Windows 8/10)
// - [Linux] /usr/bin/zip
//
@WinterSnowfall
WinterSnowfall / wine_raw_sockets.sh
Created November 8, 2023 14:57
Allow Wine(server) to use RAW sockets
#!/bin/bash
# short script to address the following exception:
# err:winediag:WSASocketW Failed to create a socket of type SOCK_RAW, this requires special permissions.
WINEBINARY="/opt/wine-staging/bin/wineserver"
# some games will use RAW sockets for their multiplayer implementation,
# however Wine can't properly support these without the below grant
@WinterSnowfall
WinterSnowfall / bulk_rename_bak.sh
Created October 13, 2024 12:18
Script to bulk rename all files in a folder to .bak. Optionally creates blank entries for those files as well. Includes undo operations.
#!/bin/bash
if [ $# -ge 1 ]
then
if [ "$1" == "add" -o "$1" == "zero" ]
then
for file in $(find . -maxdepth 1 -type f)
do
# exlude the script from renaming
if [ "$file" != "$0" ]