Skip to content

Commit 5cf9b95

Browse files
authored
Merge pull request #3508 from joolswills/amiberry_v5.x
Update amiberry version to v5.1
2 parents 1aa7823 + 1416b9e commit 5cf9b95

File tree

6 files changed

+212
-112
lines changed

6 files changed

+212
-112
lines changed

platforms.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
ags_exts=".exe"
55
ags_fullname="Adventure Game Studio"
66

7-
amiga_exts=".adf .adz .cue .dms .ipf .lha .m3u .sh .uae .zip"
7+
amiga_exts=".adf .adz .chd .cue .dms .ipf .lha .m3u .sh .uae .zip"
88
amiga_fullname="Commodore Amiga"
99

1010
amstradcpc_exts=".cdt .cpc .dsk .zip"

scriptmodules/emulators/amiberry.sh

Lines changed: 64 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,27 @@
1111

1212
rp_module_id="amiberry"
1313
rp_module_desc="Amiga emulator with JIT support (forked from uae4arm)"
14-
rp_module_help="ROM Extension: .adf .ipf .zip\n\nCopy your Amiga games to $romdir/amiga\n\nCopy the required BIOS files\nkick13.rom\nkick20.rom\nkick31.rom\nto $biosdir"
14+
rp_module_help="ROM Extension: .adf .chd .ipf .lha .zip\n\nCopy your Amiga games to $romdir/amiga\n\nCopy the required BIOS files\nkick13.rom\nkick20.rom\nkick31.rom\nto $biosdir/amiga"
1515
rp_module_licence="GPL3 https://raw.githubusercontent.com/midwan/amiberry/master/COPYING"
16-
rp_module_repo="git https://github.com/midwan/amiberry v3.3"
16+
rp_module_repo="git https://github.com/midwan/amiberry v5.1"
1717
rp_module_section="opt"
18-
rp_module_flags="!all arm"
18+
rp_module_flags="!all arm rpi3 rpi4"
19+
20+
function _update_hook_amiberry() {
21+
local rom
22+
for rom in kick13.rom kick20.rom kick31.rom; do
23+
# if we have a kickstart rom in $biosdir, move it to $biosdir/amiga and symlink the old location
24+
if [[ -f "$biosdir/$rom" && ! -h "$biosdir/$rom" ]]; then
25+
moveConfigFile "$biosdir/$rom" "$biosdir/amiga/$rom"
26+
fi
27+
done
28+
}
1929

