-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·63 lines (53 loc) · 2.02 KB
/
setup.sh
File metadata and controls
executable file
·63 lines (53 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
# Setup the environment, that is get all the necessary tools and hacks
# and generate all the levels contained in the hacks.
#
# You still have to obtain a clean Super Mario World ROM (as a
# .smc file) before you can execute this script.
# Check your ROM with this tool:
# https://media.smwcentral.net/onlinetools/jsromclean.htm
#
# The default structure created is the following:
# .
# |-- ... (all other folders already present in the repository)
# |-- compressed_hacks (all downloaded hacks)
# |-- hacks (uncompressed hacks)
# |-- levels (all the level data)
# |-- scripts (<- you are here; the download list of hacks will also be
# | created here)
# |-- roms (all roms created by applying the hacks to the original game)
# `-- tools (all required and optional tools)
# TODO maybe give flags for cleanup and optional tools. at the moment,
# we are very liberal with space, but this is also supposed to be a
# simple script
parent_dir=$(dirname $0)
tools_dir="$parent_dir/../tools"
# A directory called 'hacks' will be created here.
hacks_parent_dir="$parent_dir/.."
hacks_dir="$hacks_parent_dir/hacks"
roms_dir="$parent_dir/../roms"
levels_dir="$parent_dir/../levels"
print_usage() {
echo "Usage: $0 <smc_file>"
echo ""
echo "Required arguments:"
echo " smc_file: A .smc ROM file of Super Mario World (read this file's first"
echo " comment for detailed information)."
}
if [ "x$1" = "x-h" ]; then
print_usage
exit 0
fi
if [ -z "$1" ]; then
print_usage
exit 1
fi
sh $parent_dir/get_tools.sh -ek "$tools_dir"
sh $parent_dir/get_hacks.sh -k "$hacks_parent_dir" \
|| (echo "Using tar instead of 7z..."; \
sh $parent_dir/get_hacks.sh -kt "$hacks_parent_dir")
sh $parent_dir/create_roms.sh "$hacks_dir" "$roms_dir" "$1"
sh $parent_dir/dump_levels.sh "$roms_dir" "$levels_dir" \
|| (echo "Please manually execute dump_levels.sh after installing Wine."; \
echo "The full command is \`sh $parent_dir/dump_levels.sh $roms_dir $levels_dir\`")
echo "Done! Your environment is all setup."