Update the Commander X16 emulator and ROM to version r46.

This commit is contained in:
thorpej 2023-11-27 03:20:59 +00:00
parent 02f3736a81
commit a52f0267ed
11 changed files with 77 additions and 118 deletions

View File

@ -1,9 +1,8 @@
# $NetBSD: Makefile,v 1.13 2023/05/16 06:01:45 thorpej Exp $
# $NetBSD: Makefile,v 1.14 2023/11/27 03:20:59 thorpej Exp $
DISTNAME= x16-emulator-41
PKGREVISION= 4
DISTNAME= x16-emulator-46
CATEGORIES= emulators
MASTER_SITES= ${MASTER_SITE_GITHUB:=commanderx16/}
MASTER_SITES= ${MASTER_SITE_GITHUB:=X16Community/}
GITHUB_PROJECT= x16-emulator
GITHUB_TAG= r${PKGVERSION_NOREV}
@ -12,9 +11,11 @@ HOMEPAGE= http://commanderx16.com/
COMMENT= Emulator for the Commander X16 computer system
LICENSE= 2-clause-bsd
DEPENDS+= x16-rom-41{,nb*}:../../emulators/x16-rom
DEPENDS+= x16-rom-46{,nb*}:../../emulators/x16-rom
MAKE_ENV+= ROM_RELATIVE_PATH=../share/x16/
MAKE_ENV+= GIT_REV=${GITHUB_TAG}
USE_LANGUAGES= c99 c++17
USE_TOOLS+= gmake
INSTALLATION_DIRS+= bin

View File

@ -1,11 +1,8 @@
$NetBSD: distinfo,v 1.7 2023/05/16 06:01:45 thorpej Exp $
$NetBSD: distinfo,v 1.8 2023/11/27 03:20:59 thorpej Exp $
BLAKE2s (x16-emulator-41.tar.gz) = 095b9dd13b544d878dab791bb2e4ffae82ba582e72bd7d8b618b2181eceb558c
SHA512 (x16-emulator-41.tar.gz) = 88b75589149e3c308e66fa45c2c07b497c97cea11b9c3fc9635f3e27f8f11ea47fcb55cf9089ac720742b7c96288c2286d120b07ca77879d08153ffbc7870fa1
Size (x16-emulator-41.tar.gz) = 182076 bytes
SHA1 (patch-Makefile) = e5029a2956a79e808d8ca9197d5db330930fa7e3
SHA1 (patch-src_debugger.c) = ab309e1ece277a3c0bb6c1a3fc230efbc95c325e
SHA1 (patch-src_glue.h) = 377c592090c9853d604953896480ea4d6526bf47
SHA1 (patch-src_main.c) = 2d037b3b897eb7767ead3968eeb92f3fff4ac563
BLAKE2s (x16-emulator-46.tar.gz) = ec4ec0c0155843c4c7be5ce103794b02973b31aae3c8af8cc5fade765453a78d
SHA512 (x16-emulator-46.tar.gz) = d5e2ac7db8dbb710dd400a31e5c4b0d426c7284d899df3a7814c25ca15a4cbe546dbf986223e833f6526a7981c785bbebe47729c79d03a35928c5f72c985d86e
Size (x16-emulator-46.tar.gz) = 300653 bytes
SHA1 (patch-Makefile) = bc5fa340969e56d8eb8f6d8e3d6527ac773a6d31
SHA1 (patch-src_main.c) = 6b759386bc9e1a87a1b33763cc14da75cd4b755f
SHA1 (patch-src_rendertext.c) = 2474af4dff454ddd6d4ca2c9abc4eba963c3d51e
SHA1 (patch-src_serial.c) = fc80458efe6fd3b9f78071e31d44bada1788219b

View File

