#
# Crystal Chips BootManager "Load and Execute" PBAT Script v1.0
#
# (c) 2005 Crystal Chips - http://www.crystal-chips.com/
#
# For use only with Crystal Chips hardware and software.
#
# Modification Info:
# This file is unmodified.  If you modify this script and distribute it,
#   please edit this text.  Please do not change the copyright information.
#
# Description:
#
# This script is used by BootManager(BM) to load and execute PS2 ELF files.
# You can modify this script to support loading ELF files from additional devices.
#

SET "FILENAME" "$ARG1$"

IF MATCHES "host:*" "$FILENAME$"
# you could add a "fakehost" driver, etc here.
# if you DO add a driver, remove the next 2 lines
    ECHO "No support for LOADEXEC from host:"
    RETURN "-1"

ELSEIF MATCHES "cdrom*" "$FILENAME$"
# no drivers are needed for CDROM

ELSEIF MATCHES "mc?:*" "$FILENAME$"
# only memory card drivers are needed.
    SET "DRIVERS" "^"moduleload^" ^"-m rom0:SIO2MAN^" ^"-m rom0:MCMAN^""

ELSEIF MATCHES "mass:*" "$FILENAME$"
# memory card drivers are needed to load USB drivers(which are stored on memory card)
    SET "DRIVERS" "^"moduleload^" ^"-m rom0:SIO2MAN^" ^"-m rom0:MCMAN^" ^"-m $BM.SHARED$/USBD.IRX^" ^"-m $BM.SHARED$/USBMASS.IRX^""
ELSE
    ECHO "Unknown device: $FILENAME$!"
    RETURN "-1"
ENDIF

# Do not change this line!
LOADEXEC "EEELF" $DRIVERS$ "$FILENAME$"
