pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ti99sim: SDL-based TI-99/4a simulator



Module Name:	pkgsrc-wip
Committed By:	Jason W. Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Mon Oct 7 12:50:36 2024 -0500
Changeset:	036721af70f4369b5129957d923ef5221be0e3d2

Modified Files:
	Makefile
Added Files:
	ti99sim/DESCR
	ti99sim/Makefile
	ti99sim/PLIST
	ti99sim/distinfo
	ti99sim/files/Makefile.freebsd
	ti99sim/patches/patch-Makefile.linux
	ti99sim/patches/patch-include_common.hpp
	ti99sim/patches/patch-include_platform.hpp
	ti99sim/patches/patch-rules.mak
	ti99sim/patches/patch-src_core_device-support.cpp
	ti99sim/patches/patch-src_core_stateobject.cpp

Log Message:
ti99sim: SDL-based TI-99/4a simulator

An emulator for the Texas Instruments TI-99/4A Home Computer. It
features full sound speech emulation. Supports emulation of the Gram
Kracker(TM), TI-Disk system, and 32K Memory expansion unit. This is a
port of a Win32 based emulator that I wrote a while back and am in the
process of porting to Linux using SDL (Simple DirectMedia Layer). The
code is now machine independant and should run on any platform
supported by SDL.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=036721af70f4369b5129957d923ef5221be0e3d2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                          |   1 +
 ti99sim/DESCR                                     |   7 ++
 ti99sim/Makefile                                  |  37 ++++++++
 ti99sim/PLIST                                     |   1 +
 ti99sim/distinfo                                  |  11 +++
 ti99sim/files/Makefile.freebsd                    | 103 ++++++++++++++++++++++
 ti99sim/patches/patch-Makefile.linux              |  13 +++
 ti99sim/patches/patch-include_common.hpp          |  17 ++++
 ti99sim/patches/patch-include_platform.hpp        |  15 ++++
 ti99sim/patches/patch-rules.mak                   |  55 ++++++++++++
 ti99sim/patches/patch-src_core_device-support.cpp |  12 +++
 ti99sim/patches/patch-src_core_stateobject.cpp    |  12 +++
 12 files changed, 284 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index badca56e16..d6fb02971d 100644
--- a/Makefile
+++ b/Makefile
@@ -5543,6 +5543,7 @@ SUBDIR+=	theforceengine
 SUBDIR+=	thepeg
 SUBDIR+=	thunderbird
 SUBDIR+=	thunderbird68-enigmail
+SUBDIR+=	ti99sim
 SUBDIR+=	tilda
 SUBDIR+=	tilix
 SUBDIR+=	timescaledb-tune
