WinUAE launcher for you! (1 Viewer)

gazoot

New Member
January 10, 2006
4
0
Sweden
Hello guys and gals, first off let me thank you developers for a media portal with class. It has everything I've ever wanted, so thanks a LOT!

Feeling the urge to give something back to you for this excellent product, and being a bit of an emulator freak, I've put together a wrapper for my favourite computer Amiga, and it's emulator WinUAE. My goal was this:

* Launch any game conveniently, even multidisk games.
* Being able to control the emulator without keyboard, only remote and joypads.
* And of course, using My Programs to launch it seamlessly. Thanks waeberd for writing this plugin, you rock!

After a day an night of coding, I present the WinUAE launcher!

Quick install (for experienced people):
Download it from http://hem.passagen.se/gazoot/mediaportal/winuae_launcher.zip
Extract the zip to a folder, maybe in the winuae dir. Edit the configuration part of the "launch.sh" script. Use My Programs to launch "launch.bat" with your disk files, and you're set!

Longer explanation:
You need a good WinUAE configuration file, so create a one that you really like, or take inspiration from "mediaportal.uae" in the launcher directory. It's the one I use.
[edit] Important: Be sure to set use_gui=no in the configuration! [/edit]

The script will work without effort for any single-disk game. What you need for multidisk is a consistent naming scheme. The default is (Disk X of Y), which needs to be somewhere in the file name for all disks. The script will then locate all disks with this pattern, put them in disk drives up to df3:, and finally put all disks in the disk swapper, so you can switch disks in case you have lots of disks, or a game that doesn't support more than one drive.

You can change this naming pattern in the configuration in case you have another naming already.

For the remote, use HIP to configure your remote with winuae. Except for the disk swapper, everything seems to be remote configurable. To use the disk swapper from the keyboard, hold down the End key and press 1-0 on the normal keyboard (not the numeric) to swap to disk 1-10 in df0:. If you are able to map the remote to the disk swapper, please let me know! I lost too many hours of sleep trying to make it work...

Use the following settings for My Programs:
Launcher Application: launcher_dir\launcher.bat
Shellexecute: No
Wait for exit: Yes
Arguments: <blank>
Startup directory: launcher_dir
Quotes around filenames: Yes
File-extensions: .zip,.adf,.adz

I think this should get you started. Please post any bugs, question or ideas to make it better. Have fun! Download url again: http://hem.passagen.se/gazoot/mediaportal/winuae_launcher.zip
WinUAE download here: http://www.winuae.net/
HIP: http://www.byremote.com.au/HIP/Download.htm (a bit complicated but very good program)


/Gazoot
 

gazoot

New Member
January 10, 2006
4
0
Sweden
Updated version

No problem - I love'em too. :)

I fixed a problem in this updated version - all unix tools required for the job is now included in the zip file. I hope it will work perfecly now.

If you still wonder what this launcher really does, it rewrites the .uae configuration file with "useful" data, and launches winuae with the new config. It would be very nice to hear if it works for you, so please let me know here!


/Gazoot
 

aasmund Nordal

Portal Pro
June 20, 2005
204
0
Norway
Home Country
Norway Norway
I get theese errors: http://aasmund.mscon.net/ting/error.JPG
I use your .uae config.

When I found your post I just thought it was someting good for the winuae but I am not shure what it is.
But I am guesing it adapts the configuration to the game?
or add features?

The problem for me right now is that I cant use one config for every game and sometimes I have to click the mouse or press a key go go further in the game.


my config to launch.sh

Code:
#!/bin/sh

# WinUAE launcher script for MediaPortal
# By Andreas Söderlund (gazoot [care of] home [dot] se)
#
# Download the BEST Media center at
# https://www.team-mediaportal.com/
#
# Unix utils from http://unxutils.sourceforge.net/
# (Not totally compatible with unix though - Use cygwin)
#
# Please edit the configuration below to suit your needs.

##### Configuration #######################################

# NOTE: Use forward slashes in the filenames!

# WinUAE executable file
WINUAE="C:/Programfiler/WinUAE/winuae.exe"

# Template configuration file for WinUAE
CONFIG="C:/Documents and Settings/Ã¥smund/Mine dokumenter/winuae_launcher/launcher/mediaportal.uae"

# Multi disk regexp search (EGREP)
# If this pattern is found in file, use multiple floppies
# and also put them in the Disk Swapper.
MULTIDISK_REGEXP="\(Disk [0-9]+ of [0-9]+\)"

##### End of configuration! ###############################

##### Functions ###########################################

writefloppy ()
{
	echo >> $LAUNCH_CONFIG
	echo floppy$1=$2 >> $LAUNCH_CONFIG
	echo floppy$1type=0 >> $LAUNCH_CONFIG
	echo floppy$1sound=0 >> $LAUNCH_CONFIG
}

