diff options
author | B. Watson <yalhcru@gmail.com> | 2021-10-12 00:28:03 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-10-13 00:52:43 +0700 |
commit | 8d93bcfabe35a584ae25540ef992a1be84ce0bd9 (patch) | |
tree | 4cfec592dff59ab517f15bb0f046f0bc6cb5b303 /games/yae | |
parent | e1ae146a04df065d6f7746bc524e7bd0970266d9 (diff) |
games/yae: Fix audio, X close button.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/yae')
-rw-r--r-- | games/yae/README | 2 | ||||
-rw-r--r-- | games/yae/doinst.sh | 6 | ||||
-rw-r--r-- | games/yae/icons/128.png | bin | 0 -> 14134 bytes | |||
-rw-r--r-- | games/yae/icons/16.png | bin | 0 -> 1161 bytes | |||
-rw-r--r-- | games/yae/icons/32.png | bin | 0 -> 1914 bytes | |||
-rw-r--r-- | games/yae/icons/48.png | bin | 0 -> 3306 bytes | |||
-rw-r--r-- | games/yae/icons/64.png | bin | 0 -> 4852 bytes | |||
-rw-r--r-- | games/yae/patches/allow_x_window_close.diff | 33 | ||||
-rw-r--r-- | games/yae/yae.1 | 71 | ||||
-rw-r--r-- | games/yae/yae.SlackBuild | 36 | ||||
-rw-r--r-- | games/yae/yae.desktop | 4 | ||||
-rw-r--r-- | games/yae/yae.png | bin | 17291 -> 0 bytes | |||
-rw-r--r-- | games/yae/yae.pod | 27 |
13 files changed, 124 insertions, 55 deletions
diff --git a/games/yae/README b/games/yae/README index 4ae1908a53f3..e41fbf9b3fe7 100644 --- a/games/yae/README +++ b/games/yae/README @@ -5,5 +5,3 @@ Emulates the 8-bit Apple II, II+, and //e computers. This is an older emulator without a lot of fancy features. The package includes the ROM images and an Apple DOS 3.3 disk image. - -Audio is supported, but only if OSS modules are loaded. diff --git a/games/yae/doinst.sh b/games/yae/doinst.sh index 5fb28930db0b..3e5691a052b5 100644 --- a/games/yae/doinst.sh +++ b/games/yae/doinst.sh @@ -1,3 +1,9 @@ if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/games/yae/icons/128.png b/games/yae/icons/128.png Binary files differnew file mode 100644 index 000000000000..fd6e712ae6fa --- /dev/null +++ b/games/yae/icons/128.png diff --git a/games/yae/icons/16.png b/games/yae/icons/16.png Binary files differnew file mode 100644 index 000000000000..bc176a6fff43 --- /dev/null +++ b/games/yae/icons/16.png diff --git a/games/yae/icons/32.png b/games/yae/icons/32.png Binary files differnew file mode 100644 index 000000000000..ec3c712d8570 --- /dev/null +++ b/games/yae/icons/32.png diff --git a/games/yae/icons/48.png b/games/yae/icons/48.png Binary files differnew file mode 100644 index 000000000000..2fdf9bfc7af2 --- /dev/null +++ b/games/yae/icons/48.png diff --git a/games/yae/icons/64.png b/games/yae/icons/64.png Binary files differnew file mode 100644 index 000000000000..0a843f393af6 --- /dev/null +++ b/games/yae/icons/64.png diff --git a/games/yae/patches/allow_x_window_close.diff b/games/yae/patches/allow_x_window_close.diff new file mode 100644 index 000000000000..d596ce7b390a --- /dev/null +++ b/games/yae/patches/allow_x_window_close.diff @@ -0,0 +1,33 @@ +diff -Naur -Naur yae-0.7/x_window.c yae-0.7.patched/x_window.c +--- yae-0.7/x_window.c 2007-04-03 17:47:59.000000000 -0400 ++++ yae-0.7.patched/x_window.c 2021-10-12 00:23:48.765550342 -0400 +@@ -57,6 +57,8 @@ + + static Cursor InvisibleCursor; + ++static Atom delete_atom; ++ + Visual *getVisual( Display *dpy, int screen, int depth, int class ) + { + XVisualInfo vinfo, *vinfoList; +@@ -219,6 +221,9 @@ + XFlush( dc->display ); + #endif + ++ delete_atom = XInternAtom(dc->display, "WM_DELETE_WINDOW", False); ++ XSetWMProtocols(dc->display, dc->window, &delete_atom, 1); ++ + /* + * startup micro job for X window + */ +@@ -313,6 +318,10 @@ + #endif + refreshScreen(); + break; ++ case ClientMessage: ++ if(event.xclient.data.l[0] == delete_atom) ++ shutdown_6502(); ++ break; + case DestroyNotify: + Signal6502( SIG_6502_SHUTDOWN ); + break; diff --git a/games/yae/yae.1 b/games/yae/yae.1 index 41aedfacb232..677232182f4f 100644 --- a/games/yae/yae.1 +++ b/games/yae/yae.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== @@ -38,27 +38,36 @@ . ds PI \(*p . ds L" `` . ds R" '' +. ds C` +. ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" -.\" If the F register is turned on, we'll generate index entries on stderr for +.\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX .. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" .. +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} +. \} .\} +.rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. @@ -124,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "YAE 1" -.TH YAE 1 "2013-08-29" "0.7" "yae" +.TH YAE 1 "2021-10-12" "0.7" "yae" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -136,51 +145,51 @@ yae \- Yet another Apple Emulator \&\fByae\fR [\-2|\-e|\-+] [disk\-image] ... .SH "DESCRIPTION" .IX Header "DESCRIPTION" -\&\fByae\fR emulates the Apple \s-1II\s0, \s-1II+\s0, and //e 8\-bit computers from Apple, +\&\fByae\fR emulates the Apple \s-1II, II+,\s0 and //e 8\-bit computers from Apple, Inc. Standard .dsk images are supported. If \fByae\fR is run without any disk image arguments, \fI/usr/share/yae/Master.dsk\fR will be booted. .PP \&\s-1ROM\s0 image files are required; see \fB\s-1FILES\s0\fR for details. .PP -\&\s-1OSS\s0 audio is supported, using the /dev/audio device. For Linux systems -using \s-1ALSA\s0, \s-1OSS\s0 audio is provided by the snd_pcm_oss and snd_mixer_oss -kernel modules. If /dev/audio can't be opened, the emulator will run -with sound disabled. +\&\s-1ALSA\s0 audio is supported, by linking the emulator with \fB\-laoss\fR. This +also allows PulseAudio to work, if you have the default \s-1ALSA\s0 device +set to \*(L"pcm.default pulse\*(R" (and \*(L"ctl.default pulse\*(R") in \fB/etc/asound.conf\fR. .SH "OPTIONS" .IX Header "OPTIONS" -.IP "\-2" 4 +.IP "\fB\-2\fR" 4 .IX Item "-2" -Emulate the Apple \s-1II\s0. +Emulate the Apple \s-1II.\s0 .Sp -Note that the emulator uses the same \s-1ROM\s0 image for \s-1II\s0 and \s-1II+\s0, so the +Note that the emulator uses the same \s-1ROM\s0 image for \s-1II\s0 and \s-1II+,\s0 so the emulated \s-1II\s0 will have Applesoft and autostart (which the original \s-1II\s0 didn't ship with). -.IP "\-+" 4 -Emulate the Apple \s-1II+\s0. -.IP "\-e" 4 +.IP "\fB\-+\fR" 4 +.IX Item "-+" +Emulate the Apple \s-1II+.\s0 +.IP "\fB\-e\fR" 4 .IX Item "-e" Emulate the Apple //e (the default). .SH "KEYSTROKES" .IX Header "KEYSTROKES" -.IP "Backspace" 4 +.IP "\fBBackspace\fR" 4 .IX Item "Backspace" Alias for the left-arrow key. -.IP "Control+Delete" 4 +.IP "\fBControl+Delete\fR" 4 .IX Item "Control+Delete" Apple Reset key. -.IP "Left Alt" 4 +.IP "\fBLeft Alt\fR" 4 .IX Item "Left Alt" The left (open) apple key on the //e keyboard. -.IP "Right Alt" 4 +.IP "\fBRight Alt\fR" 4 .IX Item "Right Alt" The right (closed) apple key on the //e keyboard. -.IP "F1" 4 +.IP "\fBF1\fR" 4 .IX Item "F1" Change disks in the first drive (slot 6, drive 0). This will either read a filename on standard input (if kdialog can't be run), or display a kdialog file-selector. Either way, the emulator stops and its window becomes unresponsive until a file has been chosen. -.IP "F2" 4 +.IP "\fBF2\fR" 4 .IX Item "F2" Exit the emulator immediately. No confirmation dialog, so be careful. @@ -195,10 +204,10 @@ keyboard. Config file. Searched for first in the current directory, then in user's home directory. For config file syntax, see \&\fI/usr/share/yae/yaerc.sample\fR. -.IP "\s-1ROM\s0 files" 4 +.IP "\fB\s-1ROM\s0 files\fR" 4 .IX Item "ROM files" -For \s-1II\s0 and \s-1II+\s0 emulation, the required \s-1ROM\s0 image is called \fB\s-1APPLE2\s0.ROM\fR. -For the //e, the image is \fB\s-1APPLE2E\s0.ROM\fR. For all modes, \fB\s-1DISK\s0.ROM\fR is +For \s-1II\s0 and \s-1II+\s0 emulation, the required \s-1ROM\s0 image is called \fB\s-1APPLE2.ROM\s0\fR. +For the //e, the image is \fB\s-1APPLE2E.ROM\s0\fR. For all modes, \fB\s-1DISK.ROM\s0\fR is required. .Sp \&\s-1ROM\s0 file locations can be set in the config file. By default, they're diff --git a/games/yae/yae.SlackBuild b/games/yae/yae.SlackBuild index 316c92a7b8f0..991fa3eb03bb 100644 --- a/games/yae/yae.SlackBuild +++ b/games/yae/yae.SlackBuild @@ -6,11 +6,18 @@ # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. +# 20211011 bkw: BUILD=2 +# - fix -current build (-fcommon). +# - link with -laoss, makes audio work on ALSA or pulseaudio systems. +# - new-style icons. +# - update man page. +# - allow X window close button to work. yet another patch. + cd $(dirname $0) ; CWD=$(pwd) PRGNAM=yae VERSION=${VERSION:-0.7} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -22,9 +29,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -86,6 +90,13 @@ patch -p1 < $CWD/patches/defaultmasterdisk.diff # this package, which Just Work instead of requiring user configuration. patch -p1 < $CWD/patches/defaultromlocation.diff +# *So* annoying: the standard X close button wasn't enabled. If this +# application did the whole "Are you sure you want to quit?" thing, I +# might understand why... but it already exits without confirmation, +# you just have to remember that F2 is the exit key. So why not the +# easily-memorable window close button? +patch -p1 < $CWD/patches/allow_x_window_close.diff + # Try to make 64-bit work. This seems OK, the scanline code seems to # assume sizeof(long)==4, which is wrong on x86_64. Using int (which # is still 4 bytes) fixes the display issues. There still might be @@ -104,6 +115,9 @@ CONFSUB=/usr/share/libtool/config/config.sub cp $CONFSUB . autoreconf -if +SLKCFLAGS+=" -fcommon" + +LIBS="-laoss" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ @@ -144,10 +158,20 @@ cat $CWD/${PRGNAM}rc.sample > $PKG/usr/share/$PRGNAM/${PRGNAM}rc.sample mkdir -p $PKG/usr/share/applications cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop -# icon created for this build, based on +# icons created for this build, based on # http://www.callapple.org/soft/images/icons/apple.gif +# 20211012 bkw: resized with convert(1), the aspect ratio is +# slightly squashed, but that just makes it look retro... +for i in $CWD/icons/*.png; do + px=$( basename $i | cut -d. -f1 ) + size=${px}x${px} + dir=$PKG/usr/share/icons/hicolor/$size/apps + mkdir -p $dir + cat $i > $dir/$PRGNAM.png +done + mkdir -p $PKG/usr/share/pixmaps -cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png +ln -s ../icons/hicolor/64x64/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cat $PRGNAM-roms/README > $PKG/usr/doc/$PRGNAM-$VERSION/README.roms diff --git a/games/yae/yae.desktop b/games/yae/yae.desktop index e2b04ee7fee3..b93789da5196 100644 --- a/games/yae/yae.desktop +++ b/games/yae/yae.desktop @@ -1,8 +1,8 @@ [Desktop Entry] Name=YAE Comment=Apple II Emulator -StartupNotify=true -Exec=yae +StartupNotify=false +Exec=/usr/games/yae Icon=yae Terminal=false Type=Application diff --git a/games/yae/yae.png b/games/yae/yae.png Binary files differdeleted file mode 100644 index 0df8b4536984..000000000000 --- a/games/yae/yae.png +++ /dev/null diff --git a/games/yae/yae.pod b/games/yae/yae.pod index dbb72b976e30..2b258b25b9d8 100644 --- a/games/yae/yae.pod +++ b/games/yae/yae.pod @@ -18,16 +18,15 @@ disk image arguments, I</usr/share/yae/Master.dsk> will be booted. ROM image files are required; see B<FILES> for details. -OSS audio is supported, using the /dev/audio device. For Linux systems -using ALSA, OSS audio is provided by the snd_pcm_oss and snd_mixer_oss -kernel modules. If /dev/audio can't be opened, the emulator will run -with sound disabled. +ALSA audio is supported, by linking the emulator with B<-laoss>. This +also allows PulseAudio to work, if you have the default ALSA device +set to "pcm.default pulse" (and "ctl.default pulse") in B</etc/asound.conf>. =head1 OPTIONS =over -=item -2 +=item B<-2> Emulate the Apple II. @@ -35,11 +34,11 @@ Note that the emulator uses the same ROM image for II and II+, so the emulated II will have Applesoft and autostart (which the original II didn't ship with). -=item -+ +=item B<-+> Emulate the Apple II+. -=item -e +=item B<-e> Emulate the Apple //e (the default). @@ -49,30 +48,30 @@ Emulate the Apple //e (the default). =over -=item Backspace +=item B<Backspace> Alias for the left-arrow key. -=item Control+Delete +=item B<Control+Delete> Apple Reset key. -=item Left Alt +=item B<Left Alt> The left (open) apple key on the //e keyboard. -=item Right Alt +=item B<Right Alt> The right (closed) apple key on the //e keyboard. -=item F1 +=item B<F1> Change disks in the first drive (slot 6, drive 0). This will either read a filename on standard input (if kdialog can't be run), or display a kdialog file-selector. Either way, the emulator stops and its window becomes unresponsive until a file has been chosen. -=item F2 +=item B<F2> Exit the emulator immediately. No confirmation dialog, so be careful. @@ -93,7 +92,7 @@ Config file. Searched for first in the current directory, then in user's home directory. For config file syntax, see I</usr/share/yae/yaerc.sample>. -=item ROM files +=item B<ROM files> For II and II+ emulation, the required ROM image is called B<APPLE2.ROM>. For the //e, the image is B<APPLE2E.ROM>. For all modes, B<DISK.ROM> is |