From 357eca3b8b202eaaaa4c14ca4aba088ece865a1e Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 4 May 2023 23:35:38 +0100 Subject: [PATCH] system/ti99sim: Added (emulator for TI-99/4A computer) Signed-off-by: bedlam Signed-off-by: Willy Sudiarto Raharjo --- system/ti99sim/README | 19 +++++ system/ti99sim/doinst.sh | 9 +++ system/ti99sim/setup_paths.diff | 73 +++++++++++++++++ system/ti99sim/slack-desc | 19 +++++ system/ti99sim/ti99sim.SlackBuild | 118 ++++++++++++++++++++++++++++ system/ti99sim/ti99sim.desktop | 10 +++ system/ti99sim/ti99sim.info | 16 ++++ system/ti99sim/ti99sim.png | Bin 0 -> 5291 bytes system/ti99sim/verbose_compile.diff | 78 ++++++++++++++++++ 9 files changed, 342 insertions(+) create mode 100644 system/ti99sim/README create mode 100644 system/ti99sim/doinst.sh create mode 100644 system/ti99sim/setup_paths.diff create mode 100644 system/ti99sim/slack-desc create mode 100644 system/ti99sim/ti99sim.SlackBuild create mode 100644 system/ti99sim/ti99sim.desktop create mode 100644 system/ti99sim/ti99sim.info create mode 100644 system/ti99sim/ti99sim.png create mode 100644 system/ti99sim/verbose_compile.diff diff --git a/system/ti99sim/README b/system/ti99sim/README new file mode 100644 index 0000000000..21df8707c1 --- /dev/null +++ b/system/ti99sim/README @@ -0,0 +1,19 @@ +ti99sim (emulator for TI-99/4A computer) + +ti99sim emulates the Texas Instruments TI-99/4A computer. It supports +emulated disk drives, joysticks, speech synthesis, and various other +hardware. + +The package includes the system ROMs and a large collection of +cartridge ROM images installed in /opt/ti99sim/cartridges. + +See /usr/doc/ti99sim-$VERSION/README.html for documentation. Although +there's a desktop menu launcher, you'll have to use the command line +to run cartridges and disk images. + +Note: because some of the utilities have very generic names (such as +"disk", "decode", "say"), they're installed in /usr/bin with the +prefix ti99sim- (e.g. "ti99sim-disk"). If you really want to call +them by their original names, try: + + export PATH=/opt/ti99sim/bin:$PATH diff --git a/system/ti99sim/doinst.sh b/system/ti99sim/doinst.sh new file mode 100644 index 0000000000..3e5691a052 --- /dev/null +++ b/system/ti99sim/doinst.sh @@ -0,0 +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/system/ti99sim/setup_paths.diff b/system/ti99sim/setup_paths.diff new file mode 100644 index 0000000000..78cabba972 --- /dev/null +++ b/system/ti99sim/setup_paths.diff @@ -0,0 +1,73 @@ +diff -Naur ti99sim-0.16.0/scripts/setup ti99sim-0.16.0.patched/scripts/setup +--- ti99sim-0.16.0/scripts/setup 2020-05-25 16:52:23.000000000 -0400 ++++ ti99sim-0.16.0.patched/scripts/setup 2023-04-29 02:32:53.326030933 -0400 +@@ -1,15 +1,18 @@ + #!/bin/sh + ++CWD="$1" ++OUTDIR="$2" ++ + root=`dirname $0` + root=`dirname $root` + root=`readlink -f $root` + +-tmpdir=$(mktemp -d) ++TMPDIR=`pwd` tmpdir=$(mktemp -d) + cd $tmpdir + +-wget http://ftp.whtech.com/System%20ROMs/MAME/pre_0.174/ti99_complete.zip +-wget http://ftp.whtech.com/System%20ROMs/MAME/ti99_gkracker.zip +-wget http://ftp.whtech.com/emulators/mess/mess_modules.zip ++cp "$CWD"/ti99_complete.zip . ++cp "$CWD"/ti99_gkracker.zip . ++cp "$CWD"/mess_modules.zip . + + unzip -oq ti99_complete ti99_4a.zip + unzip -oq ti99_complete ti99_4qi.zip +@@ -33,33 +36,16 @@ + $root/bin/convert-ctg $root/roms/ti-disk.dat + $root/bin/convert-ctg $root/roms/ti-pcard.dat + +-mkdir -p ~/.ti99sim +- +-if [ -d /home/pi/RetroPie ]; then +- if [ ! -d ~/.ti99sim/console ]; then +- mkdir -p /home/pi/RetroPie/BIOS/ti99 +- ln -s /home/pi/RetroPie/BIOS/ti99 ~/.ti99sim/console +- fi +- if [ ! -d ~/.ti99sim/cartridges ]; then +- mkdir -p /home/pi/RetroPie/roms/ti99 +- ln -s /home/pi/RetroPie/roms/ti99 ~/.ti99sim/cartridges +- fi +-fi +- +-mkdir -p ~/.ti99sim/console +-mkdir -p ~/.ti99sim/cartridges +-mkdir -p ~/.ti99sim/disks +- +-if [ ! -f ~/.ti99sim/disks/image.cf7 ]; then ++if [ ! -f $OUTDIR/disks/image.cf7 ]; then + tmpdisk=$(mktemp -uq) + $root/bin/disk --create=sssd $tmpdisk > /dev/null + $root/bin/disk --output=cf7+ --filename=image.cf7#32 $tmpdisk > /dev/null + rm $tmpdisk +- mv image.cf7 ~/.ti99sim/disks ++ mv image.cf7 $OUTDIR/disks + fi + +-mv -n *ctg ~/.ti99sim/console +-mv -n spchrom.bin ~/.ti99sim/console ++mv -n *ctg $OUTDIR/console ++mv -n spchrom.bin $OUTDIR/console + + unzip -oq mess_modules -d roms + mv roms/minimem*.bin . +@@ -67,7 +53,7 @@ + $root/bin/convert-ctg $root/roms/mini-memory.dat + $root/bin/mkcart roms + +-mv -n *ctg ~/.ti99sim/cartridges ++mv -n *ctg $OUTDIR/cartridges + + cd - + diff --git a/system/ti99sim/slack-desc b/system/ti99sim/slack-desc new file mode 100644 index 0000000000..ab758cce40 --- /dev/null +++ b/system/ti99sim/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +ti99sim: ti99sim (emulator for TI-99/4A computer) +ti99sim: +ti99sim: ti99sim emulates the Texas Instruments TI-99/4A computer. It supports +ti99sim: emulated disk drives, joysticks, speech synthesis, and various other +ti99sim: hardware. +ti99sim: +ti99sim: The package includes the system ROMs and a large collection of +ti99sim: cartridge ROM images. +ti99sim: +ti99sim: +ti99sim: diff --git a/system/ti99sim/ti99sim.SlackBuild b/system/ti99sim/ti99sim.SlackBuild new file mode 100644 index 0000000000..a56499dfb3 --- /dev/null +++ b/system/ti99sim/ti99sim.SlackBuild @@ -0,0 +1,118 @@ +#!/bin/bash + +# Slackware build script for ti99sim + +# Written by B. Watson (urchlay@slackware.uk) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=ti99sim +VERSION=${VERSION:-0.16.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.src.tar.xz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ + +# The actual code doesn't need patching, but the build stuff does. +# Make it show the damn compile commands. +patch -p1 < $CWD/verbose_compile.diff + +# Modify the setup script so it doesn't download anything, and so +# it installs stuff in $PKG, not ~/.ti99sim. +patch -p1 < $CWD/setup_paths.diff + +# No other way to make it use our flags. +sed -i "s,-g3 *-O3,$SLKCFLAGS," rules.mak + +# Binaries already installed stripped. SYS_BIN must be /bin +# to avoid it creating absolute symlinks (we'll create relative ones, below). +make install DATA_DIR=$PKG/opt/$PRGNAM SYS_BIN=$PKG/opt/$PRGNAM/bin + +# Modified setup script requires arguments (original one didn't). +sh scripts/setup $CWD $PKG/opt/$PRGNAM + +# Names are too generic, prefix with ti99sim- unless already prefixed. +mkdir -p $PKG/usr/bin +for i in $PKG/opt/$PRGNAM/bin/*; do + src=$( basename $i ) + case "$src" in + ti99sim-*) dest=$src ;; + *) dest=ti99sim-$src ;; + esac + ln -s ../../opt/$PRGNAM/bin/$src $PKG/usr/bin/$dest +done + +# Icon cut from TI logo, found here: +# https://logos.fandom.com/wiki/Texas_Instruments +for px in 16 22 32 48 64 128; do + size="${px}x${px}" + dir=$PKG/usr/share/icons/hicolor/$size/apps + mkdir -p $dir + convert -resize $size $CWD/$PRGNAM.png $dir/$PRGNAM.png +done +mkdir -p $PKG/usr/share/pixmaps +ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png + +# .desktop file by SlackBuild author. It's not that useful since there's no +# way to attach disk images or cartridges to the emulator after it starts. +# The .desktop file just starts it up with no media, you can plunk around +# in BASIC but not save your work. Have to use --dsk1 and other options +# to actually do anything fun. +mkdir -p $PKG/usr/share/applications +cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop + +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC +cp -a doc/* $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/ti99sim/ti99sim.desktop b/system/ti99sim/ti99sim.desktop new file mode 100644 index 0000000000..65863671f5 --- /dev/null +++ b/system/ti99sim/ti99sim.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Name=TI-99 Sim +GenericName=TI-99/4A Emulator +Type=Application +Exec=ti99sim-sdl +Icon=ti99sim +Terminal=false +StartupNotify=false +Categories=Emulator;System; diff --git a/system/ti99sim/ti99sim.info b/system/ti99sim/ti99sim.info new file mode 100644 index 0000000000..727a95201a --- /dev/null +++ b/system/ti99sim/ti99sim.info @@ -0,0 +1,16 @@ +PRGNAM="ti99sim" +VERSION="0.16.0" +HOMEPAGE="https://mrousseau.org/programs/ti99sim/" +DOWNLOAD="https://mrousseau.org/programs/ti99sim/archives/ti99sim-0.16.0.src.tar.xz \ + http://ftp.whtech.com/System%20ROMs/MAME/pre_0.174/ti99_complete.zip \ + http://ftp.whtech.com/System%20ROMs/MAME/ti99_gkracker.zip \ + http://ftp.whtech.com/emulators/mess/mess_modules.zip" +MD5SUM="224c88ae9b44d98be0b19f0686452572 \ + bffb2d2132febf594b26bfffeaca8101 \ + 687d3633c736f8aa9646af0752acc850 \ + 73b40263a4e869e51c8957823eb97aa2" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" diff --git a/system/ti99sim/ti99sim.png b/system/ti99sim/ti99sim.png new file mode 100644 index 0000000000000000000000000000000000000000..9d2a242e89a8af9e00276193530fb46cfb51e1be GIT binary patch literal 5291 zcmV;c6jbYpP)005u}1^@s6i_d2*0004mX+uL$Nkc;* zaB^>EX>4Tx04R}tkv&MmKpe$i(@I4u4t5Yx$WWauii$XD6^c+H)C#RSm|XfHG-*gu zTpR`0f`cE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x2f6zV<0H>J7*4a5@ScbI1UcD^>|Z|DC_uzlmY09Yt$3B?`*;lJ}66=~B2z$q*$-G39n zc}sJ_npnUotw87YVIu8H00P?-aD)Yn|c#Qy4?&3z#dvFcSMEDgAsRWa~_kX{tnBUx;lZ7BJV=&|iH8gYE%vzRg9yTdBLxvNKD+ zSis_plAjHR{7RQS47^8-J|grg=3ZrZqJ_FASO9dmUiSIU x0FAm0kFl?$WN> $(DF).dep; \ + rm -f $(DF).d + + $(CFG)/%.o : %.m +- @echo $< +- @$(CC) -c $(CFLAGS) $(WARNINGS) $(INCLUDES) -o $@ $< ++ $(CC) -c $(CFLAGS) $(WARNINGS) $(INCLUDES) -o $@ $< + + %.h.gch: %.h + @echo Generating pre-compiled header for $< +- @$(CXX) $(CFLAGS) $(WARNINGS) $(INCLUDES) $< ++ $(CXX) $(CFLAGS) $(WARNINGS) $(INCLUDES) $< + + .SUFFIXES: .cpp .c .o +