writeswapper ()
{
	echo >> $LAUNCH_CONFIG
	echo diskimage$1=$2 >> $LAUNCH_CONFIG
}

writefloppies ()
{
	echo >> $LAUNCH_CONFIG
	echo nr_floppies=$1 >> $LAUNCH_CONFIG
}

##### Main program ########################################

if [ -z $1 ];
then
	echo Need disk file!
	exit 1
fi 

DISK=$1
BACKSLASH='\\'

# Create temporary configuration that will be launched with WinUAE
LAUNCH_CONFIG="`dirname $CONFIG`/mediaportal_winuae_launcher_temp_config.uae"

cp "$CONFIG" "$LAUNCH_CONFIG"

# Remove floppy information from new config
sed -r -e "/^(nr_)?flopp(y[0-9]\w*|ies)=/d" "$LAUNCH_CONFIG" > "$LAUNCH_CONFIG.bak"
sed -r -e "/diskimage[0-9]+=/d" "$LAUNCH_CONFIG.bak" > "$LAUNCH_CONFIG"
rm "$LAUNCH_CONFIG.bak"

# Test for multiple disks
multi=`echo $DISK|sed -n -r /"$MULTIDISK_REGEXP"/p`

if [ ! -z "$multi" ]
then
	# Multiple disks found
	# Extract start of file name without regexp.
	FILES=`echo $DISK|sed -r s/"$MULTIDISK_REGEXP"/\.\*/`
	
	# Avoid globbing by replacing square brackets with .
	FILES=`echo $FILES|sed -r s#[\[]#.#g`
	FILES=`echo $FILES|sed -r s#[\]]#.#g`
	
	DIR=`dirname "$DISK"`
	
	# Strip dir from full filename to get the search criteria
	SEARCH=${FILES#"$DIR"\\}
	
	let "i = 0"
	
	OLD_IFS=$IFS
	IFS='?'
	
	for floppy in `./find "$DIR" -iregex ".*$SEARCH" -printf "%p?"`;
	do
		if [ ! -z "$floppy" ];
		then
			#echo $floppy
			if [ $i -le 3 ];
			then
				writefloppy "$i" "$floppy"
			fi
			
			writeswapper "$i" "$floppy"
			let "i = i + 1"
		fi
	done
	
	IFS=$OLD_IFS
	
else
	# No multidisk, just write simple configuration
	# and start.
	writefloppy 0 "$DISK"
	
	let "i = 1"
fi

writefloppies $i

# Replace slash with backslash in config file
# to be windows compatible
LAUNCH_CONFIG=`echo $LAUNCH_CONFIG|sed -r s#/#"$BACKSLASH"#g`

# Lets go!
"$WINUAE" -config="$LAUNCH_CONFIG"
 

gazoot

New Member
January 10, 2006
4
0
Sweden
Whoops! Some pretty heavy errors you're getting there. I can see three probable causes right now:

1. You're not using the latest version. :) I updated the launcher yesterday, so please update and see if it works then. Sorry about that.

If that doesn't work:

2. The shebang line "#!/bin/sh", I don't think it's needed because sh.exe is launched with the script as argument anyway. So try removing the top line in launcher.sh.

3. You use the char å in your CONFIG path, it should probably work but you never know... try using an path without our scandinavian chars. :)

Thanks for the report, let me know if it still doesn't work and I'll look into it some more.


/Gazoot
 

aasmund Nordal

Portal Pro
June 20, 2005
204
0
Norway
Home Country
Norway Norway
I just want to say, I wil post I just had a lot of things to do.
Today I get visit from my brother and kids, and they wil spend the night.
Pherhaps I wil try your new files and the other sugestions tonight.

Although I did download the files after this post.

Code:
I fixed a problem in this updated version - all unix tools required for the job is now included in the zip file. I hope it will work perfecly now.
 

gazoot

New Member
January 10, 2006
4
0
Sweden
From the screenshot, it looks like you didn't change the configuration paths to winuae and the configuration file. Are they set correctly in launcher.sh?

/Gazoot
 

baloubic

Portal Member
June 10, 2006
32
1
I have problems with the diskswapper...

If I use zip files to store the correctly named adf files ( Disk 1 of 3, etc), the launcher tries to load zip files with winuae - nothing happens.

If I unzip the files, so that I have three correctly named adf files in a directory, the launcher only starts the one I chose in media portal. If I look at the created configuration it says "one floppy", nothing loaded into disk swap or other df:s.

Anyone?
 

Roy

Portal Member
January 29, 2007
18
2
Bergen
Home Country
Norway Norway
Ey Gazoot.

Nice initiative for ppl still caught up in the 80's and 90's. :)

I have a question regarding exiting WinUAE. I've configured WinUAE to exit when I press CTRL + F11, but everything just seems to hang when I do that. I don't know if it has something to do with the waitclose.exe stuff or what. Any suggestions?
 

Users who are viewing this thread

Top Bottom