Skip to content

Commit

Permalink
change config order / remove keyboard shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
FollyMaddy committed Jan 7, 2024
1 parent 879f872 commit 97c3b39
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions 00-scriptmodules-00/emulators/b-em-allegro4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,49 +82,44 @@ function install_b-em-allegro4() {
}

function configure_b-em-allegro4() {

# add system first to ensure that the config directory is present so next parts are possible
mkRomDir "bbcmicro"
addEmulator 0 "b-em-allegro4-BBC_B_8271_FDC-multiload" "bbcmicro" "XINIT:$md_inst/b-em-allegro4-multiload.sh -m3 %ROM%"
addEmulator 0 "b-em-allegro4-Master_128-multiload" "bbcmicro" "XINIT:$md_inst/b-em-allegro4-multiload.sh -m10 %ROM%"
addSystem "bbcmicro" "Acorn BBC micro" ".uef .ssd"
# part to add the config
cat >"$configdir/bbcmicro/b-em.cfg" << _EOF_
video_resize = 0
fullborders = 1
fasttape = 1
_EOF_
ln -s "$configdir/bbcmicro/b-em.cfg" "$md_inst/b-em.cfg"
#
# part to copy the cmos files and create symlinks
mv $md_inst/*.bin $configdir/bbcmicro
ln -s "$configdir/bbcmicro/cmos.bin" "$md_inst/cmos.bin"
ln -s "$configdir/bbcmicro/cmos350.bin" "$md_inst/cmos350.bin"
ln -s "$configdir/bbcmicro/cmosa.bin" "$md_inst/cmosa.bin"
ln -s "$configdir/bbcmicro/cmosc.bin" "$md_inst/cmosc.bin"
#
#
chown $user:$user -R "$configdir/bbcmicro"

cat >"$md_inst/matchbox_key_shortcuts" << _EOF_
<ctrl>c=close
_EOF_

cat >"$md_inst/b-em-allegro4-multiload.sh" << _EOF_
#!/bin/bash
function load_tape() {
cassload=();cassload=( "Shift_L+quoteright" "t" "a" "p" "e" "Return" "c" "h" "a" "i" "n" "at" "at" "Return" )
xset -dpms s off s noblank
matchbox-window-manager -use_titlebar no -use_cursor no -kbdconfig $md_inst/matchbox_key_shortcuts &
matchbox-window-manager -use_titlebar no -use_cursor no &
/opt/retropie/emulators/b-em-allegro4/b-em \$1 -tape "\$2"|\
for index in \${!cassload[@]};do xdotool \$(if [[ \$index == 0 ]];then echo "sleep 1.5";fi) keydown \${cassload[\$index]} sleep 0.1 keyup \${cassload[\$index]};done
}
function load_disc() {
#dfs autoload with Shift_L+F12
xset -dpms s off s noblank
matchbox-window-manager -use_titlebar no -use_cursor no -kbdconfig $md_inst/matchbox_key_shortcuts &
matchbox-window-manager -use_titlebar no -use_cursor no &
/opt/retropie/emulators/b-em-allegro4/b-em \$1 -disc "\$2" -autoboot
}
[[ "\$2" == *.uef ]] && load_tape \$1 "\$2"
[[ "\$2" == *.ssd ]] && load_disc \$1 "\$2"
_EOF_
chmod +x "$md_inst/b-em-allegro4-multiload.sh"


mkRomDir "bbcmicro"
addEmulator 0 "b-em-allegro4-BBC_B_8271_FDC-multiload" "bbcmicro" "XINIT:$md_inst/b-em-allegro4-multiload.sh -m3 %ROM%"
addEmulator 0 "b-em-allegro4-Master_128-multiload" "bbcmicro" "XINIT:$md_inst/b-em-allegro4-multiload.sh -m10 %ROM%"
addSystem "bbcmicro" "Acorn BBC micro" ".uef .ssd"
}

1 comment on commit 97c3b39

@FollyMaddy
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested OK on RPI5 with 64 bits Raspberrypi OS Bookworm

Please sign in to comment.