diff options
author | wiz <wiz@pkgsrc.org> | 2000-02-20 18:15:13 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2000-02-20 18:15:13 +0000 |
commit | 3de5bbda60231a53cfb8f3ec9ba3cdf444d78632 (patch) | |
tree | 637167734bd8a6337417dd91db5d9f0dafafcc6d /emulators/darcnes/patches | |
parent | c098a3a4a64befb71b7bf9ef6a060efd884433d7 (diff) | |
download | pkgsrc-3de5bbda60231a53cfb8f3ec9ba3cdf444d78632.tar.gz |
Updated darcnes to 2000-02-19.
Changes:
o Unified cd_freebsd.c and cd_linux.c into cd_unix.c.
o Added support for NetBSD CDROM (untested), and sound interfaces
(thanks to Thomas Klausner for the NetBSD changes).
o Changed the nes bank 4 and 6 I/O hooks.
o Fixed FDS mapper to compile again.
o Fixed some problems with the PCE timer.
o Changed the PCE VDP interface not to use procpointers.
o Added clipping sprites to the right side of the screen to the PCE VDP.
o Removed the old (disabled) ROM type identification routine.
o Fixed the battery file handling to not use a cheap hack to get the
filename (this breaks all gg savegames until you rename the battery
file).
Diffstat (limited to 'emulators/darcnes/patches')
-rw-r--r-- | emulators/darcnes/patches/patch-aa | 19 | ||||
-rw-r--r-- | emulators/darcnes/patches/patch-ab | 110 | ||||
-rw-r--r-- | emulators/darcnes/patches/patch-ac | 108 | ||||
-rw-r--r-- | emulators/darcnes/patches/patch-af | 12 |
4 files changed, 24 insertions, 225 deletions
diff --git a/emulators/darcnes/patches/patch-aa b/emulators/darcnes/patches/patch-aa index a4875946250..c76262ba41e 100644 --- a/emulators/darcnes/patches/patch-aa +++ b/emulators/darcnes/patches/patch-aa @@ -1,8 +1,8 @@ -$NetBSD: patch-aa,v 1.2 2000/02/14 02:44:33 wiz Exp $ +$NetBSD: patch-aa,v 1.3 2000/02/20 18:15:15 wiz Exp $ ---- ./Makefile.orig Sat Feb 12 20:04:24 2000 -+++ ./Makefile Mon Feb 14 03:27:44 2000 -@@ -11,23 +11,23 @@ +--- ./Makefile.orig Mon Feb 14 03:36:58 2000 ++++ ./Makefile Sun Feb 20 15:28:50 2000 +@@ -11,10 +11,10 @@ #C_ONLY=-DC_ONLY @@ -15,14 +15,7 @@ $NetBSD: patch-aa,v 1.2 2000/02/14 02:44:33 wiz Exp $ DEBUG=-g - CDFLAGS=-DPCE_CD_SUPPORT - --CD_SRC=cd_freebsd.c --CD_OBJ=cd_freebsd.o -+CD_SRC=cd_netbsd.c -+CD_OBJ=cd_netbsd.o - #CD_SRC=cd_linux.c - #CD_OBJ=cd_linux.o +@@ -25,7 +25,7 @@ OPTFLAGS=-O2 -fomit-frame-pointer @@ -31,7 +24,7 @@ $NetBSD: patch-aa,v 1.2 2000/02/14 02:44:33 wiz Exp $ BASE_SFLAGS=-Wall $(DEBUG) $(OPTFLAGS) $(CDFLAGS) # -@@ -53,9 +53,9 @@ +@@ -51,9 +51,9 @@ AS=gcc LD=gcc diff --git a/emulators/darcnes/patches/patch-ab b/emulators/darcnes/patches/patch-ab index 6e1ede12b76..07d70a90923 100644 --- a/emulators/darcnes/patches/patch-ab +++ b/emulators/darcnes/patches/patch-ab @@ -1,98 +1,14 @@ -$NetBSD: patch-ab,v 1.2 2000/02/14 02:44:34 wiz Exp $ +$NetBSD: patch-ab,v 1.3 2000/02/20 18:15:15 wiz Exp $ ---- ./cd_netbsd.c.orig Mon Feb 14 00:38:08 2000 -+++ ./cd_netbsd.c Mon Feb 14 00:38:08 2000 -@@ -0,0 +1,93 @@ -+/* -+ * cd_netbsd.c -+ * -+ * NetBSD CDROM interface -+ */ -+ -+#include <sys/types.h> -+#include <sys/stat.h> -+#include <fcntl.h> -+#include <sys/ioctl.h> -+#include <unistd.h> -+#include <stdio.h> -+ -+#include <sys/cdio.h> -+ -+#include "types.h" -+#include "cd.h" -+ -+#define CDROM_DEVICE "/dev/rcd0d" -+ -+int pce_cd_drive; -+ -+struct ioc_read_toc_entry pce_cd_tocentry; -+ -+void cd_set_sector_address(u32 sector) -+{ -+ int result; -+ -+ result = lseek(pce_cd_drive, (sector) * 2048, SEEK_SET); -+ if (result < 0) { -+ perror("pce_cd: seeking to CD sector"); -+ } -+} -+ -+void cd_read_next_sector(u8 *buf) -+{ -+ int result; -+ -+ result = read(pce_cd_drive, buf, 2048); -+ if (result < 0) { -+ perror("pce_cd: reading CD data"); -+ } -+} -+ -+void cd_get_tocheader(u8 *start_track, u8 *stop_track) -+{ -+ struct ioc_toc_header toc_header; -+ int result; -+ -+ result = ioctl(pce_cd_drive, CDIOREADTOCHEADER, &toc_header); -+ if (result < 0) { -+ perror("pce_cd: reading tocheader"); -+ /* XXX: use dummy values? */ -+ *start_track = 1; -+ *stop_track = 4; -+ } else { -+ *start_track = toc_header.starting_track; -+ *stop_track = toc_header.ending_track; -+ } -+} -+ -+void cd_get_tocentry(u8 track, u32 *lba, u8 *flags) -+{ -+ int result; -+ struct cd_toc_entry toc_entry; -+ -+ pce_cd_tocentry.starting_track = track; -+ pce_cd_tocentry.address_format = CD_LBA_FORMAT; -+ pce_cd_tocentry.data_len = sizeof(toc_entry); -+ pce_cd_tocentry.data = &toc_entry; -+ -+ result = ioctl(pce_cd_drive, CDIOREADTOCENTRYS, &pce_cd_tocentry); -+ if (result < 0) { -+ perror("pce_cd: reading tocentry"); -+/* deb_printf("pce_cd: tocread failure.\n"); */ -+ } else { -+ /* is this what you want? */ -+ *lba = toc_entry.addr.lba; -+ *flags = toc_entry.control; -+ /* ???: FIXME: may want cdte.adr << 4 in here as well */ -+ } -+} -+ -+void cd_init(void) -+{ -+ pce_cd_drive = open(CDROM_DEVICE, O_RDONLY); -+ if (pce_cd_drive < 0) { -+ perror("pce_cd: opening CD drive"); -+ pce_cd_drive = 0; -+ } else { -+ /* Do something? */ -+ } -+} +--- ./cd_unix.c.orig Mon Feb 14 03:09:03 2000 ++++ ./cd_unix.c Sun Feb 20 15:41:46 2000 +@@ -8,7 +8,7 @@ + + /* #define CD_LINUX */ /* use linux-specific code */ +-#define CD_FREEBSD /* use freebsd-specific code */ +-/* #define CD_NETBSD */ /* use netbsd-specific code */ ++/* #define CD_FREEBSD */ /* use freebsd-specific code */ ++#define CD_NETBSD /* use netbsd-specific code */ + + #ifdef CD_LINUX + #define CDROM_DEVICE "/dev/cdrom" diff --git a/emulators/darcnes/patches/patch-ac b/emulators/darcnes/patches/patch-ac index a9921d42248..65cc39ccf9c 100644 --- a/emulators/darcnes/patches/patch-ac +++ b/emulators/darcnes/patches/patch-ac @@ -1,112 +1,14 @@ -$NetBSD: patch-ac,v 1.2 2000/02/14 02:44:35 wiz Exp $ +$NetBSD: patch-ac,v 1.3 2000/02/20 18:15:15 wiz Exp $ ---- ./snd_unix.c.orig Wed Jan 26 21:22:18 2000 -+++ ./snd_unix.c Mon Feb 14 00:38:09 2000 -@@ -8,13 +8,21 @@ +--- ./snd_unix.c.orig Mon Feb 14 03:04:13 2000 ++++ ./snd_unix.c Sun Feb 20 15:41:22 2000 +@@ -8,7 +8,7 @@ /* #define SOUND_LINUX */ /* use linux sound header */ -#define SOUND_FREEBSD /* use freebsd sound header */ +-/* #define SOUND_NETBSD */ /* use netbsd sound system */ +/* #define SOUND_FREEBSD */ /* use freebsd sound header */ +#define SOUND_NETBSD /* use netbsd sound system */ #ifdef SOUND_LINUX #define SOUND_HEADER <sys/soundcard.h> -+#define SOUND_DEVICE "/dev/dsp" - #endif - - #ifdef SOUND_FREEBSD - #define SOUND_HEADER <machine/soundcard.h> -+#define SOUND_DEVICE "/dev/dsp" -+#endif -+ -+#ifdef SOUND_NETBSD -+#define SOUND_HEADER <sys/audioio.h> -+#define SOUND_DEVICE "/dev/sound" - #endif - - #include <stdio.h> -@@ -66,16 +74,21 @@ - - int snd_open(int samples_per_sync, int sample_rate) - { -- int tmp; - int result; -+#if defined(SOUND_LINUX) || defined(SOUND_FREEBSD) -+ int tmp; - int sound_rate; - int sound_frag; -+#endif -+#ifdef SOUND_NETBSD -+ audio_info_t info; -+#endif - - waveptr = 0; - wavflag = 0; - -- printf("opening /dev/dsp..."); -- sound_fd = open("/dev/dsp", O_WRONLY); -+ printf("opening "SOUND_DEVICE"..."); -+ sound_fd = open(SOUND_DEVICE, O_WRONLY); - if (sound_fd < 0) { - perror("failed"); - sound_fd = 0; -@@ -83,7 +96,8 @@ - } else { - printf("done.\n"); - } -- -+ -+#if defined(SOUND_LINUX) || defined(SOUND_FREEBSD) - printf("setting unsigned 8-bit format..."); - tmp = AFMT_U8; - result = ioctl(sound_fd, SNDCTL_DSP_SETFMT, &tmp); -@@ -132,7 +146,41 @@ - } else { - printf("done.\n"); - } -+#endif -+#ifdef SOUND_NETBSD -+ AUDIO_INITINFO(&info); -+ printf("setting unsigned 8-bit format..."); -+ info.play.encoding = AUDIO_ENCODING_ULINEAR; -+ /* this doesn't work for me, so ignore results */ -+ result = ioctl(sound_fd, AUDIO_SETINFO, &info); -+ if (result < 0) -+ { -+ perror("warning: unsigned linear mode failed, using signed"); -+ info.play.encoding = AUDIO_ENCODING_SLINEAR; -+ } - -+ printf("setting sound rate to %dHz...", sample_rate); -+ info.play.sample_rate = sample_rate; -+ /* 8 bits per sample */ -+ info.play.precision = 8; -+ printf("setting mono mode..."); -+ info.play.channels = 1; -+ info.mode = AUMODE_PLAY_ALL; -+ /* "frag size" */ -+ info.blocksize = 1 << 8; -+ /* "number of frags", hiwater mark */ -+ info.hiwat = 8; -+ result = ioctl(sound_fd, AUDIO_SETINFO, &info); -+ if (result < 0) { -+ perror("initializing sound failed"); -+ close(sound_fd); -+ sound_fd = 0; -+ return 0; -+ } else { -+ printf("done.\n"); -+ } -+#endif -+ - return 1; - } - -@@ -141,6 +189,7 @@ - if (sound_fd) { - close(sound_fd); - } -+ sound_fd = 0; - } - - /* diff --git a/emulators/darcnes/patches/patch-af b/emulators/darcnes/patches/patch-af deleted file mode 100644 index ed3f830c995..00000000000 --- a/emulators/darcnes/patches/patch-af +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-af,v 1.1 2000/02/14 02:44:43 wiz Exp $ - ---- ./pce_vdp.c.orig Sun Feb 6 23:28:03 2000 -+++ ./pce_vdp.c Mon Feb 14 02:36:38 2000 -@@ -13,6 +13,7 @@ - #include "video.h" - #include "blitters.h" - #include "tiledraw.h" -+#include "endian.h" - - #define PCE_VDP_RAMSIZE 0x10000 - |