1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

emulators/pcem: update to version 17

The repository used by this port is actively maintained and there
"dev" branch contains updates and fixes (including for builds on
aarch64).

Since the maintainer had not updated the port for more than 1 year
and it had become deprecated, I'm taking over maintainership.
This commit is contained in:
Stefan Eßer 2023-10-15 15:18:13 +02:00
parent 438e140d54
commit a03851a452
19 changed files with 6560 additions and 17 deletions

View File

@ -1,31 +1,29 @@
PORTNAME= pcem
DISTVERSION= 14
PORTREVISION= 2
DISTVERSIONPREFIX= v
DISTVERSION= 17
CATEGORIES= emulators
MASTER_SITES= https://bitbucket.org/pcem_emulator/pcem/get/
DISTNAME= faf5d6423060
MAINTAINER= darkfm@vera.com.uy
MAINTAINER= se@freebsd.org
COMMENT= PC/PC-Compatible low-level emulator striving for accuracy
WWW= https://www.pcem-emulator.co.uk
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
BROKEN_FreeBSD_13= ld: error: duplicate symbol: CGACONST
BROKEN_FreeBSD_14= ld: error: duplicate symbol: CGACONST
DEPRECATED= Fails to build and marked broken over a year ago
EXPIRATION_DATE=2023-11-30
ONLY_FOR_ARCHS= amd64
USES= autoreconf compiler gl gmake localbase:ldflags openal pkgconfig sdl zip
USES= autoreconf compiler dos2unix gl gmake localbase:ldflags openal \
pkgconfig sdl
USE_GITHUB= yes
GH_ACCOUNT= sarah-walker-pcem
USE_GL= gl
USE_SDL= sdl2
USE_WX= 3.0
WRKSRC= ${WRKDIR}/pcem_emulator-pcem-faf5d6423060/
PLIST_FILES= bin/pcem
CONFIGURE_ARGS= --enable-release-build --with-wx-config="${WX_CONFIG}"
GNU_CONFIGURE= yes
ONLY_FOR_ARCHS= amd64
CONFIGURE_ARGS= --enable-release-build \
--with-wx-config="${WX_CONFIG}"
PLIST_FILES= bin/pcem
.include <bsd.port.mk>

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1555640654
SHA256 (faf5d6423060.zip) = c184c1e279b2d77d89bdc02ed6a87d0f79b98863dcef2feca1fff74554e2f19b
SIZE (faf5d6423060.zip) = 1792228
TIMESTAMP = 1697375608
SHA256 (sarah-walker-pcem-pcem-v17_GH0.tar.gz) = bd3b107c467cf88f9647a1970054ce41d416201996e8cf6d47c7bc27ed15d5e3
SIZE (sarah-walker-pcem-pcem-v17_GH0.tar.gz) = 1868495

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
--- src/codegen_allocator.c.orig 2020-12-01 19:49:05 UTC
+++ src/codegen_allocator.c
@@ -1,4 +1,4 @@
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/mman.h>
#include <unistd.h>
#include <stdlib.h>

View File

@ -0,0 +1,11 @@
--- src/codegen_backend_arm.c.orig 2020-12-01 19:49:05 UTC
+++ src/codegen_backend_arm.c
@@ -11,7 +11,7 @@
#include "x86.h"
#include "x87.h"
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/mman.h>
#include <unistd.h>
#endif

View File

@ -0,0 +1,11 @@
--- src/codegen_backend_x86-64.c.orig 2020-12-01 19:49:05 UTC
+++ src/codegen_backend_x86-64.c
@@ -10,7 +10,7 @@
#include "codegen_reg.h"
#include "x86.h"
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/mman.h>
#include <unistd.h>
#include <stdlib.h>

View File

@ -0,0 +1,11 @@
--- src/codegen_backend_x86.c.orig 2020-12-01 19:49:05 UTC
+++ src/codegen_backend_x86.c
@@ -11,7 +11,7 @@
#include "codegen_reg.h"
#include "x86.h"
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/mman.h>
#include <unistd.h>
#endif

View File