diff --git a/ti99sim/DESCR b/ti99sim/DESCR
new file mode 100644
index 0000000000..0dc9dc81ff
--- /dev/null
+++ b/ti99sim/DESCR
@@ -0,0 +1,7 @@
+An emulator for the Texas Instruments TI-99/4A Home Computer. It
+features full sound speech emulation. Supports emulation of the Gram
+Kracker(TM), TI-Disk system, and 32K Memory expansion unit. This is a
+port of a Win32 based emulator that I wrote a while back and am in the
+process of porting to Linux using SDL (Simple DirectMedia Layer). The
+code is now machine independant and should run on any platform
+supported by SDL.
diff --git a/ti99sim/Makefile b/ti99sim/Makefile
new file mode 100644
index 0000000000..0cf3760643
--- /dev/null
+++ b/ti99sim/Makefile
@@ -0,0 +1,37 @@
+# $NetBSD$
+#
+###########################################################
+#                  Generated by fbsd2pkg                  #
+#              Mon Oct  7 11:59:41 CDT 2024               #
+###########################################################
+
+DISTNAME=	ti99sim-${PV}.src
+PKGNAME=	${DISTNAME}
+CATEGORIES=	emulators
+MASTER_SITES=	https://www.mrousseau.org/programs/ti99sim/archives/
+EXTRACT_SUFX=	.tar.xz
+
+OWNER=		bacon%NetBSD.org@localhost
+HOMEPAGE=	https://www.mrousseau.org/programs/ti99sim/
+COMMENT=	SDL-based TI-99/4a simulator
+LICENSE=	gnu-gpl-v3
+
+# Test and change if necessary.
+# MAKE_JOBS_SAFE=	no
+
+# Just assuming C and C++: Adjust this!
+USE_LANGUAGES=	c c++
+USE_TOOLS+=	gmake
+
+WRKSRC=		${WRKDIR}/ti99sim-${PV}
+# Check this
+MAKE_FLAGS+=	DATA_DIR=${STAGEDIR}${DATADIR} \ \
+		BIN_DIR=${STAGEDIR}${DATADIR}/bin \
+		SYS_BIN=${STAGEDIR}${PREFIX}/bin
+
+PV=		0.16.0
+DATADIR=	${PREFIX}/share/ti99sim
+
+.include "../../security/openssl/buildlink3.mk"
+.include "../../devel/SDL2/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/ti99sim/PLIST b/ti99sim/PLIST
new file mode 100644
index 0000000000..48d96a5493
--- /dev/null
+++ b/ti99sim/PLIST
@@ -0,0 +1 @@
+@comment $NetBSD$
diff --git a/ti99sim/distinfo b/ti99sim/distinfo
new file mode 100644
index 0000000000..a45032be79
--- /dev/null
+++ b/ti99sim/distinfo
@@ -0,0 +1,11 @@
+$NetBSD$
+
+BLAKE2s (ti99sim-0.16.0.src.tar.xz) = b6cd23be4a8e281f926a82726409d466651ae03f69fb9a431d1ce44a2d93b09c
+SHA512 (ti99sim-0.16.0.src.tar.xz) = 5636b1ecbaf7da10ecaea2d59aac0d84f03934065c02d3441576e4675a6d818ca21e3af80caddfa9fef640f6e0bef093a09082ec0d453df87b67431d7f5c0fec
+Size (ti99sim-0.16.0.src.tar.xz) = 193760 bytes
+SHA1 (patch-Makefile.linux) = 246b6a6c750bdd1cdc760d9e5e1faa336f913f76
+SHA1 (patch-include_common.hpp) = c2baa6abfbe640cb15dfd7190d743373250a90db
+SHA1 (patch-include_platform.hpp) = 2b01ea7439d915095a36ea01921c2266fd77094b
+SHA1 (patch-rules.mak) = 0df5cdfefbff13fc2bf7042609157858c7c204a5
+SHA1 (patch-src_core_device-support.cpp) = c685db3bd50d8ee1d320971a3b759e06459c15be
+SHA1 (patch-src_core_stateobject.cpp) = 9ee81d2897741d5d881dd35a83fd622a360ff9ce
diff --git a/ti99sim/files/Makefile.freebsd b/ti99sim/files/Makefile.freebsd
new file mode 100644
index 0000000000..e95835edd1
--- /dev/null
+++ b/ti99sim/files/Makefile.freebsd
@@ -0,0 +1,103 @@
+# TI-99/sim Makefile for Linux
+
+XLIBS += -lstdc++fs
+
+ifndef DATA_DIR
+DATA_DIR  := /usr/local/share/ti99sim
+endif
+
+ifndef BIN_DIR
+BIN_DIR   := $(DATA_DIR)/bin
+endif
+
+ifndef SYS_BIN
+SYS_BIN   := /usr/local/bin
+endif
+
+ifneq ($(BIN_DIR),$(DATA_DIR)/bin)
+	TI_DATA_DIR := TI_DATA_DIR=$(DATA_DIR)
+endif
+
+INSTALL   := /usr/bin/install
+
+ITARGETS  = \
+	bin/catalog \
+	bin/convert-ctg \
+	bin/decode \
+	bin/disk \
+	bin/dumpcpu \
+	bin/dumpgrom \
+	bin/dumpspch \
+	bin/list \
+	bin/mkcart \
+	bin/mkspch \
+	bin/say \
+	bin/ti99sim-console \
+	bin/ti99sim-sdl
+
+SRC_DIRS = \
+	src/core \
+	src/console \
+	src/sdl \
+	src/util
+
+install: ti99sim
+	@$(INSTALL) -d $(DATA_DIR)
+	@$(INSTALL) -d $(DATA_DIR)/cartridges
+	@$(INSTALL) -d $(DATA_DIR)/console
+	@$(INSTALL) -d $(DATA_DIR)/disks
+	@$(INSTALL) -d $(BIN_DIR)
+	@for target in $(ITARGETS); do \
+	   $(INSTALL) -s $$target $(BIN_DIR); \
+	 done
+	@if [ $(BIN_DIR) != $(SYS_BIN) ]; then \
+	   for target in $(notdir $(ITARGETS)); do \
+	     ln -f -s $(BIN_DIR)/$$target $(SYS_BIN)/$$target; \
+	   done \
+	fi
+
+uninstall:
+	@for target in $(notdir $(ITARGETS)); do \
+	   rm -f $(BIN_DIR)/$$target; \
+	   rm -f $(SYS_BIN)/$$target; \
+	done
+	@rm -Rd $(DATA_DIR)
+
+clean:
+	@if [ -x src ]; then \
+	   rm -f {.,include,doc}/*~; \
+	   for dir in $(SRC_DIRS); do \
+	     $(MAKE) -sC $$dir clean; \
+	   done \
+	 fi
+	@if [ -x bin ]; then \
+	   rmdir --ignore-fail-on-non-empty bin; \
+	 fi
+
+dep:
+	@if [ -x src ]; then \
+	  for dir in $(SRC_DIRS); do \
+	    $(MAKE) -C $$dir dep; \
+	  done \
+	fi
+
+ti99sim:
+	@if [ -x src ]; then \
+	  if ! [ -r /usr/include/endian.h ]; then \
+	    if [ -r /usr/include/machine/endian.h ]; then \
+	      rm -f include/endian.h; \
+	      ln -s /usr/include/machine/endian.h include/endian.h; \
+	    fi \
+	  fi; \
+	  for dir in $(SRC_DIRS); do \
+	    $(MAKE) -sC $$dir $(TI_DATA_DIR); \
+	  done \
+	fi
+
+test: ti99sim
+	@if [ -x test ]; then \
+	  $(MAKE) -sC test; \
+	  for test in test/bin/test-*; do \
+	    $$test; \
+	  done \
+	fi
diff --git a/ti99sim/patches/patch-Makefile.linux b/ti99sim/patches/patch-Makefile.linux
new file mode 100644
index 0000000000..ad3eed6ad7
--- /dev/null
+++ b/ti99sim/patches/patch-Makefile.linux
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- Makefile.linux.orig	2024-10-04 12:57:23 UTC
++++ Makefile.linux
+@@ -52,7 +52,7 @@ install: ti99sim
+ 	 done
+ 	@if [ $(BIN_DIR) != $(SYS_BIN) ]; then \
+ 	   for target in $(notdir $(ITARGETS)); do \
+-	     ln -f -s $(BIN_DIR)/$$target $(SYS_BIN)/$$target; \
++	     cp $(BIN_DIR)/$$target $(SYS_BIN)/$$target; \
+ 	   done \
+ 	fi
+ 
diff --git a/ti99sim/patches/patch-include_common.hpp b/ti99sim/patches/patch-include_common.hpp
new file mode 100644
index 0000000000..cf5fd24fc7
--- /dev/null
+++ b/ti99sim/patches/patch-include_common.hpp
@@ -0,0 +1,17 @@
+$NetBSD$
+
+--- include/common.hpp.orig	2024-10-03 22:11:28 UTC
++++ include/common.hpp
+@@ -116,9 +116,9 @@ template <typename T, size_t N> char( &ArraySizeHelper
+ 	// Use the environments endian definitions
+ 	#include <endian.h>
+ 
+-	#define BIG_ENDIAN		__BIG_ENDIAN
+-	#define LITTLE_ENDIAN	__LITTLE_ENDIAN
+-	#define BYTE_ORDER		__BYTE_ORDER
++	//#define BIG_ENDIAN		__BIG_ENDIAN
++	//#define LITTLE_ENDIAN	__LITTLE_ENDIAN
++	//#define BYTE_ORDER		__BYTE_ORDER
+ 
+ #endif
+ 
diff --git a/ti99sim/patches/patch-include_platform.hpp b/ti99sim/patches/patch-include_platform.hpp
new file mode 100644
index 0000000000..245e663fcd
--- /dev/null
+++ b/ti99sim/patches/patch-include_platform.hpp
@@ -0,0 +1,15 @@
+$NetBSD$
+
+--- include/platform.hpp.orig	2024-10-06 12:13:54 UTC
++++ include/platform.hpp
+@@ -35,6 +35,10 @@
+ 		#define OS_WINDOWS
+ 	#endif
+ 
++// FIXME: __GNUC__ is defined under clang as well, but using OS_LINUX
++// for all Unix variants encourages developers to assume linuxisms
++// where they won't work.  Maybe define OS_UNIX for portable code
++// and just use OS_LINUX for linux-specific code.
+ #elif defined( __GNUC__ )
+ 
+ 	#if ! defined( OS_LINUX )
diff --git a/ti99sim/patches/patch-rules.mak b/ti99sim/patches/patch-rules.mak
new file mode 100644
index 0000000000..b477598d38
--- /dev/null
+++ b/ti99sim/patches/patch-rules.mak
@@ -0,0 +1,55 @@
+$NetBSD$
+
+# Add NetBSD support
+
+--- rules.mak.orig	2020-05-25 20:52:22.000000000 +0000
++++ rules.mak
+@@ -12,23 +12,20 @@ ifndef CXX
+ CXX      := g++
+ endif
+ 
+-ifneq (,$(findstring /,$(shell whereis ccache)))
+-CXX      := ccache $(CXX)
+-endif
+-
+ CFLAGS   += --std=c++2a
+ CFLAGS   += -fno-strict-aliasing -fexceptions -fPIC
+ CFLAGS   += -fdata-sections -ffunction-sections
+ CFLAGS   += -funsigned-char
++CFLAGS   += -Wno-deprecated-declarations
+ 
+ LFLAGS   += -Wl,--gc-sections
+ LFLAGS   += -rdynamic
+ 
+-XLIBS    += -lstdc++fs
++# XLIBS    += -lstdc++fs
+ 
+ WARNINGS := -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
+ WARNINGS += -Wno-implicit-fallthrough
+-WARNINGS += -Wno-maybe-uninitialized
++WARNINGS += -Wno-uninitialized
+ WARNINGS += -Wcast-qual
+ 
+ INCLUDES := -I../../include
+@@ -41,10 +38,6 @@ ifeq ($(CFG),Debug)
+ DEBUG    := 1
+ endif
+ 
+-ifdef ARCH
+-CFLAGS   += -march=$(ARCH)
+-endif
+-
+ ifdef LTO
+ CFLAGS   += -flto
+ LFLAGS   += -flto
+@@ -80,6 +73,10 @@ ifeq ($(OSTYPE),FreeBSD)
+ OS       := OS_LINUX
+ endif
+ 
++ifeq ($(OSTYPE),NetBSD)
++OS       := OS_LINUX
++endif
++
+ ifeq ($(OSTYPE),Darwin)
+ CXX      := c++
+ OS       := OS_MACOSX
diff --git a/ti99sim/patches/patch-src_core_device-support.cpp b/ti99sim/patches/patch-src_core_device-support.cpp
new file mode 100644
index 0000000000..c488de643d
--- /dev/null
+++ b/ti99sim/patches/patch-src_core_device-support.cpp
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- src/core/device-support.cpp.orig	2024-10-04 12:23:39 UTC
++++ src/core/device-support.cpp
+@@ -27,6 +27,7 @@
+ //----------------------------------------------------------------------------
+ 
+ #include <regex>
++#include <cstring>
+ #include "idevice.hpp"
+ #include "icomputer.hpp"
+ #include "cartridge.hpp"
diff --git a/ti99sim/patches/patch-src_core_stateobject.cpp b/ti99sim/patches/patch-src_core_stateobject.cpp
new file mode 100644
index 0000000000..5ade234e72
--- /dev/null
+++ b/ti99sim/patches/patch-src_core_stateobject.cpp
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- src/core/stateobject.cpp.orig	2024-10-03 22:18:01 UTC
++++ src/core/stateobject.cpp
+@@ -31,6 +31,7 @@
+ #include <cstdio>
+ #include <iomanip>
+ #include <fstream>
++#include <sstream>
+ #include "common.hpp"
+ #include "logger.hpp"
+ #include "stateobject.hpp"


Home | Main Index | Thread Index | Old Index