2030
function _get_platform_amiberry() {
2131
local platform="$__platform-sdl2"
22-
if isPlatform "dispmanx"; then
32+
if isPlatform "aarch64" && isPlatform "rpi"; then
33+
platform="$__platform-64-sdl2"
34+
elif isPlatform "dispmanx"; then
2335
platform="$__platform"
2436
elif isPlatform "odroid-xu"; then
2537
platform="xu4"
@@ -34,7 +46,7 @@ function _get_platform_amiberry() {
3446
}
3547

3648
function depends_amiberry() {
37-
local depends=(autoconf libpng-dev libmpeg2-4-dev zlib1g-dev libmpg123-dev libflac-dev libxml2-dev libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev)
49+
local depends=(autoconf libpng-dev libmpeg2-4-dev zlib1g-dev libmpg123-dev libflac-dev libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev)
3850

3951
isPlatform "dispmanx" && depends+=(libraspberrypi-dev)
4052
isPlatform "vero4k" && depends+=(vero3-userland-dev-osmc)
@@ -44,43 +56,70 @@ function depends_amiberry() {
4456

4557
function sources_amiberry() {
4658
gitPullOrClone
59+
applyPatch "$md_data/01_preserve_env.diff"
4760
# use our default optimisation level
48-
sed -i "s/-Ofast//" "$md_build/Makefile"
61+
sed -i "/CFLAGS += -O3/d" "$md_build/Makefile"
4962
}
5063

5164
function build_amiberry() {
5265
local platform=$(_get_platform_amiberry)
5366
cd external/capsimg
54-
./bootstrap.fs
55-
./configure.fs
56-
make -f Makefile.fs clean
57-
make -f Makefile.fs
67+
./bootstrap
68+
./configure
69+
make clean
70+
make
5871
cd "$md_build"
5972
make clean
60-
make PLATFORM="$platform"
73+
make PLATFORM="$platform" CPUFLAGS="$__cpu_flags"
6174
md_ret_require="$md_build/amiberry"
6275
}
6376

6477
function install_amiberry() {
6578
md_ret_files=(
79+
'abr'
6680
'amiberry'
6781
'data'
6882
'external/capsimg/capsimg.so'
83+
'kickstarts'
6984
)
7085

7186
cp -R "$md_build/whdboot" "$md_inst/whdboot-dist"
7287
}
7388

7489
function configure_amiberry() {
75-
configure_uae4arm
90+
addEmulator 1 "amiberry" "amiga" "$md_inst/amiberry.sh %ROM%"
91+
addEmulator 0 "amiberry-a500" "amiga" "$md_inst/amiberry.sh %ROM% --model A500"
92+
addEmulator 0 "amiberry-a500plus" "amiga" "$md_inst/amiberry.sh %ROM% --model A500P"
93+
addEmulator 0 "amiberry-a1200" "amiga" "$md_inst/amiberry.sh %ROM% --model A1200"
94+
addEmulator 0 "amiberry-a4000" "amiga" "$md_inst/amiberry.sh %ROM% --model A4000"
95+
addEmulator 0 "amiberry-cdtv" "amiga" "$md_inst/amiberry.sh %ROM% --model CDTV"
96+
addEmulator 0 "amiberry-cd32" "amiga" "$md_inst/amiberry.sh %ROM% --model CD32"
97+
addSystem "amiga"
7698

7799
[[ "$md_mode" == "remove" ]] && return
78100

101+
mkRomDir "amiga"
102+
103+
mkUserDir "$md_conf_root/amiga"
104+
mkUserDir "$md_conf_root/amiga/amiberry"
105+
106+
# move config / save folders to $md_conf_root/amiga/amiberry
107+
local dir
108+
for dir in conf savestates screenshots; do
109+
moveConfigDir "$md_inst/$dir" "$md_conf_root/amiga/amiberry/$dir"
110+
done
111+
112+
# symlink cd32.nvr from $md_inst/data to "$md_conf_root/amiga/amiberry
113+
moveConfigFile "$md_inst/data/cd32.nvr" "$md_conf_root/amiga/amiberry/cd32.nvr"
114+
115+
moveConfigDir "$md_inst/kickstarts" "$biosdir/amiga"
116+
chown -R $user:$user "$biosdir/amiga"
117+
79118
# symlink the retroarch config / autoconfigs for amiberry to use
80119
ln -sf "$configdir/all/retroarch/autoconfig" "$md_inst/controllers"
81120
ln -sf "$configdir/all/retroarch.cfg" "$md_inst/conf/retroarch.cfg"
82121

83-
local config_dir="$md_conf_root/amiga/$md_id"
122+
local config_dir="$md_conf_root/amiga/amiberry"
84123

85124
# create whdboot config area
86125
moveConfigDir "$md_inst/whdboot" "$config_dir/whdboot"
@@ -89,4 +128,16 @@ function configure_amiberry() {
89128
cp -R "$md_inst/whdboot-dist/"{game-data,save-data,boot-data.zip,WHDLoad} "$config_dir/whdboot/"
90129

91130
chown -R $user:$user "$config_dir/whdboot"
131+
132+
# copy shared uae4arm/amiberry launch script while setting is_amiberry=1
133+
sed "s/is_amiberry=0/is_amiberry=1/" "$md_data/../uae4arm/uae4arm.sh" >"$md_inst/amiberry.sh"
134+
chmod a+x "$md_inst/amiberry.sh"
135+
136+
local script="+Start Amiberry.sh"
137+
cat > "$romdir/amiga/$script" << _EOF_
138+
#!/bin/bash
139+
"$md_inst/amiberry.sh"
140+
_EOF_
141+
chmod a+x "$romdir/amiga/$script"
142+
chown $user:$user "$romdir/amiga/$script"
92143
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/Makefile b/Makefile
2+
index 29969690..dc798edf 100644
3+
--- a/Makefile
4+
+++ b/Makefile
5+
@@ -17,10 +17,10 @@ SDL_CONFIG ?= sdl2-config
6+
export SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
7+
export SDL_LDFLAGS := $(shell $(SDL_CONFIG) --libs)
8+
9+
-CPPFLAGS = -MD -MT $@ -MF $(@:%.o=%.d) $(SDL_CFLAGS) -Iexternal/libguisan/include -Isrc -Isrc/osdep -Isrc/threaddep -Isrc/include -Isrc/archivers -Isrc/floppybridge -DAMIBERRY -D_FILE_OFFSET_BITS=64
10+
-CFLAGS=-pipe -Wno-shift-overflow -Wno-narrowing
11+
+CPPFLAGS += -MD -MT $@ -MF $(@:%.o=%.d) $(SDL_CFLAGS) -Iexternal/libguisan/include -Isrc -Isrc/osdep -Isrc/threaddep -Isrc/include -Isrc/archivers -Isrc/floppybridge -DAMIBERRY -D_FILE_OFFSET_BITS=64
12+
+CFLAGS += -pipe -Wno-shift-overflow -Wno-narrowing
13+
USE_LD ?= gold
14+
-LDFLAGS = $(SDL_LDFLAGS) -lSDL2_image -lSDL2_ttf -lguisan -Lexternal/libguisan/lib
15+
+LDFLAGS += $(SDL_LDFLAGS) -lSDL2_image -lSDL2_ttf -lguisan -Lexternal/libguisan/lib
16+
ifneq ($(strip $(USE_LD)),)
17+
LDFLAGS += -fuse-ld=$(USE_LD)
18+
endif

scriptmodules/emulators/uae4all.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
rp_module_id="uae4all"
1313
rp_module_desc="Amiga emulator UAE4All"
14-
rp_module_help="ROM Extension: .adf\n\nCopy your Amiga games to $romdir/amiga\n\nCopy the required BIOS files\nkick13.rom\nkick20.rom\nkick31.rom\nto $biosdir"
14+
rp_module_help="ROM Extension: .adf\n\nCopy your Amiga games to $romdir/amiga\n\nCopy the required BIOS files\nkick13.rom\nkick20.rom\nkick31.rom\nto $biosdir/amiga"
1515
rp_module_licence="GPL2 https://raw.githubusercontent.com/RetroPie/uae4all2/retropie/copying"
1616
rp_module_repo="git https://github.com/RetroPie/uae4all2.git retropie"
1717
rp_module_section="opt"
@@ -76,13 +76,13 @@ function configure_uae4all() {
7676
if [[ ! -h "$md_inst/kickstarts" ]]; then
7777
rm -f "$md_inst/kickstarts/"{kick12.rom,kick13.rom,kick20.rom,kick31.rom}
7878
fi
79-
moveConfigDir "$md_inst/kickstarts" "$biosdir"
79+
moveConfigDir "$md_inst/kickstarts" "$biosdir/amiga"
8080

8181
rm -f "$romdir/amiga/+Start UAE4All.sh"
8282
if [[ "$md_mode" == "install" ]]; then
8383
if [[ ! -f "$biosdir/aros-amiga-m68k-ext.bin" ]]; then
8484
# unpack aros kickstart
85-
unzip -j "aros20140110.zip" -d "$biosdir"
85+
unzip -j "aros20140110.zip" -d "$biosdir/amiga"
8686
fi
8787

8888
cat > "$romdir/amiga/+Start UAE4All.sh" << _EOF_

scriptmodules/emulators/uae4arm.sh

Lines changed: 54 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111

1212
rp_module_id="uae4arm"
1313
rp_module_desc="Amiga emulator with JIT support"
14-
rp_module_help="ROM Extension: .adf\n\nCopy your Amiga games to $romdir/amiga\n\nCopy the required BIOS files\nkick13.rom\nkick20.rom\nkick31.rom\nto $biosdir"
14+
rp_module_help="ROM Extension: .adf .ipf\n\nCopy your Amiga games to $romdir/amiga\n\nCopy the required BIOS files\nkick13.rom\nkick20.rom\nkick31.rom\nto $biosdir/amiga"
1515
rp_module_licence="GPL2"
1616
rp_module_repo="git https://github.com/Chips-fr/uae4arm-rpi.git master"
1717
rp_module_section="opt"
18-
rp_module_flags="!all videocore"
18+
rp_module_flags="!all dispmanx"
1919

2020
function depends_uae4arm() {
2121
getDepends libsdl1.2-dev libsdl-gfx1.2-dev libsdl-ttf2.0-dev libguichan-dev libmpg123-dev libxml2-dev libflac-dev libmpeg2-4-dev
@@ -43,67 +43,60 @@ function install_uae4arm() {
4343
}
4444

4545
function configure_uae4arm() {
46+
addEmulator 1 "uae4arm" "amiga" "$md_inst/uae4arm.sh %ROM%"
47+
addEmulator 0 "uae4arm-a500" "amiga" "$md_inst/uae4arm.sh %ROM% -config=conf/rp-a500.uae"
48+
addEmulator 0 "uae4arm-a1200" "amiga" "$md_inst/uae4arm.sh %ROM% -config=conf/rp-a1200.uae"
49+
addSystem "amiga"
50+
51+
[[ "$md_mode" == "remove" ]] && return
52+
4653
mkRomDir "amiga"
4754

48-
if [[ "$md_mode" == "install" ]]; then
49-
mkUserDir "$md_conf_root/amiga"
50-
mkUserDir "$md_conf_root/amiga/$md_id"
51-
52-
# move config / save folders to $md_conf_root/amiga/$md_id
53-
local dir
54-
for dir in conf savestates screenshots; do
55-
moveConfigDir "$md_inst/$dir" "$md_conf_root/amiga/$md_id/$dir"
56-
done
57-
58-
# and kickstart dir (removing old symlinks first)
59-
if [[ ! -h "$md_inst/kickstarts" ]]; then
60-
rm -f "$md_inst/kickstarts/"{kick12.rom,kick13.rom,kick20.rom,kick31.rom}
61-
fi
62-
moveConfigDir "$md_inst/kickstarts" "$biosdir"
63-
64-
local conf="$(mktemp)"
65-
iniConfig "=" "" "$conf"
66-
iniSet "config_description" "RetroPie A500, 68000, OCS, 512KB Chip + 512KB Slow Fast"
67-
iniSet "chipmem_size" "1"
68-
iniSet "bogomem_size" "2"
69-
iniSet "chipset" "ocs"
70-
iniSet "cachesize" "0"
71-
iniSet "kickstart_rom_file" "\$(FILE_PATH)/kick13.rom"
72-
copyDefaultConfig "$conf" "$md_conf_root/amiga/$md_id/conf/rp-a500.uae"
73-
rm "$conf"
74-
75-
conf="$(mktemp)"
76-
iniConfig "=" "" "$conf"
77-
iniSet "config_description" "RetroPie A1200, 68EC020, AGA, 2MB Chip"
78-
iniSet "chipmem_size" "4"
79-
iniSet "finegrain_cpu_speed" "1024"
80-
iniSet "cpu_type" "68ec020"
81-
iniSet "cpu_model" "68020"
82-
iniSet "chipset" "aga"
83-
iniSet "cachesize" "0"
84-
iniSet "kickstart_rom_file" "\$(FILE_PATH)/kick31.rom"
85-
copyDefaultConfig "$conf" "$md_conf_root/amiga/$md_id/conf/rp-a1200.uae"
86-
rm "$conf"
87-
88-
# copy launch script (used for uae4arm and amiberry)
89-
sed "s/EMULATOR/$md_id/" "$scriptdir/scriptmodules/$md_type/uae4arm/uae4arm.sh" >"$md_inst/$md_id.sh"
90-
chmod a+x "$md_inst/$md_id.sh"
91-
92-
local script="+Start UAE4Arm.sh"
93-
[[ "$md_id" == "amiberry" ]] && script="+Start Amiberry.sh"
94-
rm -f "$romdir/amiga/$script"
95-
if [[ "$md_mode" == "install" ]]; then
96-
cat > "$romdir/amiga/$script" << _EOF_
55+
mkUserDir "$md_conf_root/amiga"
56+
mkUserDir "$md_conf_root/amiga/uae4arm"
57+
58+
# move config / save folders to $md_conf_root/amiga/uae4arm
59+
local dir
60+
for dir in conf savestates screenshots; do
61+
moveConfigDir "$md_inst/$dir" "$md_conf_root/amiga/uae4arm/$dir"
62+
done
63+
64+
moveConfigDir "$md_inst/kickstarts" "$biosdir/amiga"
65+
chown -R $user:$user "$biosdir/amiga"
66+
67+
local conf="$(mktemp)"
68+
iniConfig "=" "" "$conf"
69+
iniSet "config_description" "RetroPie A500, 68000, OCS, 512KB Chip + 512KB Slow Fast"
70+
iniSet "chipmem_size" "1"
71+
iniSet "bogomem_size" "2"
72+
iniSet "chipset" "ocs"
73+
iniSet "cachesize" "0"
74+
iniSet "kickstart_rom_file" "\$(FILE_PATH)/kick13.rom"
75+
copyDefaultConfig "$conf" "$md_conf_root/amiga/uae4arm/conf/rp-a500.uae"
76+
rm "$conf"
77+
78+
conf="$(mktemp)"
79+
iniConfig "=" "" "$conf"
80+
iniSet "config_description" "RetroPie A1200, 68EC020, AGA, 2MB Chip"
81+
iniSet "chipmem_size" "4"
82+
iniSet "finegrain_cpu_speed" "1024"
83+
iniSet "cpu_type" "68ec020"
84+
iniSet "cpu_model" "68020"
85+
iniSet "chipset" "aga"
86+
iniSet "cachesize" "0"
87+
iniSet "kickstart_rom_file" "\$(FILE_PATH)/kick31.rom"
88+
copyDefaultConfig "$conf" "$md_conf_root/amiga/uae4arm/conf/rp-a1200.uae"
89+
rm "$conf"
90+
91+
# copy shared uae4arm/amiberry launch script
92+
cp "$md_data/uae4arm.sh" "$md_inst/"
93+
chmod a+x "$md_inst/uae4arm.sh"
94+
95+
local script="+Start UAE4Arm.sh"
96+
cat > "$romdir/amiga/$script" << _EOF_
9797
#!/bin/bash
98-
"$md_inst/$md_id.sh"
98+
"$md_inst/uae4arm.sh"
9999
_EOF_
100-
chmod a+x "$romdir/amiga/$script"
101-
chown $user:$user "$romdir/amiga/$script"
102-
fi
103-
fi
104-
105-
addEmulator 1 "$md_id" "amiga" "$md_inst/$md_id.sh auto %ROM%"
106-
addEmulator 1 "$md_id-a500" "amiga" "$md_inst/$md_id.sh rp-a500.uae %ROM%"
107-
addEmulator 1 "$md_id-a1200" "amiga" "$md_inst/$md_id.sh rp-a1200.uae %ROM%"
108-
addSystem "amiga"
100+
chmod a+x "$romdir/amiga/$script"
101+
chown $user:$user "$romdir/amiga/$script"
109102
}

0 commit comments

Comments
 (0)