1#!/usr/bin/env bash
2
3###############################################################################
4#
5# Copyright (C) 2009-2013 Nintendo.  All rights reserved.
6#
7# These coded instructions, statements, and computer programs contain
8# proprietary information of Nintendo of America Inc. and/or Nintendo
9# Company Ltd., and are protected by Federal copyright law.  They may
10# not be disclosed to third parties or copied or duplicated in any form,
11# in whole or in part, without the prior written consent of Nintendo.
12#
13###############################################################################
14
15source getbridgetype
16
17FSEMUL_PARAMS=
18if [ "$BRIDGE_TYPE" == "Toucan" ]
19then
20	BRIDGE_INSTALL_PATH=$SDIO_BRIDGE_TOOLS
21	if [ "${CAFE_HARDWARE:0:2}" == "ev" ]
22	then
23		FSEMUL_PARAMS=-m
24	fi
25else
26	BRIDGE_INSTALL_PATH=$MION_BRIDGE_TOOLS
27fi
28
29if [ "$BRIDGE_TYPE" == "Mion" ]
30then
31    if [ -z "$BRIDGE_PARAMETERS" ]
32    then
33        FSEMUL_PARAMS="-em -ip $BRIDGE_CURRENT_IP_ADDRESS"
34    else
35        FSEMUL_PARAMS="$BRIDGE_PARAMETERS -ip $BRIDGE_CURRENT_IP_ADDRESS"
36    fi
37fi
38
39if [ ${CAFE_DETACH_FSEMUL:-0} != 0 ]
40then
41     "$BRIDGE_INSTALL_PATH/FSEmul.exe" "$@" $FSEMUL_PARAMS < /dev/null &> /dev/null &
42else
43     "$BRIDGE_INSTALL_PATH/FSEmul.exe" "$@" $FSEMUL_PARAMS < /dev/null &
44fi
45
46