summaryrefslogtreecommitdiff
path: root/emulators/ucon64
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2020-12-05 13:16:36 +0000
committerwiz <wiz@pkgsrc.org>2020-12-05 13:16:36 +0000
commitd980d0ae1fac00058e62eb6664a3a4210b6ba68b (patch)
tree5d816e9a3774a6a125c5c8d9271cb0a4cb6dc694 /emulators/ucon64
parent3148f8b5afae359fdbf503f81de5eccc352a45fa (diff)
downloadpkgsrc-d980d0ae1fac00058e62eb6664a3a4210b6ba68b.tar.gz
ucon64: update to 2.2.1.
2.2.1 - updated (SNES) fixed checksum calculation of SNES/Super Famicom Classic Mini SRAM data of special chip games like Super Mario RPG, Super Mario World 2 - Yoshi's Island, Hoshi no Kirby Super Deluxe and Star Fox 2 (by dbjh) - added (SNES) --range=OFFSET1:OFFSET2 specify range for calculating checksum of SNES/Super Famicom Classic Mini (hakchi2) SRAM data. Can be used in combination with --sminis for special chip games (by dbjh) - added (SNES) --xic2 send ROM to SMC IC2 compatible backup unit (by dbjh; thanks to Mystic_Merlin for finding this out and for testing) - removed (PSX/N64) --xdex, because the underlying code had nothing to do with the DexDrive (by dbjh) - added full MinGW-w64, 64-bit Visual C++ (2015 &amp; 2019) and 64-bit Cygwin build support (including libdiscmage and libcd64); improved 64-bit support in general (by dbjh) - libdiscmage support is no longer enabled by default. Use the configure option --with-libdiscmage to enable support (by dbjh)
Diffstat (limited to 'emulators/ucon64')
-rw-r--r--emulators/ucon64/Makefile7
-rw-r--r--emulators/ucon64/PLIST3
-rw-r--r--emulators/ucon64/distinfo19
-rw-r--r--emulators/ucon64/patches/patch-backup_libcd64_Makefile48
-rw-r--r--emulators/ucon64/patches/patch-backup_libcd64_cd64io.c227
-rw-r--r--emulators/ucon64/patches/patch-backup_libcd64_cd64io.h77
-rw-r--r--emulators/ucon64/patches/patch-configure15
-rw-r--r--emulators/ucon64/patches/patch-configure.in15
-rw-r--r--emulators/ucon64/patches/patch-libdiscmage_ioapi.h19
-rw-r--r--emulators/ucon64/patches/patch-libdiscmage_misc__z.h23
-rw-r--r--emulators/ucon64/patches/patch-misc_archive.h23
-rw-r--r--emulators/ucon64/patches/patch-misc_ioapi.h19
12 files changed, 50 insertions, 445 deletions
diff --git a/emulators/ucon64/Makefile b/emulators/ucon64/Makefile
index e83bd92ce43..83657d1be87 100644
--- a/emulators/ucon64/Makefile
+++ b/emulators/ucon64/Makefile
@@ -1,18 +1,19 @@
-# $NetBSD: Makefile,v 1.16 2020/03/20 11:57:36 nia Exp $
+# $NetBSD: Makefile,v 1.17 2020/12/05 13:16:36 wiz Exp $
-DISTNAME= ucon64-2.2.0-src
+DISTNAME= ucon64-2.2.1-src
PKGNAME= ${DISTNAME:S/-src//}
CATEGORIES= emulators
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ucon64/}
MAINTAINER= pkgsrc-users@NetBSD.org
-HOMEPAGE= http://ucon64.sourceforge.net/
+HOMEPAGE= https://ucon64.sourceforge.io/
COMMENT= Emulator ROM and disk image converter and inspector
LICENSE= gnu-gpl-v2
WRKSRC= ${WRKDIR}/${DISTNAME}/src
CONFIGURE_ARGS+= --with-libcd64
+CONFIGURE_ARGS+= --with-libdiscmage
GNU_CONFIGURE= yes
USE_TOOLS+= gmake
CHECK_PORTABILITY_SKIP+= install_beos.sh
diff --git a/emulators/ucon64/PLIST b/emulators/ucon64/PLIST
index 2ce5b8c3292..2c5f6894b8f 100644
--- a/emulators/ucon64/PLIST
+++ b/emulators/ucon64/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.5 2019/07/07 22:47:57 wiz Exp $
+@comment $NetBSD: PLIST,v 1.6 2020/12/05 13:16:36 wiz Exp $
bin/ucon64
lib/discmage.so
share/doc/ucon64/changes.html
@@ -9,7 +9,6 @@ share/doc/ucon64/images/bg.jpg
share/doc/ucon64/images/cameralink.png
share/doc/ucon64/images/cd64.png
share/doc/ucon64/images/cd_rw.png
-share/doc/ucon64/images/dexdrive.png
share/doc/ucon64/images/f2a.png
share/doc/ucon64/images/fal.png
share/doc/ucon64/images/fig.png
diff --git a/emulators/ucon64/distinfo b/emulators/ucon64/distinfo
index 13618b2764f..a6baae540c4 100644
--- a/emulators/ucon64/distinfo
+++ b/emulators/ucon64/distinfo
@@ -1,13 +1,8 @@
-$NetBSD: distinfo,v 1.10 2019/07/07 22:47:57 wiz Exp $
+$NetBSD: distinfo,v 1.11 2020/12/05 13:16:36 wiz Exp $
-SHA1 (ucon64-2.2.0-src.tar.gz) = e92167c4537c9b74c879242b785d108f0f91e641
-RMD160 (ucon64-2.2.0-src.tar.gz) = 4bd6e17fbe970800f1f4e563263ccc86794eddf7
-SHA512 (ucon64-2.2.0-src.tar.gz) = 1f21083585d9e3a32546139e2b0786ff37d32e070b21ecc39a1d179e39be3e786d5d07b06c1dce8b3f43e14800974159f54a9a469e59070b2b50c4cbb85136dc
-Size (ucon64-2.2.0-src.tar.gz) = 1488002 bytes
-SHA1 (patch-backup_libcd64_Makefile) = c6d659c96ea2389266b6480f2d3afe79a647685d
-SHA1 (patch-backup_libcd64_cd64io.c) = ab1d2b9ad9c3258114f946b13c28520b40eb60b2
-SHA1 (patch-backup_libcd64_cd64io.h) = c4f915436c3867ea77ddc95942a074a8266a5c03
-SHA1 (patch-configure) = 2f56081b1ea8b0fcabc1979866fddc144241bc62
-SHA1 (patch-configure.in) = 069ffe610faec56696b71b42f2abafa53488a5ff
-SHA1 (patch-libdiscmage_misc__z.h) = 3456714ff4ea4328a7d6b3cd785e76abbca2423a
-SHA1 (patch-misc_archive.h) = 3ed6b8a6464e0fcb2992e0065b1e84ac0572f670
+SHA1 (ucon64-2.2.1-src.tar.gz) = bfc6fad1b82cb0d5ffe734f46d088567e8d93126
+RMD160 (ucon64-2.2.1-src.tar.gz) = ca363e350be23fa2f083deb598efab307066b231
+SHA512 (ucon64-2.2.1-src.tar.gz) = 34453399151e5ed256fdcf387b9d32a052718b264e51b99a2be251b90589337d13cd317f8d1aa7d3c8e39c8e407b22797d4608ec6d14b99c8673ec74f349f6c2
+Size (ucon64-2.2.1-src.tar.gz) = 1476080 bytes
+SHA1 (patch-libdiscmage_ioapi.h) = a5857b1623a3180d09e19815e261f23491aaad96
+SHA1 (patch-misc_ioapi.h) = dc2939f8f404e25a7dcb841555024551f2962984
diff --git a/emulators/ucon64/patches/patch-backup_libcd64_Makefile b/emulators/ucon64/patches/patch-backup_libcd64_Makefile
deleted file mode 100644
index 339cf0115bc..00000000000
--- a/emulators/ucon64/patches/patch-backup_libcd64_Makefile
+++ /dev/null
@@ -1,48 +0,0 @@
-$NetBSD: patch-backup_libcd64_Makefile,v 1.2 2019/07/07 22:47:57 wiz Exp $
-
-Patch from upstream to improve build on NetBSD.
-
---- backup/libcd64/Makefile.orig 2019-05-21 00:13:14.000000000 +0000
-+++ backup/libcd64/Makefile
-@@ -80,19 +80,10 @@ RAWIO=1
- endif
-
- ifeq ($(OSTYPE),OpenBSD)
--# i386_iopl() is located in libi386.a (note the .a)
--#LIBS+=/usr/lib/libi386.a
--#LDFLAGS+=-li386
--LIBS+=/usr/lib/libamd64.a
--LDFLAGS+=-lamd64
- RAWIO=1
- endif
-
- ifeq ($(OSTYPE),NetBSD)
--#LIBS+=/usr/lib/libi386.a
--#LDFLAGS+=-li386
--LIBS+=/usr/lib/libx86_64.a
--LDFLAGS+=-lx86_64
- RAWIO=1
- endif
-
-@@ -131,6 +122,21 @@ endif
-
- ifdef RAWIO
- CFLAGS+=-DCD64_USE_RAWIO
-+
-+ifeq ($(OSTYPE),OpenBSD)
-+# i386_iopl() is located in libi386.a (note the .a)
-+#LIBS+=/usr/lib/libi386.a
-+#LDFLAGS+=-li386
-+LIBS+=/usr/lib/libamd64.a
-+LDFLAGS+=-lamd64
-+endif
-+
-+ifeq ($(OSTYPE),NetBSD)
-+#LIBS+=/usr/lib/libi386.a
-+#LDFLAGS+=-li386
-+LIBS+=/usr/lib/libx86_64.a
-+LDFLAGS+=-lx86_64
-+endif
- endif
-
- default: all
diff --git a/emulators/ucon64/patches/patch-backup_libcd64_cd64io.c b/emulators/ucon64/patches/patch-backup_libcd64_cd64io.c
deleted file mode 100644
index d65285427b5..00000000000
--- a/emulators/ucon64/patches/patch-backup_libcd64_cd64io.c
+++ /dev/null
@@ -1,227 +0,0 @@
-$NetBSD: patch-backup_libcd64_cd64io.c,v 1.2 2019/07/07 22:47:57 wiz Exp $
-
-Patch from upstream to improve build on NetBSD.
-
---- backup/libcd64/cd64io.c.orig 2019-05-06 06:48:17.000000000 +0000
-+++ backup/libcd64/cd64io.c
-@@ -41,7 +41,20 @@
-
- #ifdef CD64_USE_RAWIO
-
-+static INLINE uint8_t inb2(uint16_t);
-+static INLINE void outb2(uint8_t, uint16_t);
-+
- #if defined _WIN32 || defined __CYGWIN__
-+#ifdef _MSC_VER
-+#pragma warning(push)
-+#pragma warning(disable: 4255) /* 'function' : no function prototype given: converting '()' to '(void)' */
-+#pragma warning(disable: 4668) /* 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives' */
-+#pragma warning(disable: 4820) /* 'bytes' bytes padding added after construct 'member_name' */
-+#endif
-+#include <windows.h> /* defines _WIN32 (checks for */
-+#ifdef _MSC_VER /* __CYGWIN__ must come first) */
-+#pragma warning(pop)
-+#endif
- #ifdef __CYGWIN__
- #include <dlfcn.h>
-
-@@ -73,10 +86,8 @@ static short int (WINAPI *IsDriverInstal
- static unsigned char (__stdcall *DlPortReadPortUchar)(unsigned short) = NULL;
- static void (__stdcall *DlPortWritePortUchar)(unsigned short, unsigned char) = NULL;
-
--static INLINE uint8_t inb(uint16_t);
--static INLINE void outb(uint8_t, uint16_t);
--static uint8_t (*input_byte)(uint16_t) = inb;
--static void (*output_byte)(uint8_t, uint16_t) = outb;
-+static uint8_t (*input_byte)(uint16_t) = inb2;
-+static void (*output_byte)(uint8_t, uint16_t) = outb2;
- #endif
-
- #ifdef __BEOS__
-@@ -774,9 +785,8 @@ static LONG new_exception_filter(LPEXCEP
- #endif
- #endif /* _WIN32 || __CYGWIN__ */
-
--#if ((defined _WIN32 || defined __CYGWIN__ || defined __BEOS__) && \
-- (defined __i386__ || defined __x86_64__)) || defined _MSC_VER
--static INLINE uint8_t inb(uint16_t port) {
-+#if defined __i386__ || defined __x86_64__ || defined _MSC_VER
-+static INLINE uint8_t inb2(uint16_t port) {
-
- #ifdef __BEOS__
- st_ioport_t temp;
-@@ -785,27 +795,30 @@ static INLINE uint8_t inb(uint16_t port)
- ioctl(io_portfd, 'r', &temp, 0);
-
- return temp.data8;
--#else /* Win32 */
-+#elif defined _WIN32 || defined __CYGWIN__
- if (io_driver_found) return input_byte(port);
-- else {
-+ else
- #ifdef _MSC_VER
- #ifdef _M_IX86
-- return (unsigned char) _inp(port);
-+ return (uint8_t) _inp(port);
- #endif
--#else
-- unsigned char byte;
-+#endif
-+#endif /* _WIN32 || __CYGWIN__ */
-+#if defined __MINGW32__ || defined __CYGWIN__ || \
-+ ((defined __i386__ || defined __x86_64__) && !defined __BEOS__)
-+ {
-+ uint8_t byte;
- __asm__ __volatile__
- ("inb %1, %0"
- : "=a" (byte)
- : "d" (port)
- );
- return byte;
--#endif
- }
- #endif
- }
-
--static INLINE void outb(uint8_t byte, uint16_t port) {
-+static INLINE void outb2(uint8_t byte, uint16_t port) {
-
- #ifdef __BEOS__
- st_ioport_t temp;
-@@ -813,24 +826,27 @@ static INLINE void outb(uint8_t byte, ui
- temp.port = port;
- temp.data8 = byte;
- ioctl(io_portfd, 'w', &temp, 0);
--#else /* Win32 */
-+#elif defined _WIN32 || defined __CYGWIN__
- if (io_driver_found) output_byte(byte, port);
-- else {
-+ else
- #ifdef _MSC_VER
- #ifdef _M_IX86
- _outp(port, byte);
- #endif
--#else
-+#endif
-+#endif /* _WIN32 || __CYGWIN__ */
-+#if defined __MINGW32__ || defined __CYGWIN__ || \
-+ ((defined __i386__ || defined __x86_64__) && !defined __BEOS__)
-+ {
- __asm__ __volatile__
- ("outb %1, %0"
- :
- : "d" (port), "a" (byte)
- );
--#endif
- }
- #endif
- }
--#endif /* inb/outb defs */
-+#endif /* inb2/outb2 defs */
-
- int cd64_open_rawio(struct cd64_t *cd64) {
-
-@@ -1112,8 +1128,8 @@ int cd64_close_rawio(struct cd64_t *cd64
- close_module(io_driver, cd64);
- io_driver = NULL;
- io_driver_found = 0;
-- input_byte = inb;
-- output_byte = outb;
-+ input_byte = inb2;
-+ output_byte = outb2;
- #endif
-
- return 1;
-@@ -1127,7 +1143,7 @@ static INLINE int cd64_wait_rawio(struct
- i = 0;
-
- if (cd64->using_ppa) {
-- status = inb((uint16_t) (cd64->port+1));
-+ status = inb2((uint16_t) (cd64->port+1));
-
- while (status & 0x80) {
- i++;
-@@ -1136,15 +1152,15 @@ static INLINE int cd64_wait_rawio(struct
- * Try to knock some sense into it. */
- uint8_t dir = 1;
- status = 0x06 | (dir << 5);
-- outb(status, (uint16_t) (cd64->port+2));
-+ outb2(status, (uint16_t) (cd64->port+2));
-
- dir = 0;
- status = 0x04 | (dir << 5);
-- outb(status, (uint16_t) (cd64->port+2));
-+ outb2(status, (uint16_t) (cd64->port+2));
- status = 0x05 | (dir << 5);
-- outb(status, (uint16_t) (cd64->port+2));
-+ outb2(status, (uint16_t) (cd64->port+2));
- status = 0x04 | (dir << 5);
-- outb(status, (uint16_t) (cd64->port+2));
-+ outb2(status, (uint16_t) (cd64->port+2));
-
- reset_tries++;
- i = 0;
-@@ -1155,14 +1171,14 @@ static INLINE int cd64_wait_rawio(struct
- break;
- }
-
-- status = inb((uint16_t) (cd64->port+1));
-+ status = inb2((uint16_t) (cd64->port+1));
- }
- }
- else { /* Comms link */
-- status = inb((uint16_t) (cd64->port+2));
-+ status = inb2((uint16_t) (cd64->port+2));
- while (status & 1) {
- /* Do we need to handle a stuck situation here? */
-- status = inb((uint16_t) (cd64->port+2));
-+ status = inb2((uint16_t) (cd64->port+2));
- }
- }
-
-@@ -1181,10 +1197,10 @@ int cd64_xfer_rawio(struct cd64_t *cd64,
- if (delayms) MSLEEP(delayms);
- dir = 1;
- ctl = 0x06 | (dir << 5);
-- outb(ctl, (uint16_t) (cd64->port+2));
-+ outb2(ctl, (uint16_t) (cd64->port+2));
- if (delayms) MSLEEP(delayms);
- if (rd) {
-- *rd = inb((uint16_t) cd64->port);
-+ *rd = inb2((uint16_t) cd64->port);
- #if DEBUG_LOWLEVEL
- printf("got %xh", *rd);
- if (*rd > 0x20) printf(" (%c)", *rd);
-@@ -1195,10 +1211,10 @@ int cd64_xfer_rawio(struct cd64_t *cd64,
- if (delayms) MSLEEP(delayms);
- dir = 0;
- ctl = 0x04 | (dir << 5);
-- outb(ctl, (uint16_t) (cd64->port+2));
-+ outb2(ctl, (uint16_t) (cd64->port+2));
- if (delayms) MSLEEP(delayms);
- if (wr) {
-- outb(*wr, (uint16_t) cd64->port);
-+ outb2(*wr, (uint16_t) cd64->port);
- #if DEBUG_LOWLEVEL
- printf("put %xh", *wr);
- if (*wr > 0x20) printf(" (%c)", *wr);
-@@ -1207,15 +1223,15 @@ int cd64_xfer_rawio(struct cd64_t *cd64,
- }
- if (delayms) MSLEEP(delayms);
- ctl = 0x05 | (dir << 5);
-- outb(ctl, (uint16_t) (cd64->port+2));
-+ outb2(ctl, (uint16_t) (cd64->port+2));
- if (delayms) MSLEEP(delayms);
- ctl = 0x04 | (dir << 5);
-- outb(ctl, (uint16_t) (cd64->port+2));
-+ outb2(ctl, (uint16_t) (cd64->port+2));
- }
- else { /* Comms link */
-- outb(*wr, (uint16_t) cd64->port);
-+ outb2(*wr, (uint16_t) cd64->port);
- if (!cd64_wait_rawio(cd64)) { return 0; }
-- *rd = inb((uint16_t) cd64->port);
-+ *rd = inb2((uint16_t) cd64->port);
- }
-
- return 1;
diff --git a/emulators/ucon64/patches/patch-backup_libcd64_cd64io.h b/emulators/ucon64/patches/patch-backup_libcd64_cd64io.h
deleted file mode 100644
index e736cf5ad12..00000000000
--- a/emulators/ucon64/patches/patch-backup_libcd64_cd64io.h
+++ /dev/null
@@ -1,77 +0,0 @@
-$NetBSD: patch-backup_libcd64_cd64io.h,v 1.2 2019/07/07 22:47:57 wiz Exp $
-
-Patch from upstream to improve build on NetBSD.
-
---- backup/libcd64/cd64io.h.orig 2018-03-07 11:09:59.000000000 +0000
-+++ backup/libcd64/cd64io.h
-@@ -30,32 +30,15 @@ int cd64_xfer_portdev(struct cd64_t *cd6
- #endif
-
- #ifdef CD64_USE_RAWIO
--/* #define REALLY_SLOW_IO */
--#if defined __linux__ && (defined __i386__ || defined __x86_64__)
-+#ifdef __linux__
- #include <sys/io.h>
- #endif
--#if (defined __OpenBSD__ || defined __NetBSD__) && (defined __i386__ || defined __x86_64__)
-+#if defined __OpenBSD__ || defined __NetBSD__
- #include <sys/types.h>
- #include <machine/sysarch.h>
--#include <machine/pio.h>
--/* pio.h defines several I/O functions & macros, including the macros inb() and
-- * outb(). This shows that using a bit of inline assembly is not such a bad idea
-- * at all. */
--#undef inb
--#define inb(port) __inb(port)
--#undef outb
--#define outb(data, port) __outb(port, data)
- #endif
- #ifdef __FreeBSD__
- #include <fcntl.h>
--#include <machine/cpufunc.h>
--/* Almost the same story as under OpenBSD. cpufunc.h defines the macros inb()
-- * and outb(). We redefine them. Be sure _POSIX_SOURCE is not defined before
-- * including <machine/cpufunc.h>. */
--#undef inb
--#define inb(port) inbv(port)
--#undef outb
--#define outb(data, port) outbv(port, data)
- #endif
- #ifdef __BEOS__
- #include <fcntl.h>
-@@ -68,24 +51,6 @@ int cd64_xfer_portdev(struct cd64_t *cd6
- #pragma warning(pop)
- #define F_OK 0
- #endif
--#ifdef __MSDOS__
--#include <pc.h> /* inportb() & outportb() */
--#define inb(port) inportb(port)
--#define outb(data, port) outportb(port, data)
--#endif
--#if defined _WIN32 || defined __CYGWIN__
--#ifdef _MSC_VER
--#pragma warning(push)
--#pragma warning(disable: 4255) /* 'function' : no function prototype given: converting '()' to '(void)' */
--#pragma warning(disable: 4668) /* 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives' */
--#pragma warning(disable: 4820) /* 'bytes' bytes padding added after construct 'member_name' */
--#endif
--#include <windows.h> /* defines _WIN32 (checks for */
--#ifdef _MSC_VER /* __CYGWIN__ must come first) */
--#pragma warning(pop)
--#endif
--#endif /* _WIN32 || __CYGWIN__ */
--
- int cd64_open_rawio(struct cd64_t *cd64);
- int cd64_close_rawio(struct cd64_t *cd64);
- int cd64_xfer_rawio(struct cd64_t *cd64, uint8_t *wr, uint8_t *rd, int delayms);
-@@ -99,8 +64,8 @@ int cd64_xfer_rawio(struct cd64_t *cd64,
- #pragma warning(disable: 4668) /* 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives' */
- #pragma warning(disable: 4820) /* 'bytes' bytes padding added after construct 'member_name' */
- #endif
--#include <windows.h>
--#ifdef _MSC_VER
-+#include <windows.h> /* defines _WIN32 (checks for */
-+#ifdef _MSC_VER /* __CYGWIN__ must come first) */
- #pragma warning(pop)
- #endif
- #define MSLEEP(x) Sleep(x)
diff --git a/emulators/ucon64/patches/patch-configure b/emulators/ucon64/patches/patch-configure
deleted file mode 100644
index 008667c3a45..00000000000
--- a/emulators/ucon64/patches/patch-configure
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-configure,v 1.2 2019/07/07 22:47:57 wiz Exp $
-
-Patch from upstream to improve build on NetBSD.
-
---- configure.orig 2019-05-30 15:37:45.000000000 +0000
-+++ configure
-@@ -3434,7 +3434,7 @@ fi
-
- if test $with_libcd64 = yes; then
- CFLAGS0=$CFLAGS
-- CFLAGS+=" -Ibackup/libcd64"
-+ CFLAGS="$CFLAGS -Ibackup/libcd64"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #include "ultra64/host/cd64lib.h"
diff --git a/emulators/ucon64/patches/patch-configure.in b/emulators/ucon64/patches/patch-configure.in
deleted file mode 100644
index 76e33517b48..00000000000
--- a/emulators/ucon64/patches/patch-configure.in
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-configure.in,v 1.2 2019/07/07 22:47:57 wiz Exp $
-
-Patch from upstream to improve build on NetBSD.
-
---- configure.in.orig 2019-05-30 15:24:12.000000000 +0000
-+++ configure.in
-@@ -125,7 +125,7 @@ AC_ARG_WITH(libcd64,
- with_libcd64=no)
- if test $with_libcd64 = yes; then
- CFLAGS0=$CFLAGS
-- CFLAGS+=" -Ibackup/libcd64"
-+ CFLAGS="$CFLAGS -Ibackup/libcd64"
- AC_TRY_COMPILE([#include "ultra64/host/cd64lib.h"], , with_libcd64=yes, with_libcd64=no)
- CFLAGS=$CFLAGS0
- fi
diff --git a/emulators/ucon64/patches/patch-libdiscmage_ioapi.h b/emulators/ucon64/patches/patch-libdiscmage_ioapi.h
new file mode 100644
index 00000000000..57690becf8e
--- /dev/null
+++ b/emulators/ucon64/patches/patch-libdiscmage_ioapi.h
@@ -0,0 +1,19 @@
+$NetBSD: patch-libdiscmage_ioapi.h,v 1.1 2020/12/05 13:16:36 wiz Exp $
+
+OF is not defined in zlib.h on all systems.
+From upstream.
+
+--- libdiscmage/ioapi.h.orig 2016-03-03 13:55:44.000000000 +0000
++++ libdiscmage/ioapi.h
+@@ -35,6 +35,11 @@
+ extern "C" {
+ #endif
+
++// On NetBSD and Gentoo, OF is not defined in zconf.h, which is included by zlib.h.
++#ifndef OF
++#define OF(x) x
++#endif
++
+ typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
+ typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
+ typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
diff --git a/emulators/ucon64/patches/patch-libdiscmage_misc__z.h b/emulators/ucon64/patches/patch-libdiscmage_misc__z.h
deleted file mode 100644
index 4b9ff037bc3..00000000000
--- a/emulators/ucon64/patches/patch-libdiscmage_misc__z.h
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-libdiscmage_misc__z.h,v 1.1 2019/07/07 22:47:57 wiz Exp $
-
-Patch from upstream to improve build on NetBSD.
-
---- libdiscmage/misc_z.h.orig 2017-05-05 10:26:38.000000000 +0000
-+++ libdiscmage/misc_z.h
-@@ -1,7 +1,7 @@
- /*
- misc_z.h - miscellaneous zlib functions
-
--Copyright (c) 2001 - 2004, 2016 - 2017 dbjh
-+Copyright (c) 2001 - 2004, 2016 - 2017, 2019 dbjh
-
-
- This program is free software; you can redistribute it and/or modify
-@@ -58,6 +58,7 @@ extern off_t q_fsize2 (const char *filen
- #define fseek(FILE, OFFSET, MODE) fseek2(FILE, OFFSET, MODE)
- #define fread(BUF, SIZE, NUM, FILE) fread2(BUF, SIZE, NUM, FILE)
- #define fgetc(FILE) fgetc2(FILE)
-+#undef fgets // necessary on (at least) NetBSD
- #define fgets(BUF, MAXLEN, FILE) fgets2(BUF, MAXLEN, FILE)
- #undef feof // necessary on (at least) Cygwin
- #define feof(FILE) feof2(FILE)
diff --git a/emulators/ucon64/patches/patch-misc_archive.h b/emulators/ucon64/patches/patch-misc_archive.h
deleted file mode 100644
index b659d97c17d..00000000000
--- a/emulators/ucon64/patches/patch-misc_archive.h
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-misc_archive.h,v 1.1 2019/07/07 22:47:57 wiz Exp $
-
-Patch from upstream to improve build on NetBSD.
-
---- misc/archive.h.orig 2017-05-05 09:40:40.000000000 +0000
-+++ misc/archive.h
-@@ -1,7 +1,7 @@
- /*
- archive.h - g(un)zip and unzip support
-
--Copyright (c) 2001 - 2004, 2015 - 2017 dbjh
-+Copyright (c) 2001 - 2004, 2015 - 2017, 2019 dbjh
-
-
- This program is free software; you can redistribute it and/or modify
-@@ -58,6 +58,7 @@ extern off_t fsizeof2 (const char *filen
- #define fseek(FILE, OFFSET, MODE) fseek2(FILE, OFFSET, MODE)
- #define fread(BUF, SIZE, NUM, FILE) fread2(BUF, SIZE, NUM, FILE)
- #define fgetc(FILE) fgetc2(FILE)
-+#undef fgets // necessary on (at least) NetBSD
- #define fgets(BUF, MAXLEN, FILE) fgets2(BUF, MAXLEN, FILE)
- #undef feof // necessary on (at least) Cygwin
- #define feof(FILE) feof2(FILE)
diff --git a/emulators/ucon64/patches/patch-misc_ioapi.h b/emulators/ucon64/patches/patch-misc_ioapi.h
new file mode 100644
index 00000000000..859bb30813a
--- /dev/null
+++ b/emulators/ucon64/patches/patch-misc_ioapi.h
@@ -0,0 +1,19 @@
+$NetBSD: patch-misc_ioapi.h,v 1.1 2020/12/05 13:16:36 wiz Exp $
+
+OF is not defined in zlib.h on all systems.
+From upstream.
+
+--- misc/ioapi.h.orig 2016-03-03 13:55:44.000000000 +0000
++++ misc/ioapi.h
+@@ -35,6 +35,11 @@
+ extern "C" {
+ #endif
+
++// On NetBSD and Gentoo, OF is not defined in zconf.h, which is included by zlib.h.
++#ifndef OF
++#define OF(x) x
++#endif
++
+ typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
+ typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
+ typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));