@ -0,0 +1,20 @@
--- src/codegen_timing_p6.c.orig 2020-12-01 19:49:05 UTC
+++ src/codegen_timing_p6.c
@@ -80,7 +80,7 @@ static const p6_instruction_t aluc_op =
{
.nr_uops = 2,
.uop[0] = {.type = UOP_ALU01, .throughput = 1, .latency = 1},
- .uop[0] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}
+ .uop[1] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}
};
static const p6_instruction_t load_alu_op =
{
@@ -146,7 +146,7 @@ static const p6_instruction_t bswap_op =
{
.nr_uops = 2,
.uop[0] = {.type = UOP_ALU0, .throughput = 1, .latency = 1},
- .uop[0] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}
+ .uop[1] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}
};
static const p6_instruction_t leave_op =
{

View File

@ -0,0 +1,11 @@
--- src/codegen_x86-64.c.orig 2020-12-01 19:49:05 UTC
+++ src/codegen_x86-64.c
@@ -15,7 +15,7 @@
#include "codegen_ops.h"
#include "codegen_ops_x86-64.h"
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/mman.h>
#include <unistd.h>
#endif

View File

@ -0,0 +1,50 @@
--- src/hdd_file.c.orig 2020-12-01 19:49:05 UTC
+++ src/hdd_file.c
@@ -14,9 +14,9 @@ void hdd_load_ext(hdd_file_t *hdd, const char *fn, int
{
/* Try to open existing hard disk image */
if (read_only)
- hdd->f = (void*)fopen64(fn, "rb");
+ hdd->f = (void*)fopen(fn, "rb");
else
- hdd->f = (void*)fopen64(fn, "rb+");
+ hdd->f = (void*)fopen(fn, "rb+");
if (hdd->f != NULL)
{
hdd->img_type = HDD_IMG_RAW;
@@ -59,7 +59,7 @@ void hdd_load_ext(hdd_file_t *hdd, const char *fn, int
{
/* Failed because it does not exist,
so try to create new file */
- hdd->f = (void*)fopen64(fn, "wb+");
+ hdd->f = (void*)fopen(fn, "wb+");
if (hdd->f == NULL)
{
pclog("Cannot create file '%s': %s",
@@ -128,7 +128,7 @@ int hdd_read_sectors(hdd_file_t *hdd, int offset, int
transfer_sectors = hdd->sectors - offset;
addr = (uint64_t)offset * 512;
- fseeko64((FILE*)hdd->f, addr, SEEK_SET);
+ fseek((FILE*)hdd->f, addr, SEEK_SET);
fread(buffer, transfer_sectors*512, 1, (FILE*)hdd->f);
if (nr_sectors != transfer_sectors)
@@ -157,7 +157,7 @@ int hdd_write_sectors(hdd_file_t *hdd, int offset, int
transfer_sectors = hdd->sectors - offset;
addr = (uint64_t)offset * 512;
- fseeko64((FILE*)hdd->f, addr, SEEK_SET);
+ fseek((FILE*)hdd->f, addr, SEEK_SET);
fwrite(buffer, transfer_sectors*512, 1, (FILE*)hdd->f);
if (nr_sectors != transfer_sectors)
@@ -189,7 +189,7 @@ int hdd_format_sectors(hdd_file_t *hdd, int offset, in
if ((hdd->sectors - offset) < transfer_sectors)
transfer_sectors = hdd->sectors - offset;
addr = (uint64_t)offset * 512;
- fseeko64((FILE*)hdd->f, addr, SEEK_SET);
+ fseek((FILE*)hdd->f, addr, SEEK_SET);
for (c = 0; c < transfer_sectors; c++)
fwrite(zero_buffer, 512, 1, (FILE*)hdd->f);

View File

@ -0,0 +1,11 @@
--- src/rtc_tc8521.c.orig 2020-12-01 19:49:05 UTC
+++ src/rtc_tc8521.c
@@ -167,7 +167,7 @@ static void tc8521_set_nvrram(uint8_t *nvrram, struct
{
nvrram[TC8521_HOUR1] = (cur_time_tm->tm_hour % 12) % 10;
nvrram[TC8521_HOUR10] = ((cur_time_tm->tm_hour % 12) / 10)
- | (cur_time_tm->tm_hour >= 12) ? 2 : 0;
+ | ((cur_time_tm->tm_hour >= 12) ? 2 : 0);
}
nvrram[TC8521_WEEKDAY] = cur_time_tm->tm_wday;
nvrram[TC8521_DAY1] = cur_time_tm->tm_mday % 10;

View File

@ -0,0 +1,11 @@
--- src/vid_t1000.c.orig 2020-12-01 19:49:05 UTC
+++ src/vid_t1000.c
@@ -436,7 +436,7 @@ static void t1000_poll(void *p)
else mem_mapping_disable(&t1000->mapping);
}
/* Switch between internal plasma and external CRT display. */
- if (st_display_internal != -1 && st_display_internal != t1000->internal)
+ if (st_display_internal != (uint8_t)-1 && st_display_internal != t1000->internal)
{
t1000->internal = st_display_internal;
t1000_recalctimings(t1000);

View File

@ -0,0 +1,11 @@
--- src/vid_t3100e.c.orig 2020-12-01 19:49:05 UTC
+++ src/vid_t3100e.c
@@ -470,7 +470,7 @@ void t3100e_poll(void *p)
}
/* Switch between internal plasma and external CRT display. */
- if (st_display_internal != -1 && st_display_internal != t3100e->internal)
+ if (st_display_internal != (uint8_t)-1 && st_display_internal != t3100e->internal)
{
t3100e->internal = st_display_internal;
t3100e_recalctimings(t3100e);

View File

@ -0,0 +1,11 @@
--- src/vid_voodoo_codegen_x86-64.h.orig 2020-12-01 19:49:05 UTC
+++ src/vid_voodoo_codegen_x86-64.h
@@ -5,7 +5,7 @@
fbzColorPath
*/
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/mman.h>
#include <unistd.h>
#endif

View File

@ -0,0 +1,11 @@
--- src/vid_voodoo_render.c.orig 2020-12-01 19:49:05 UTC
+++ src/vid_voodoo_render.c
@@ -1,5 +1,8 @@
#include <math.h>
#include <stddef.h>
+#ifdef __FreeBSD__
+#include <sys/mman.h>
+#endif
#include "ibm.h"
#include "device.h"
#include "mem.h"

View File

@ -0,0 +1,31 @@
--- src/wx-config.c.orig 2020-12-01 19:49:05 UTC
+++ src/wx-config.c
@@ -1807,7 +1807,7 @@ static int hdnew_dlgproc(void* hdlg, int message, INT_
if (hd_format == 0) /* Raw .img */
{
- f = fopen64(hd_new_name, "wb");
+ f = fopen(hd_new_name, "wb");
if (!f)
{
wx_messagebox(hdlg, "Can't open file for write", "PCem error", WX_MB_OK);
@@ -2219,7 +2219,7 @@ static int hd_file(void *hdlg, int drive)
if (!getfile(hdlg, "Hard disc image (*.img;*.vhd)|*.img;*.vhd|All files (*.*)|*.*", ""))
{
off64_t sz;
- FILE *f = fopen64(openfilestring, "rb");
+ FILE *f = fopen(openfilestring, "rb");
if (!f)
{
wx_messagebox(hdlg,"Can't open file for read","PCem error",WX_MB_OK);
@@ -2271,8 +2271,8 @@ static int hd_file(void *hdlg, int drive)
}
else
{
- fseeko64(f, -1, SEEK_END);
- sz = ftello64(f) + 1;
+ fseek(f, -1, SEEK_END);
+ sz = ftell(f) + 1;
fclose(f);
check_hd_type(hdlg, sz);
}

View File

@ -0,0 +1,20 @@
--- src/wx-sdl2.c.orig 2020-12-01 19:49:05 UTC
+++ src/wx-sdl2.c
@@ -44,9 +44,16 @@
#include "wx-common.h"
#include "wx-display.h"
-#if __APPLE__
+#ifdef __APPLE__
#define pause __pause
#include <util.h>
+#include <fcntl.h>
+#include <unistd.h>
+#undef pause
+#endif
+
+#ifdef __FreeBSD__
+#define pause __pause
#include <fcntl.h>
#include <unistd.h>
#undef pause

View File

@ -0,0 +1,11 @@
--- src/wx-thread.c.orig 2020-12-01 19:49:05 UTC
+++ src/wx-thread.c
@@ -171,7 +171,7 @@ int thread_wait_event(event_t *handle, int timeout)
event_pthread_t *event = (event_pthread_t *)handle;
struct timespec abstime;
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
clock_gettime(CLOCK_REALTIME, &abstime);
#else
struct timeval now;

View File

@ -0,0 +1,11 @@
--- src/x86seg.c.orig 2020-12-01 19:49:05 UTC
+++ src/x86seg.c
@@ -3058,7 +3058,7 @@ void x86_smi_enter(void)
{
uint32_t base;
- if (!cyrix.smhr & SMHR_VALID)
+ if (!(cyrix.smhr & SMHR_VALID))
cyrix.smhr = (cyrix.arr[3].base + cyrix.arr[3].size) | SMHR_VALID;
base = cyrix.smhr & SMHR_ADDR_MASK;