@ -1,29 +1,40 @@
$NetBSD: patch-Makefile,v 1.3 2022/08/07 17:38:08 thorpej Exp $
$NetBSD: patch-Makefile,v 1.4 2023/11/27 03:21:00 thorpej Exp $
Honor CFLAGS/LDFLAGS.
Allow the default location of the X16 ROM to be overridden.
--- Makefile.orig 2022-05-09 06:32:54.000000000 +0000
+++ Makefile 2022-08-07 14:43:29.476121731 +0000
@@ -20,8 +20,8 @@ else
Allow GIT_REV to be overridden.
--- Makefile.orig 2023-11-06 03:36:56
+++ Makefile 2023-11-27 03:00:05
@@ -10,9 +10,9 @@ CFLAGS=-std=c99 -O3 -Wall -Werror -g $(shell $(SDL2CON
SDL2CONFIG=sdl2-config
endif
-CFLAGS=-std=c99 -O3 -Wall -Werror -g $(shell $(SDL2CONFIG) --cflags) -Isrc/extern/include -Isrc/extern/src
-LDFLAGS=$(shell $(SDL2CONFIG) --libs) -lm
+CFLAGS+=-std=c99 -O3 -Wall -Werror -g $(shell $(SDL2CONFIG) --cflags) -Isrc/extern/include -Isrc/extern/src
+LDFLAGS+=$(shell $(SDL2CONFIG) --libs) -lm
-CFLAGS=-std=c99 -O3 -Wall -Werror -g $(shell $(SDL2CONFIG) --cflags) -Isrc/extern/include
-CXXFLAGS=-std=c++17 -O3 -Wall -Werror -Isrc/extern/ymfm/src
-LDFLAGS=$(shell $(SDL2CONFIG) --libs) -lm -lz
+CFLAGS+=-std=c99 -O3 -Wall -Werror -g $(shell $(SDL2CONFIG) --cflags) -Isrc/extern/include
+CXXFLAGS+=-std=c++17 -O3 -Wall -Werror -Isrc/extern/ymfm/src
+LDFLAGS+=$(shell $(SDL2CONFIG) --libs) -lm -lz
ODIR = build
SDIR = src
@@ -66,6 +66,9 @@ ifneq ("$(wildcard ./src/rom_labels.h)",
HEADERS+=src/rom_labels.h
# build with link time optimization
ifndef NOLTO
@@ -30,10 +30,16 @@ X16_OUTPUT=x16emu
CFLAGS+=-D TRACE
endif
+ifdef ROM_RELATIVE_PATH
+ CFLAGS+=-DROM_RELATIVE_PATH=\"$(ROM_RELATIVE_PATH)\"
+endif
+
X16_OUTPUT=x16emu
MAKECART_OUTPUT=makecart
+ifndef GIT_REV
GIT_REV=$(shell git diff --quiet && /bin/echo -n $$(git rev-parse --short=8 HEAD || /bin/echo "00000000") || /bin/echo -n $$( /bin/echo -n $$(git rev-parse --short=7 HEAD || /bin/echo "0000000"); /bin/echo -n '+'))
+endif
CFLAGS+=-D GIT_REV='"$(GIT_REV)"'
all: $(OBJS) $(HEADERS)
$(CC) -o $(OUTPUT) $(OBJS) $(LDFLAGS)

View File

@ -1,17 +0,0 @@
$NetBSD: patch-src_debugger.c,v 1.1 2023/05/16 06:01:45 thorpej Exp $
Squelch "passing arguments to 'DEBUGRenderCmdLine' without a prototype is
deprecated in all versions of C and is not supported in C2x" error
thrown by Apple clang version 14.0.3 (clang-1403.0.22.14.1) (Xcode 14.3).
--- src/debugger.c.orig 2023-05-16 05:55:48
+++ src/debugger.c 2023-05-16 05:56:11
@@ -36,7 +36,7 @@ static void DEBUGRenderCmdLine();
static void DEBUGRenderVRAM(int y, int data);
static void DEBUGRenderCode(int lines,int initialPC);
static void DEBUGRenderStack(int bytesCount);
-static void DEBUGRenderCmdLine();
+static void DEBUGRenderCmdLine(int x, int width, int height);
static bool DEBUGBuildCmdLine(SDL_Keycode key);
static void DEBUGExecCmd();

View File

@ -1,17 +0,0 @@
$NetBSD: patch-src_glue.h,v 1.1 2023/05/16 06:01:45 thorpej Exp $
Squelch "passing arguments to 'machine_paste' without a prototype is
deprecated in all versions of C and is not supported in C2x" error
thrown by Apple clang version 14.0.3 (clang-1403.0.22.14.1) (Xcode 14.3).
--- src/glue.h.orig 2023-05-16 05:38:54
+++ src/glue.h 2023-05-16 05:39:19
@@ -63,7 +63,7 @@ extern void machine_paste();
extern void machine_dump();
extern void machine_reset();
-extern void machine_paste();
+extern void machine_paste(char *);
extern void machine_toggle_warp();
extern void init_audio();

View File

@ -1,22 +1,22 @@
$NetBSD: patch-src_main.c,v 1.1 2022/08/07 17:38:08 thorpej Exp $
$NetBSD: patch-src_main.c,v 1.2 2023/11/27 03:21:00 thorpej Exp $
Allow the default location of the X16 ROM to be overridden.
--- src/main.c.orig 2022-08-07 02:13:20.524132103 +0000
+++ src/main.c 2022-08-07 02:17:36.561192332 +0000
@@ -491,9 +491,13 @@ main(int argc, char **argv)
--- src/main.c.orig 2023-11-06 03:36:56
+++ src/main.c 2023-11-27 02:44:32
@@ -513,9 +513,13 @@ main(int argc, char **argv)
char *base_path = SDL_GetBasePath();
- // This causes the emulator to load ROM data from the executable's directory when
- // no ROM file is specified on the command line.
+ // This causes the emulator to load ROM data from the executable's
+ // directory ((or somewhere nearby if ROM_RELATIVE_PATH is specified)
+ // directory (or somewhere nearby if ROM_RELATIVE_PATH is specified)
+ // when no ROM file is specified on the command line.
memcpy(rom_path, base_path, strlen(base_path) + 1);
+#ifdef ROM_RELATIVE_PATH
+ strncpy(rom_path + strlen(rom_path), ROM_RELATIVE_PATH, PATH_MAX - strlen(rom_path));
+#endif
strncpy(rom_path + strlen(rom_path), rom_filename, PATH_MAX - strlen(rom_path));
memory_randomize_ram(true);
argc--;

View File

@ -1,29 +0,0 @@
$NetBSD: patch-src_serial.c,v 1.1 2023/05/16 06:01:45 thorpej Exp $
Squelch "passing arguments to 'xxxxx' without a prototype is
deprecated in all versions of C and is not supported in C2x" error
thrown by Apple clang version 14.0.3 (clang-1403.0.22.14.1) (Xcode 14.3).
In this instance, passing the argument is incorrect, since UNLSN() and
UNTLK() don't actually take one.
--- src/serial.c.orig 2022-05-09 06:32:54
+++ src/serial.c 2023-05-16 05:53:45
@@ -203,7 +203,7 @@ serial_step(int clocks)
switch (byte & 0x60) {
case 0x20:
if (byte == 0x3f) {
- int ret = UNLSN(byte);
+ int ret = UNLSN();
fnf = ret == 2;
listening = false;
} else {
@@ -213,7 +213,7 @@ serial_step(int clocks)
break;
case 0x40:
if (byte == 0x5f) {
- UNTLK(byte);
+ UNTLK();
talking = false;
} else {
TALK(byte);

View File

@ -1,9 +1,8 @@
# $NetBSD: Makefile,v 1.4 2023/08/14 05:24:22 wiz Exp $
# $NetBSD: Makefile,v 1.5 2023/11/27 03:21:00 thorpej Exp $
DISTNAME= x16-rom-41
PKGREVISION= 1
DISTNAME= x16-rom-46
CATEGORIES= emulators
MASTER_SITES= ${MASTER_SITE_GITHUB:=commanderx16/}
MASTER_SITES= ${MASTER_SITE_GITHUB:=X16Community/}
GITHUB_PROJECT= x16-rom
GITHUB_TAG= r${PKGVERSION_NOREV}
@ -13,6 +12,9 @@ COMMENT= ROM for the Commander X16 computer system
LICENSE= commander-x16-rom-license
TOOL_DEPENDS+= cc65-[0-9]*:../../cross/cc65
TOOL_DEPENDS+= lzsa-[0-9]*:../../archivers/lzsa
MAKE_ENV+= GIT_REV=${GITHUB_TAG}
USE_TOOLS+= gmake bash

View File

@ -1,6 +1,6 @@
$NetBSD: distinfo,v 1.4 2022/08/07 17:36:52 thorpej Exp $
$NetBSD: distinfo,v 1.5 2023/11/27 03:21:00 thorpej Exp $
BLAKE2s (x16-rom-41.tar.gz) = ad1c5ce4fe1fb3b2642f59fdedf0d3895e097663c68f71fb016479ba7b31277a
SHA512 (x16-rom-41.tar.gz) = 21afe719d1447e289a210607fde0a54847d2dcc6216933146b2a96f13e83c72158827c98a2c2dcc2f9b4fd1aee18d1b25947ca0ef3cb60bad0518f7952c10512
Size (x16-rom-41.tar.gz) = 630172 bytes
SHA1 (patch-scripts_symbolize.sh) = 1d5c75ccd3015508ab8510a1b0890a376aca80eb
BLAKE2s (x16-rom-46.tar.gz) = 3efd6965342935fb5d588038cf11df869c9eeedd38eb7cd88c21aff0aa564606
SHA512 (x16-rom-46.tar.gz) = 2eb9a9e4f2cf86e71897e900bfa528f79a3e9e8bedc5bcc25868c3508afc85cdd087a39be37d1ceab7441b3d91553e0056a67efcd575dfa11fda468f9065181a
Size (x16-rom-46.tar.gz) = 899784 bytes
SHA1 (patch-Makefile) = cea4a06b0545215ceec4ed36eb84534737ec2f5f

View File

@ -0,0 +1,23 @@
$NetBSD: patch-Makefile,v 1.1 2023/11/27 03:21:00 thorpej Exp $
Allow the git revision to be overridden.
--- Makefile.orig 2023-11-06 03:34:39
+++ Makefile 2023-11-27 03:12:47
@@ -336,10 +336,16 @@ $(GIT_SIGNATURE): FORCE
rm -rf $(BUILD_DIR)
$(MAKE) -C codex clean
+ifdef GIT_REV
+$(GIT_SIGNATURE): FORCE
+ @mkdir -p $(BUILD_DIR)
+ /bin/echo -n ${GIT_REV} | tr '[:lower:]' '[:upper:]' > $(GIT_SIGNATURE)
+else
$(GIT_SIGNATURE): FORCE
@mkdir -p $(BUILD_DIR)
git diff --quiet && /bin/echo -n $$( (git rev-parse --short=8 HEAD || /bin/echo "00000000") | tr '[:lower:]' '[:upper:]') > $(GIT_SIGNATURE) \
|| /bin/echo -n $$( /bin/echo -n $$(git rev-parse --short=7 HEAD || echo "0000000") | tr '[:lower:]' '[:upper:]'; /bin/echo -n '+') > $(GIT_SIGNATURE)
+endif
FORCE:

View File

@ -1,12 +0,0 @@
$NetBSD: patch-scripts_symbolize.sh,v 1.1 2022/08/07 17:36:52 thorpej Exp $
Not all systems have bash located in /bin.
--- scripts/symbolize.sh.orig 2022-08-07 00:14:46.188776145 +0000
+++ scripts/symbolize.sh 2022-08-07 00:16:00.740600064 +0000
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
echo "uint16_t addresses_bank$1[] = {"
for i in $(cat $2 | sort | uniq | grep "^.....[ABCDEF]" | cut -c 6-9); do