Skip to content

Commit 2746c44

Browse files
committed
atari800 - added basic launch script for basic archive support
* only supports first file in archive * check md_mode in configure stage so we only do install work when installing
1 parent 059590b commit 2746c44

File tree

2 files changed

+37
-7
lines changed

2 files changed

+37
-7
lines changed

scriptmodules/emulators/atari800.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,22 @@ function configure_atari800() {
4848
mkRomDir "atari800"
4949
mkRomDir "atari5200"
5050

51-
mkUserDir "$md_conf_root/atari800"
51+
if [[ "$md_mode" == "install" ]]; then
52+
mkUserDir "$md_conf_root/atari800"
5253

53-
# move old config if exists to new location
54-
if [[ -f "$md_conf_root/atari800.cfg" ]]; then
55-
mv "$md_conf_root/atari800.cfg" "$md_conf_root/atari800/atari800.cfg"
54+
# move old config if exists to new location
55+
if [[ -f "$md_conf_root/atari800.cfg" ]]; then
56+
mv "$md_conf_root/atari800.cfg" "$md_conf_root/atari800/atari800.cfg"
57+
fi
58+
moveConfigFile "$home/.atari800.cfg" "$md_conf_root/atari800/atari800.cfg"
59+
60+
# copy launch script (used for unpacking archives)
61+
sed "s#EMULATOR#/bin/$md_id#" "$scriptdir/scriptmodules/$md_type/atari800/atari800.sh" >"$md_inst/$md_id.sh"
62+
chmod a+x "$md_inst/$md_id.sh"
5663
fi
57-
moveConfigFile "$home/.atari800.cfg" "$md_conf_root/atari800/atari800.cfg"
5864

59-
addEmulator 1 "atari800" "atari800" "$md_inst/bin/atari800 %ROM%"
60-
addEmulator 1 "atari800" "atari5200" "$md_inst/bin/atari800 %ROM%"
65+
addEmulator 1 "atari800" "atari800" "$md_inst/atari800.sh %ROM%"
66+
addEmulator 1 "atari800" "atari5200" "$md_inst/atari800.sh %ROM%"
6167
addSystem "atari800"
6268
addSystem "atari5200"
6369
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
emulator="./EMULATOR"
4+
rom="$1"
5+
6+
pushd "${0%/*}" >/dev/null
7+
8+
if [[ -z "$rom" ]]; then
9+
"$emulator"
10+
else
11+
source "../../lib/archivefuncs.sh"
12+
13+
archiveExtract "$rom" ".a52 .atr .bas .bin .car .dcm .xex .xfd"
14+
15+
# check successful extraction and if we have at least one file
16+
if [[ $? == 0 ]]; then
17+
rom="${arch_files[0]}"
18+
fi
19+
20+
"$emulator" "$rom"
21+
archiveCleanup
22+
fi
23+
24+
popd

0 commit comments

Comments
 (0)