├── .gitignore ├── Amiga ├── run_all.sh ├── change_configs.sh ├── multidisk.cfg ├── template.uae ├── README.md └── generate_uae.sh ├── README.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | BIOS/* 2 | roms/* 3 | *.bak 4 | -------------------------------------------------------------------------------- /Amiga/run_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT_DIR="${0%/*}" 4 | 5 | $SCRIPT_DIR/change_configs.sh 6 | $SCRIPT_DIR/generate_uae.sh -q 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RetroPieAssistant 2 | 3 | Helpful scripts and things for RetroPie configuration. 4 | 5 | Currently the only cool thing can be found in the [Amiga](https://github.com/Douggernaut/RetroPieAssistant/tree/master/Amiga) directory. 6 | -------------------------------------------------------------------------------- /Amiga/change_configs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXT_CONFIG_FILE="/etc/emulationstation/es_systems.cfg" 4 | EMU_CONFIG_FILE="/opt/retropie/configs/amiga/emulators.cfg" 5 | 6 | # make backup before changes, don't overwrite existing backup 7 | if [[ ! -f $EXT_CONFIG_FILE.bak ]]; then 8 | sudo cp -n $EXT_CONFIG_FILE $EXT_CONFIG_FILE.bak 9 | fi 10 | # add .uae to accepted amiga extensions if not present 11 | sudo sed -i '/[A|a]miga/{n;//{/.uae/!{s/<\/extension>/ .uae<\/extension>/}}}' $EXT_CONFIG_FILE 12 | 13 | # make backup before changes, don't overwrite existing backup 14 | if [[ ! -f $EMU_CONFIG_FILE.bak ]]; then 15 | cp -n $EMU_CONFIG_FILE $EMU_CONFIG_FILE.bak 16 | fi 17 | # replace uae4arm line with the following line 18 | new_line='uae4arm="pushd /opt/retropie/emulators/uae4arm/; ./uae4arm -f %ROM%"' 19 | sed -i '/^uae4arm/!b;c'"${new_line}"'' $EMU_CONFIG_FILE 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Douggernaut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Amiga/multidisk.cfg: -------------------------------------------------------------------------------- 1 | # Use this file to specify formats for multid[I|i][S|s][K|k] ROMs, one format per line. 2 | # 3 | # Example game names and the format to parse them correctly, note the use of 4 | # escaped whitespace '\ ' escaped parentheses \( \) and unescaped ( ) parentheses: 5 | # File Name | Parse String | Captured Value 6 | # ----------------------------------------------------------------------- 7 | # GameName_Disk2.adf |_Disk([0-9]+) | 2 8 | # DifferentGame (Disk 1 of 3).adf |\ \(Disk\ ([0-9]+)\ of\ [0-9]+\) | 1 9 | # ThirdGame_Disk_B.adf |_Disk_([A-Z]+) | B 10 | # 11 | # Caveats: 12 | # Every non-commented line will be included, so don't leave blank lines. 13 | # Parentheses and space characters which appear in the file names must be escaped with \ 14 | # Every line must include one pair of unescaped parentheses - this will be the d[I|i][S|s][K|k] number 15 | # 16 | # Place your formats below this line. Some examples are provided. 17 | \ \([D|d][I|i][S|s][K|k]\ ([0-9]+)\ of\ [0-9]+\) 18 | _[D|d][I|i][S|s][K|k]([0-9]+) 19 | _[D|d][I|i][S|s][K|k]_([0-9]+) 20 | _[D|d][I|i][S|s][K|k]([A-Z]+) 21 | -------------------------------------------------------------------------------- /Amiga/template.uae: -------------------------------------------------------------------------------- 1 | config_description=UAE default configuration 2 | config_hardware=true 3 | config_host=true 4 | config_version=2.4.1 5 | pandora.rom_path=/opt/retropie/emulators/uae4arm/kickstarts/ 6 | pandora.floppy_path=/opt/retropie/emulators/uae4arm/disks/ 7 | pandora.hardfile_path=/opt/retropie/emulators/uae4arm/ 8 | ; host-specific 9 | pandora.cpu_speed=600 10 | pandora.joy_conf=0 11 | pandora.joy_port=0 12 | pandora.tap_delay=10 13 | pandora.custom_controls=0 14 | pandora.custom_dpad=1 15 | pandora.custom_up=0 16 | pandora.custom_down=0 17 | pandora.custom_left=0 18 | pandora.custom_right=0 19 | pandora.custom_a=0 20 | pandora.custom_b=0 21 | pandora.custom_x=0 22 | pandora.custom_y=0 23 | pandora.custom_l=0 24 | pandora.custom_r=0 25 | pandora.move_x=0 26 | pandora.move_y=0 27 | pandora.button1=2 28 | pandora.button2=1 29 | pandora.autofire_button=3 30 | pandora.jump=-1 31 | ; common 32 | use_gui=no 33 | kickstart_rom_file=$(FILE_PATH)/kick31.rom 34 | kickstart_ext_rom_file= 35 | floppy0= 36 | floppy0type=0 37 | floppy1= 38 | floppy1type=0 39 | floppy2= 40 | floppy2type=0 41 | floppy3= 42 | floppy3type=0 43 | nr_floppies= 44 | floppy_speed=100 45 | sound_output=exact 46 | sound_channels=stereo 47 | sound_stereo_separation=7 48 | sound_stereo_mixing_delay=0 49 | sound_frequency=44100 50 | sound_interpol=none 51 | sound_filter=off 52 | sound_filter_type=standard 53 | cachesize=8192 54 | bsdsocket_emu=false 55 | synchronize_clock=true 56 | absolute_mouse=none 57 | gfx_framerate=0 58 | gfx_width=640 59 | gfx_height=262 60 | gfx_width_windowed=320 61 | gfx_height_windowed=240 62 | gfx_width_fullscreen=640 63 | gfx_height_fullscreen=480 64 | gfx_lores=false 65 | gfx_resolution=hires 66 | gfx_correct_aspect=1 67 | gfx_fullscreen_ratio=100 68 | immediate_blits=false 69 | fast_copper=true 70 | ntsc=false 71 | show_leds=false 72 | chipset=ecs_agnus 73 | collision_level=playfields 74 | fastmem_size=0 75 | z3mem_size=0 76 | z3mem_start=0x10000000 77 | bogomem_size=0 78 | gfxcard_size=0 79 | gfxcard_type=ZorroIII 80 | chipmem_size=2 81 | cpu_speed=real 82 | cpu_type=68000 83 | cpu_model=68000 84 | cpu_compatible=false 85 | cpu_24bit_addressing=true 86 | rtg_modes=0x502 87 | input.joymouse_speed_analog=2 88 | input.autofire=8 89 | -------------------------------------------------------------------------------- /Amiga/README.md: -------------------------------------------------------------------------------- 1 | # Amiga Reconfigurator 2 | 3 | Inspired by posts like these: 4 | * http://blog.petrockblock.com/forums/topic/launch-amiga-games-from-retropie-menu/ 5 | * https://retropie.org.uk/forum/topic/400/launching-amiga-games-form-emulation-station 6 | 7 | These are scripts to configure EmulationStation and create configuration files to allow running of Amiga games directly from EmulationStation without having to launch uae4arm. 8 | 9 | Features: 10 | * Automatically updates uae4arm emulator configuration files to accept .uae file formats 11 | * Assembles .uae configuration files for games with arbitrary numbers of disks 12 | * Simultaneously supports multiple varying disk numbering formats and configurable custom ones too 13 | * GameName_Disk1.adf 14 | * GameName_Disk2.adf 15 | * OtherGame_disk_0.adf 16 | * OtherGame_disk_1.adf 17 | * SingleDiskGame.adf 18 | * GameFour (Disk 1 of 3).adf 19 | * GameFour (Disk 2 of 3).adf 20 | * GameFour (Disk 3 of 3).adf 21 | * Fifth-DskA.adf 22 | * Fifth-DskB.adf 23 | * Other examples too 24 | * Almost literally anything you can think of 25 | * Because regex is great 26 | * Can be instructed to unzip .zip files, as long as and .adf or .adz file of the same name as the .zip file is in the .zip top level directory 27 | * Is "quick": using a large full romset on a Raspberry Pi 3 without overclock: 28 | * Unzip 4278 .adf floppy disk files and generate .uae files representing 2517 unique games in less than 17 minutes 29 | * Generate same .uae files from pre-unzipped .adf files in 3.5 minutes 30 | * "Useful" output, verbose and quiet options available 31 | * Won't overwrite .uae files unless you really want it to 32 | * Some of the code is commented 33 | 34 | Bad stuff: 35 | * Default configuration values (pulled from uae4arm) aren't great, and I don't know enough yet to make intelligent revisions 36 | * Can't use lctrl+esc to bring up GUI - must use F12 instead 37 | * Probably more 38 | 39 | Usage: 40 | * SSH into your Raspberry Pi 41 | * `git clone https://github.com/Douggernaut/RetroPieAssistant.git` 42 | * edit RetroPieAssistant/Amiga/multidisk.cfg to add your custom regex for disk format strings as wanted/needed (feel free to ask for help on this) 43 | * edit RetroPieAssistant/Amiga/template.uae as needed (and please tell me how also!) 44 | * `./RetroPieAssistant/Amiga/generate_uae.sh -h` to make sense of it 45 | * Make sure your .adf, .adz, or .zip files are contained in the Amiga roms directory (/home/pi/RetroPie/roms/amiga) 46 | * `./RetroPieAssistant/Amiga/run_all.sh` 47 | * Set UAE4ARM as the default emulator for Amiga (launch a game and press any key as it launches to access the options) 48 | 49 | Thanks for having a look! 50 | -------------------------------------------------------------------------------- /Amiga/generate_uae.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ROM_FOLDER="/home/pi/RetroPie/roms/amiga" 4 | ZIP_FOLDER="zip_files" 5 | 6 | SCRIPT_DIR="${0%/*}" 7 | MULTIDISK_FILE="$SCRIPT_DIR/multidisk.cfg" 8 | TEMPLATE_FILE="$SCRIPT_DIR/template.uae" 9 | 10 | function print { 11 | if [[ ! $quiet = "true" ]]; then 12 | echo "$1" >&2 13 | fi 14 | } 15 | 16 | function print_help { 17 | print "This script creates .uae configuration files for amiga .adf disk ROMS." 18 | print "The output files are meant to be used to display individual games in the EmulationStation Amiga list." 19 | print "If you want to change how this script searches for multi-disk games, please edit this file:" 20 | print " $MULTIDISK_FILE" 21 | print "Usage:" 22 | print "$0 [OPTIONS]" 23 | print " -f : overwrite .uae files" 24 | print " -h : this help menu" 25 | print " -q : quiet output" 26 | print " -v : enable verbose printing" 27 | print " -z : unzip .zip files in rom directory" 28 | } 29 | 30 | function qprint { 31 | if [[ $quiet = "true" ]]; then 32 | if [[ $2 ]]; then 33 | echo -n "$1" >&2 34 | else 35 | echo "$1" >&2 36 | fi 37 | fi 38 | } 39 | 40 | function vprint { 41 | if [[ $verbose = "true" ]]; then 42 | print "$1" 43 | fi 44 | } 45 | 46 | function get_multidisk_strings { 47 | multidisk_str="" 48 | while IFS= read -r line; do 49 | if [[ ! $line = \#* ]]; then 50 | vprint "$line" 51 | if [[ ! -z $multidisk_str ]]; then multidisk_str="$multidisk_str|"; fi 52 | multidisk_str="$multidisk_str$line" 53 | fi 54 | done < $1 55 | echo "$multidisk_str" 56 | } 57 | 58 | function init_config { 59 | configfile=$1 60 | vprint "Initializing $configfile..." 61 | for i in `seq 0 3`; do 62 | sed -i '/floppy'"$i"'=/{s/=.*/=/}' "$ROM_FOLDER/$uae_file" 63 | done 64 | sed -i '/nr_floppies=/{s/=.*/=/}' "$ROM_FOLDER/$uae_file" 65 | } 66 | 67 | while getopts ":fhqvz" opt; do 68 | case $opt in 69 | f) 70 | force=true 71 | ;; 72 | h) 73 | print_help 74 | exit 0 75 | ;; 76 | q) 77 | if [[ $verbose = "true" ]]; then 78 | print "-qv is incompatible" 79 | fi 80 | quiet=true 81 | ;; 82 | v) 83 | if [[ $quiet = "true" ]]; then 84 | print "-qv is incompatible" 85 | fi 86 | verbose=true 87 | ;; 88 | z) 89 | unzip=true 90 | ;; 91 | \?) 92 | print "Invalid option: -$OPTARG" 93 | exit 0 94 | ;; 95 | :) 96 | print "Option -$OPTARG requires an argument." 97 | exit 1 98 | ;; 99 | esac 100 | done 101 | 102 | set -e 103 | 104 | vprint "Building multidisk format string from $MULTIDISK_FILE..." 105 | multidisk_str=$(get_multidisk_strings $MULTIDISK_FILE) 106 | vprint "Multidisk string:" 107 | vprint "$multidisk_str" 108 | vprint 109 | 110 | lastgame="" 111 | zero="false" 112 | 113 | for fullpath in $ROM_FOLDER/*.{adf,adz,zip}; do 114 | filename="${fullpath##*/}" # filename with extension 115 | basename="${filename%.*}" # no extension 116 | extension="${filename##*.}" # just extension 117 | 118 | if [[ $filename =~ \*.* ]]; then 119 | continue 120 | fi 121 | 122 | print "Processing $filename" 123 | 124 | # ASSUMPTION - zip file contains an .adf or .adz file of the same name as the zip at its top level 125 | if [[ $extension = "zip" ]] && [[ $unzip = "true" ]]; then 126 | vprint "Unzipping $filename..." 127 | set +e 128 | ext="adf" 129 | unzip -n "$fullpath" "$basename.$ext" -d $ROM_FOLDER 2>/dev/null 130 | if [[ ! $? = 0 ]]; then 131 | ext="adz" 132 | unzip -n "$fullpath" "$basename.$ext" -d $ROM_FOLDER 2>/dev/null 133 | fi 134 | if [[ ! $? = 0 ]]; then 135 | print "WARNING: unzip of $filename failed. Check that the file has $basename.{adf,adz} at its top level." 136 | print " Skipping $filename..." 137 | print 138 | set -e 139 | continue 140 | fi 141 | set -e 142 | mkdir -p $ROM_FOLDER/$ZIP_FOLDER 143 | vprint "Moving $filename to $ROM_FOLDER/$ZIPFOLDER" 144 | mv -n "$fullpath" "$ROM_FOLDER/$ZIP_FOLDER" 145 | filename="$basename.$ext" 146 | fullpath="$ROM_FOLDER/$filename" 147 | extension=$ext 148 | elif [[ $extension = "zip" ]]; then 149 | vprint "Skipping $filename because -z option not specified." 150 | vprint 151 | continue 152 | fi 153 | 154 | # use the multidisk config strings to pull out the game name and the disk identifier 155 | disk_identifier="" 156 | vprint "Running name detection on $filename" 157 | if [[ $basename =~ (.*)($multidisk_str) ]]; then 158 | game="${BASH_REMATCH[1]}" 159 | index=3 160 | while [[ -z $disk_identifier ]]; do 161 | disk_identifier="${BASH_REMATCH[$index]}" 162 | index=$((index+1)) 163 | done 164 | vprint " Detected [$game] disk $disk_identifier." 165 | else 166 | game=$basename 167 | vprint " No matching disk numbers detected on the below file - it is single-disk or $MULTIDISK_FILE needs to be updated." 168 | vprint " $filename" 169 | fi 170 | 171 | uae_file=$game.uae 172 | 173 | # game files are sorted lexicographically and not in ascending numerical order 174 | # i.e. 1 10 11 2 3 4 5 6 7 8 9 175 | # i.e. A AA B C D ... Z 176 | # also disks may start numbered 0 or 1. 177 | # so we have to deal with the cases in which our disks are out of order. 178 | if [[ ! $game == $lastgame ]]; then 179 | zero="false" 180 | alpha="false" 181 | count=1 182 | qprint "" 183 | qprint "$game ..." n 184 | fi 185 | 186 | # make sure you don't want to lose all that hard work configuring things 187 | if [[ -f $ROM_FOLDER/$uae_file ]] && [[ ! $force = "true" ]] && [[ ! $game == $lastgame ]]; then 188 | print "$uae_file already exists. Use -f flag to force overwrites. Skipping $game." 189 | continue 190 | fi 191 | 192 | # create .uae file if it doesn't exist 193 | if [[ ! -f $ROM_FOLDER/$uae_file ]]; then 194 | vprint "Creating $uae_file..." 195 | cp "$TEMPLATE_FILE" "$ROM_FOLDER/$uae_file" 196 | else 197 | vprint "Updating $uae_file..." 198 | fi 199 | 200 | case $disk_identifier in 201 | "A") 202 | init_config "$ROM_FOLDER/$uae_file" 203 | alpha="true" 204 | ;; 205 | "0") 206 | init_config "$ROM_FOLDER/$uae_file" 207 | zero="true" 208 | ;; 209 | "1") 210 | if [[ ! $game == $lastgame ]]; then 211 | init_config "$ROM_FOLDER/$uae_file" 212 | else 213 | count=$((count+1)) 214 | fi 215 | ;; 216 | "") 217 | disk_identifier="1" 218 | init_config "$ROM_FOLDER/$uae_file" 219 | ;; 220 | *) 221 | count=$((count+1)) 222 | ;; 223 | esac 224 | 225 | # put the filename into its disk number 226 | escaped_fullpath=${fullpath//\//\\\/} 227 | if [[ $alpha = "false" ]] && [[ $zero = "true" ]]; then 228 | vprint "Updating drive floppy$disk_identifier to point to $fullpath." 229 | sed -i '/floppy'"$disk_identifier"'=/{s/=.*/='"$escaped_fullpath"'/}' "$ROM_FOLDER/$uae_file" 230 | elif [[ $alpha = "false" ]]; then 231 | vprint "Updating drive floppy$((disk_identifier-1)) to point to $fullpath.." 232 | sed -i '/floppy'"$((disk_identifier-1))"'=/{s/=.*/='"$escaped_fullpath"'/}' "$ROM_FOLDER/$uae_file" 233 | else 234 | case $disk_identifier in 235 | "A") drive_number=0 ;; 236 | "B") drive_number=1 ;; 237 | "C") drive_number=2 ;; 238 | "D") drive_number=3 ;; 239 | *) drive_number=5 ;; 240 | esac 241 | vprint "Updating drive floppy$drive_number to point to $fullpath..." 242 | sed -i '/floppy'"$drive_number"'=/{s/=.*/='"$escaped_fullpath"'/}' "$ROM_FOLDER/$uae_file" 243 | fi 244 | 245 | # replace nr_floppies with the disk number 246 | # ASSUMPTION - files will be processed in ascending order 247 | vprint "Updating nr_floppies to $count..." 248 | sed -i '/nr_floppies=/{s/=.*/='"$count"'/}' "$ROM_FOLDER/$uae_file" 249 | vprint 250 | 251 | # update last game for counting purposes 252 | lastgame=$game 253 | qprint " $disk_identifier" n 254 | done 255 | 256 | if [[ $unzip = "true" ]] && [[ -d $ROM_FOLDER/$ZIP_FOLDER ]]; then 257 | print "NOTE: Successfully processed zip files are stored in $ROM_FOLDER/$ZIP_FOLDER because -z option was set." 258 | fi 259 | 260 | print "Done!" 261 | qprint "" 262 | --------------------------------------------------------------------------------